Changeset 1241
- Timestamp:
- 08/04/07 09:55:37 (6 years ago)
- Location:
- branch/k0p/umitInterfaceEditor
- Files:
-
- 5 modified
-
Changelog (modified) (1 diff)
-
Profile.py (modified) (9 diffs)
-
TODO (modified) (1 diff)
-
Tools.py (modified) (3 diffs)
-
umitInterfaceEditor.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branch/k0p/umitInterfaceEditor/Changelog
r1213 r1241 1 1 # Umit Interface Editor v0.1 Changelog 2 2 # 3 04:07:2007 4 5 6 7 8 9 03: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 3 18 4 19 02:07:2007: 5 20 - Fixed bug around allocation of SpecialHBox Wrapper 6 - Add Command to Move items21 - Added Command to Move items 7 22 - Fixed a bug related of signals fo Command to Move items 8 23 - Auto-update ToolBar Items 24 - Began with functions to move in ProfileCore 9 25 10 26 01:07:2007: -
branch/k0p/umitInterfaceEditor/Profile.py
r1230 r1241 144 144 145 145 146 class 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 170 class 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 146 181 147 182 class CommandMove(TwiceCommand, Command): … … 256 291 257 292 258 259 260 261 293 class CommandAddRemoveOption(TwiceCommand, Command): 262 294 ''' … … 292 324 widget.remove(i) 293 325 t = gtk.Label('-') 326 t.set_size_request(-1, 23) 294 327 t.show() 295 328 … … 339 372 self._y = 0 340 373 341 374 self.connect('button-press-event', self._bp) 342 375 #Private API 376 def _bp(self, widget,event): 377 print "other" 343 378 def _fill_table(self): 344 379 k = 0 … … 419 454 420 455 def _button_press_event(self,widget, event): 421 #XXX: See, may be this is import for bug of assertation GObject422 456 widget.set_select(True) 423 457 self._parent.select(False) … … 539 573 HIGNotebook.__init__(self) 540 574 self.sections_widgets = {} 575 self.sections_widgets_list = [] 541 576 self.connect('key-press-event', self.on_key_press) 542 577 self.connect('switch-page', self.on_switch_page) … … 578 613 label.show_all() 579 614 self.sections_widgets[label] = number 615 self.sections_widgets_list.append(label) 580 616 self.append_page(box, label) 617 self.set_tab_reorderable(label, True) 581 618 582 619 def select(self, value): 583 620 if self._old_select!=None: 584 621 self._old_select.set_select(value) 622 self._old_select=None 585 623 586 624 def on_button_press(self, widget, event): … … 590 628 widget.set_select(True) 591 629 self._old_select = widget 630 592 631 self.set_current_page(self.sections_widgets[widget]) 593 632 #XXX - this focus owns drag-n-drop received :( … … 606 645 if self._old_select.is_voidplace(): 607 646 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) 608 657 self.remove_page(self.get_current_page()) 658 659 660 609 661 else: 610 662 cmd = CommandAddRemoveLabel(self._old_select, -
branch/k0p/umitInterfaceEditor/TODO
r1207 r1241 4 4 option_check,option_list and others 5 5 - 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 6 16 7 17 #TODO 01/07/2007 -
branch/k0p/umitInterfaceEditor/Tools.py
r1216 r1241 136 136 ('Remove Section', gtk.STOCK_REMOVE, _('_Remove Section'), 137 137 None, _('Remove Section'), self.np), 138 ('Add Place', gtk.STOCK_ADD, _('Add Place'), 139 None, _('Add Place'), self.np), 138 140 ('Remove Option', gtk.STOCK_DELETE, _('Remove Option'), 139 141 None, _('Remove Option'), self.np), … … 144 146 <toolitem action='Move up'/> 145 147 <toolitem action='Move down'/> 146 <separator/> 148 <toolitem action='Add Place'/> 149 <toolitem action='Remove Option'/> 150 <separator/> 147 151 <toolitem action='Move Section Left'/> 148 152 <toolitem action='Move Section Right'/> 149 <separator/>150 153 <toolitem action='Add Section'/> 151 154 <toolitem action='Remove Section'/> 152 155 <separator/> 153 <toolitem action='Remove Option'/>156 154 157 </toolbar> 155 158 """ … … 226 229 self._table = HIGTable() 227 230 231 232 #Name 228 233 self._label_name = HIGEntryLabel(_('Name')) 229 234 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 230 252 231 253 self._table.attach(self._label_name, 0,1,0, 1) 232 254 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) 233 258 234 259 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 236 273 def disable_all(self): 237 274 pass -
branch/k0p/umitInterfaceEditor/umitInterfaceEditor.py
r1210 r1241 73 73 self._current_edit_mode = None 74 74 75 75 self.connect("delete_event", gtk.main_quit) 76 76 77 77 def create_profile_edit(self): … … 352 352 def save(self, widget): 353 353 self.list_options_box.save() 354 354 def quit(self, widget): 355 gtk.main_quit() 355 356 def np(self, widget): 356 357 print "Don't work yet" … … 367 368 ('Save all', gtk.STOCK_SAVE, _('_Save all'), None, _('Save all'), 368 369 self.np), 369 ('Quit', gtk.STOCK_QUIT, _('_Quit'), None, _('Quit'), self. np),370 ('Quit', gtk.STOCK_QUIT, _('_Quit'), None, _('Quit'), self.quit), 370 371 ('Edit', None, _('Edit'), None), 371 372 ('Undo', gtk.STOCK_UNDO, _('_Undo'), None, _('Undo'), self._undo_cb),
