def start(self): """ Start Emma process """ self.mainwindow = MainWindow(self) self.mainwindow.connect('destroy', lambda *args: gtk.main_quit()) self.key_map = KeyMap(self) try: icon = gtk.gdk.pixbuf_new_from_file( os.path.join(icons_path, "emma.png")) self.mainwindow.set_icon(icon) except glib.GError: print "Icon not loaded" # init all notebooks self.message_notebook = self.mainwindow.message_notebook self.main_notebook = self.mainwindow.main_notebook # init Message log self.msg_log = TabMsgLog(self) self.message_notebook.prepend_page(self.msg_log, gtk.Label('Message Log')) # init SQL log self.sql_log = TabSqlLog(self) self.message_notebook.prepend_page(self.sql_log, gtk.Label('SQL Log')) self.blob_view = TabBlobView(self) self.message_notebook.append_page(self.blob_view, gtk.Label('Blob View')) self.local_search_dialog = LocalSearch() self.connections_tv = ConnectionsTreeView(self) self.mainwindow.connections_tv_container.add(self.connections_tv) self.connections_tv.show() self.main_notebook.add_query_tab() if int(self.config.get("ping_connection_interval")) > 0: gobject.timeout_add( int(self.config.get("ping_connection_interval")) * 1000, self.on_connection_ping) self.init_plugins()
def start(self): self.glade_file = os.path.join(glade_path, "emma.glade") if not os.access(self.glade_file, os.R_OK): print self.glade_file, "not found!" sys.exit(-1) print "glade file: %r" % self.glade_file self.xml = gtk.glade.XML(self.glade_file) self.xml.signal_autoconnect(self) self.key_map = KeyMap(self) self.mainwindow = widgets.MainWindow(self) self.mainwindow.connect('destroy', lambda *args: gtk.main_quit()) self.mainwindow.connect('key_release_event', self.key_map.on_mainwindow_key_release_event) self.mainwindow.connect('key_press_event', self.key_map.on_mainwindow_key_press_event) try: icon = gtk.gdk.pixbuf_new_from_file( os.path.join(icons_path, "emma.png")) self.mainwindow.set_icon(icon) except glib.GError: print "Icon not loaded" # init all notebooks self.message_notebook = self.mainwindow.message_notebook self.main_notebook = self.mainwindow.main_notebook # init Message log self.msg_log = widgets.TabMsgLog(self) self.message_notebook.prepend_page(self.msg_log, gtk.Label('Message Log')) # init SQL log self.sql_log = widgets.TabSqlLog(self) self.message_notebook.prepend_page(self.sql_log, gtk.Label('SQL Log')) self.blob_view = widgets.TabBlobView(self) self.message_notebook.append_page(self.blob_view, gtk.Label('Blob View')) # Local Search Window self.local_search_window = self.xml.get_widget("localsearch_window") self.local_search_entry = self.xml.get_widget("local_search_entry") self.local_search_entry.connect( "activate", lambda *a: self.local_search_window.response(gtk.RESPONSE_OK)) self.local_search_start_at_first_row = self.xml.get_widget( "search_start_at_first_row") self.local_search_case_sensitive = self.xml.get_widget( "search_case_sensitive") # self.field_edit = self.xml.get_widget("field_edit") # self.field_edit_content = self.xml.get_widget("edit_field_content") self.connections_tv = ConnectionsTreeView(self) self.mainwindow.connections_tv_container.add(self.connections_tv) self.connections_tv.show() self.main_notebook.add_query_tab() if int(self.config.get("ping_connection_interval")) > 0: gobject.timeout_add( int(self.config.get("ping_connection_interval")) * 1000, self.on_connection_ping) self.init_plugins()