Changeset 105032 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 26, 2024 3:29:27 PM (8 months ago)
- svn:sync-xref-src-repo-rev:
- 163650
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/editors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIShortcutConfigurationEditor.cpp
r105031 r105032 244 244 /** Constructs model passing @a pParent to the base-class. 245 245 * @param enmType Brings the action-pool type this model is related to. */ 246 UIShortcutConfigurationModel(QObject *pParent, UIType enmType); 247 248 /** Defines the parent @a pTable reference. */ 249 void setTable(UIShortcutConfigurationView *pTable); 246 UIShortcutConfigurationModel(UIShortcutConfigurationEditor *pParent, UIType enmType); 250 247 251 248 /** Loads a @a list of shortcuts to the model. */ … … 283 280 private: 284 281 282 /** Return the parent table-view reference. */ 283 QITableView *view() const; 284 285 285 /** Applies filter. */ 286 286 void applyFilter(); 287 287 288 /** Holds the parent shortcut-configuration editor instance. */ 289 UIShortcutConfigurationEditor *m_pShortcutConfigurationEditor; 290 288 291 /** Holds the action-pool type this model is related to. */ 289 292 UIType m_enmType; 290 291 /** Holds the parent table reference. */292 UIShortcutConfigurationView *m_pTable;293 293 294 294 /** Holds current filter. */ … … 340 340 *********************************************************************************************************************************/ 341 341 342 UIShortcutConfigurationModel::UIShortcutConfigurationModel( QObject*pParent, UIType enmType)342 UIShortcutConfigurationModel::UIShortcutConfigurationModel(UIShortcutConfigurationEditor *pParent, UIType enmType) 343 343 : QAbstractTableModel(pParent) 344 , m_pShortcutConfigurationEditor(pParent) 344 345 , m_enmType(enmType) 345 , m_pTable(0) 346 { 347 } 348 349 void UIShortcutConfigurationModel::setTable(UIShortcutConfigurationView *pTable) 350 { 351 m_pTable = pTable; 346 { 352 347 } 353 348 … … 362 357 continue; 363 358 /* Add suitable item to the model as a new shortcut: */ 364 m_shortcuts << UIShortcutTableViewRow( m_pTable, item);359 m_shortcuts << UIShortcutTableViewRow(view(), item); 365 360 } 366 361 /* Apply filter: */ … … 646 641 } 647 642 643 QITableView *UIShortcutConfigurationModel::view() const 644 { 645 switch (m_enmType) 646 { 647 case UIType_ManagerUI: return m_pShortcutConfigurationEditor->viewManager(); 648 case UIType_RuntimeUI: return m_pShortcutConfigurationEditor->viewRuntime(); 649 } 650 } 651 648 652 void UIShortcutConfigurationModel::applyFilter() 649 653 { … … 793 797 } 794 798 799 QITableView *UIShortcutConfigurationEditor::viewManager() 800 { 801 return m_pTableManager; 802 } 803 804 QITableView *UIShortcutConfigurationEditor::viewRuntime() 805 { 806 return m_pTableRuntime; 807 } 808 795 809 void UIShortcutConfigurationEditor::load(const UIShortcutConfigurationList &value) 796 810 { … … 895 909 m_pTableManager = new UIShortcutConfigurationView(pTabManager, m_pModelManager, "m_pTableManager"); 896 910 if (m_pTableManager) 897 {898 m_pModelManager->setTable(m_pTableManager);899 911 pLayoutManager->addWidget(m_pTableManager); 900 }901 912 } 902 913 … … 932 943 m_pTableRuntime = new UIShortcutConfigurationView(pTabMachine, m_pModelRuntime, "m_pTableRuntime"); 933 944 if (m_pTableRuntime) 934 {935 m_pModelRuntime->setTable(m_pTableRuntime);936 945 pLayoutMachine->addWidget(m_pTableRuntime); 937 }938 946 } 939 947 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIShortcutConfigurationEditor.h
r105031 r105032 38 38 class QLineEdit; 39 39 class QTabWidget; 40 class QITableView; 40 41 class UIShortcutConfigurationModel; 41 class UIShortcutConfigurationView;42 42 43 43 /** Shortcut search functor template. */ … … 170 170 UIShortcutConfigurationEditor(QWidget *pParent = 0); 171 171 172 /** Returns manager table-view reference. */ 173 QITableView *viewManager(); 174 /** Returns runtime table-view reference. */ 175 QITableView *viewRuntime(); 176 172 177 /** Loads shortcut configuration list from passed @a value. */ 173 178 void load(const UIShortcutConfigurationList &value); … … 213 218 QLineEdit *m_pEditorFilterManager; 214 219 /** Holds the Manager UI shortcuts table instance. */ 215 UIShortcutConfigurationView*m_pTableManager;220 QITableView *m_pTableManager; 216 221 /** Holds the Runtime UI shortcuts filter instance. */ 217 222 QLineEdit *m_pEditorFilterRuntime; 218 223 /** Holds the Runtime UI shortcuts table instance. */ 219 UIShortcutConfigurationView*m_pTableRuntime;224 QITableView *m_pTableRuntime; 220 225 }; 221 226
Note:
See TracChangeset
for help on using the changeset viewer.