Esempio n. 1
0
 def on_connect_menu_item_clicked(self, menuitem):
     """
     Callback of the 'connect' menuitem
     """
     server = self.get_selected_server()
     gc = GuiController()
     gc.connectToServer(server)
Esempio n. 2
0
    def on_tab_change(self, notebook, page, page_num):
        """
        Callback method handling tab changes.
        
        @param notebook - the notebook instance
        @param page - notebookpage 
        @param page_num - number of the current page 
        
        """
        #load favorites and recent servers directly if switched to
        #these tabs
        gc = GuiController()
        if 1 == page_num:  #favorites
            #gc.loadFavorites(self.favoritestab)
            gc.executeFavoritesLoading(self.favoritestab)
            self.favoritestab.filter.lock()
        if 2 == page_num:  #recent server
            #gc.loadRecentServer(self.recenttab)
            gc.executeRecentServersLoading(self.recenttab)
            self.recenttab.filter.lock()
        if 3 == page_num:  #buddies tab
            fm = FileManager()
            config = fm.getConfiguration()
            execute = fm.value_as_boolean(config[cfgkey.OPT_BUDDYSEARCH])
            if self.first_switch and execute:
                gc.execute_buddies_loading(self.buddiestab, execute=True)
            else:
                gc.execute_buddies_loading(self.buddiestab)

        self.first_switch = False
Esempio n. 3
0
 def onAddFavButtonClicked(self, widget):
     """
     Callback to handle adding a favorite
     """
     server = self.detailsbox.current_server
     gui = GuiController()
     gui.addFavorite(server)
Esempio n. 4
0
 def on_connect_menu_item_clicked(self, menuitem):
     """
     Callback of the 'connect' menuitem
     """
     server = self.get_selected_server()
     gc = GuiController()
     gc.connectToServer(server)
Esempio n. 5
0
 def onAddFavButtonClicked(self, widget):   
     """
     Callback to handle adding a favorite
     """
     server = self.detailsbox.current_server
     gui = GuiController()
     gui.addFavorite(server)
Esempio n. 6
0
 def on_refresh_clicked(self, button):
     """
     Callback of the refresh button
     """    
     self.lock()
     guicontroller = GuiController()
     liststore = self.parenttab.serverlist.liststore
     guicontroller.execute_serverlist_refresh(liststore, self.parenttab)
Esempio n. 7
0
 def on_refresh_clicked(self, widget):
     """
     Callback for the refresh button
     """
     self.refresh_button.set_sensitive(False)
     
     guicontroller = GuiController()
     guicontroller.executeRecentServersLoading(self.parent)    
Esempio n. 8
0
 def on_add_fav_menu_item_clicked(self, menuitem):
     """
     Callback for the 'add to favorites' context menu item
     """
     server = self.get_selected_server()
     if server:
         gc = GuiController()
         gc.addFavorite(server)
Esempio n. 9
0
 def on_add_fav_menu_item_clicked(self, menuitem):
     """
     Callback for the 'add to favorites' context menu item
     """
     server = self.get_selected_server()
     if server:
         gc = GuiController()
         gc.addFavorite(server)
Esempio n. 10
0
 def on_refresh_clicked(self, button):
     """
     Callback of the refresh button
     """
     self.lock()
     guicontroller = GuiController()
     liststore = self.parenttab.serverlist.liststore
     guicontroller.execute_serverlist_refresh(liststore, self.parenttab)
Esempio n. 11
0
 def on_status_button_clicked(self, button):
     """
     Callback of the status button
     Performs the 'rcon status' command
     """
     rcon_command = 'status'
     self.buffer.insert_at_cursor('rcon > status\n')
     gc = GuiController()
     gc.send_rcon_command(self.server, rcon_command, self)
Esempio n. 12
0
 def on_status_button_clicked(self, button):    
     """
     Callback of the status button
     Performs the 'rcon status' command
     """
     rcon_command = 'status'
     self.buffer.insert_at_cursor('rcon > status\n')
     gc = GuiController()
     gc.send_rcon_command(self.server, rcon_command, self)
