Changeset 36324 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 21, 2011 12:34:49 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70651
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp
r34740 r36324 7 7 8 8 /* 9 * Copyright (C) 2006-201 0Oracle Corporation9 * Copyright (C) 2006-2011 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 #include "UISettingsPage.h" 22 22 23 /* Returns settings page type: */24 UISettingsPageType UISettingsPage::type() const25 {26 return m_type;27 }28 29 /* Validation stuff: */30 void UISettingsPage::setValidator(QIWidgetValidator *pValidator)31 {32 Q_UNUSED(pValidator);33 }34 35 /* Validation stuff: */36 bool UISettingsPage::revalidate(QString &strWarningText, QString &strTitle)37 {38 Q_UNUSED(strWarningText);39 Q_UNUSED(strTitle);40 return true;41 }42 43 /* Navigation stuff: */44 void UISettingsPage::setOrderAfter(QWidget *pWidget)45 {46 m_pFirstWidget = pWidget;47 }48 49 /* Page 'ID' stuff: */50 int UISettingsPage::id() const51 {52 return m_cId;53 }54 55 /* Page 'ID' stuff: */56 void UISettingsPage::setId(int cId)57 {58 m_cId = cId;59 }60 61 /* Page 'processed' stuff: */62 bool UISettingsPage::processed() const63 {64 return m_fProcessed;65 }66 67 /* Page 'processed' stuff: */68 void UISettingsPage::setProcessed(bool fProcessed)69 {70 m_fProcessed = fProcessed;71 }72 73 /* Page 'failed' stuff: */74 bool UISettingsPage::failed() const75 {76 return m_fFailed;77 }78 79 /* Page 'failed' stuff: */80 void UISettingsPage::setFailed(bool fFailed)81 {82 m_fFailed = fFailed;83 }84 85 23 /* Settings page constructor, hidden: */ 86 UISettingsPage::UISettingsPage(UISettingsPageType type, QWidget *pParent) 87 : QIWithRetranslateUI<QWidget>(pParent) 88 , m_type(type) 24 UISettingsPage::UISettingsPage(UISettingsPageType pageType) 25 : m_pageType(pageType) 89 26 , m_cId(-1) 90 27 , m_fProcessed(false) 91 28 , m_fFailed(false) 92 29 , m_pFirstWidget(0) 30 { 31 } 32 33 /* Global settings page constructor, hidden: */ 34 UISettingsPageGlobal::UISettingsPageGlobal() 35 : UISettingsPage(UISettingsPageType_Global) 93 36 { 94 37 } … … 107 50 } 108 51 109 /* Globalsettings page constructor, hidden: */110 UISettingsPage Global::UISettingsPageGlobal(QWidget *pParent)111 : UISettingsPage(UISettingsPageType_ Global, pParent)52 /* Machine settings page constructor, hidden: */ 53 UISettingsPageMachine::UISettingsPageMachine() 54 : UISettingsPage(UISettingsPageType_Machine) 112 55 { 113 56 } … … 125 68 } 126 69 127 /* Machine settings page constructor, hidden: */128 UISettingsPageMachine::UISettingsPageMachine(QWidget *pParent)129 : UISettingsPage(UISettingsPageType_Machine, pParent)130 {131 }132 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h
r34740 r36324 6 6 7 7 /* 8 * Copyright (C) 2006-201 0Oracle Corporation8 * Copyright (C) 2006-2011 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 #define __UISettingsPage_h__ 21 21 22 /* Globalincludes */22 /* Qt includes */ 23 23 #include <QWidget> 24 24 #include <QVariant> 25 25 26 /* Localincludes */26 /* Other includes */ 27 27 #include "QIWithRetranslateUI.h" 28 28 #include "COMDefs.h" … … 81 81 virtual void saveFromCacheTo(QVariant &data) = 0; 82 82 83 /* Returns settings page type: */84 virtual UISettingsPageType type() const;85 86 83 /* Validation stuff: */ 87 virtual void setValidator(QIWidgetValidator *pValidator);88 virtual bool revalidate(QString &strWarningText, QString &strTitle);84 virtual void setValidator(QIWidgetValidator* /* pValidator */) {} 85 virtual bool revalidate(QString& /* strWarningText */, QString& /* strTitle */) { return true; } 89 86 90 87 /* Navigation stuff: */ 91 virtual void setOrderAfter(QWidget *pWidget); 88 QWidget* firstWidget() const { return m_pFirstWidget; } 89 virtual void setOrderAfter(QWidget *pWidget) { m_pFirstWidget = pWidget; } 90 91 /* Settings page type stuff: */ 92 UISettingsPageType pageType() const { return m_pageType; } 92 93 93 94 /* Page 'ID' stuff: */ 94 int id() const ;95 void setId(int cId) ;95 int id() const { return m_cId; } 96 void setId(int cId) { m_cId = cId; } 96 97 97 98 /* Page 'processed' stuff: */ 98 bool processed() const ;99 void setProcessed(bool fProcessed) ;99 bool processed() const { return m_fProcessed; } 100 void setProcessed(bool fProcessed) { m_fProcessed = fProcessed; } 100 101 101 102 /* Page 'failed' stuff: */ 102 bool failed() const ;103 void setFailed(bool fFailed) ;103 bool failed() const { return m_fFailed; } 104 void setFailed(bool fFailed) { m_fFailed = fFailed; } 104 105 105 106 protected: 106 107 107 108 /* Settings page constructor, hidden: */ 108 UISettingsPage(UISettingsPageType type , QWidget *pParent = 0);109 UISettingsPage(UISettingsPageType type); 109 110 110 /* Variables: */ 111 UISettingsPageType m_type; 111 private: 112 113 /* Private variables: */ 114 UISettingsPageType m_pageType; 112 115 int m_cId; 113 116 bool m_fProcessed; … … 123 126 protected: 124 127 128 /* Global settings page constructor, hidden: */ 129 UISettingsPageGlobal(); 130 125 131 /* Fetch data to m_properties & m_settings: */ 126 132 void fetchData(const QVariant &data); … … 128 134 /* Upload m_properties & m_settings to data: */ 129 135 void uploadData(QVariant &data) const; 130 131 /* Global settings page constructor, hidden: */132 UISettingsPageGlobal(QWidget *pParent = 0);133 136 134 137 /* Global data source: */ … … 144 147 protected: 145 148 149 /* Machine settings page constructor, hidden: */ 150 UISettingsPageMachine(); 151 146 152 /* Fetch data to m_machine: */ 147 153 void fetchData(const QVariant &data); … … 149 155 /* Upload m_machine to data: */ 150 156 void uploadData(QVariant &data) const; 151 152 /* Machine settings page constructor, hidden: */153 UISettingsPageMachine(QWidget *pParent = 0);154 157 155 158 /* Machine data source: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r36104 r36324 318 318 319 319 /* Update alternative-name combo-box availability: */ 320 m_pAdapterNameLabel->setEnabled(attachmentType() != KNetworkAttachmentType_Null &&321 attachmentType() != KNetworkAttachmentType_NAT);322 320 m_pAdapterNameCombo->setEnabled(attachmentType() != KNetworkAttachmentType_Null && 323 321 attachmentType() != KNetworkAttachmentType_NAT); 324 m_pPromiscuousModeLabel->setEnabled(attachmentType() != KNetworkAttachmentType_Null &&325 attachmentType() != KNetworkAttachmentType_NAT);326 322 m_pPromiscuousModeCombo->setEnabled(attachmentType() != KNetworkAttachmentType_Null && 327 323 attachmentType() != KNetworkAttachmentType_NAT); … … 827 823 { 828 824 /* Setup tab order: */ 829 Assert( m_pFirstWidget);830 setTabOrder( m_pFirstWidget, m_pTwAdapters->focusProxy());825 Assert(firstWidget()); 826 setTabOrder(firstWidget(), m_pTwAdapters->focusProxy()); 831 827 QWidget *pLastFocusWidget = m_pTwAdapters->focusProxy(); 832 828 … … 911 907 adapter.AttachToHostOnlyInterface(); 912 908 break; 913 909 #ifdef VBOX_WITH_VDE 914 910 case KNetworkAttachmentType_VDE: 915 911 adapter.SetVDENetwork(data.m_strVDENetworkName); 916 912 adapter.AttachToVDE(); 917 913 break; 918 #endif 914 #endif /* VBOX_WITH_VDE */ 919 915 default: 920 916 break; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.cpp
r33882 r36324 7 7 8 8 /* 9 * Copyright (C) 2006-201 0Oracle Corporation9 * Copyright (C) 2006-2011 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 196 196 void UIMachineSettingsParallelPage::getFromCache() 197 197 { 198 Assert( m_pFirstWidget);199 setTabOrder( m_pFirstWidget, mTabWidget->focusProxy());198 Assert(firstWidget()); 199 setTabOrder(firstWidget(), mTabWidget->focusProxy()); 200 200 QWidget *pLastFocusWidget = mTabWidget->focusProxy(); 201 201 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp
r33909 r36324 7 7 8 8 /* 9 * Copyright (C) 2006-20 08Oracle Corporation9 * Copyright (C) 2006-2011 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 172 172 KPortMode mode = vboxGlobal().toPortMode (aText); 173 173 mCbPipe->setEnabled (mode == KPortMode_HostPipe); 174 mLbPath->setEnabled (mode != KPortMode_Disconnected);175 174 mLePath->setEnabled (mode != KPortMode_Disconnected); 176 175 if (mValidator) … … 245 244 void UIMachineSettingsSerialPage::getFromCache() 246 245 { 247 Assert( m_pFirstWidget);248 setTabOrder( m_pFirstWidget, mTabWidget->focusProxy());246 Assert(firstWidget()); 247 setTabOrder(firstWidget(), mTabWidget->focusProxy()); 249 248 QWidget *pLastFocusWidget = mTabWidget->focusProxy(); 250 249 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp
r33912 r36324 7 7 8 8 /* 9 * Copyright (C) 2006-201 0Oracle Corporation9 * Copyright (C) 2006-2011 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 154 154 155 155 /* Depending on page type: */ 156 switch ( type())156 switch (pageType()) 157 157 { 158 158 case UISettingsPageType_Global: … … 237 237 { 238 238 /* Depending on page type: */ 239 switch ( type())239 switch (pageType()) 240 240 { 241 241 case UISettingsPageType_Global: … … 275 275 { 276 276 /* Depending on page type: */ 277 switch ( type())277 switch (pageType()) 278 278 { 279 279 case UISettingsPageType_Machine: … … 297 297 298 298 /* Depending on page type: */ 299 switch ( type())299 switch (pageType()) 300 300 { 301 301 case UISettingsPageType_Global: … … 470 470 /* Add new corresponding list item to the cache: */ 471 471 UIUSBFilterData data; 472 switch ( type())472 switch (pageType()) 473 473 { 474 474 case UISettingsPageType_Global: … … 507 507 /* Add new corresponding list item to the cache: */ 508 508 UIUSBFilterData data; 509 switch ( type())509 switch (pageType()) 510 510 { 511 511 case UISettingsPageType_Global: … … 555 555 556 556 /* Configure USB filter details dialog: */ 557 UIMachineSettingsUSBFilterDetails dlgFilterDetails( type(), this);557 UIMachineSettingsUSBFilterDetails dlgFilterDetails(pageType(), this); 558 558 dlgFilterDetails.mLeName->setText(data.m_strName); 559 559 dlgFilterDetails.mLeVendorID->setText(data.m_strVendorId); … … 564 564 dlgFilterDetails.mLeProduct->setText(data.m_strProduct); 565 565 dlgFilterDetails.mLeSerialNo->setText(data.m_strSerialNumber); 566 switch ( type())566 switch (pageType()) 567 567 { 568 568 case UISettingsPageType_Global: … … 602 602 data.m_strSerialNumber = dlgFilterDetails.mLeSerialNo->text().isEmpty() ? QString::null : dlgFilterDetails.mLeSerialNo->text(); 603 603 data.m_strPort = dlgFilterDetails.mLePort->text().isEmpty() ? QString::null : dlgFilterDetails.mLePort->text(); 604 switch ( type())604 switch (pageType()) 605 605 { 606 606 case UISettingsPageType_Global: … … 724 724 void UIMachineSettingsUSB::fetchData(const QVariant &data) 725 725 { 726 switch ( type())726 switch (pageType()) 727 727 { 728 728 case UISettingsPageType_Global: … … 745 745 void UIMachineSettingsUSB::uploadData(QVariant &data) const 746 746 { 747 switch ( type())747 switch (pageType()) 748 748 { 749 749 case UISettingsPageType_Global:
Note:
See TracChangeset
for help on using the changeset viewer.