Changeset 37544 in vbox
- Timestamp:
- Jun 17, 2011 1:54:47 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 10 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r37494 r37544 312 312 src/settings/global/UIGlobalSettingsNetworkDetails.h \ 313 313 src/settings/global/UIGlobalSettingsExtension.h \ 314 src/settings/global/UIGlobalSettingsProxy.h \ 314 315 src/settings/machine/UIMachineSettingsGeneral.h \ 315 316 src/settings/machine/UIMachineSettingsSystem.h \ … … 479 480 src/settings/global/UIGlobalSettingsNetworkDetails.cpp \ 480 481 src/settings/global/UIGlobalSettingsExtension.cpp \ 482 src/settings/global/UIGlobalSettingsProxy.cpp \ 481 483 src/settings/machine/UIMachineSettingsGeneral.cpp \ 482 484 src/settings/machine/UIMachineSettingsSystem.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r37468 r37544 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 … … 36 36 src/settings/global/UIGlobalSettingsNetworkDetails.ui \ 37 37 src/settings/global/UIGlobalSettingsExtension.ui \ 38 src/settings/global/UIGlobalSettingsProxy.ui \ 38 39 src/settings/machine/UIMachineSettingsGeneral.ui \ 39 40 src/settings/machine/UIMachineSettingsSystem.ui \ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.cpp
r35880 r37544 54 54 maxGuestRes = "auto"; 55 55 remapScancodes = QString::null; 56 proxySettings = QString::null; 56 57 trayIconEnabled = false; 57 58 presentationModeEnabled = false; … … 67 68 maxGuestRes = that.maxGuestRes; 68 69 remapScancodes = that.remapScancodes; 70 proxySettings = that.proxySettings; 69 71 trayIconEnabled = that.trayIconEnabled; 70 72 presentationModeEnabled = that.presentationModeEnabled; … … 85 87 maxGuestRes == that.maxGuestRes && 86 88 remapScancodes == that.remapScancodes && 89 proxySettings == that.proxySettings && 87 90 trayIconEnabled == that.trayIconEnabled && 88 91 presentationModeEnabled == that.presentationModeEnabled && … … 115 118 { "GUI/MaxGuestResolution", "maxGuestRes", "\\d*[1-9]\\d*,\\d*[1-9]\\d*|any|auto", true }, 116 119 { "GUI/RemapScancodes", "remapScancodes", "(\\d+=\\d+,)*\\d+=\\d+", true }, 120 { "GUI/ProxySettings", "proxySettings", "[\\s\\S]*", true }, 117 121 { "GUI/TrayIcon/Enabled", "trayIconEnabled", "true|false", true }, 118 122 #ifdef Q_WS_MAC -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobalSettings.h
r35730 r37544 44 44 QString maxGuestRes; 45 45 QString remapScancodes; 46 QString proxySettings; 46 47 bool trayIconEnabled; 47 48 bool presentationModeEnabled; … … 62 63 Q_PROPERTY (QString maxGuestRes READ maxGuestRes WRITE setMaxGuestRes) 63 64 Q_PROPERTY (QString remapScancodes READ remapScancodes WRITE setRemapScancodes) 65 Q_PROPERTY (QString proxySettings READ proxySettings WRITE setProxySettings) 64 66 Q_PROPERTY (bool trayIconEnabled READ trayIconEnabled WRITE setTrayIconEnabled) 65 67 Q_PROPERTY (bool presentationModeEnabled READ presentationModeEnabled WRITE setPresentationModeEnabled) … … 114 116 } 115 117 118 QString proxySettings() const { return data()->proxySettings; } 119 void setProxySettings (const QString &aProxySettings) 120 { 121 mData()->proxySettings = aProxySettings; 122 } 116 123 117 124 bool trayIconEnabled() const { return data()->trayIconEnabled; } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxUpdateDlg.cpp
r30192 r37544 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 … … 28 28 #include "VBoxUpdateDlg.h" 29 29 #include "UIIconPool.h" 30 #include "VBoxUtils.h" 30 31 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 31 32 … … 244 245 , mSelf (aSelf) 245 246 , mUrl ("http://update.virtualbox.org/query.php") 246 , mHttp (new QIHttp (this , mUrl.host()))247 , mHttp (new QIHttp (this)) 247 248 , mForceRun (aForceRun) 248 249 { … … 256 257 setWindowIcon(UIIconPool::iconSetFull(QSize (32, 32), QSize (16, 16), 257 258 ":/refresh_32px.png", ":/refresh_16px.png")); 259 260 /* Setup HTTP proxy: */ 261 UIProxyManager proxyManager(vboxGlobal().settings().proxySettings()); 262 if (proxyManager.proxyEnabled()) 263 { 264 mHttp->setProxy(proxyManager.proxyHost(), proxyManager.proxyPort().toInt(), 265 proxyManager.authEnabled() ? proxyManager.authLogin() : QString(), 266 proxyManager.authEnabled() ? proxyManager.authPassword() : QString()); 267 } 268 /* Set HTTP host: */ 269 mHttp->setHost(mUrl.host()); 258 270 259 271 /* Setup other connections */ -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIHttp.h
r33540 r37544 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 … … 57 57 }; 58 58 59 QIHttp (QObject *aParent , const QString &aHostName, quint16 aPort = 80)60 : QHttp (a HostName, aPort, aParent)59 QIHttp (QObject *aParent) 60 : QHttp (aParent) 61 61 , mStatusCode (0) 62 62 , mErrorCode (NoError) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxUtils.h
r28800 r37544 6 6 7 7 /* 8 * Copyright (C) 2006-20 08Oracle Corporation8 * Copyright (C) 2006-2011 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 123 123 }; 124 124 125 class UIProxyManager 126 { 127 public: 128 129 UIProxyManager(const QString &strProxySettings = QString()) 130 { 131 /* Parse settings: */ 132 if (!strProxySettings.isEmpty()) 133 { 134 QStringList proxySettings = strProxySettings.split(","); 135 if (proxySettings.size() > 0) 136 m_fProxyEnabled = proxySettings[0] == "proxyEnabled"; 137 if (proxySettings.size() > 1) 138 m_strProxyHost = proxySettings[1]; 139 if (proxySettings.size() > 2) 140 m_strProxyPort = proxySettings[2]; 141 if (proxySettings.size() > 3) 142 m_fAuthEnabled = proxySettings[3] == "authEnabled"; 143 if (proxySettings.size() > 4) 144 m_strAuthLogin = proxySettings[4]; 145 if (proxySettings.size() > 5) 146 m_strAuthPassword = proxySettings[5]; 147 } 148 } 149 150 QString toString() const 151 { 152 /* Serialize settings: */ 153 QString strResult; 154 if (m_fProxyEnabled || !m_strProxyHost.isEmpty() || !m_strProxyPort.isEmpty() || 155 m_fAuthEnabled || !m_strAuthLogin.isEmpty() || !m_strAuthPassword.isEmpty()) 156 { 157 QStringList proxySettings; 158 proxySettings << QString(m_fProxyEnabled ? "proxyEnabled" : "proxyDisabled"); 159 proxySettings << m_strProxyHost; 160 proxySettings << m_strProxyPort; 161 proxySettings << QString(m_fAuthEnabled ? "authEnabled" : "authDisabled"); 162 proxySettings << m_strAuthLogin; 163 proxySettings << m_strAuthPassword; 164 strResult = proxySettings.join(","); 165 } 166 return strResult; 167 } 168 169 /* Proxy attribute getters: */ 170 bool proxyEnabled() const { return m_fProxyEnabled; } 171 const QString& proxyHost() const { return m_strProxyHost; } 172 const QString& proxyPort() const { return m_strProxyPort; } 173 bool authEnabled() const { return m_fAuthEnabled; } 174 const QString& authLogin() const { return m_strAuthLogin; } 175 const QString& authPassword() const { return m_strAuthPassword; } 176 177 /* Proxy attribute setters: */ 178 void setProxyEnabled(bool fProxyEnabled) { m_fProxyEnabled = fProxyEnabled; } 179 void setProxyHost(const QString &strProxyHost) { m_strProxyHost = strProxyHost; } 180 void setProxyPort(const QString &strProxyPort) { m_strProxyPort = strProxyPort; } 181 void setAuthEnabled(bool fAuthEnabled) { m_fAuthEnabled = fAuthEnabled; } 182 void setAuthLogin(const QString &strAuthLogin) { m_strAuthLogin = strAuthLogin; } 183 void setAuthPassword(const QString &strAuthPassword) { m_strAuthPassword = strAuthPassword; } 184 185 private: 186 187 /* Proxy attribute variables: */ 188 bool m_fProxyEnabled; 189 QString m_strProxyHost; 190 QString m_strProxyPort; 191 bool m_fAuthEnabled; 192 QString m_strAuthLogin; 193 QString m_strAuthPassword; 194 }; 195 125 196 #ifdef Q_WS_MAC 126 197 # include "VBoxUtils-darwin.h" -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r37169 r37544 40 40 #include "UIGlobalSettingsNetwork.h" 41 41 #include "UIGlobalSettingsExtension.h" 42 #include "UIGlobalSettingsProxy.h" 42 43 43 44 #include "UIMachineSettingsGeneral.h" … … 385 386 break; 386 387 } 388 /* Proxy page: */ 389 case GLSettingsPage_Proxy: 390 { 391 pSettingsPage = new UIGlobalSettingsProxy; 392 addItem(":/extension_pack_32px.png", ":/extension_pack_disabled_32px.png", 393 ":/extension_pack_16px.png", ":/extension_pack_disabled_16px.png", 394 iPageIndex, "#proxy", pSettingsPage); 395 break; 396 } 387 397 default: 388 398 break; … … 483 493 /* Extension page: */ 484 494 m_pSelector->setItemText(GLSettingsPage_Extension, tr("Extensions")); 495 496 /* Proxy page: */ 497 m_pSelector->setItemText(GLSettingsPage_Proxy, tr("Proxy")); 485 498 486 499 /* Translate the selector: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h
r37168 r37544 40 40 GLSettingsPage_Network, 41 41 GLSettingsPage_Extension, 42 GLSettingsPage_Proxy, 42 43 GLSettingsPage_MAX 43 44 }; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.cpp
r37470 r37544 3 3 * 4 4 * VBox frontends: Qt4 GUI ("VirtualBox"): 5 * UIGlobalSettings Generalclass implementation5 * UIGlobalSettingsProxy class implementation 6 6 */ 7 7 8 8 /* 9 * Copyright (C) 20 06-2010Oracle Corporation9 * Copyright (C) 2011 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 18 18 */ 19 19 20 /* Global includes */21 #include <QDir>22 23 20 /* Local includes */ 24 #include "UIGlobalSettings General.h"25 #include "VBox Global.h"21 #include "UIGlobalSettingsProxy.h" 22 #include "VBoxUtils.h" 26 23 27 24 /* General page constructor: */ 28 UIGlobalSettings General::UIGlobalSettingsGeneral()25 UIGlobalSettingsProxy::UIGlobalSettingsProxy() 29 26 { 30 27 /* Apply UI decorations: */ 31 Ui::UIGlobalSettingsGeneral::setupUi(this); 32 33 #ifndef VBOX_GUI_WITH_SYSTRAY 34 m_pEnableTrayIconCheckbox->hide(); 35 m_pSpacerWidget1->hide(); 36 #endif /* !VBOX_GUI_WITH_SYSTRAY */ 37 #ifndef Q_WS_MAC 38 m_pEnablePresentationModeCheckbox->hide(); 39 m_pSpacerWidget2->hide(); 40 #endif /* !Q_WS_MAC */ 41 //#ifndef Q_WS_WIN /* Checkbox hidden for now! */ 42 m_pDisableHostScreenSaverCheckbox->hide(); 43 m_pSpacerWidget3->hide(); 44 //#endif /* !Q_WS_WIN */ 45 46 /* If all checkboxes hidden, hide separator too: */ 47 if (m_pEnableTrayIconCheckbox->isHidden() && 48 m_pEnablePresentationModeCheckbox->isHidden() && 49 m_pDisableHostScreenSaverCheckbox->isHidden()) 50 m_pLineSeparator2->hide(); 28 Ui::UIGlobalSettingsProxy::setupUi(this); 51 29 52 30 /* Setup widgets: */ 53 m_pMachineFolderSelector->setHomeDir(vboxGlobal().virtualBox().GetHomeFolder()); 54 m_pVRDPLibNameSelector->setHomeDir(vboxGlobal().virtualBox().GetHomeFolder()); 55 m_pVRDPLibNameSelector->setMode(VBoxFilePathSelectorWidget::Mode_File_Open); 31 m_pPortEditor->setFixedWidthByText(QString().fill('0', 6)); 32 m_pHostEditor->setValidator(new QRegExpValidator(QRegExp("\\S*"), m_pPortEditor)); 33 m_pPortEditor->setValidator(new QRegExpValidator(QRegExp("\\d*"), m_pPortEditor)); 34 m_pLoginEditor->setValidator(new QRegExpValidator(QRegExp("\\S*"), m_pPortEditor)); 35 m_pPasswordEditor->setValidator(new QRegExpValidator(QRegExp("\\S*"), m_pPortEditor)); 36 37 /* Setup connections: */ 38 connect(m_pProxyCheckbox, SIGNAL(stateChanged(int)), this, SLOT(sltProxyToggled())); 39 connect(m_pAuthCheckbox, SIGNAL(stateChanged(int)), this, SLOT(sltAuthToggled())); 56 40 57 41 /* Apply language settings: */ … … 61 45 /* Load data to cashe from corresponding external object(s), 62 46 * this task COULD be performed in other than GUI thread: */ 63 void UIGlobalSettings General::loadToCacheFrom(QVariant &data)47 void UIGlobalSettingsProxy::loadToCacheFrom(QVariant &data) 64 48 { 65 49 /* Fetch data to properties & settings: */ … … 67 51 68 52 /* Load to cache: */ 69 m_cache.m_strDefaultMachineFolder = m_properties.GetDefaultMachineFolder();70 m_cache.m_ strVRDEAuthLibrary = m_properties.GetVRDEAuthLibrary();71 m_cache.m_ fTrayIconEnabled = m_settings.trayIconEnabled();72 #ifdef Q_WS_MAC 73 m_cache.m_f PresentationModeEnabled = m_settings.presentationModeEnabled();74 #endif /* Q_WS_MAC */ 75 m_cache.m_ fHostScreenSaverDisables = m_settings.hostScreenSaverDisabled();53 UIProxyManager proxyManager(m_settings.proxySettings()); 54 m_cache.m_fProxyEnabled = proxyManager.proxyEnabled(); 55 m_cache.m_strProxyHost = proxyManager.proxyHost(); 56 m_cache.m_strProxyPort = proxyManager.proxyPort(); 57 m_cache.m_fAuthEnabled = proxyManager.authEnabled(); 58 m_cache.m_strAuthLogin = proxyManager.authLogin(); 59 m_cache.m_strAuthPassword = proxyManager.authPassword(); 76 60 77 61 /* Upload properties & settings to data: */ … … 81 65 /* Load data to corresponding widgets from cache, 82 66 * this task SHOULD be performed in GUI thread only: */ 83 void UIGlobalSettings General::getFromCache()67 void UIGlobalSettingsProxy::getFromCache() 84 68 { 85 69 /* Fetch from cache: */ 86 m_p MachineFolderSelector->setPath(m_cache.m_strDefaultMachineFolder);87 m_p VRDPLibNameSelector->setPath(m_cache.m_strVRDEAuthLibrary);88 m_p EnableTrayIconCheckbox->setChecked(m_cache.m_fTrayIconEnabled);89 #ifdef Q_WS_MAC 90 m_p EnablePresentationModeCheckbox->setChecked(m_cache.m_fPresentationModeEnabled);91 #endif /* Q_WS_MAC */ 92 m_pDisableHostScreenSaverCheckbox->setChecked(m_cache.m_fHostScreenSaverDisables);70 m_pProxyCheckbox->setChecked(m_cache.m_fProxyEnabled); 71 m_pHostEditor->setText(m_cache.m_strProxyHost); 72 m_pPortEditor->setText(m_cache.m_strProxyPort); 73 m_pAuthCheckbox->setChecked(m_cache.m_fAuthEnabled); 74 m_pLoginEditor->setText(m_cache.m_strAuthLogin); 75 m_pPasswordEditor->setText(m_cache.m_strAuthPassword); 76 sltProxyToggled(); 93 77 } 94 78 95 79 /* Save data from corresponding widgets to cache, 96 80 * this task SHOULD be performed in GUI thread only: */ 97 void UIGlobalSettings General::putToCache()81 void UIGlobalSettingsProxy::putToCache() 98 82 { 99 83 /* Upload to cache: */ 100 m_cache.m_strDefaultMachineFolder = m_pMachineFolderSelector->path(); 101 m_cache.m_strVRDEAuthLibrary = m_pVRDPLibNameSelector->path(); 102 m_cache.m_fTrayIconEnabled = m_pEnableTrayIconCheckbox->isChecked(); 103 #ifdef Q_WS_MAC 104 m_cache.m_fPresentationModeEnabled = m_pEnablePresentationModeCheckbox->isChecked(); 105 #endif /* Q_WS_MAC */ 106 m_cache.m_fHostScreenSaverDisables = m_pDisableHostScreenSaverCheckbox->isChecked(); 84 m_cache.m_fProxyEnabled = m_pProxyCheckbox->isChecked(); 85 m_cache.m_strProxyHost = m_pHostEditor->text(); 86 m_cache.m_strProxyPort = m_pPortEditor->text(); 87 m_cache.m_fAuthEnabled = m_pAuthCheckbox->isChecked(); 88 m_cache.m_strAuthLogin = m_pLoginEditor->text(); 89 m_cache.m_strAuthPassword = m_pPasswordEditor->text(); 107 90 } 108 91 109 92 /* Save data from cache to corresponding external object(s), 110 93 * this task COULD be performed in other than GUI thread: */ 111 void UIGlobalSettings General::saveFromCacheTo(QVariant &data)94 void UIGlobalSettingsProxy::saveFromCacheTo(QVariant &data) 112 95 { 113 96 /* Fetch data to properties & settings: */ 114 97 UISettingsPageGlobal::fetchData(data); 115 98 116 /* Save from cache: */ 117 if (m_properties.isOk() && m_pMachineFolderSelector->isModified()) 118 m_properties.SetDefaultMachineFolder(m_cache.m_strDefaultMachineFolder); 119 if (m_properties.isOk() && m_pVRDPLibNameSelector->isModified()) 120 m_properties.SetVRDEAuthLibrary(m_cache.m_strVRDEAuthLibrary); 121 m_settings.setTrayIconEnabled(m_cache.m_fTrayIconEnabled); 122 #ifdef Q_WS_MAC 123 m_settings.setPresentationModeEnabled(m_cache.m_fPresentationModeEnabled); 124 #endif /* Q_WS_MAC */ 125 m_settings.setHostScreenSaverDisabled(m_cache.m_fHostScreenSaverDisables); 99 UIProxyManager proxyManager; 100 proxyManager.setProxyEnabled(m_cache.m_fProxyEnabled); 101 proxyManager.setProxyHost(m_cache.m_strProxyHost); 102 proxyManager.setProxyPort(m_cache.m_strProxyPort); 103 proxyManager.setAuthEnabled(m_cache.m_fAuthEnabled); 104 proxyManager.setAuthLogin(m_cache.m_strAuthLogin); 105 proxyManager.setAuthPassword(m_cache.m_strAuthPassword); 106 m_settings.setProxySettings(proxyManager.toString()); 126 107 127 108 /* Upload properties & settings to data: */ … … 130 111 131 112 /* Navigation stuff: */ 132 void UIGlobalSettings General::setOrderAfter(QWidget *pWidget)113 void UIGlobalSettingsProxy::setOrderAfter(QWidget *pWidget) 133 114 { 134 setTabOrder(pWidget, m_pMachineFolderSelector); 135 setTabOrder(m_pMachineFolderSelector, m_pVRDPLibNameSelector); 136 setTabOrder(m_pVRDPLibNameSelector, m_pEnableTrayIconCheckbox); 137 setTabOrder(m_pEnableTrayIconCheckbox, m_pEnablePresentationModeCheckbox); 138 setTabOrder(m_pEnablePresentationModeCheckbox, m_pDisableHostScreenSaverCheckbox); 115 setTabOrder(pWidget, m_pProxyCheckbox); 116 setTabOrder(m_pProxyCheckbox, m_pHostEditor); 117 setTabOrder(m_pHostEditor, m_pPortEditor); 118 setTabOrder(m_pPortEditor, m_pAuthCheckbox); 119 setTabOrder(m_pAuthCheckbox, m_pLoginEditor); 120 setTabOrder(m_pLoginEditor, m_pPasswordEditor); 139 121 } 140 122 141 123 /* Translation stuff: */ 142 void UIGlobalSettings General::retranslateUi()124 void UIGlobalSettingsProxy::retranslateUi() 143 125 { 144 126 /* Translate uic generated strings: */ 145 Ui::UIGlobalSettingsGeneral::retranslateUi(this); 146 147 m_pMachineFolderSelector->setWhatsThis(tr("Displays the path to the default virtual " 148 "machine folder. This folder is used, if not " 149 "explicitly specified otherwise, when creating " 150 "new virtual machines.")); 151 m_pVRDPLibNameSelector->setWhatsThis(tr("Displays the path to the library that " 152 "provides authentication for Remote Display " 153 "(VRDP) clients.")); 127 Ui::UIGlobalSettingsProxy::retranslateUi(this); 154 128 } 155 129 130 void UIGlobalSettingsProxy::sltProxyToggled() 131 { 132 m_pHostLabel->setEnabled(m_pProxyCheckbox->isChecked()); 133 m_pHostEditor->setEnabled(m_pProxyCheckbox->isChecked()); 134 m_pPortLabel->setEnabled(m_pProxyCheckbox->isChecked()); 135 m_pPortEditor->setEnabled(m_pProxyCheckbox->isChecked()); 136 m_pAuthCheckbox->setEnabled(m_pProxyCheckbox->isChecked()); 137 sltAuthToggled(); 138 } 139 140 void UIGlobalSettingsProxy::sltAuthToggled() 141 { 142 m_pLoginLabel->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked()); 143 m_pLoginEditor->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked()); 144 m_pPasswordLabel->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked()); 145 m_pPasswordEditor->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked()); 146 } 147 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.h
r37470 r37544 2 2 * 3 3 * VBox frontends: Qt4 GUI ("VirtualBox"): 4 * UIGlobalSettings Generalclass declaration4 * UIGlobalSettingsProxy class declaration 5 5 */ 6 6 7 7 /* 8 * Copyright (C) 20 06-2010Oracle Corporation8 * Copyright (C) 2011 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 17 17 */ 18 18 19 #ifndef __UIGlobalSettings General_h__20 #define __UIGlobalSettings General_h__19 #ifndef __UIGlobalSettingsProxy_h__ 20 #define __UIGlobalSettingsProxy_h__ 21 21 22 22 /* Local includes */ 23 23 #include "UISettingsPage.h" 24 #include "UIGlobalSettings General.gen.h"24 #include "UIGlobalSettingsProxy.gen.h" 25 25 26 /* Global settings / Generalpage / Cache: */27 struct UISettingsCacheGlobal General26 /* Global settings / Proxy page / Cache: */ 27 struct UISettingsCacheGlobalProxy 28 28 { 29 QString m_strDefaultMachineFolder;30 QString m_strVRDEAuthLibrary;31 bool m_fTrayIconEnabled;32 #ifdef Q_WS_MAC 33 bool m_f PresentationModeEnabled;34 #endif /* Q_WS_MAC */ 35 bool m_fHostScreenSaverDisables;29 UISettingsCacheGlobalProxy() : m_fProxyEnabled(false), m_fAuthEnabled(false) {} 30 bool m_fProxyEnabled; 31 QString m_strProxyHost; 32 QString m_strProxyPort; 33 bool m_fAuthEnabled; 34 QString m_strAuthLogin; 35 QString m_strAuthPassword; 36 36 }; 37 37 38 /* Global settings / Generalpage: */39 class UIGlobalSettings General : public UISettingsPageGlobal, public Ui::UIGlobalSettingsGeneral38 /* Global settings / Proxy page: */ 39 class UIGlobalSettingsProxy : public UISettingsPageGlobal, public Ui::UIGlobalSettingsProxy 40 40 { 41 41 Q_OBJECT; … … 44 44 45 45 /* Constructor: */ 46 UIGlobalSettings General();46 UIGlobalSettingsProxy(); 47 47 48 48 protected: … … 68 68 void retranslateUi(); 69 69 70 private slots: 71 72 void sltProxyToggled(); 73 void sltAuthToggled(); 74 70 75 private: 71 76 72 77 /* Cache: */ 73 UISettingsCacheGlobal Generalm_cache;78 UISettingsCacheGlobalProxy m_cache; 74 79 }; 75 80 76 #endif // __UIGlobalSettings General_h__81 #endif // __UIGlobalSettingsProxy_h__ 77 82 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.ui
r37470 r37544 3 3 VBox frontends: Qt4 GUI ("VirtualBox"): 4 4 5 Copyright (C) 20 08-2010Oracle Corporation5 Copyright (C) 2011 Oracle Corporation 6 6 7 7 This file is part of VirtualBox Open Source Edition (OSE), as … … 13 13 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 14 14 </comment> 15 <class>UIGlobalSettings General</class>16 <widget class="QWidget" name="UIGlobalSettings General">15 <class>UIGlobalSettingsProxy</class> 16 <widget class="QWidget" name="UIGlobalSettingsProxy"> 17 17 <property name="geometry"> 18 18 <rect> 19 19 <x>0</x> 20 20 <y>0</y> 21 <width> 400</width>22 <height> 200</height>21 <width>300</width> 22 <height>150</height> 23 23 </rect> 24 24 </property> … … 27 27 <number>0</number> 28 28 </property> 29 <item row="0" column="0" colspan="2"> 30 <widget class="QLabel" name="m_pMachineFolderLabel"> 31 <property name="text"> 32 <string>Default &Machine Folder:</string> 29 <item row="0" column="0"> 30 <spacer> 31 <property name="orientation"> 32 <enum>Qt::Horizontal</enum> 33 </property> 34 <property name="sizeType"> 35 <enum>QSizePolicy::Fixed</enum> 36 </property> 37 <property name="sizeHint"> 38 <size> 39 <width>40</width> 40 <height>20</height> 41 </size> 42 </property> 43 </spacer> 44 </item> 45 <item row="0" column="1" colspan="4"> 46 <widget class="QCheckBox" name="m_pProxyCheckbox"> 47 <property name="whatsThis"> 48 <string>When checked, VirtualBox will use the proxy settings supplied for tasks like downloading Guest Additions from the network or checking for updates.</string> 49 </property> 50 <property name="text"> 51 <string>&Enable proxy</string> 52 </property> 53 <property name="checked"> 54 <bool>false</bool> 55 </property> 56 </widget> 57 </item> 58 <item row="1" column="1"> 59 <spacer> 60 <property name="orientation"> 61 <enum>Qt::Horizontal</enum> 62 </property> 63 <property name="sizeType"> 64 <enum>QSizePolicy::Fixed</enum> 65 </property> 66 <property name="sizeHint"> 67 <size> 68 <width>16</width> 69 <height>0</height> 70 </size> 71 </property> 72 </spacer> 73 </item> 74 <item row="1" column="2" colspan="3"> 75 <layout class="QHBoxLayout"> 76 <property name="margin"> 77 <number>0</number> 78 </property> 79 <item> 80 <widget class="QLabel" name="m_pHostLabel"> 81 <property name="text"> 82 <string>Ho&st:</string> 83 </property> 84 <property name="alignment"> 85 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 86 </property> 87 <property name="buddy"> 88 <cstring>m_pHostEditor</cstring> 89 </property> 90 </widget> 91 </item> 92 <item> 93 <widget class="QILineEdit" name="m_pHostEditor"> 94 <property name="whatsThis"> 95 <string>Changes the proxy host.</string> 96 </property> 97 </widget> 98 </item> 99 <item> 100 <widget class="QLabel" name="m_pPortLabel"> 101 <property name="text"> 102 <string>&Port:</string> 103 </property> 104 <property name="alignment"> 105 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 106 </property> 107 <property name="buddy"> 108 <cstring>m_pPortEditor</cstring> 109 </property> 110 </widget> 111 </item> 112 <item> 113 <widget class="QILineEdit" name="m_pPortEditor"> 114 <property name="whatsThis"> 115 <string>Changes the proxy port.</string> 116 </property> 117 </widget> 118 </item> 119 </layout> 120 </item> 121 <item row="2" column="2" colspan="3"> 122 <widget class="QCheckBox" name="m_pAuthCheckbox"> 123 <property name="whatsThis"> 124 <string>When checked the authentication supplied will be used with the proxy server.</string> 125 </property> 126 <property name="text"> 127 <string>&Use authentication</string> 128 </property> 129 <property name="checked"> 130 <bool>false</bool> 131 </property> 132 </widget> 133 </item> 134 <item row="3" column="2" rowspan="2"> 135 <spacer> 136 <property name="orientation"> 137 <enum>Qt::Horizontal</enum> 138 </property> 139 <property name="sizeType"> 140 <enum>QSizePolicy::Fixed</enum> 141 </property> 142 <property name="sizeHint"> 143 <size> 144 <width>16</width> 145 <height>0</height> 146 </size> 147 </property> 148 </spacer> 149 </item> 150 <item row="3" column="3"> 151 <widget class="QLabel" name="m_pLoginLabel"> 152 <property name="text"> 153 <string>User &name:</string> 33 154 </property> 34 155 <property name="alignment"> … … 36 157 </property> 37 158 <property name="buddy"> 38 <cstring>m_pMachineFolderSelector</cstring> 39 </property> 40 </widget> 41 </item> 42 <item row="0" column="2"> 43 <widget class="VBoxFilePathSelectorWidget" name="m_pMachineFolderSelector"> 44 <property name="sizePolicy"> 45 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> 46 <horstretch>0</horstretch> 47 <verstretch>0</verstretch> 48 </sizepolicy> 49 </property> 50 </widget> 51 </item> 52 <item row="1" column="0" colspan="3"> 53 <widget class="Line" name="m_pLineSeparator1"> 54 <property name="orientation"> 55 <enum>Qt::Horizontal</enum> 56 </property> 57 </widget> 58 </item> 59 <item row="2" column="0" colspan="2"> 60 <widget class="QLabel" name="m_pVRDPLibLabel"> 61 <property name="text"> 62 <string>V&RDP Authentication Library:</string> 159 <cstring>m_pLoginEditor</cstring> 160 </property> 161 </widget> 162 </item> 163 <item row="3" column="4"> 164 <widget class="QILineEdit" name="m_pLoginEditor"> 165 <property name="whatsThis"> 166 <string>Changes the user name used for authentication.</string> 167 </property> 168 </widget> 169 </item> 170 <item row="4" column="3"> 171 <widget class="QLabel" name="m_pPasswordLabel"> 172 <property name="text"> 173 <string>Pass&word:</string> 63 174 </property> 64 175 <property name="alignment"> … … 66 177 </property> 67 178 <property name="buddy"> 68 <cstring>m_pVRDPLibNameSelector</cstring> 69 </property> 70 </widget> 71 </item> 72 <item row="2" column="2"> 73 <widget class="VBoxFilePathSelectorWidget" name="m_pVRDPLibNameSelector"> 74 <property name="sizePolicy"> 75 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> 76 <horstretch>0</horstretch> 77 <verstretch>0</verstretch> 78 </sizepolicy> 79 </property> 80 </widget> 81 </item> 82 <item row="3" column="0" colspan="3"> 83 <widget class="Line" name="m_pLineSeparator2"> 84 <property name="orientation"> 85 <enum>Qt::Horizontal</enum> 86 </property> 87 </widget> 88 </item> 89 <item row="4" column="0"> 90 <widget class="QWidget" name="m_pSpacerWidget1"> 91 <property name="sizePolicy"> 92 <sizepolicy hsizetype="Fixed" vsizetype="Minimum"> 93 <horstretch>0</horstretch> 94 <verstretch>0</verstretch> 95 </sizepolicy> 96 </property> 97 <property name="minimumWidth"> 98 <number>34</number> 99 </property> 100 </widget> 101 </item> 102 <item row="4" column="1" colspan="2"> 103 <widget class="QCheckBox" name="m_pEnableTrayIconCheckbox"> 104 <property name="whatsThis"> 105 <string>When checked, the application will provide an icon with the context menu in the system tray.</string> 106 </property> 107 <property name="text"> 108 <string>&Show System Tray Icon</string> 109 </property> 110 </widget> 111 </item> 112 <item row="5" column="0"> 113 <widget class="QWidget" name="m_pSpacerWidget2"> 114 <property name="sizePolicy"> 115 <sizepolicy hsizetype="Fixed" vsizetype="Minimum"> 116 <horstretch>0</horstretch> 117 <verstretch>0</verstretch> 118 </sizepolicy> 119 </property> 120 <property name="minimumWidth"> 121 <number>34</number> 122 </property> 123 </widget> 124 </item> 125 <item row="5" column="1" colspan="2"> 126 <widget class="QCheckBox" name="m_pEnablePresentationModeCheckbox"> 127 <property name="text"> 128 <string>&Auto show Dock and Menubar in fullscreen</string> 129 </property> 130 </widget> 131 </item> 132 <item row="6" column="0"> 133 <widget class="QWidget" name="m_pSpacerWidget3"> 134 <property name="sizePolicy"> 135 <sizepolicy hsizetype="Fixed" vsizetype="Minimum"> 136 <horstretch>0</horstretch> 137 <verstretch>0</verstretch> 138 </sizepolicy> 139 </property> 140 <property name="minimumWidth"> 141 <number>34</number> 142 </property> 143 </widget> 144 </item> 145 <item row="6" column="1" colspan="2"> 146 <widget class="QCheckBox" name="m_pDisableHostScreenSaverCheckbox"> 147 <property name="whatsThis"> 148 <string>When checked, the host screen saver will be disabled whenever a virtual machine is running.</string> 149 </property> 150 <property name="text"> 151 <string>Disable Host &ScreenSaver</string> 152 </property> 153 </widget> 154 </item> 155 <item row="7" column="0" colspan="3"> 179 <cstring>m_pPasswordEditor</cstring> 180 </property> 181 </widget> 182 </item> 183 <item row="4" column="4"> 184 <widget class="QILineEdit" name="m_pPasswordEditor"> 185 <property name="whatsThis"> 186 <string>Changes the password used for authentication.</string> 187 </property> 188 </widget> 189 </item> 190 <item row="5" column="1" colspan="4"> 156 191 <spacer> 157 192 <property name="orientation"> … … 170 205 <customwidgets> 171 206 <customwidget> 172 <class>VBoxFilePathSelectorWidget</class> 173 <extends>QComboBox</extends> 174 <header>VBoxFilePathSelectorWidget.h</header> 175 <container>1</container> 207 <class>QILineEdit</class> 208 <extends>QLineEdit</extends> 209 <header>QILineEdit.h</header> 176 210 </customwidget> 177 211 </customwidgets> -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIDownloader.cpp
r30356 r37544 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 … … 24 24 #include "VBoxProblemReporter.h" 25 25 #include "UISpecialControls.h" 26 #include "VBoxUtils.h" 26 27 27 28 /* Global includes */ … … 150 151 void UIDownloader::acknowledgeStart() 151 152 { 153 /* Recreate HTTP: */ 152 154 delete m_pHttp; 153 m_pHttp = new QIHttp(this, m_source.host()); 155 m_pHttp = new QIHttp(this); 156 /* Setup HTTP proxy: */ 157 UIProxyManager proxyManager(vboxGlobal().settings().proxySettings()); 158 if (proxyManager.proxyEnabled()) 159 { 160 m_pHttp->setProxy(proxyManager.proxyHost(), proxyManager.proxyPort().toInt(), 161 proxyManager.authEnabled() ? proxyManager.authLogin() : QString(), 162 proxyManager.authEnabled() ? proxyManager.authPassword() : QString()); 163 } 164 /* Set HTTP host: */ 165 m_pHttp->setHost(m_source.host()); 166 /* Setup connections: */ 154 167 connect(m_pHttp, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), 155 168 this, SLOT(acknowledgeProcess(const QHttpResponseHeader &))); 156 169 connect(m_pHttp, SIGNAL(allIsDone(bool)), 157 170 this, SLOT(acknowledgeFinished(bool))); 171 /* Make a request: */ 158 172 m_pHttp->get(m_source.toEncoded()); 159 173 } … … 206 220 void UIDownloader::downloadStart() 207 221 { 222 /* Recreate HTTP: */ 208 223 delete m_pHttp; 209 m_pHttp = new QIHttp(this, m_source.host()); 224 m_pHttp = new QIHttp(this); 225 /* Setup HTTP proxy: */ 226 UIProxyManager proxyManager(vboxGlobal().settings().proxySettings()); 227 if (proxyManager.proxyEnabled()) 228 { 229 m_pHttp->setProxy(proxyManager.proxyHost(), proxyManager.proxyPort().toInt(), 230 proxyManager.authEnabled() ? proxyManager.authLogin() : QString(), 231 proxyManager.authEnabled() ? proxyManager.authPassword() : QString()); 232 } 233 /* Set HTTP host: */ 234 m_pHttp->setHost(m_source.host()); 235 /* Setup connections: */ 210 236 connect(m_pHttp, SIGNAL(dataReadProgress (int, int)), 211 237 this, SLOT (downloadProcess(int, int))); 212 238 connect(m_pHttp, SIGNAL(allIsDone(bool)), 213 239 this, SLOT(downloadFinished(bool))); 240 /* Make a request: */ 214 241 m_pHttp->get(m_source.toEncoded()); 215 242 }
Note:
See TracChangeset
for help on using the changeset viewer.