Esempio n. 13
0
 def on_tab_change(self, notebook, page, page_num):
     """
     Callback method handling tab changes.
     
     @param notebook - the notebook instance
     @param page - notebookpage 
     @param page_num - number of the current page 
     
     """
     #load favorites and recent servers directly if switched to
     #these tabs 
     gc = GuiController()
     if 1 == page_num: #favorites
         #gc.loadFavorites(self.favoritestab)
         gc.executeFavoritesLoading(self.favoritestab)
         self.favoritestab.filter.lock()
     if 2 == page_num: #recent server
         #gc.loadRecentServer(self.recenttab)
         gc.executeRecentServersLoading(self.recenttab)
         self.recenttab.filter.lock()
     if 3 == page_num: #buddies tab
         fm = FileManager()
         config = fm.getConfiguration()
         execute = fm.value_as_boolean(config[cfgkey.OPT_BUDDYSEARCH])
         if self.first_switch and execute:
             gc.execute_buddies_loading(self.buddiestab, execute=True)
         else:
             gc.execute_buddies_loading(self.buddiestab)
              
     self.first_switch = False
Esempio n. 14
0
 def on_send_requested(self, widget):
     """
     Callback of the send button
     """    
     rcon_command = self.input.get_text()
     gc = GuiController()
     
     self.buffer.insert_at_cursor('rcon > ' + rcon_command + '\n')
     self.input.set_text('')
     
     gc.send_rcon_command(self.server, rcon_command, self)
Esempio n. 15
0
    def on_send_requested(self, widget):
        """
        Callback of the send button
        """
        rcon_command = self.input.get_text()
        gc = GuiController()

        self.buffer.insert_at_cursor('rcon > ' + rcon_command + '\n')
        self.input.set_text('')

        gc.send_rcon_command(self.server, rcon_command, self)
Esempio n. 16
0
    def onRefreshButtonClicked(self, widget):
        """
        Callback for refreshing the current selected server
        """

        selection = self.serverlist.serverlistview.get_selection()
        model, paths = selection.get_selected_rows()
        if paths:
            row = model[paths[0][0]]
            server = row[8]
            guicontroller = GuiController()
            guicontroller.setDetailServer(server, self)
Esempio n. 17
0
 def on_context_add_buddy_pressed(self, menuitem):
     """
     Callback for the context menu item 'add to buddylist'
     """
     #get the selected row of the playerlist
     selection = self.playerlistview.get_selection()
     result = selection.get_selected()
     if result: 
         iter = result[1]
         name = self.playerliststore.get_value(iter, 0)
         gc = GuiController()
         gc.add_name_to_buddylist(name, None)
Esempio n. 18
0
 def on_remove_buddy_clicked(self, widget):
     """
     Callback for the remove buddy button
     """
     selection = self.buddylistview.get_selection()
     result = selection.get_selected()
     if result: 
         iter = result[1]
         name_to_remove = self.buddyliststore.get_value(iter, 1)
         gc = GuiController()
         gc.remove_buddy(name_to_remove)
         self.buddyliststore.remove(iter)
Esempio n. 19
0
    def onSelectionChanged(self, selection):
        """
        Callback handling the selection of a row in the serverlist.
        Triggers updating the serverdetails area of the parent tab.
        """

        model, paths = selection.get_selected_rows()
        if paths:
            row = model[paths[0][0]]
            server = row[8]
            guicontroller = GuiController()
            guicontroller.setDetailServer(server, self.parenttab)
Esempio n. 20
0
    def onSelectionChanged(self, selection):
        """
        Callback handling the selection of a row in the serverlist.
        Triggers updating the serverdetails area of the parent tab.
        """

        model, paths = selection.get_selected_rows()
        if paths:
            row = model[paths[0][0]]
            server = row[9]
            guicontroller = GuiController()
            guicontroller.setDetailServer(server, self.parenttab)
Esempio n. 21
0
 def on_ok_clicked(self, widget):
         """
         Callback of the OK button
         """
         #get the entered name
         enteredname = self.nameentry.get_text()
         
         gc = GuiController()
         gc.add_name_to_buddylist(enteredname, self.parenttab)
         
         #afterwards close the dialog
         self.destroy()
Esempio n. 22
0
 def onRefreshButtonClicked(self, widget):
     """
     Callback for refreshing the current selected server
     """
     
     selection = self.serverlist.serverlistview.get_selection()
     model, paths = selection.get_selected_rows()
     if paths:
         row =  model[paths[0][0]]
         server = row[8]
         guicontroller = GuiController()
         guicontroller.setDetailServer(server, self)
