Ejemplo n.º 1
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)
Ejemplo n.º 2
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)
Ejemplo n.º 3
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)