示例#1
0
    def configure(self, window):
        """
        Configures the RTM Backend
        """
        import gtk
        import gobject

        def on_login_finish(*args):
            Utils.dialog_reset_cursor(dlg)

        def on_response(sender, responseID):
            if responseID == gtk.RESPONSE_OK:
                self.username = str(tree.get_widget('user_entry').get_text())
                self.password = str(tree.get_widget('pass_entry').get_text())

        def load_button_clicked(button):
            Utils.dialog_set_busy_cursor(dlg)
            conduit.GLOBALS.syncManager.run_blocking_dataprovider_function_calls(
                self, on_login_finish, self._login)

        tree = Utils.dataprovider_glade_get_widget(__file__, "config.glade",
                                                   "RTMConfigDialog")

        #get a whole bunch of widgets
        load_button = tree.get_widget("load_button")
        dlg = tree.get_widget("RTMConfigDialog")

        # load button
        load_button.connect('clicked', load_button_clicked)

        # run the dialog
        Utils.run_dialog_non_blocking(dlg, on_response, window)
示例#2
0
    def configure(self, window):
        import gtk
        import gobject
        def on_login_finish(*args):
            if self.fapi.uid:
                build_album_store()
            Utils.dialog_reset_cursor(dlg)
            
        def on_response(sender, responseID):
            if responseID == gtk.RESPONSE_OK:
                self.albumname = albumnamecombo.child.get_text()
                
        def load_button_clicked(button):
            Utils.dialog_set_busy_cursor(dlg)
            conduit.GLOBALS.syncManager.run_blocking_dataprovider_function_calls(
                                            self,
                                            on_login_finish,
                                            self._login)

        def build_album_store():
            album_store.clear()
            album_count = 0
            album_iter = None
            for album_name in self._get_albums().keys():
                iter = album_store.append((album_name,))
                if album_name != "" and album_name == self.albumname:
                    album_iter = iter
                album_count += 1

            if album_iter:
                albumnamecombo.set_active_iter(album_iter)
            elif self.albumname:
                albumnamecombo.child.set_text(self.albumname)
            elif album_count:
                albumnamecombo.set_active(0)

        tree = Utils.dataprovider_glade_get_widget(
                        __file__,
                        "config.glade",
                        "FacebookConfigDialog")

        #get a whole bunch of widgets
        albumnamecombo = tree.get_widget("albumnamecombo")
        load_button = tree.get_widget("load_button")
        dlg = tree.get_widget("FacebookConfigDialog")

        # setup combobox
        album_store = gtk.ListStore(gobject.TYPE_STRING)
        albumnamecombo.set_model(album_store)
        cell = gtk.CellRendererText()
        albumnamecombo.pack_start(cell, True)
        albumnamecombo.set_text_column(0)

        # load button
        load_button.connect('clicked', load_button_clicked)
        albumnamecombo.child.set_text(self.albumname)

        # run the dialog
        Utils.run_dialog_non_blocking(dlg, on_response, window)
示例#3
0
    def configure(self, window):
        """
        Show configuration dialog for this module.

        @param window: The parent window (used for modal dialogs)
        @type window: C{gtk.Window}
        """
        # lazily import gtk so if conduit is run from command line or a non
        # gtk system, this module will still load. There should be no need
        # to use gtk outside of this function
        import gtk

        def on_dialog_response(sender, response_id):
            """
            Response handler for configuration dialog.
            """
            if response_id == gtk.RESPONSE_OK:
                self._set_aws_access_key(access_key_entry.get_text())
                self._set_aws_secret_access_key(
                    secret_access_key_entry.get_text())
                self._set_bucket_name(bucket_name_entry.get_text())
                self._set_use_ssl((True, False)[ssl_combo_box.get_active()])

        tree = Utils.dataprovider_glade_get_widget(__file__,
                                                   "config.glade",
                                                   "AmazonS3ConfigDialog")

        # get widgets
        dialog = tree.get_widget("AmazonS3ConfigDialog")
        access_key_entry = tree.get_widget("accessKey")
        secret_access_key_entry = tree.get_widget("secretAccessKey")
        bucket_name_entry = tree.get_widget("bucketName")
        ssl_combo_box = tree.get_widget("useSsl")

        # set values of widgets
        access_key_entry.set_text(
            (self.aws_access_key, "")[self.aws_access_key == None])
        secret_access_key_entry.set_text((self.aws_secret_access_key, "")
                                         [self.aws_secret_access_key == None])
        bucket_name_entry.set_text(self.bucket_name)
        ssl_combo_box.set_active((1, 0)[self.use_ssl])

        # show dialog
        Utils.run_dialog_non_blocking(dialog, on_dialog_response, window)