Esempio n. 23
0
 def on_remove_fav_menu_item_clicked(self, menuitem):
     """
     Callback of the 'remove from favorites' menu item
     """
     # get the selected row of the serverlist
     selection = self.serverlistview.get_selection()
     result = selection.get_selected()
     if result:
         iter = result[1]
         server = self.liststore.get_value(iter, 8)
         gc = GuiController()
         gc.removeFavorite(server)
         self.liststore.remove(iter)
Esempio n. 24
0
 def connect_button_clicked(self, widget):
     """
     Callback of the connect button
     """
     gui = GuiController()
     server = self.detailsbox.current_server
     if server:
         if server.needsPassword():
             passdialog = PasswordDialog(server,\
                                              PassDialogType.SERVER_PASSWORD)
             passdialog.run()
         else:
             gui.connectToServer(server)
Esempio n. 25
0
 def on_remove_fav_menu_item_clicked(self, menuitem):
     """
     Callback of the 'remove from favorites' menu item
     """
     #get the selected row of the serverlist
     selection = self.serverlistview.get_selection()
     result = selection.get_selected()
     if result:
         iter = result[1]
         server = self.liststore.get_value(iter, 9)
         gc = GuiController()
         gc.removeFavorite(server)
         self.liststore.remove(iter)
Esempio n. 26
0
    def on_search_clicked(self, button):
        """
        Callback of the search button
        """
        #disable the button, so that no multiple queries are launched while
        #still one is active
        self.lock()

        filter = Filter(FilterType.ADVANCED_FILTER)
        filter.initialize_from_stored_filter_settings()

        guicontroller = GuiController()
        guicontroller.executeMasterServerQuery(filter, self.parent)
Esempio n. 27
0
 def connect_button_clicked(self, widget):
     """
     Callback of the connect button
     """
     gui = GuiController()
     server = self.detailsbox.current_server
     if server:
         if server.needsPassword():
             passdialog = PasswordDialog(server,\
                                              PassDialogType.SERVER_PASSWORD)
             passdialog.run()
         else:
             gui.connectToServer(server)
Esempio n. 28
0
 def on_search_clicked(self, button):
     """
     Callback of the search button
     """
     #disable the button, so that no multiple queries are launched while
     #still one is active
     self.lock()
     
     filter = Filter(FilterType.ADVANCED_FILTER)
     filter.initialize_from_stored_filter_settings()
     
     guicontroller = GuiController()
     guicontroller.executeMasterServerQuery(filter, self.parent)    
Esempio n. 29
0
    def on_search_buddies_clicked(self, widget):
        """
        Callback of the search buddies button
        """
        self.lock()

        fm = FileManager()

        #create a filter object
        filter = Filter(FilterType.BUDDY_FILTER, self.parenttab)
        filter.playerlist = fm.get_buddies()
        self.parenttab.set_all_buddies_to_offline()
        gc = GuiController()
        gc.executeMasterServerQuery(filter, self.parenttab)
Esempio n. 30
0
    def on_row_double_clickdef(self, treeview, path, view_column):
        """
        Callback for the row-activate signal (double-click, enter...)
        """
        row = self.liststore[path]
        server = row[8]
        gui = GuiController()

        if server:
            if server.needsPassword():
                passdialog = PasswordDialog(server, PassDialogType.SERVER_PASSWORD)
                passdialog.run()
            else:
                gui.connectToServer(server)
Esempio n. 31
0
 def on_search_buddies_clicked(self, widget):
     """
     Callback of the search buddies button
     """
     self.lock()
     
     fm = FileManager()
     
     #create a filter object
     filter = Filter(FilterType.BUDDY_FILTER, self.parenttab)
     filter.playerlist = fm.get_buddies()
     self.parenttab.set_all_buddies_to_offline()
     gc = GuiController()
     gc.executeMasterServerQuery(filter, self.parenttab) 
Esempio n. 32
0
    def on_row_double_clickdef(self, treeview, path, view_column):
        """
        Callback for the row-activate signal (double-click, enter...)
        """
        row = self.liststore[path]
        server = row[9]
        gui = GuiController()

        if server:
            if server.needsPassword():
                passdialog = PasswordDialog(server, PassDialogType\
                                                               .SERVER_PASSWORD)
                passdialog.run()
            else:
                gui.connectToServer(server)
Esempio n. 33
0
    def on_search_clicked(self, widget):
        """
        Callback for the search button - triggers the execution of the 
        master server query
        """
        #disable the button, so that no multiple queries are launched while
        #still one is active
        self.lock()
        #update the filter dict of the filemanager
        self.save_filter()

        filter = Filter(FilterType.BASIC_FILTER)
        filter.initialize_from_stored_filter_settings()

        guicontroller = GuiController()
        guicontroller.executeMasterServerQuery(filter, self.parent)
