Changeset 85454 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 24, 2020 10:50:38 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r85398 r85454 118 118 const char *UIExtraDataDefs::GUI_CloudConsoleManager_Restrictions = "GUI/CloudConsoleManager/Restrictions"; 119 119 const char *UIExtraDataDefs::GUI_CloudConsoleManager_Details_Expanded = "GUI/CloudConsoleManager/Details/Expanded"; 120 121 /* Cloud Console: */ 122 const char *UIExtraDataDefs::GUI_CloudConsole_PublicKey_Path = "GUI/CloudConsole/PublicKey/Path"; 120 123 121 124 #ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r85398 r85454 230 230 /** Holds whether Cloud Console Manager details expanded. */ 231 231 SHARED_LIBRARY_STUFF extern const char *GUI_CloudConsoleManager_Details_Expanded; 232 /** @} */ 233 234 /** @name Cloud Console 235 * @{ */ 236 /** Holds Cloud Console public key path. */ 237 SHARED_LIBRARY_STUFF extern const char *GUI_CloudConsole_PublicKey_Path; 232 238 /** @} */ 233 239 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r85389 r85454 1933 1933 << GUI_CloudConsoleManager_Restrictions 1934 1934 << GUI_CloudConsoleManager_Details_Expanded 1935 << GUI_CloudConsole_PublicKey_Path 1935 1936 << GUI_HideDescriptionForWizards 1936 1937 << GUI_HideFromManager << GUI_HideDetails … … 3063 3064 } 3064 3065 3066 QString UIExtraDataManager::cloudConsolePublicKeyPath() 3067 { 3068 return extraDataString(GUI_CloudConsole_PublicKey_Path); 3069 } 3070 3071 void UIExtraDataManager::setCloudConsolePublicKeyPath(const QString &strPath) 3072 { 3073 setExtraDataString(GUI_CloudConsole_PublicKey_Path, strPath); 3074 } 3075 3065 3076 WizardMode UIExtraDataManager::modeForWizardType(WizardType type) 3066 3077 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r85389 r85454 450 450 /** Defines whether Cloud Console Manager details @a fExpanded. */ 451 451 void setCloudConsoleManagerDetailsExpanded(bool fExpanded); 452 /** @} */ 453 454 /** @name Cloud Console 455 * @{ */ 456 /** Returns Cloud Console public key path. */ 457 QString cloudConsolePublicKeyPath(); 458 /** Defines Cloud Console public key @a strPath. */ 459 void setCloudConsolePublicKeyPath(const QString &strPath); 452 460 /** @} */ 453 461 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r85446 r85454 131 131 void prepare(); 132 132 133 /** Loads file contents. */ 134 void loadFileContents(const QString &strPath, bool fIgnoreErrors = false); 135 133 136 /** Holds the text-editor instance. */ 134 137 QTextEdit *m_pTextEditor; … … 175 178 if (!strFileName.isEmpty()) 176 179 { 177 QFile file(strFileName); 178 if (file.open(QIODevice::ReadOnly)) 179 m_pTextEditor->setPlainText(file.readAll()); 180 else 181 msgCenter().cannotOpenPublicKeyFile(strFileName); 180 gEDataManager->setCloudConsolePublicKeyPath(strFileName); 181 loadFileContents(strFileName); 182 182 } 183 183 } … … 219 219 /* Apply language settings: */ 220 220 retranslateUi(); 221 222 /* Load last remembered file contents: */ 223 loadFileContents(gEDataManager->cloudConsolePublicKeyPath(), true /* ignore errors */); 224 225 /* Resize to suitable size: */ 226 const int iMinimumHeightHint = minimumSizeHint().height(); 227 resize(iMinimumHeightHint * 2, iMinimumHeightHint); 228 } 229 230 void UIAcquirePublicKeyDialog::loadFileContents(const QString &strPath, bool fIgnoreErrors /* = false */) 231 { 232 if (strPath.isEmpty()) 233 return; 234 QFile file(strPath); 235 if (file.open(QIODevice::ReadOnly)) 236 m_pTextEditor->setPlainText(file.readAll()); 237 else if (!fIgnoreErrors) 238 msgCenter().cannotOpenPublicKeyFile(strPath); 221 239 } 222 240
Note:
See TracChangeset
for help on using the changeset viewer.