Changeset 1410

Show
Ignore:
Timestamp:
08/17/07 13:21:14 (6 years ago)
Author:
kop-labs
Message:

ToolbarInterface? - remove option added

Location:
branch/k0p/umitInterfaceEditor
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branch/k0p/umitInterfaceEditor/OptionManager.py

    r1409 r1410  
    2929from higwidgets.higbuttons import HIGButton 
    3030from higwidgets.higdialogs import HIGDialog, HIGAlertDialog 
    31  
     31from umitCore.Logging import log 
    3232from umitCore.I18N import _ 
    3333## Testing at devel  
     
    403403        self.exists_display = (self.optiondisplay != None ) #True or False 
    404404        if self.exists_display: 
    405              
     405            log.debug('<<< Cursor changed') 
    406406            self.__treeview.connect("cursor-changed",self.update_option_display) 
    407407             
  • branch/k0p/umitInterfaceEditor/PageNotebook.py

    r1393 r1410  
    504504         
    505505     
     506    def delete_on_item(self, widget): 
     507        if not widget.is_voidplace():  
     508            # remove widgets like checkbuttons or others and put voidplace 
     509            childs = widget.get_children() 
     510            cmd = CommandAddRemoveOption(widget,childs, 
     511                                         self._profilecore, False) 
     512            widget.set_select(False) 
     513            command_manager.add_command(cmd) 
     514            log.debug(' Remove Widgets like CheckButtons or others and put voidplace') 
     515             
     516        else: 
     517            # remove voidplace and delete the widget from table/box 
     518            #XXX  
     519            cmd = CommandAddRemoveVoidplace(self,  
     520                                            widget, self._coords, False) 
     521            #widget.unload_voidplace() 
     522            command_manager.add_command(cmd) 
     523            log.debug('Remove voidplace and delete the widget from table') 
     524         
     525     
     526     
    506527         
    507528    def _key_press_event(self, widget, event): 
     
    509530        _keyval = gtk.gdk.keyval_name(event.keyval) 
    510531        if _keyval == "Delete" and self._old_selected!=None : 
    511             if not widget.is_voidplace():  
    512                 # remove widgets like checkbuttons or others and put voidplace 
    513                 childs = widget.get_children() 
    514                 cmd = CommandAddRemoveOption(widget,childs, 
    515                                              self._profilecore, False) 
    516                 widget.set_select(False) 
    517                 command_manager.add_command(cmd) 
    518                 log.debug(' Remove Widgets like CheckButtons or others and put voidplace') 
    519                  
    520             else: 
    521                 # remove voidplace and delete the widget from table/box 
    522                 #XXX  
    523                 cmd = CommandAddRemoveVoidplace(self,  
    524                                                 widget, self._coords, False) 
    525                 #widget.unload_voidplace() 
    526                 command_manager.add_command(cmd) 
    527                 log.debug('Remove voidplace and delete the widget from table') 
     532            self.delete_on_item(widget) 
     533 
    528534                 
    529535        #self._table.remove(widget) 
  • branch/k0p/umitInterfaceEditor/Tools.py

    r1393 r1410  
    174174             None, _('Add Place'), self._add_place), 
    175175            ('Remove Option', gtk.STOCK_DELETE, _('Remove Option'),  
    176              None, _('Remove Option'), self.np), 
     176             None, _('Remove Option'), self._remove_option), 
    177177 
    178178        ] 
     
    223223    def enable(self,item, value): 
    224224        self.main_action_group.get_action(item).set_sensitive(value) 
     225    def _remove_option(self, widget): 
     226        self.box_editable.delete_on_item(self.box_editable._old_selected) 
    225227    def _add_section(self, widget): 
    226228        '''