Esempio n. 34
0
 def on_search_clicked(self, widget):
     """
     Callback for the search button - triggers the execution of the 
     master server query
     """
     #disable the button, so that no multiple queries are launched while
     #still one is active
     self.lock()
     #update the filter dict of the filemanager
     self.save_filter()
     
     filter = Filter(FilterType.BASIC_FILTER)
     filter.initialize_from_stored_filter_settings()    
     
     guicontroller = GuiController()
     guicontroller.executeMasterServerQuery(filter, self.parent)    
Esempio n. 35
0
    def refresh(self):
        """
        refresh of the serverdetails view of the currently active tab of the
        currently selected server
        """

        #get the current tab
        pagenum = self.notebook.get_current_page()
        tab = self.notebook.get_nth_page(pagenum)

        selection = tab.serverlist.serverlistview.get_selection()
        model, paths = selection.get_selected_rows()
        if paths:
            row = model[paths[0][0]]
            server = row[8]
            guicontroller = GuiController()
            guicontroller.setDetailServer(server, tab)
Esempio n. 36
0
    def on_search_player_clicked(self, widget):
        """
        Callback of the player search button
        """
        self.search_button.set_sensitive(False)
        self.playersearchbutton.set_sensitive(False)

        name2search = self.playersearch_entry.get_text()
        searchname_list = []
        searchname_list.append(name2search)

        #create the filter object
        filter = Filter(FilterType.BUDDY_FILTER)
        filter.playerlist = searchname_list
        self.parenttab.set_all_buddies_to_offline()
        gc = GuiController()
        gc.executeMasterServerQuery(filter, self.parenttab)
Esempio n. 37
0
 def on_ok_clicked(self, widget):
         """
         Callback of the OK button
         """
         #get the entered password
         password = self.passentry.get_text()
         #set the password at the server object
         self.server.setPassword(password)
         
         #set rememberpassword option
         self.server.setRememberPassword(self.remembercheckbutton.get_active())
         
         #and connect...
         gui = GuiController()
         gui.connectToServer(self.server)
         #afterwards close the dialog
         self.destroy()
Esempio n. 38
0
 def on_search_player_clicked(self, widget):
     """
     Callback of the player search button
     """
     self.search_button.set_sensitive(False)
     self.playersearchbutton.set_sensitive(False)
     
     name2search = self.playersearch_entry.get_text()
     searchname_list = []
     searchname_list.append(name2search)
     
     #create the filter object
     filter = Filter(FilterType.BUDDY_FILTER)
     filter.playerlist = searchname_list
     self.parenttab.set_all_buddies_to_offline()
     gc = GuiController()
     gc.executeMasterServerQuery(filter, self.parenttab) 
Esempio n. 39
0
    def on_ok_clicked(self, widget):
        """
            Callback of the OK button
            """
        #get the entered password
        password = self.passentry.get_text()
        #set the password at the server object
        self.server.setPassword(password)

        #set rememberpassword option
        self.server.setRememberPassword(self.remembercheckbutton.get_active())

        #and connect...
        gui = GuiController()
        gui.connectToServer(self.server)
        #afterwards close the dialog
        self.destroy()
Esempio n. 40
0
 def refresh(self):
     """
     refresh of the serverdetails view of the currently active tab of the
     currently selected server
     """        
     
     #get the current tab
     pagenum = self.notebook.get_current_page()
     tab = self.notebook.get_nth_page(pagenum)
     
     selection = tab.serverlist.serverlistview.get_selection()
     model, paths = selection.get_selected_rows()
     if paths:
         row =  model[paths[0][0]]
         server = row[8]
         guicontroller = GuiController()
         guicontroller.setDetailServer(server, tab)
Esempio n. 41
0
 def on_lookup_clicked(self, button):
     """
     Callback of the lookup button
     """
     self.lock()
     
     srvman = ServerManager() 
     enteredserver = self.lookupentry.get_text()
     guicontroller = GuiController()
     try:
         host, port = enteredserver.split(':', 1)
         port = int(port)
         host = guicontroller.get_host_by_name(host)
         server = srvman.getServer(host, port)
     except:
         self.parent.statusbar.progressbar.set_text('Failed to lookup server!')
         self.unlock()
         return
     #TODO: perform the lookup
     guicontroller.lookup_server(server, self.parenttab)
