Changeset 1933
- Timestamp:
- Tue Feb 28 21:31:03 2006
- Files:
-
- trunk/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcutContainer.h (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcutList.cxx (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcut.cxx (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/OptionsWindow.h (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcutList.h (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcut.h (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/GLiveSupport.h (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcutContainer.cxx (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.cxx (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.user-template (modified) (diff)
- trunk/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.template (modified) (diff)
- trunk/livesupport/src/modules/widgets/src/ZebraTreeView.cxx (modified) (diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
trunk/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx
r1927 r1933 40 40 #include "LiveSupport/Widgets/ScrolledNotebook.h" 41 41 #include "LiveSupport/Widgets/EntryBin.h" 42 #include "LiveSupport/Widgets/ZebraTreeView.h"43 42 44 43 #include "OptionsWindow.h" … … 167 166 { 168 167 resetEntries(); 168 resetKeyBindings(); 169 169 onCloseButtonClicked(false); 170 170 } … … 212 212 } 213 213 214 // TODO: save the changes in keybindings 215 214 216 if (changed) { 215 217 try { … … 400 402 401 403 keyBindingsModel = Gtk::TreeStore::create(keyBindingsColumns); 402 ZebraTreeView * keyBindingsView = Gtk::manage(wf->createTreeView( 403 keyBindingsModel )); 404 keyBindingsView = Gtk::manage(wf->createTreeView(keyBindingsModel)); 404 405 405 406 keyBindingsView->appendColumn("", keyBindingsColumns.actionColumn); … … 407 408 408 409 // fill in the data 410 fillKeyBindingsModel(); 411 412 // set TreeView properties 413 keyBindingsView->set_headers_visible(false); 414 keyBindingsView->set_enable_search(false); 415 keyBindingsView->columns_autosize(); 416 keyBindingsView->expand_all(); 417 418 // connect the callbacks 419 keyBindingsView->signal_row_activated().connect(sigc::mem_fun(*this, 420 &OptionsWindow::onKeyBindingsRowActivated )); 421 keyBindingsView->signal_key_press_event().connect_notify(sigc::mem_fun( 422 *this, 423 &OptionsWindow::onKeyBindingsKeyPressed )); 424 keyBindingsView->signal_focus_out_event().connect_notify(sigc::mem_fun( 425 *this, 426 &OptionsWindow::onKeyBindingsFocusOut )); 427 428 // make a new box and pack the components into it 429 Gtk::VBox * section = Gtk::manage(new Gtk::VBox); 430 section->pack_start(*keyBindingsView, Gtk::PACK_SHRINK, 5); 431 432 return section; 433 } 434 435 436 /*------------------------------------------------------------------------------ 437 * Fill the key bindings model from the KeyboardShortcutList. 438 *----------------------------------------------------------------------------*/ 439 void 440 OptionsWindow :: fillKeyBindingsModel(void) throw () 441 { 409 442 Ptr<const KeyboardShortcutList>::Ref 410 443 list = gLiveSupport->getKeyboardShortcutList(); 411 444 412 445 try { 413 int rowNumber = 0;414 446 KeyboardShortcutList::iterator it; 415 447 for (it = list->begin(); it != list->end(); ++it) { … … 421 453 parent[keyBindingsColumns.actionColumn] 422 454 = *gLiveSupport->getLocalizedWindowName(windowName); 423 parent[keyBindingsColumns.rowNumberColumn]424 = rowNumber++;425 455 426 456 KeyboardShortcutContainer::iterator iter; … … 438 468 actionString); 439 469 child[keyBindingsColumns.keyNameColumn] 440 = *keyString; // TODO: localize this? 441 child[keyBindingsColumns.rowNumberColumn] 442 = rowNumber++; 470 = Glib::Markup::escape_text(*keyString); 471 // TODO: localize this? 443 472 } 444 473 } … … 448 477 std::exit(1); 449 478 } 450 451 // set TreeView properties452 keyBindingsView->set_headers_visible(false);453 keyBindingsView->set_rules_hint(true);454 keyBindingsView->columns_autosize();455 keyBindingsView->expand_all();456 457 // connect the callbacks458 459 // make a new box and pack the components into it460 Gtk::VBox * section = Gtk::manage(new Gtk::VBox);461 section->pack_start(*keyBindingsView, Gtk::PACK_SHRINK, 5);462 463 return section;464 479 } 465 480 629 644 } 630 645 646 647 /*------------------------------------------------------------------------------ 648 * Reset the key bindings to their saved state. 649 *----------------------------------------------------------------------------*/ 650 void 651 OptionsWindow :: resetKeyBindings(void) throw () 652 { 653 keyBindingsModel->clear(); 654 fillKeyBindingsModel(); 655 keyBindingsView->expand_all(); 656 } 657 658 659 /*------------------------------------------------------------------------------ 660 * Event handler for clicking on a row in the key bindings table. 661 *----------------------------------------------------------------------------*/ 662 void 663 OptionsWindow :: onKeyBindingsRowActivated(const Gtk::TreePath & path, 664 Gtk::TreeViewColumn * column) 665 throw () 666 { 667 resetEditedKeyBinding(); 668 669 Gtk::TreeIter iter = keyBindingsModel->get_iter(path); 670 if (iter) { 671 Gtk::TreeRow row = *iter; 672 editedKeyName.reset(new const Glib::ustring( 673 row[keyBindingsColumns.keyNameColumn])); 674 editedKeyRow = row; 675 row[keyBindingsColumns.keyNameColumn] = "Press a key..."; 676 } 677 } 678 679 680 /*------------------------------------------------------------------------------ 681 * Event handler for clicking outside the key bindings table. 682 *----------------------------------------------------------------------------*/ 683 void 684 OptionsWindow :: onKeyBindingsKeyPressed(GdkEventKey * event) throw () 685 { 686 if (editedKeyName) { 687 Ptr<const Glib::ustring>::Ref 688 newKeyName = KeyboardShortcut::modifiedKeyToString( 689 Gdk::ModifierType(event->state), 690 event->keyval); 691 if (newKeyName && *newKeyName != "Escape") { 692 editedKeyName = newKeyName; 693 } 694 resetEditedKeyBinding(); 695 } 696 } 697 698 699 /*------------------------------------------------------------------------------ 700 * Event handler for clicking outside the key bindings table. 701 *----------------------------------------------------------------------------*/ 702 void 703 OptionsWindow :: onKeyBindingsFocusOut(GdkEventFocus * event) 704 throw () 705 { 706 resetEditedKeyBinding(); 707 } 708 709 710 /*------------------------------------------------------------------------------ 711 * Reset the key binding to its pre-editing value. 712 *----------------------------------------------------------------------------*/ 713 void 714 OptionsWindow :: resetEditedKeyBinding(void) throw () 715 { 716 if (editedKeyName) { 717 editedKeyRow[keyBindingsColumns.keyNameColumn] 718 = Glib::Markup::escape_text(*editedKeyName); 719 editedKeyName.reset(); 720 } 721 } 722 -
trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcutContainer.h
r1925 r1933 69 69 * 70 70 * <pre><code> 71 * <keyboardShortcutContainer> 72 * <windowName>liveModeWindow</windowName> 71 * <keyboardShortcutContainer 72 * windowName = "liveModeWindow"> 73 73 * <keyboardShortcut> ... </keyboardShortcut> 74 74 * <keyboardShortcut> ... </keyboardShortcut> … … 81 81 * 82 82 * <pre><code> 83 * <!ELEMENT keyboardShortcutContainer (windowName, keyboardShortcut+) > 84 * <!ELEMENT windowName (CDATA) > 83 * <!ELEMENT keyboardShortcutContainer (keyboardShortcut+) > 84 * <!ATTLIST keyboardShortcutContainer windowName CDATA #REQUIRED > 85 85 * </code></pre> 86 86 * 169 169 */ 170 170 KeyboardShortcut::Action 171 findAction(unsigned int modifiers, unsigned int key) const throw (); 171 findAction(Gdk::ModifierType modifiers, 172 guint key) const throw (); 172 173 173 174 /** -
trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcutList.cxx
r1925 r1933 85 85 KeyboardShortcut::Action 86 86 KeyboardShortcutList :: findAction(const Glib::ustring & windowName, 87 unsigned int modifiers, 88 unsigned int key) const 87 Gdk::ModifierType modifiers, 88 guint key) const 89 89 throw () 90 90 { -
trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcut.cxx
r1925 r1933 53 53 * The name of the attribute of the action element. 54 54 */ 55 static const std::string action ElementName = "action";55 static const std::string actionAttributeName = "action"; 55 55 56 56 /** 57 57 * The name of the attribute of the key element. 58 58 */ 59 static const std::string key ElementName = "key";59 static const std::string keyAttributeName = "key"; 59 59 60 60 /* 61 61 * The modifier keys we check against. 62 62 * The following modifiers are omitted, hence ignored: 63 * GDK_LOCK_MASK (caps lock), 64 * GDK_MOD2_MASK (don't know what; always on on my computer), 65 * GDK_MOD3_MASK (don't know what; always off on my computer), 66 * GDK_BUTTONX_MASK (mouse buttons, X = 1..5). 63 * Gdk::LOCK_MASK (caps lock), 64 * Gdk::MOD2_MASK (don't know what; always on on my computer), 65 * Gdk::MOD3_MASK (don't know what; always off on my computer), 66 * Gdk::BUTTONX_MASK (mouse buttons, X = 1..5). 67 67 */ 68 static const unsigned int modifiersChecked = GDK_SHIFT_MASK 69 | GDK_CONTROL_MASK 70 | GDK_MOD1_MASK // Alt 71 | GDK_MOD4_MASK // Windows key 72 | GDK_MOD5_MASK; // AltGr 68 static const Gdk::ModifierType modifiersChecked = Gdk::SHIFT_MASK 69 | Gdk::CONTROL_MASK 70 | Gdk::MOD1_MASK // Alt 71 | Gdk::MOD4_MASK // Windows key 72 | Gdk::MOD5_MASK; // AltGr 73 73 74 74 … … 81 81 82 82 /*------------------------------------------------------------------------------ 83 * Add a shortcut key for this object.84 *----------------------------------------------------------------------------*/85 void86 KeyboardShortcut :: addKey(Ptr<const Glib::ustring>::Ref modifiedKeyName)87 throw (std::invalid_argument)88 {89 Ptr<Glib::ustring>::Ref inputString(new Glib::ustring(90 *modifiedKeyName ));91 92 Ptr<Glib::ustring>::Ref keyName = getToken(inputString);93 if (!keyName) {94 throw std::invalid_argument("");95 }96 unsigned int key = stringToKey(keyName);97 98 Ptr<Glib::ustring>::Ref modifierName;99 unsigned int modifiers = 0;100 while ((modifierName = getToken(inputString))) {101 modifiers |= stringToModifier(modifierName);102 }103 104 addKey(modifiers, key);105 }106 107 108 /*------------------------------------------------------------------------------109 * Add a shortcut key for this object.110 *----------------------------------------------------------------------------*/111 void112 KeyboardShortcut :: addKey(unsigned int modifiers,113 unsigned int key) throw ()114 {115 modifierList.push_back(modifiers);116 keyList.push_back(gdk_keyval_to_upper(key));117 }118 119 120 /*------------------------------------------------------------------------------121 83 * Create a keyboard shortcut element object based on an XML element. 122 84 *----------------------------------------------------------------------------*/ … … 130 92 } 131 93 132 xmlpp::Node::NodeList children;133 134 94 // set the action 135 children = element.get_children(actionElementName); 136 if (children.size() < 1) { 137 throw std::invalid_argument("missing " 138 + actionElementName + " element"); 139 } else if (children.size() > 1) { 140 throw std::invalid_argument("too many " 141 + actionElementName + " elements"); 142 } 143 const xmlpp::Element* actionElement = dynamic_cast<const xmlpp::Element*>( 144 children.front()); 145 actionString.reset(new Glib::ustring(actionElement->get_child_text() 146 ->get_content() )); 147 try { 148 action = stringToAction(actionString); 149 } catch (std::invalid_argument &e) { 150 std::string eMsg = "Invalid action specification "; 151 eMsg += *actionString; 152 eMsg += "."; 153 throw std::invalid_argument(eMsg); 154 } 155 156 // set the keys 157 children = element.get_children(keyElementName); 158 if (children.size() < 1) { 159 throw std::invalid_argument("missing " 160 + keyElementName + " element"); 161 } 162 bool firstRun = true; 163 xmlpp::Node::NodeList::const_iterator it; 164 for (it = children.begin(); it != children.end(); ++it) { 165 const xmlpp::Element* keyElement = 166 dynamic_cast<const xmlpp::Element*>(*it); 167 Ptr<Glib::ustring>::Ref keyString(new Glib::ustring( 168 keyElement->get_child_text() 169 ->get_content() )); 170 if (firstRun) { 171 firstKeyString = keyString; 172 firstRun = false; 173 } 95 xmlpp::Attribute * actionAttribute = element.get_attribute( 96 actionAttributeName); 97 if (actionAttribute) { 98 actionString.reset(new Glib::ustring(actionAttribute->get_value())); 174 99 try { 175 a ddKey(keyString);100 action = stringToAction(actionString); 175 100 } catch (std::invalid_argument &e) { 176 std::string eMsg = "Invalid key specification "; 177 eMsg += *keyString; 178 eMsg += " for action "; 101 std::string eMsg = "Invalid action specification "; 179 102 eMsg += *actionString; 180 103 eMsg += "."; 181 104 throw std::invalid_argument(eMsg); 182 105 } 106 } else { 107 throw std::invalid_argument("missing " 108 + actionAttributeName + " attribute"); 109 } 110 111 // set the key 112 xmlpp::Attribute * keyAttribute = element.get_attribute( 113 keyAttributeName); 114 if (keyAttribute) { 115 setKey(keyAttribute->get_value()); 116 } else { 117 throw std::invalid_argument("missing " 118 + keyAttributeName + " attribute"); 119 } 120 } 121 122 123 /*------------------------------------------------------------------------------ 124 * Set the shortcut key. 125 *----------------------------------------------------------------------------*/ 126 void 127 KeyboardShortcut :: setKey(const Glib::ustring & keyName) 128 throw (std::invalid_argument) 129 { 130 shortcutKey = Gtk::AccelKey(keyName); 131 if (shortcutKey.get_key() == 0) { 132 throw std::invalid_argument("invalid shortcut key name"); 183 133 } 184 134 } … … 190 140 *----------------------------------------------------------------------------*/ 191 141 bool 192 KeyboardShortcut :: isTriggeredBy(unsigned int modifiers, 193 unsigned int key) const throw () 142 KeyboardShortcut :: isTriggeredBy(Gdk::ModifierType modifiers, 143 guint key) const 144 throw () 194 145 { 195 unsigned int myKey = gdk_keyval_to_upper(key); 196 unsigned int myModifiers = modifiers & modifiersChecked; 197 198 KeyListType::const_iterator modifierIt = modifierList.begin(); 199 KeyListType::const_iterator keyIt = keyList.begin(); 146 Gdk::ModifierType myModifiers = modifiers & modifiersChecked; 200 147 201 while (keyIt != keyList.end()) { 202 if (*modifierIt == myModifiers && *keyIt == myKey) { 203 return true; 204 } 205 ++modifierIt; 206 ++keyIt; 148 if (shortcutKey.get_mod() == myModifiers 149 && shortcutKey.get_key() == key) { 150 return true; 151 } else { 152 return false; 207 153 } 208 209 return false;210 154 } 211 155 241 185 242 186 /*------------------------------------------------------------------------------ 243 * Get the next token in the key descriptionstring.187 * Convert a modifiers-key code pair to a user-readable string. 243 187 *----------------------------------------------------------------------------*/ 244 188 Ptr<Glib::ustring>::Ref 245 KeyboardShortcut :: getToken(Ptr<Glib::ustring>::Ref inputString) 189 KeyboardShortcut :: modifiedKeyToString(Gdk::ModifierType modifiers, 190 guint key) 246 191 throw () 247 192 { 248 Ptr<Glib::ustring>::Ref token; 249 250 if (!inputString || inputString->length() == 0) { 251 return token; // initialized to a 0 pointer 252 } 253 254 unsigned int minusPosition = inputString->rfind('-'); 255 unsigned int lastPosition = inputString->length() - 1; 256 257 if (minusPosition == lastPosition) { 258 if (minusPosition == 0) { 259 token.reset(new Glib::ustring("-")); 260 inputString->erase(); 261 return token; 262 } else if (inputString->at(minusPosition - 1) == '-') { 263 token.reset(new Glib::ustring("-")); 264 inputString->erase(minusPosition - 1); 265 return token; 266 } else { 267 return token; 268 } 269 } else if (minusPosition == Glib::ustring::npos) { 270 token.reset(new Glib::ustring(*inputString)); 271 inputString->erase(); 272 return token; 273 } else { 274 token.reset(new Glib::ustring(*inputString, minusPosition + 1)); 275 inputString->erase(minusPosition); 276 return token; 277 } 278 } 279 280 281 /*------------------------------------------------------------------------------ 282 * Convert a key name to a gtk+ gdkkeysyms value. 283 *----------------------------------------------------------------------------*/ 284 unsigned int 285 KeyboardShortcut :: stringToKey(Ptr<const Glib::ustring>::Ref keyName) 286 throw (std::invalid_argument) 287 { 288 if (keyName->length() == 1) { 289 char c = keyName->at(0); 290 if (c >= '0' && c <= '9') { 291 return GDK_0 + (c - '0'); 292 } else if (c >= 'A' && c <= 'Z') { 293 return GDK_A + (c - 'A'); 294 } else if (c >= 'a' && c <= 'z') { 295 return GDK_a + (c - 'a'); 296 } 297 } else if (*keyName == "Space") { 298 return GDK_space; 299 } else if (*keyName == "Esc") { 300 return GDK_Escape; 301 } else if (*keyName == "Escape") { 302 return GDK_Escape; 303 } else if (*keyName == "Tab") { 304 return GDK_Tab; 305 } else if (*keyName == "Backspace") { 306 return GDK_BackSpace; 307 } else if (*keyName == "Del") { 308 return GDK_Delete; 309 } else if (*keyName == "Delete") { 310 return GDK_Delete; 311 } else if (*keyName == "Home") { 312 return GDK_Home; 313 } else if (*keyName == "End") { 314 return GDK_End; 315 } else if (*keyName == "Up") { 316 return GDK_Up; 317 } else if (*keyName == "Down") { 318 return GDK_Down; 319 } else if (*keyName == "Left") { 320 return GDK_Left; 321 } else if (*keyName == "Right") { 322 return GDK_Right; 323 } else if (*keyName == "PgUp") { 324 return GDK_Page_Up; 325 } else if (*keyName == "PageUp") { 326 return GDK_Page_Up; 327 } else if (*keyName == "PgDn") { 328 return GDK_Page_Down; 329 } else if (*keyName == "PgDown") { 330 return GDK_Page_Down; 331 } else if (*keyName == "PageDown") { 332 return GDK_Page_Down; 333 } else if (*keyName == "F1") { 334 return GDK_F1; 335 } else if (*keyName == "F2") { 336 return GDK_F2; 337 } else if (*keyName == "F3") { 338 return GDK_F3; 339 } else if (*keyName == "F4") { 340 return GDK_F4; 341 } else if (*keyName == "F5") { 342 return GDK_F5; 343 } else if (*keyName == "F6") { 344 return GDK_F6; 345 } else if (*keyName == "F7") { 346 return GDK_F7; 347 } else if (*keyName == "F8") { 348 return GDK_F8; 349 } else if (*keyName == "F9") { 350 return GDK_F9; 351 } else if (*keyName == "F10") { 352 return GDK_F10; 353 } else if (*keyName == "F11") { 354 return GDK_F11; 355 } else if (*keyName == "F12") { 356 return GDK_F12; 357 } 358 359 // if none of the above: 360 throw std::invalid_argument(""); 361 } 362 363 364 /*------------------------------------------------------------------------------ 365 * Convert a mofifier name to a gtk+ gdktypes value. 366 *----------------------------------------------------------------------------*/ 367 unsigned int 368 KeyboardShortcut :: stringToModifier(Ptr<const Glib::ustring>::Ref modifierName) 369 throw (std::invalid_argument) 370 { 371 if (*modifierName == "Shift") { 372 return GDK_SHIFT_MASK; 373 } else if (*modifierName == "Ctrl") { 374 return GDK_CONTROL_MASK; 375 } else if (*modifierName == "Control") { 376 return GDK_CONTROL_MASK; 377 } else if (*modifierName == "Alt") { 378 return GDK_MOD1_MASK; 379 } else if (*modifierName == "AltGr") { 380 return GDK_MOD5_MASK; 381 } else if (*modifierName == "Win") { 382 return GDK_MOD4_MASK; 383 } else if (*modifierName == "Windows") { 384 return GDK_MOD4_MASK; 385 } else { 386 throw std::invalid_argument(""); 387 } 193 Gtk::AccelKey accelKey(key, modifiers & modifiersChecked); 194 Ptr<Glib::ustring>::Ref keyName(new Glib::ustring(accelKey.get_abbrev())); 195 return keyName; 388 196 } 389 197 -
trunk/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx
r1902 r1933 763 763 if (event->type == GDK_KEY_PRESS) { 764 764 KeyboardShortcut::Action action = gLiveSupport->findAction( 765 windowName, 766 event->state, 767 event->keyval); 765 windowName, 766 Gdk::ModifierType(event->state), 767 event->keyval); 768 768 switch (action) { 769 769 case KeyboardShortcut::moveItemUp : -
trunk/livesupport/src/products/gLiveSupport/src/OptionsWindow.h
r1927 r1933 58 58 #include "LiveSupport/Widgets/ScrolledWindow.h" 59 59 #include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" 60 #include "LiveSupport/Widgets/ZebraTreeView.h" 60 61 #include "GLiveSupport.h" 61 62 #include "MasterPanelUserInfoWidget.h" … … 163 164 164 165 /** 166 * Reset the key bindings to their saved state. 167 */ 168 void 169 resetKeyBindings(void) throw (); 170 171 /** 172 * Fill the key bindings model from the KeyboardShortcutList. 173 */ 174 void 175 fillKeyBindingsModel(void) throw (); 176 177 /** 178 * The row of the currently edited key binding. 179 */ 180 Gtk::TreeRow editedKeyRow; 181 182 /** 183 * The value of the currently edited key binding 184 * (as a user-readable modifiers - key name combo). 185 */ 186 Ptr<const Glib::ustring>::Ref editedKeyName; 187 188 /** 189 * Reset the key binding to its pre-editing value. 190 */ 191 void 192 resetEditedKeyBinding(void) throw (); 193 194 /** 165 195 * Construct the "Sound" section. 166 196 * … … 226 256 227 257 /** 228 * Event handler for the test button 258 * Event handler for the test button. 228 258 * 229 259 * @param entry the text entry field containing the new device name … … 236 266 237 267 /** 268 * Event handler for double-clicking a row in the key bindings table. 269 * 270 * @param event the button event 271 */ 272 virtual void 273 onKeyBindingsRowActivated(const Gtk::TreePath & path, 274 Gtk::TreeViewColumn * column) 275 throw (); 276 277 /** 278 * Signal handler for a key pressed in the key bindings table. 279 * 280 * @param event the button event received 281 * @return true if the key press was fully handled, false if not 282 */ 283 virtual void 284 onKeyBindingsKeyPressed(GdkEventKey * event) throw (); 285 286 /** 287 * Event handler for clicking outside the key bindings table. 288 * 289 * @param event the focus event 290 */ 291 virtual void 292 onKeyBindingsFocusOut(GdkEventFocus * event) throw (); 293 294 /** 238 295 * The columns model containing the data for the Key bindings section. 239 296 * 290 347 Glib::RefPtr<Gtk::TreeStore> keyBindingsModel; 291 348 349 /** 350 * The tree view. 351 */ 352 ZebraTreeView * keyBindingsView; 353 292 354 293 355 public: -
trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcutList.h
r1925 r1933 152 152 KeyboardShortcut::Action 153 153 findAction(const Glib::ustring & windowName, 154 unsigned int modifiers, 155 unsigned int key) const throw (); 154 Gdk::ModifierType modifiers, 155 guint key) const throw (); 156 156 157 157 /** -
trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcut.h
r1925 r1933 42 42 43 43 #include <stdexcept> 44 #include <vector> 45 #include <gdk/gdktypes.h> 46 #include <gdk/gdkkeysyms.h> 47 #include <gdk/gdkkeys.h> 44 #include <gtkmm/accelkey.h> 48 45 49 46 #include "LiveSupport/Core/Ptr.h" … … 71 68 * 72 69 * <pre><code> 73 * <keyboardShortcut> 74 * <action>pauseAudio</action> 75 * <key>Ctrl-Alt-P</key> 76 * <key>Space</key> 77 * <key>F10</key> 78 * </keyboardShortcut> 70 * <keyboardShortcut action = "pauseAudio" 71 * key = "<Alt><Ctrl>P" /> 79 72 * </code></pre> 80 73 * 81 74 * The possible action values are the members of the Action enumeration. 82 75 * 83 * The possible key values are the letters A-Z (or a-z; they are not 84 * case-sensitive), the numbers 0-9, 85 * plus Space, Esc (or Escape), Tab, Backspace, Delete (Del), Home, End, 86 * Up, Down, Left, Right, PgUp (PageUp), PgDown (PageDown, PgDn), 87 * and the function keys F1 through F12. 76 * The possible key values are zero or more of the modifiers 77 * <Shift>, <Control> and <Alt>, followed by the 78 * name of the key, e.g., the letters A-Z (or a-z; they are not 79 * case-sensitive), the numbers 0-9, Space, Tab, etc. 80 * The key names are the ones defined in Gtk::AccelKey, used in the 81 * Gnome Keyboard Shortcuts applet, for example. 82 * (Note: Gtk::AccelKey is a wrapper for the gdk_keyval_name() and 83 * gdk_keyval_from_name() C functions in GDK.) 88 84 * 89 * The key names can be prefixed with zero or more of the modifiers 90 * Shift, Ctrl (or Control), Alt, AltGr, and Win (or Windows), 91 * separated by '-' characters. 92 * 93 * There must be exactly one <code>action</code> attribute, and one or more 94 * <code>key</code> attributes. (Zero keys is not an error, but pointless.) 85 * There must be exactly one each of the <code>action</code> 86 * <code>key</code> attributes. 95 87 * 96 88 * The DTD for the expected XML element looks like the following: 97 89 * 98 90 * <pre><code> 99 * <!ELEMENT keyboardShortcut (action, key+) > 100 * <!ELEMENT action (CDATA) > 101 * <!ELEMENT key (CDATA) > 91 * <!ELEMENT keyboardShortcut EMPTY > 92 * <!ATTLIST keyboardShortcut action CDATA #REQUIRED > 93 * <!ATTLIST keyboardShortcut key CDATA #REQUIRED > 102 94 * </code></pre> 103 95 * … … 143 135 144 136 /** 145 * The type for storing key and modifier values. 146 */ 147 typedef std::vector<unsigned int> 148 KeyListType; 149 150 /** 151 * The list of modifiers to be used with the keys. 152 * For a list of the possible values, see 153 * <code>/usr/include/gtk-2.0/gdk/gdktypes.h</code>. 154 * 155 * This always has the same length as <code>keys</code>. 137 * The key associated with this keyboard shortcut. 156 138 */ 157 KeyListType modifierList;139 Gtk::AccelKey shortcutKey; 157 139 158 140 /** 159 * The list of keys associated with this keyboard shortcut. 160 * For a list of the possible values, see 161 * <code>/usr/include/gtk-2.0/gdk/gdkkeysyms.h</code>. 141 * Set the shortcut key. 162 142 * 163 * This always has the same length as <code>modifiers</code>.143 * @param keyName the string representation of the shortcut key. 163 143 */ 164 KeyListType keyList; 165 166 /** 167 * A string representation of the first item in the key list. 168 */ 169 Ptr<Glib::ustring>::Ref firstKeyString; 144 void 145 setKey(const Glib::ustring & keyName) 146 throw (std::invalid_argument); 170 147 171 148 /** … … 181 158 throw(std::invalid_argument); 182 159 183 /** 184 * Get the next token in the key description string. 185 * The tokens are read right-to-left, and the separator is '-'. 186 * 187 * @param inputString the string to be parsed; it will be 188 * truncated on return. 189 * @return the token extracted; if the input string was empty, 190 * a null pointer is returned. 191 */ 192 Ptr<Glib::ustring>::Ref 193 getToken(Ptr<Glib::ustring>::Ref inputString) throw (); 194 195 /** 196 * Convert a modifier name to a gtk+ gdktypes value. 197 * 198 * @param modifierName a string containing the modifier's name. 199 * @return the numeric value of the modifier. 200 * @exception std::invalid_argument if the string is not a valid 201 * modifier name. 202 */ 203 unsigned int 204 stringToModifier(Ptr<const Glib::ustring>::Ref modifierName) 205 throw(std::invalid_argument); 206 207 /** 208 * Convert a key name to a gtk+ gdkkeysyms value. 209 * 210 * @param keyName a string containing the key's name. 211 * @return the numeric value of the key. 212 * @exception std::invalid_argument if the string is not a valid 213 * key name. 214 */ 215 unsigned int 216 stringToKey(Ptr<const Glib::ustring>::Ref keyName) 217 throw(std::invalid_argument); 218 160 219 161 protected: 220 162 /** … … 237 179 238 180 /** 239 * Add a shortcut key for this object. This will be one of the240 * modifier-key pairs which trigger the action.241 *242 * @param modifiedKeyName a string containing a key name (with243 * some modifiers, optionally).244 * @exception std::invalid_argument if the string is not a valid245 * key description.246 */247 void248 addKey(Ptr<const Glib::ustring>::Ref modifiedKeyName)249 throw (std::invalid_argument);250 251 /**252 * Add a shortcut key for this action. This will be one of the253 * modifier-key pairs which trigger the action.254 *255 * @param key the gtk+ code of the key.256 * @param modifiers the gtk+ modifier bits.257 */258 void259 addKey(unsigned int modifiers,260 unsigned int key) throw ();261 262 /**263 181 * Return the name of the XML element this object expects 264 182 * to be sent to a call to configure(). … … 312 230 */ 313 231 bool 314 isTriggeredBy(unsigned int modifiers, 315 unsigned int key) const throw (); 232 isTriggeredBy(Gdk::ModifierType modifiers, 233 guint key) const throw (); 316 234 317 235 /** 335 253 getKeyString(void) const throw () 336 254 { 337 return firstKeyString; 255 Ptr<const Glib::ustring>::Ref keyName(new Glib::ustring( 256 shortcutKey.get_abbrev() )); 257 return keyName; 338 258 } 259 260 /** 261 * Convert a modifiers-key code pair to a user-readable string. 262 * 263 * @return a string representing the modifier-key pair. 264 */ 265 static Ptr<Glib::ustring>::Ref 266 modifiedKeyToString(Gdk::ModifierType modifiers, 267 guint key) throw (); 339 268 }; 340 269 -
trunk/livesupport/src/products/gLiveSupport/src/GLiveSupport.h
r1925 r1933 979 979 KeyboardShortcut::Action 980 980 findAction(const Glib::ustring & windowName, 981 unsigned int modifiers, 982 unsigned int key) const throw () 981 Gdk::ModifierType modifiers, 982 guint key) const throw () 983 983 { 984 984 return keyboardShortcutList->findAction(windowName, modifiers, key); -
trunk/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx
r1902 r1933 340 340 if (iter) { 341 341 KeyboardShortcut::Action action = gLiveSupport->findAction( 342 windowName, 343 event->state, 344 event->keyval); 342 windowName, 343 Gdk::ModifierType(event->state), 344 event->keyval); 345 345 switch (action) { 346 346 case KeyboardShortcut::moveItemUp : -
trunk/livesupport/src/products/gLiveSupport/src/KeyboardShortcutContainer.cxx
r1925 r1933 54 54 * The name of the window name sub-element. 55 55 */ 56 static const std::string windowName ElementName = "windowName";56 static const std::string windowNameAttributeName = "windowName"; 56 56 57 57 … … 89 89 } 90 90 91 childNodes = element.get_children(windowNameElementName); 92 if (childNodes.size() < 1) { 93 throw std::invalid_argument("no windowName element"); 94 } else if (childNodes.size() > 1) { 95 throw std::invalid_argument("more than one windowName element"); 91 xmlpp::Attribute * windowNameAttr = element.get_attribute( 92 windowNameAttributeName); 93 if (windowNameAttr) { 94 windowName.reset(new const Glib::ustring(windowNameAttr->get_value())); 95 } else { 96 throw std::invalid_argument("missing windowName attribute"); 96 97 } 97 const xmlpp::Element * windowNameElement98 = dynamic_cast<const xmlpp::Element*> (99 childNodes.front() );100 windowName.reset(new const Glib::ustring(windowNameElement->get_child_text()101 ->get_content()));102 98 } 103 99 106 102 *----------------------------------------------------------------------------*/ 107 103 KeyboardShortcut::Action 108 KeyboardShortcutContainer :: findAction(unsigned int modifiers, 109 unsigned int key) const throw () 104 KeyboardShortcutContainer :: findAction(Gdk::ModifierType modifiers, 105 guint key) const 106 throw () 110 107 { 111 108 ShortcutListType::const_iterator it = shortcutList.begin(); -
trunk/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.cxx
r1925 r1933 734 734 if (event->type == GDK_KEY_PRESS) { 735 735 KeyboardShortcut::Action action = gLiveSupport->findAction( 736 windowName, 737 event->state, 738 event->keyval); 736 windowName, 737 Gdk::ModifierType(event->state), 738 event->keyval); 739 739 switch (action) { 740 740 case KeyboardShortcut::playAudio : -
trunk/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx
r1902 r1933 496 496 if (event->type == GDK_KEY_PRESS) { 497 497 KeyboardShortcut::Action action = gLiveSupport->findAction( 498 windowName, 499 event->state, 500 event->keyval); 498 windowName, 499 Gdk::ModifierType(event->state), 500 event->keyval); 501 501 switch (action) { 502 502 case KeyboardShortcut::moveItemUp : -
trunk/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml
r1925 r1933 100 100 101 101 <!ELEMENT keyboardShortcutList (keyboardShortcutContainer*) > 102 <!ELEMENT keyboardShortcutContainer (windowName, keyboardShortcut+) > 103 <!ELEMENT windowName (#PCDATA) > 104 <!ELEMENT keyboardShortcut (action, key+) > 105 <!ELEMENT action (#PCDATA) > 106 <!ELEMENT key (#PCDATA) > 102 <!ELEMENT keyboardShortcutContainer (keyboardShortcut+) > 103 <!ATTLIST keyboardShortcutContainer windowName CDATA #REQUIRED > 104 105 <!ELEMENT keyboardShortcut EMPTY > 106 <!ATTLIST keyboardShortcut action CDATA #REQUIRED > 107 <!ATTLIST keyboardShortcut key CDATA #REQUIRED > 107 108 108 109 ]> 343 344 344 345 <keyboardShortcutList> 345 <keyboardShortcutContainer> 346 <windowName>masterPanelWindow</windowName> 347 <keyboardShortcut> 348 <action>playAudio</action> 349 <key>X</key> 350 <key>Space</key> 351 </keyboardShortcut> 352 <keyboardShortcut> 353 <action>pauseAudio</action> 354 <key>V</key> 355 </keyboardShortcut> 356 <keyboardShortcut> 357 <action>stopAudio</action> 358 <key>C</key> 359 </keyboardShortcut> 360 <keyboardShortcut> 361 <action>nextTrack</action> 362 <key>B</key> 363 </keyboardShortcut> 346 <keyboardShortcutContainer 347 windowName = "masterPanelWindow"> 348 <keyboardShortcut action = "playAudio" key = "X" /> 349 <keyboardShortcut action = "pauseAudio" key = "V" /> 350 <keyboardShortcut action = "stopAudio" key = "C" /> 351 <keyboardShortcut action = "nextTrack" key = "B" /> 364 352 </keyboardShortcutContainer> 365 353 366 <keyboardShortcutContainer> 367 <windowName>liveModeWindow</windowName> 368 <keyboardShortcut> 369 <action>moveItemUp</action> 370 <key>Alt-Up</key> 371 </keyboardShortcut> 372 <keyboardShortcut> 373 <action>moveItemDown</action> 374 <key>Alt-Down</key> 375 </keyboardShortcut> 376 <keyboardShortcut> 377 <action>removeItem</action> 378 <key>Delete</key> 379 </keyboardShortcut> 380 <keyboardShortcut> 381 <action>playAudio</action> 382 <key>X</key> 383 <key>Space</key> 384 </keyboardShortcut> 354 <keyboardShortcutContainer 355 windowName = "liveModeWindow"> 356 <keyboardShortcut action = "moveItemUp" 357 key = "<Alt>Up" /> 358 <keyboardShortcut action = "moveItemDown" 359 key = "<Alt>Down" /> 360 <keyboardShortcut action = "removeItem" key = "Delete" /> 361 <keyboardShortcut action = "playAudio" key = "X" /> 385 362 </keyboardShortcutContainer> 386 363 387 <keyboardShortcutContainer> 388 <windowName>scratchpadWindow</windowName> 389 <keyboardShortcut> 390 <action>moveItemUp</action> 391 <key>Alt-Up</key> 392 </keyboardShortcut> 393 <keyboardShortcut> 394 <action>moveItemDown</action> 395 <key>Alt-Down</key> 396 </keyboardShortcut> 397 <keyboardShortcut> 398 <action>removeItem</action> 399 <key>Delete</key> 400 </keyboardShortcut> 364 <keyboardShortcutContainer 365 windowName = "scratchpadWindow"> 366 <keyboardShortcut action = "moveItemUp" 367 key = "<Alt>Up" /> 368 <keyboardShortcut action = "moveItemDown" 369 key = "<Alt>Down" /> 370 <keyboardShortcut action = "removeItem" key = "Delete" /> 401 371 </keyboardShortcutContainer> 402 372 403 <keyboardShortcutContainer> 404 <windowName>simplePlaylistManagementWindow</windowName> 405 <keyboardShortcut> 406 <action>moveItemUp</action> 407 <key>Alt-Up</key> 408 </keyboardShortcut> 409 <keyboardShortcut> 410 <action>moveItemDown</action> 411 <key>Alt-Down</key> 412 </keyboardShortcut> 413 <keyboardShortcut> 414 <action>removeItem</action> 415 <key>Delete</key> 416 </keyboardShortcut> 373 <keyboardShortcutContainer 374 windowName ="simplePlaylistManagementWindow"> 375 <keyboardShortcut action = "moveItemUp" 376 key = "<Alt>Up" /> 377 <keyboardShortcut action = "moveItemDown" 378 key = "<Alt>Down" /> 379 <keyboardShortcut action = "removeItem" key = "Delete" /> 417 380 </keyboardShortcutContainer> 418 381 </keyboardShortcutList> -
trunk/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.user-template
r1925 r1933 100 100 101 101 <!ELEMENT keyboardShortcutList (keyboardShortcutContainer*) > 102 <!ELEMENT keyboardShortcutContainer (windowName, keyboardShortcut+) > 103 <!ELEMENT windowName (#PCDATA) > 104 <!ELEMENT keyboardShortcut (action, key+) > 105 <!ELEMENT action (#PCDATA) > 106 <!ELEMENT key (#PCDATA) > 102 <!ELEMENT keyboardShortcutContainer (keyboardShortcut+) > 103 <!ATTLIST keyboardShortcutContainer windowName CDATA #REQUIRED > 104 105 <!ELEMENT keyboardShortcut EMPTY > 106 <!ATTLIST keyboardShortcut action CDATA #REQUIRED > 107 <!ATTLIST keyboardShortcut key CDATA #REQUIRED > 107 108 108 109 ]> 343 344 344 345 <keyboardShortcutList> 345 <keyboardShortcutContainer> 346 <windowName>masterPanelWindow</windowName> 347 <keyboardShortcut> 348 <action>playAudio</action> 349 <key>X</key> 350 <key>Space</key> 351 </keyboardShortcut> 352 <keyboardShortcut> 353 <action>pauseAudio</action> 354 <key>V</key> 355 </keyboardShortcut> 356 <keyboardShortcut> 357 <action>stopAudio</action> 358 <key>C</key> 359 </keyboardShortcut> 360 <keyboardShortcut> 361 <action>nextTrack</action> 362 <key>B</key> 363 </keyboardShortcut> 346 <keyboardShortcutContainer 347 windowName = "masterPanelWindow"> 348 <keyboardShortcut action = "playAudio" key = "X" /> 349 <keyboardShortcut action = "pauseAudio" key = "V" /> 350 <keyboardShortcut action = "stopAudio" key = "C" /> 351 <keyboardShortcut action = "nextTrack" key = "B" /> 364 352 </keyboardShortcutContainer> 365 353 366 <keyboardShortcutContainer> 367 <windowName>liveModeWindow</windowName> 368 <keyboardShortcut> 369 <action>moveItemUp</action> 370 <key>Alt-Up</key> 371 </keyboardShortcut> 372 <keyboardShortcut> 373 <action>moveItemDown</action> 374 <key>Alt-Down</key> 375 </keyboardShortcut> 376 <keyboardShortcut> 377 <action>removeItem</action> 378 <key>Delete</key> 379 </keyboardShortcut> 380 <keyboardShortcut> 381 <action>playAudio</action> 382 <key>X</key> 383 <key>Space</key> 384 </keyboardShortcut> 354 <keyboardShortcutContainer 355 windowName = "liveModeWindow"> 356 <keyboardShortcut action = "moveItemUp" 357 key = "<Alt>Up" /> 358 <keyboardShortcut action = "moveItemDown" 359 key = "<Alt>Down" /> 360 <keyboardShortcut action = "removeItem" key = "Delete" /> 361 <keyboardShortcut action = "playAudio" key = "X" /> 385 362 </keyboardShortcutContainer> 386 363 387 <keyboardShortcutContainer> 388 <windowName>scratchpadWindow</windowName> 389 <keyboardShortcut> 390 <action>moveItemUp</action> 391 <key>Alt-Up</key> 392 </keyboardShortcut> 393 <keyboardShortcut> 394 <action>moveItemDown</action> 395 <key>Alt-Down</key> 396 </keyboardShortcut> 397 <keyboardShortcut> 398 <action>removeItem</action> 399 <key>Delete</key> 400 </keyboardShortcut> 364 <keyboardShortcutContainer 365 windowName = "scratchpadWindow"> 366 <keyboardShortcut action = "moveItemUp" 367 key = "<Alt>Up" /> 368 <keyboardShortcut action = "moveItemDown" 369 key = "<Alt>Down" /> 370 <keyboardShortcut action = "removeItem" key = "Delete" /> 401 371 </keyboardShortcutContainer> 402 372 403 <keyboardShortcutContainer> 404 <windowName>simplePlaylistManagementWindow</windowName> 405 <keyboardShortcut> 406 <action>moveItemUp</action> 407 <key>Alt-Up</key> 408 </keyboardShortcut> 409 <keyboardShortcut> 410 <action>moveItemDown</action> 411 <key>Alt-Down</key> 412 </keyboardShortcut> 413 <keyboardShortcut> 414 <action>removeItem</action> 415 <key>Delete</key> 416 </keyboardShortcut> 373 <keyboardShortcutContainer 374 windowName ="simplePlaylistManagementWindow"> 375 <keyboardShortcut action = "moveItemUp" 376 key = "<Alt>Up" /> 377 <keyboardShortcut action = "moveItemDown" 378 key = "<Alt>Down" /> 379 <keyboardShortcut action = "removeItem" key = "Delete" /> 417 380 </keyboardShortcutContainer> 418 381 </keyboardShortcutList> -
trunk/livesupport/src/products/gLiveSupport/etc/gLiveSupport.xml.template
r1925 r1933 100 100 101 101 <!ELEMENT keyboardShortcutList (keyboardShortcutContainer*) > 102 <!ELEMENT keyboardShortcutContainer (windowName, keyboardShortcut+) > 103 <!ELEMENT windowName (#PCDATA) > 104 <!ELEMENT keyboardShortcut (action, key+) > 105 <!ELEMENT action (#PCDATA) > 106 <!ELEMENT key (#PCDATA) > 102 <!ELEMENT keyboardShortcutContainer (keyboardShortcut+) > 103 <!ATTLIST keyboardShortcutContainer windowName CDATA #REQUIRED > 104 105 <!ELEMENT keyboardShortcut EMPTY > 106 <!ATTLIST keyboardShortcut action CDATA #REQUIRED > 107 <!ATTLIST keyboardShortcut key CDATA #REQUIRED > 107 108 108 109 ]> 343 344 344 345 <keyboardShortcutList> 345 <keyboardShortcutContainer> 346 <windowName>masterPanelWindow</windowName> 347 <keyboardShortcut> 348 <action>playAudio</action> 349 <key>X</key> 350 <key>Space</key> 351 </keyboardShortcut> 352 <keyboardShortcut> 353 <action>pauseAudio</action> 354 <key>V</key> 355 </keyboardShortcut> 356 <keyboardShortcut> 357 <action>stopAudio</action> 358 <key>C</key> 359 </keyboardShortcut> 360 <keyboardShortcut> 361 <action>nextTrack</action> 362 <key>B</key> 363 </keyboardShortcut> 346 <keyboardShortcutContainer 347 windowName = "masterPanelWindow"> 348 <keyboardShortcut action = "playAudio" key = "X" /> 349 <keyboardShortcut action = "pauseAudio" key = "V" /> 350 <keyboardShortcut action = "stopAudio" key = "C" /> 351 <keyboardShortcut action = "nextTrack" key = "B" /> 364 352 </keyboardShortcutContainer> 365 353 366 <keyboardShortcutContainer> 367 <windowName>liveModeWindow</windowName> 368 <keyboardShortcut> 369 <action>moveItemUp</action> 370 <key>Alt-Up</key> 371 </keyboardShortcut> 372 <keyboardShortcut> 373 <action>moveItemDown</action> 374 <key>Alt-Down</key> 375 </keyboardShortcut> 376 <keyboardShortcut> 377 <action>removeItem</action> 378 <key>Delete</key> 379 </keyboardShortcut> 380 <keyboardShortcut> 381 <action>playAudio</action> 382 <key>X</key> 383 <key>Space</key> 384 </keyboardShortcut> 354 <keyboardShortcutContainer 355 windowName = "liveModeWindow"> 356 <keyboardShortcut action = "moveItemUp" 357 key = "<Alt>Up" /> 358 <keyboardShortcut action = "moveItemDown" 359 key = "<Alt>Down" /> 360 <keyboardShortcut action = "removeItem" key = "Delete" /> 361 <keyboardShortcut action = "playAudio" key = "X" /> 385 362 </keyboardShortcutContainer> 386 363 387 <keyboardShortcutContainer> 388 <windowName>scratchpadWindow</windowName> 389 <keyboardShortcut> 390 <action>moveItemUp</action> 391 <key>Alt-Up</key> 392 </keyboardShortcut> 393 <keyboardShortcut> 394 <action>moveItemDown</action> 395 <key>Alt-Down</key> 396 </keyboardShortcut> 397 <keyboardShortcut> 398 <action>removeItem</action> 399 <key>Delete</key> 400 </keyboardShortcut> 364 <keyboardShortcutContainer 365 windowName = "scratchpadWindow"> 366 <keyboardShortcut action = "moveItemUp" 367 key = "<Alt>Up" /> 368 <keyboardShortcut action = "moveItemDown" 369 key = "<Alt>Down" /> 370 <keyboardShortcut action = "removeItem" key = "Delete" /> 401 371 </keyboardShortcutContainer> 402 372 403 <keyboardShortcutContainer> 404 <windowName>simplePlaylistManagementWindow</windowName> 405 <keyboardShortcut> 406 <action>moveItemUp</action> 407 <key>Alt-Up</key> 408 </keyboardShortcut> 409 <keyboardShortcut> 410 <action>moveItemDown</action> 411 <key>Alt-Down</key> 412 </keyboardShortcut> 413 <keyboardShortcut> 414 <action>removeItem</action> 415 <key>Delete</key> 416 </keyboardShortcut> 373 <keyboardShortcutContainer 374 windowName ="simplePlaylistManagementWindow"> 375 <keyboardShortcut action = "moveItemUp" 376 key = "<Alt>Up" /> 377 <keyboardShortcut action = "moveItemDown" 378 key = "<Alt>Down" /> 379 <keyboardShortcut action = "removeItem" key = "Delete" /> 417 380 </keyboardShortcutContainer> 418 381 </keyboardShortcutList> -
trunk/livesupport/src/modules/widgets/src/ZebraTreeView.cxx
r1902 r1933 521 521 int rowNumber = 0; 522 522 Gtk::TreeModel::iterator iter; 523 Gtk::TreeModel::iterator it; 523 524 524 525 for (iter = treeModel->children().begin(); 525 526 iter != treeModel->children().end(); ++iter) { 526 527 Gtk::TreeRow row = *iter; 527 row[modelColumns.rowNumberColumn] = rowNumber; 528 ++rowNumber; 528 row[modelColumns.rowNumberColumn] = rowNumber++; 529 530 for (it = row->children().begin(); it != row->children().end(); ++it) { 531 Gtk::TreeRow childRow = *it; 532 childRow[modelColumns.rowNumberColumn] = rowNumber++; 533 } 529 534 } 530 535 }