PostgresMainWindow

Author:Neil Wallace (neil@openmolar.com)
Release:2.0.906~hg207

The PostgresMainWindow class provides a re-implementation of BaseMainWindow , but adds functionality for handling connections to postgres database using OpenmolarDatabase

Inherited by AdminMainWindow and ClientMainWindow

methods and attributes

class lib_openmolar.common.qt4.postgres.postgres_mainwindow.PostgresMainWindow(parent=None)[source]

Bases: lib_openmolar.common.qt4.plugin_tools.plugable_main_window.PlugableMainWindow

A main window with functions to connect to postgres

__init__(parent=None)[source]
ALLOW_MULTIPLE_SESSIONS = True

True if more than one pg session is allowed (False for client)

CONN_CLASS

alias of OpenmolarDatabase

add_session(session)[source]

get self.new_session_widget give it the session and to the ui.

Note

returns whatever self.new_session_widget created so that calling functions have a reference to it.

central_widget[source]

should be Overwritten the central widget should have functions frequently associated with a tab widget. namely addTab etc..

closeEvent(event=None)[source]

re-implement the close event of QtGui.QMainWindow, and check the user really meant to do this.

connection_dialog[source]
end_pg_sessions()[source]

disconnect from postgres server (if not connected - pass quietly).

get_password(conn_data)[source]

raise a dialog to get a password

get_user_pass(dbname)[source]

return a tuple of (result, user, password)

has_pg_connection[source]

returns a bool which states if an active connection exists.

known_session_params[source]

parse the allowed locations for connections. returns a list of ConnectionData

new_pg_session()[source]

connect a new postgres session

new_session_widget[source]

return a widget (of type PostgresSessionWidget ) single-session widgets should return the existing session widget. multi-session clients should return a new widget (and keep a reference to it)

preferences_dialog()[source]
update_session_status()[source]

toggles the connect buttons/menu actions, updates the sessions displayed.

Table Of Contents

Previous topic

PluginsDirectoryDialog

Next topic

PostgresSessionWidget