Esempio n. 42
0
    def on_lookup_clicked(self, button):
        """
        Callback of the lookup button
        """
        self.lock()

        srvman = ServerManager()
        enteredserver = self.lookupentry.get_text()
        guicontroller = GuiController()
        try:
            host, port = enteredserver.split(':', 1)
            port = int(port)
            host = guicontroller.get_host_by_name(host)
            server = srvman.getServer(host, port)
        except:
            self.parent.statusbar.progressbar.set_text(
                'Failed to lookup server!')
            self.unlock()
            return
        #TODO: perform the lookup
        guicontroller.lookup_server(server, self.parenttab)
Esempio n. 43
0
    def onRemoveRecentClicked(self, widget):
        """
        Callback method for the remove button. Triggers the removal of 
        the recent server entry by calling the gui controller which then 
        removes the recent server (from list in memory and also from file)
        Also removes the recent server directly from the liststore.
        
        @param widget - the widget that emitted the clicked signal - the button 
        """

        #remove row from liststore and also the server from the recent list
        selection = self.serverlist.serverlistview.get_selection()
        result = selection.get_selected()
        if result:
            model, iter = result

            server = self.serverlist.liststore.get_value(iter, 8)
            #remove it from the favoriteslist
            gui = GuiController()
            gui.removeRecent(server)

            model.remove(iter)
Esempio n. 44
0
 def onRemoveFavoriteClicked(self, widget):
     """
     Callback method for the remove button. Triggers the removal of 
     the favorite entry by calling the gui controller which then 
     removes the favorite (from list in memory and also from file)
     Also removes the favorite directly from the liststore.
     
     @param widget - the widget that emitted the clicked signal - the button 
     """
     
     #the current selected server displayed in the details
     server = self.detailsbox.current_server
     if server: 
         #remove it from the favoriteslist
         gui = GuiController()
         gui.removeFavorite(server)
         
         #remove row from liststore
         selection = self.serverlist.serverlistview.get_selection()
         result = selection.get_selected()
         if result: 
             model, iter = result
             model.remove(iter)
Esempio n. 45
0
 def onRemoveRecentClicked(self, widget):
     """
     Callback method for the remove button. Triggers the removal of 
     the recent server entry by calling the gui controller which then 
     removes the recent server (from list in memory and also from file)
     Also removes the recent server directly from the liststore.
     
     @param widget - the widget that emitted the clicked signal - the button 
     """
     
      
             
     #remove row from liststore and also the server from the recent list
     selection = self.serverlist.serverlistview.get_selection()
     result = selection.get_selected()
     if result: 
         model, iter = result
         
         server = self.serverlist.liststore.get_value(iter, 8)
         #remove it from the favoriteslist
         gui = GuiController()
         gui.removeRecent(server)
         
         model.remove(iter)
Esempio n. 46
0
    def __init__(self):
        """
        Constructor
        """
        gtk.AboutDialog.__init__(self)

        gc = GuiController()
        self.set_name(gc.appname)
        self.set_program_name(gc.appname)
        self.set_version(gc.appver)
        self.set_comments(gc.appdesc)
        self.set_website('http://code.google.com/p/urtsb/')
        authors = ['Sorcerer ([email protected])']
        self.set_authors(authors)
        self.set_copyright('(c) 2010')
        self.set_license(self.gplstring)

        logo_image = gtk.Image()
        logo_image.set_from_file(Globals.icon_dir + '/logo.png')
        self.set_logo(logo_image.get_pixbuf())
Esempio n. 47
0
 def on_add_clicked(self, widget):
     srvman = ServerManager()
     enteredserver = self.addentry.get_text()
     guicontroller = GuiController()
     try:
         host, port = enteredserver.split(':', 1)
         port = int(port)
         host = guicontroller.get_host_by_name(host)
         server = srvman.getServer(host, port)
     except:
         self.parent.statusbar.progressbar.set_text('Failed to add server!')
         return
     guicontroller.addFavorite(server)
     guicontroller.executeFavoritesLoading(self.parent)
     if server.isFavorite():
         self.parent.statusbar.progressbar.set_text(
             'Server successfully added')
         self.addentry.set_text('')
     else:
         self.parent.statusbar.progressbar.set_text('Failed to add server!')
