コード例 #1
0
    def run(self):
        """
        Database Restore widget run part
        """
        self.dialog.show_all()

        self.entry_server_url.set_text('%(login.server)s:%(login.port)s' %
                                       CONFIG)
        while True:
            database = False
            passwd = False
            url = False
            update = False
            # TODO: This needs to be unified with the other widgets
            self.button_server_change.connect_after(
                'clicked', lambda a, b: common.request_server(b),
                self.entry_server_url)
            res = self.dialog.run()
            if res == gtk.RESPONSE_OK:
                database = self.entry_db_name.get_text()
                url = self.entry_server_url.get_text()
                passwd = self.entry_server_password.get_text()
                update = self.check_update.get_active()
                break
            else:
                self.dialog.destroy()
                rpc.logout()
                break
        self.parent.present()
        self.dialog.destroy()

        return url, database, passwd, update
コード例 #2
0
 def refreshlist_ask(self, widget=None):
     res = common.request_server(self.entry_server_connection)
     if not res:
         return None
     host, port = res
     self.refreshlist(host, port)
     return (host, port)
コード例 #3
0
ファイル: dbdumpdrop.py プロジェクト: coopengo/tryton
 def refreshlist_ask(self, widget=None):
     res = common.request_server(self.entry_server_connection)
     if not res:
         return None
     host, port = res
     self.refreshlist(host, port)
     return (host, port)
コード例 #4
0
ファイル: dbrestore.py プロジェクト: coopengo/tryton
    def run(self):
        """
        Database Restore widget run part
        """
        self.dialog.show_all()

        self.entry_server_url.set_text('%(login.server)s:%(login.port)s' %
            CONFIG)
        while True:
            database = False
            passwd = False
            url = False
            update = False
            # TODO: This needs to be unified with the other widgets
            self.button_server_change.connect_after('clicked',
                lambda a, b: common.request_server(b),
                self.entry_server_url)
            res = self.dialog.run()
            if res == gtk.RESPONSE_OK:
                database = self.entry_db_name.get_text()
                url = self.entry_server_url.get_text()
                passwd = self.entry_server_password.get_text()
                update = self.check_update.get_active()
                break
            else:
                self.dialog.destroy()
                rpc.logout()
                break
        self.parent.present()
        self.dialog.destroy()

        return url, database, passwd, update
コード例 #5
0
 def refreshlist_ask(widget, server_widget, db_widget, label, db_progress):
     res = common.request_server(server_widget)
     if not res:
         return None
     host, port = res
     DBBackupDrop.refreshlist(widget, db_widget, label, db_progress, host,
         port)
     return (host, port)
コード例 #6
0
 def server_change(self, widget):
     """
     This method checks the server connection via host and port. If the
     connection is successfull, it query the language list and pass true
     state to the GUI. Otherwise it pass false state to the GUI.
     """
     res = common.request_server(self.entry_server_connection)
     if not res:
         return False
     host, port = res
     try:
         if self.combo_language and host and port:
             common.refresh_langlist(self.combo_language, host, port)
         self.server_connection_state(True)
     except TrytonServerError:
         self.server_connection_state(False)
         return False
     return True
コード例 #7
0
ファイル: dbcreate.py プロジェクト: coopengo/tryton
 def server_change(self, widget):
     """
     This method checks the server connection via host and port. If the
     connection is successfull, it query the language list and pass true
     state to the GUI. Otherwise it pass false state to the GUI.
     """
     res = common.request_server(self.entry_server_connection)
     if not res:
         return False
     host, port = res
     try:
         if self.combo_language and host and port:
             common.refresh_langlist(self.combo_language, host, port)
         self.server_connection_state(True)
     except TrytonServerError:
         self.server_connection_state(False)
         return False
     return True