- Timestamp:
- Aug 7, 2013 3:00:01 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 8 edited
- 15 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VirtualBox2.qrc
r46626 r47595 200 200 <file alias="sf_settings_16px.png">images/sf_settings_16px.png</file> 201 201 <file alias="sf_settings_disabled_16px.png">images/sf_settings_disabled_16px.png</file> 202 <file alias="chipset_warning_16px.png">images/chipset_warning_16px.png</file> 203 <file alias="extension_pack_warning_16px.png">images/extension_pack_warning_16px.png</file> 204 <file alias="hd_warning_16px.png">images/hd_warning_16px.png</file> 205 <file alias="hostkey_warning_16px.png">images/hostkey_warning_16px.png</file> 206 <file alias="machine_warning_16px.png">images/machine_warning_16px.png</file> 207 <file alias="nw_warning_16px.png">images/nw_warning_16px.png</file> 208 <file alias="parallel_port_warning_16px.png">images/parallel_port_warning_16px.png</file> 209 <file alias="proxy_warning_16px.png">images/proxy_warning_16px.png</file> 210 <file alias="refresh_warning_16px.png">images/refresh_warning_16px.png</file> 211 <file alias="serial_port_warning_16px.png">images/serial_port_warning_16px.png</file> 212 <file alias="sf_warning_16px.png">images/sf_warning_16px.png</file> 213 <file alias="site_warning_16px.png">images/site_warning_16px.png</file> 214 <file alias="sound_warning_16px.png">images/sound_warning_16px.png</file> 215 <file alias="usb_warning_16px.png">images/usb_warning_16px.png</file> 216 <file alias="vrdp_warning_16px.png">images/vrdp_warning_16px.png</file> 202 217 </qresource> 203 218 </RCC> -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverter.h
r42526 r47595 50 50 Assert(0); return QPixmap(); 51 51 } 52 /* QPixmap <= template class: */ 53 template<class T> QPixmap toWarningPixmap(const T &data) const 54 { 55 if (canConvert<T>()) 56 return ::toWarningPixmap(data); 57 Assert(0); return QPixmap(); 58 } 52 59 53 60 /* QString <= template class: */ -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r47478 r47595 39 39 * This function returns null QPixmap for any object type until re-determined for specific one. */ 40 40 template<class X> QPixmap toPixmap(const X & /* xobject */) { Assert(0); return QPixmap(); } 41 /* Converts passed 'Object X' to QPixmap. 42 * This function returns null QPixmap for any object type until re-determined for specific one. */ 43 template<class X> QPixmap toWarningPixmap(const X & /* xobject */) { Assert(0); return QPixmap(); } 41 44 42 45 /* Converts passed 'Object of type X' to QString. … … 100 103 template<> QString toInternalString(const GlobalSettingsPageType &globalSettingsPageType); 101 104 template<> GlobalSettingsPageType fromInternalString<GlobalSettingsPageType>(const QString &strGlobalSettingsPageType); 105 template<> QPixmap toWarningPixmap(const GlobalSettingsPageType &globalSettingsPageType); 102 106 template<> QString toInternalString(const MachineSettingsPageType &machineSettingsPageType); 103 107 template<> MachineSettingsPageType fromInternalString<MachineSettingsPageType>(const QString &strMachineSettingsPageType); 108 template<> QPixmap toWarningPixmap(const MachineSettingsPageType &machineSettingsPageType); 104 109 template<> QString toInternalString(const IndicatorType &indicatorType); 105 110 template<> IndicatorType fromInternalString<IndicatorType>(const QString &strIndicatorType); -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r47594 r47595 496 496 /* Corresponding type for known words: */ 497 497 return values.at(keys.indexOf(QRegExp(strGlobalSettingsPageType, Qt::CaseInsensitive))); 498 } 499 500 /* QPixmap <= GlobalSettingsPageType: */ 501 template<> QPixmap toWarningPixmap(const GlobalSettingsPageType &type) 502 { 503 switch (type) 504 { 505 case GlobalSettingsPageType_General: return QPixmap(":/machine_warning_16px.png"); 506 case GlobalSettingsPageType_Input: return QPixmap(":/hostkey_warning_16px.png"); 507 case GlobalSettingsPageType_Update: return QPixmap(":/refresh_warning_16px.png"); 508 case GlobalSettingsPageType_Language: return QPixmap(":/site_warning_16px.png"); 509 case GlobalSettingsPageType_Display: return QPixmap(":/vrdp_warning_16px.png"); 510 case GlobalSettingsPageType_Network: return QPixmap(":/nw_warning_16px.png"); 511 case GlobalSettingsPageType_Extensions: return QPixmap(":/extension_pack_warning_16px.png"); 512 case GlobalSettingsPageType_Proxy: return QPixmap(":/proxy_warning_16px.png"); 513 default: AssertMsgFailed(("No pixmap for %d", type)); break; 514 } 515 return QPixmap(); 498 516 } 499 517 … … 548 566 } 549 567 568 /* QPixmap <= MachineSettingsPageType: */ 569 template<> QPixmap toWarningPixmap(const MachineSettingsPageType &type) 570 { 571 switch (type) 572 { 573 case MachineSettingsPageType_General: return QPixmap(":/machine_warning_16px.png"); 574 case MachineSettingsPageType_System: return QPixmap(":/chipset_warning_16px.png"); 575 case MachineSettingsPageType_Display: return QPixmap(":/vrdp_warning_16px.png"); 576 case MachineSettingsPageType_Storage: return QPixmap(":/hd_warning_16px.png"); 577 case MachineSettingsPageType_Audio: return QPixmap(":/sound_warning_16px.png"); 578 case MachineSettingsPageType_Network: return QPixmap(":/nw_warning_16px.png"); 579 case MachineSettingsPageType_Ports: return QPixmap(":/serial_port_warning_16px.png"); 580 case MachineSettingsPageType_Serial: return QPixmap(":/serial_port_warning_16px.png"); 581 case MachineSettingsPageType_Parallel: return QPixmap(":/parallel_port_warning_16px.png"); 582 case MachineSettingsPageType_USB: return QPixmap(":/usb_warning_16px.png"); 583 case MachineSettingsPageType_SF: return QPixmap(":/sf_warning_16px.png"); 584 default: AssertMsgFailed(("No pixmap for %d", type)); break; 585 } 586 return QPixmap(); 587 } 588 550 589 /* QString <= IndicatorType: */ 551 590 template<> QString toInternalString(const IndicatorType &indicatorType) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r47581 r47595 120 120 /* Setup error & warning stuff: */ 121 121 m_pStatusBar->addWidget(m_pWarningPane); 122 m_errorIcon = UIIconPool::defaultIcon(UIIconPool::MessageBoxCriticalIcon, this).pixmap(16, 16);123 m_warningIcon = UIIconPool::defaultIcon(UIIconPool::MessageBoxWarningIcon, this).pixmap(16, 16);124 122 125 123 /* Setup whatsthis stuff: */ … … 371 369 UISettingsPage *pFailedSettingsPage = pValidator->page(); 372 370 LogRel(("Settings Dialog: Dialog validation FAILED: Page *%s*\n", 373 gpConverter->toInternalString((MachineSettingsPageType)pFailedSettingsPage->id()).toUtf8().constData()));371 pFailedSettingsPage->internalName().toUtf8().constData())); 374 372 375 373 /* Show error first: */ … … 378 376 m_fValid = false; 379 377 setError(pValidator->lastMessage()); 380 m_pWarningPane->setWarningPixmap(m_errorIcon);381 378 m_pWarningPane->setWarningText(m_strErrorHint); 382 379 #ifdef Q_WS_MAC … … 389 386 m_fSilent = false; 390 387 setWarning(pValidator->lastMessage()); 391 m_pWarningPane->setWarningPixmap(m_warningIcon);392 388 m_pWarningPane->setWarningText(m_strWarningHint); 393 389 #ifdef Q_WS_MAC … … 396 392 } 397 393 394 /* Configure warning pixmap: */ 395 m_pWarningPane->setWarningPixmap(pFailedSettingsPage->warningPixmap()); 396 398 397 /* Stop dialog revalidation on first error/warning: */ 399 if (!m_fValid || !m_fSilent) 400 break; 398 break; 401 399 } 402 400 } … … 419 417 { 420 418 /* Determine settings-page name: */ 421 const QString strPageName( gpConverter->toInternalString((MachineSettingsPageType)pSettingsPage->id()));419 const QString strPageName(pSettingsPage->internalName()); 422 420 423 421 LogRel(("Settings Dialog: %s Page: Revalidation in progress..\n", -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
r47563 r47595 143 143 QString m_strErrorString; 144 144 QString m_strWarningString; 145 QPixmap m_errorIcon;146 QPixmap m_warningIcon;147 145 VBoxWarningPane *m_pWarningPane; 148 146 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp
r47579 r47595 19 19 20 20 /* GUI includes: */ 21 #include "UIConverter.h" 21 22 #include "UISettingsPage.h" 22 23 #include "QIWidgetValidator.h" … … 59 60 } 60 61 62 GlobalSettingsPageType UISettingsPageGlobal::internalID() const 63 { 64 return static_cast<GlobalSettingsPageType>(id()); 65 } 66 67 QString UISettingsPageGlobal::internalName() const 68 { 69 return gpConverter->toInternalString(internalID()); 70 } 71 72 QPixmap UISettingsPageGlobal::warningPixmap() const 73 { 74 return gpConverter->toWarningPixmap(internalID()); 75 } 76 61 77 /* Fetch data to m_properties & m_settings: */ 62 78 void UISettingsPageGlobal::fetchData(const QVariant &data) … … 78 94 } 79 95 96 MachineSettingsPageType UISettingsPageMachine::internalID() const 97 { 98 return static_cast<MachineSettingsPageType>(id()); 99 } 100 101 QString UISettingsPageMachine::internalName() const 102 { 103 return gpConverter->toInternalString(internalID()); 104 } 105 106 QPixmap UISettingsPageMachine::warningPixmap() const 107 { 108 return gpConverter->toWarningPixmap(internalID()); 109 } 110 80 111 /* Fetch data to m_machine & m_console: */ 81 112 void UISettingsPageMachine::fetchData(const QVariant &data) -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h
r47579 r47595 26 26 /* GUI includes: */ 27 27 #include "QIWithRetranslateUI.h" 28 #include "UIDefs.h" 28 29 #include "UISettingsDefs.h" 29 30 #include "VBoxGlobalSettings.h" … … 118 119 int id() const { return m_cId; } 119 120 void setId(int cId) { m_cId = cId; } 121 122 /* Page 'name' stuff: */ 123 virtual QString internalName() const = 0; 124 125 /* Page 'warning pixmap' stuff: */ 126 virtual QPixmap warningPixmap() const = 0; 120 127 121 128 /* Page 'processed' stuff: */ … … 163 170 UISettingsPageGlobal(); 164 171 172 /* Page 'ID' stuff: */ 173 GlobalSettingsPageType internalID() const; 174 175 /* Page 'name' stuff: */ 176 QString internalName() const; 177 178 /* Page 'warning pixmap' stuff: */ 179 QPixmap warningPixmap() const; 180 165 181 /* Fetch data to m_properties & m_settings: */ 166 182 void fetchData(const QVariant &data); … … 187 203 UISettingsPageMachine(); 188 204 205 /* Page 'ID' stuff: */ 206 MachineSettingsPageType internalID() const; 207 208 /* Page 'name' stuff: */ 209 QString internalName() const; 210 211 /* Page 'warning pixmap' stuff: */ 212 QPixmap warningPixmap() const; 213 189 214 /* Fetch data to m_machine: */ 190 215 void fetchData(const QVariant &data);
Note:
See TracChangeset
for help on using the changeset viewer.