Changeset 1241

Show
Ignore:
Timestamp:
08/04/07 09:55:37 (6 years ago)
Author:
kop-labs
Message:

Move Pages

Location:
branch/k0p/umitInterfaceEditor
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branch/k0p/umitInterfaceEditor/Changelog

    r1213 r1241  
    11# Umit Interface Editor v0.1 Changelog 
    22# 
     304:07:2007 
     4 
     5 
     6 
     7 
     8 
     903:07:2007: 
     10        - Bug fixed of resize windows (draw and voidplace) 
     11        - Bux fixed: grab focus 
     12        - Added functions move down and move up at ProfileCore 
     13        - Fixed bugs with move and resize on the NotebookLabel 
     14        - Began add ProfileCore at Profile Edit Mode (move down, move up commands) 
     15        - Fixed bug when delete tabs 
     16         
     17 
    318 
    41902:07:2007: 
    520        - Fixed bug around allocation of SpecialHBox Wrapper 
    6         - Add Command to Move items  
     21        - Added Command to Move items  
    722        - Fixed a bug related of signals fo Command to Move items 
    823        - Auto-update ToolBar Items 
     24        - Began with functions to move in ProfileCore 
    925 
    102601:07:2007: 
  • branch/k0p/umitInterfaceEditor/Profile.py

    r1230 r1241  
    144144     
    145145 
     146class CommandPageNotebook(TwiceCommand, Command): 
     147    ''' 
     148    Add Page at Notebook or Remove 
     149    ''' 
     150    def __init__(self, notebook, page, number, profilecore, state): 
     151        TwiceCommand.__init__(self, state) 
     152        Command.__init__(self, _('Add/Remove Page')) 
     153        self._notebook = notebook 
     154        self._page = page 
     155        self._number = number 
     156        self._profilecore = profilecore 
     157    def _create_label(self): 
     158        pass 
     159     
     160    def _add_page(self): 
     161        label = self._create_label() 
     162        self._notebook.insert_page(self._page, label, self._number) 
     163         
     164    _execute_1 = _add_page 
     165    def _remove_page(self): 
     166        self._notebook.remove_page(self._number) 
     167     
     168    _execute_2 = _remove_page 
     169     
     170class CommandMovePage(CommandPageNotebook): 
     171    def __init__(self, notebook, page, number,profilecore, state): 
     172        CommandPageNotebook.__init__(notebook, page, number, profilecore, state) 
     173    def _move_left(self): 
     174        print "move left " 
     175    _execute_1 = _move_left 
     176    def _move_right(self): 
     177        print "move right" 
     178    _execute_2 = _move_right 
     179 
     180 
    146181 
    147182class CommandMove(TwiceCommand, Command): 
     
    256291 
    257292 
    258  
    259  
    260  
    261293class CommandAddRemoveOption(TwiceCommand, Command): 
    262294    '''  
     
    292324            widget.remove(i) 
    293325        t = gtk.Label('-') 
     326        t.set_size_request(-1, 23) 
    294327        t.show() 
    295328         
     
    339372        self._y = 0  
    340373         
    341  
     374        self.connect('button-press-event', self._bp) 
    342375    #Private API  
     376    def _bp(self, widget,event): 
     377        print "other" 
    343378    def _fill_table(self): 
    344379        k = 0 
     
    419454         
    420455    def _button_press_event(self,widget, event): 
    421         #XXX: See, may be this is import for bug of assertation GObject 
    422456        widget.set_select(True)  
    423457        self._parent.select(False) 
     
    539573        HIGNotebook.__init__(self) 
    540574        self.sections_widgets = {} 
     575        self.sections_widgets_list = [] 
    541576        self.connect('key-press-event', self.on_key_press) 
    542577        self.connect('switch-page', self.on_switch_page) 
     
    578613        label.show_all() 
    579614        self.sections_widgets[label] = number 
     615        self.sections_widgets_list.append(label) 
    580616        self.append_page(box, label) 
     617        self.set_tab_reorderable(label, True) 
    581618     
    582619    def select(self, value): 
    583620        if self._old_select!=None: 
    584621            self._old_select.set_select(value) 
     622            self._old_select=None 
    585623     
    586624    def on_button_press(self, widget, event): 
     
    590628        widget.set_select(True) 
    591629        self._old_select = widget 
     630         
    592631        self.set_current_page(self.sections_widgets[widget]) 
    593632        #XXX - this focus owns drag-n-drop received :(  
     
    606645            if self._old_select.is_voidplace(): 
    607646                self._old_select.unload_voidplace() 
     647                label_tmp =self.get_tab_label(self.get_nth_page( 
     648                    self.get_current_page())) 
     649                num = self.sections_widgets[label_tmp] 
     650                del self.sections_widgets[label_tmp] 
     651                for i in range(num, len(self.sections_widgets)): 
     652                    print i 
     653                    widget_tmp = self.sections_widgets_list[i+1] 
     654                    self.sections_widgets[widget_tmp] = self.sections_widgets[widget_tmp] - 1  
     655                 
     656                self.sections_widgets_list.pop(num) 
    608657                self.remove_page(self.get_current_page()) 
     658                 
     659 
     660                 
    609661            else:  
    610662                cmd = CommandAddRemoveLabel(self._old_select,  
  • branch/k0p/umitInterfaceEditor/TODO

    r1207 r1241  
    44        option_check,option_list and others  
    55- Profile.py - review targets  
     6 
     7 
     8 
     9 
     10#TODO 03/07/2007 
     11 
     12- Write ProfileCore ( Support Move and fix eventuals bugs with Add!!) 
     13- Integration of ProfileCore in Moves options and Sections 
     14 
     15 
    616 
    717#TODO 01/07/2007 
  • branch/k0p/umitInterfaceEditor/Tools.py

    r1216 r1241  
    136136            ('Remove Section', gtk.STOCK_REMOVE, _('_Remove Section'),  
    137137             None, _('Remove Section'), self.np), 
     138            ('Add Place', gtk.STOCK_ADD, _('Add Place'),  
     139             None, _('Add Place'), self.np), 
    138140            ('Remove Option', gtk.STOCK_DELETE, _('Remove Option'),  
    139141             None, _('Remove Option'), self.np), 
     
    144146            <toolitem action='Move up'/> 
    145147            <toolitem action='Move down'/> 
    146             <separator/> 
     148            <toolitem action='Add Place'/> 
     149            <toolitem action='Remove Option'/>     
     150            <separator/> 
    147151            <toolitem action='Move Section Left'/> 
    148152            <toolitem action='Move Section Right'/> 
    149             <separator/> 
    150153            <toolitem action='Add Section'/> 
    151154            <toolitem action='Remove Section'/> 
    152155            <separator/> 
    153             <toolitem action='Remove Option'/>          
     156      
    154157        </toolbar> 
    155158        """ 
     
    226229        self._table = HIGTable() 
    227230         
     231         
     232        #Name 
    228233        self._label_name  = HIGEntryLabel(_('Name')) 
    229234        self._entry_name = HIGTextEntry() 
     235 
     236        #Type  
     237        self._label_type = HIGEntryLabel(_('Type'))      
     238        self._combo_type = gtk.combo_box_new_text() 
     239        self._combo_type.append_text('') 
     240        self._combo_type.append_text('Option List') 
     241        self._combo_type.append_text('Option Check') 
     242        self._combo_type.set_active(0) 
     243        self._combo_type.connect('changed', self.change_combo) 
     244         
     245        #For option list open a dialog to add/remove options 
     246        self._button_list = HIGButton('Edit Option List') 
     247        img = gtk.Image() 
     248        img.set_from_file('share/icons/combo.png') 
     249        self._button_list.set_image(img) 
     250         
     251         
    230252         
    231253        self._table.attach(self._label_name, 0,1,0, 1) 
    232254        self._table.attach(self._entry_name, 1,2,0,1) 
     255        self._table.attach(self._label_type, 0,1,1,2) 
     256        self._table.attach(self._combo_type, 1,2,1, 2) 
     257        self._table.attach(self._button_list, 0,2, 3,4) 
    233258         
    234259        self._box.pack_start(self._table, False, False) 
    235          
     260    def change_combo(self,combo): 
     261        model = combo.get_model() 
     262        index = combo.get_active() 
     263        if index: 
     264            if model[index][0]=='Option List': 
     265                 
     266                log.debug('Show Button List ') 
     267                self._button_list.show() 
     268            else: 
     269                print model[index][0] 
     270                log.debug('Hide Button List ') 
     271                self._button_list.hide() 
     272        return 
    236273    def disable_all(self): 
    237274        pass  
  • branch/k0p/umitInterfaceEditor/umitInterfaceEditor.py

    r1210 r1241  
    7373        self._current_edit_mode = None  
    7474         
    75          
     75        self.connect("delete_event", gtk.main_quit) 
    7676 
    7777    def create_profile_edit(self): 
     
    352352    def save(self, widget): 
    353353        self.list_options_box.save() 
    354          
     354    def quit(self, widget): 
     355        gtk.main_quit() 
    355356    def np(self, widget): 
    356357        print "Don't work yet" 
     
    367368            ('Save all', gtk.STOCK_SAVE, _('_Save all'), None, _('Save all'), 
    368369             self.np), 
    369             ('Quit', gtk.STOCK_QUIT, _('_Quit'), None, _('Quit'), self.np), 
     370            ('Quit', gtk.STOCK_QUIT, _('_Quit'), None, _('Quit'), self.quit), 
    370371            ('Edit', None, _('Edit'), None), 
    371372            ('Undo', gtk.STOCK_UNDO, _('_Undo'), None, _('Undo'), self._undo_cb),