示例#4
0
    def configure(self, window):
        """
        Show configuration dialog for this module.

        @param window: The parent window (used for modal dialogs)
        @type window: C{gtk.Window}
        """
        # lazily import gtk so if conduit is run from command line or a non
        # gtk system, this module will still load. There should be no need
        # to use gtk outside of this function
        import gtk

        def on_dialog_response(sender, response_id):
            """
            Response handler for configuration dialog.
            """
            if response_id == gtk.RESPONSE_OK:
                self._set_aws_access_key(access_key_entry.get_text())
                self._set_aws_secret_access_key(
                    secret_access_key_entry.get_text())
                self._set_bucket_name(bucket_name_entry.get_text())
                self._set_use_ssl((True, False)[ssl_combo_box.get_active()])

        tree = Utils.dataprovider_glade_get_widget(__file__, "config.glade",
                                                   "AmazonS3ConfigDialog")

        # get widgets
        dialog = tree.get_widget("AmazonS3ConfigDialog")
        access_key_entry = tree.get_widget("accessKey")
        secret_access_key_entry = tree.get_widget("secretAccessKey")
        bucket_name_entry = tree.get_widget("bucketName")
        ssl_combo_box = tree.get_widget("useSsl")

        # set values of widgets
        access_key_entry.set_text(
            (self.aws_access_key, "")[self.aws_access_key == None])
        secret_access_key_entry.set_text(
            (self.aws_secret_access_key,
             "")[self.aws_secret_access_key == None])
        bucket_name_entry.set_text(self.bucket_name)
        ssl_combo_box.set_active((1, 0)[self.use_ssl])

        # show dialog
        Utils.run_dialog_non_blocking(dialog, on_dialog_response, window)
示例#5
0
    def configure(self, window):
        """
        Configures the RTM Backend
        """
        import gtk
        import gobject
        def on_login_finish(*args):
            Utils.dialog_reset_cursor(dlg)
            
        def on_response(sender, responseID):
            if responseID == gtk.RESPONSE_OK:
                self.username = str(tree.get_widget('user_entry').get_text())
                self.password = str(tree.get_widget('pass_entry').get_text())
                
        def load_button_clicked(button):
            Utils.dialog_set_busy_cursor(dlg)
            conduit.GLOBALS.syncManager.run_blocking_dataprovider_function_calls(
                                            self,
                                            on_login_finish,
                                            self._login)


        tree = Utils.dataprovider_glade_get_widget(
                        __file__,
                        "config.glade",
                        "RTMConfigDialog")

        #get a whole bunch of widgets
        load_button = tree.get_widget("load_button")
        dlg = tree.get_widget("RTMConfigDialog")

        # load button
        load_button.connect('clicked', load_button_clicked)

        # run the dialog
        Utils.run_dialog_non_blocking(dlg, on_response, window)
示例#6
0
    def configure(self, window):
        """
        Configures the BoxDotNet sink
        """
        import gtk
        import gobject
        def on_login_finish(*args):
            if self.token:
                build_folder_store()
            Utils.dialog_reset_cursor(dlg)
            
        def on_response(sender, responseID):
            if responseID == gtk.RESPONSE_OK:
                self.foldername = foldernamecombo.child.get_text()
                
        def load_button_clicked(button):
            Utils.dialog_set_busy_cursor(dlg)
            conduit.GLOBALS.syncManager.run_blocking_dataprovider_function_calls(
                                            self,
                                            on_login_finish,
                                            self._login)

        def build_folder_store():
            folder_store.clear()
            folder_count = 0
            folder_iter = None
            for folder_name in self._get_folders().keys():
                iter = folder_store.append((folder_name,))
                if folder_name != "" and folder_name == self.foldername:
                    folder_iter = iter
                folder_count += 1

            if folder_iter:
                foldernamecombo.set_active_iter(folder_iter)
            elif self.foldername:
                foldernamecombo.child.set_text(self.foldername)
            elif folder_count:
                foldernamecombo.set_active(0)

        tree = Utils.dataprovider_glade_get_widget(
                        __file__,
                        "config.glade",
                        "BoxDotNetConfigDialog")

        #get a whole bunch of widgets
        foldernamecombo = tree.get_widget("foldernamecombo")
        load_button = tree.get_widget("load_button")
        dlg = tree.get_widget("BoxDotNetConfigDialog")

        # setup combobox
        folder_store = gtk.ListStore(gobject.TYPE_STRING)
        foldernamecombo.set_model(folder_store)
        cell = gtk.CellRendererText()
        foldernamecombo.pack_start(cell, True)
        foldernamecombo.set_text_column(0)

        # load button
        load_button.connect('clicked', load_button_clicked)
        foldernamecombo.child.set_text(self.foldername)

        # run the dialog
        Utils.run_dialog_non_blocking(dlg, on_response, window)