Esempio n. 48
0
 def on_add_clicked(self, widget):   
     srvman = ServerManager() 
     enteredserver = self.addentry.get_text()
     guicontroller = GuiController()
     try:
         host, port = enteredserver.split(':', 1)
         port = int(port)
         host = guicontroller.get_host_by_name(host)
         server = srvman.getServer(host, port)
     except:
         self.parent.statusbar.progressbar.set_text('Failed to add server!')
         return
     guicontroller.addFavorite(server)
     guicontroller.executeFavoritesLoading(self.parent) 
     if server.isFavorite():
         self.parent.statusbar.progressbar.set_text('Server successfully added')
         self.addentry.set_text('')
     else:
         self.parent.statusbar.progressbar.set_text('Failed to add server!')
Esempio n. 49
0
   
    gobject.threads_init() # enable threads for gtk
    
    #init global definitions:
    Globals.initialize(determine_path())
    
    #init logging
    Log(loglevel)
    
    if sys.platform == 'win32':
        #apply gtk style for win32 (wimp theme)
        gtkrcpath = os.path.normpath(os.path.join(Globals.resource_dir, \
                                                               'win_gtk/gtkrc'))
        gtk.rc_parse(gtkrcpath)
    
    window = Window() # create the urtsb window
    guicontroller = GuiController() # initialize the gui controller
    guicontroller.setWindow(window)  
       
    gtk.main() # run the gtk main loop
    
    #on exit save the window size informations
    Log.log.info('Exiting....')
    fm = FileManager()
    Log.log.debug('Saving window size informations')
    fm.save_window_sizing()
    
if __name__ == "__main__":
    start()

Esempio n. 50
0
 def on_clear_button_clicked(self, widget):
     """
     Callback for the clear list button
     """
     guicontroller = GuiController()
     guicontroller.clearRecentServers(self.parent)
Esempio n. 51
0
    def __init__(self):
        """
        Constructor. Creating and inititializing the main window of UrTSB.
        """
        gtk.Window.__init__(self)
        Window.instance = self

        #window creation and basic window settings
        fm = FileManager()
        window_sizing = fm.get_window_sizing()

        gc = GuiController()
        self.set_title(gc.appname + ' v.' + gc.appver + ' - ' + gc.appdesc)
        self.set_icon_from_file(Globals.icon_dir + '/logo.png')

        if window_sizing.maximized:
            self.maximize()
        else:
            self.unmaximize()
        self.set_default_size(window_sizing.width, window_sizing.height)
        if None == window_sizing.x and None == window_sizing.y:
            self.set_position(gtk.WIN_POS_CENTER)
        else:
            self.move(window_sizing.x, window_sizing.y)
        self.connect('destroy', gtk.main_quit)

        # add a VBox that will contain the main notebookpane and a statusbar
        mainbox = gtk.VBox()
        self.add(mainbox)

        # the notebook - tabs will be serverlist, favorites,
        # recent servers and settings
        self.notebook = gtk.Notebook()
        self.notebook.set_border_width(2)
        mainbox.pack_start(self.notebook)
        self.notebook.connect('switch-page', self.on_tab_change)

        # add the serverlist tab
        self.serverlisttab = ServerTab()
        srvlabel = gtk.Label('Serverlist')
        self.notebook.append_page(self.serverlisttab, srvlabel)

        # add the favorites tab
        self.favoritestab = FavoritesTab()
        favlabel = gtk.Label('Favorites')
        self.notebook.append_page(self.favoritestab, favlabel)

        # add the recently played tab
        self.recenttab = RecentTab()
        recentlabel = gtk.Label('Recently Played')
        self.notebook.append_page(self.recenttab, recentlabel)

        # add the buddies tab
        self.buddiestab = BuddiesTab()
        buddieslabel = gtk.Label('Buddies')
        self.notebook.append_page(self.buddiestab, buddieslabel)

        # add the settings tab
        self.settingsstab = SettingsTab()
        settingslabel = gtk.Label('Settings')
        self.notebook.append_page(self.settingsstab, settingslabel)

        #set default tab
        fm = FileManager()
        config = fm.getConfiguration()
        defaulttab = int(config[cfgkey.OPT_DEFAULT_TAB])
        #this variable is used to dertermine if the tabswitch is the first
        #after application start
        self.first_switch = True

        self.notebook.set_current_page(defaulttab)

        #connect key press event to be able to create keyboard shortcuts
        self.connect('key-press-event', self.on_key_pressed_event)

        #connect window-state-event to handle maximize/demaximize
        self.connect('window-state-event', self.on_window_state_changed)

        self.show_all()