Beispiel #1
0
    def __init__(self, parent=None):
        PlugableMainWindow.__init__(self, parent)
        self.setMinimumSize(600, 400)

        self.setWindowTitle(_("Postgres Application"))

        ## Main Menu

        ## "file"

        icon = QtGui.QIcon(":icons/postgresql_elephant.svg")
        self.action_connect = QtGui.QAction(icon, _("Begin Session"), self)
        self.action_connect.setToolTip(_("Start a PostgreSQL session"))

        icon = QtGui.QIcon(":icons/no_postgresql_elephant.svg")
        self.action_disconnect = QtGui.QAction(icon, _("End Session(s)"), self)
        self.action_disconnect.setToolTip(_("End all PostgreSQL sessions"))

        insertpoint = self.action_quit
        self.menu_file.insertAction(insertpoint, self.action_connect)
        self.menu_file.insertAction(insertpoint, self.action_disconnect)
        self.menu_file.insertSeparator(insertpoint)

        #:
        self.main_toolbar.insertAction(insertpoint, self.action_connect)
        self.main_toolbar.insertAction(insertpoint, self.action_disconnect)
        #self.addToolBar(self.session_toolbar)

        ####       now load stored settings                                ####
        self.loadSettings()

        self.action_connect.triggered.connect(self.new_pg_session)
        self.action_disconnect.triggered.connect(self.end_pg_sessions)

        QtCore.QTimer.singleShot(100, self.setBriefMessageLocation)

        self.session_widgets = []

        self.setCentralWidget(self.central_widget)

        self.update_session_status()
    def __init__(self, parent=None):
        PlugableMainWindow.__init__(self, parent)
        self.setMinimumSize(600, 400)

        self.setWindowTitle(_("Postgres Application"))

        ## Main Menu

        ## "file"

        icon = QtGui.QIcon(":icons/postgresql_elephant.svg")
        self.action_connect = QtGui.QAction(icon, _("Begin Session"), self)
        self.action_connect.setToolTip(_("Start a PostgreSQL session"))

        icon = QtGui.QIcon(":icons/no_postgresql_elephant.svg")
        self.action_disconnect = QtGui.QAction(icon, _("End Session(s)"), self)
        self.action_disconnect.setToolTip(_("End all PostgreSQL sessions"))

        insertpoint = self.action_quit
        self.menu_file.insertAction(insertpoint, self.action_connect)
        self.menu_file.insertAction(insertpoint, self.action_disconnect)
        self.menu_file.insertSeparator(insertpoint)

        #:
        self.main_toolbar.insertAction(insertpoint, self.action_connect)
        self.main_toolbar.insertAction(insertpoint, self.action_disconnect)
        # self.addToolBar(self.session_toolbar)

        ####       now load stored settings                                ####
        self.loadSettings()

        self.action_connect.triggered.connect(self.new_pg_session)
        self.action_disconnect.triggered.connect(self.end_pg_sessions)

        QtCore.QTimer.singleShot(100, self.setBriefMessageLocation)

        self.session_widgets = []

        self.setCentralWidget(self.central_widget)

        self.update_session_status()
Beispiel #3
0
    def preferences_dialog(self):
        if self._preferences_dialog is None:
            dl = PlugableMainWindow.preferences_dialog(self)

            connections_pref = Preference(_("Database Connections"))

            m_d_widg = ManageDatabasesWidget(self)
            m_d_widg.set_connections(self.known_session_params)
            connections_pref.setWidget(m_d_widg)
            dl.insert_preference_dialog(0, connections_pref)

            self._preferences_dialog = dl

        return self._preferences_dialog
    def preferences_dialog(self):
        if self._preferences_dialog is None:
            dl = PlugableMainWindow.preferences_dialog(self)

            connections_pref = Preference(_("Database Connections"))

            m_d_widg = ManageDatabasesWidget(self)
            m_d_widg.set_connections(self.known_session_params)
            connections_pref.setWidget(m_d_widg)
            dl.insert_preference_dialog(0, connections_pref)

            self._preferences_dialog = dl

        return self._preferences_dialog