- Timestamp:
- Apr 4, 2023 2:56:01 PM (22 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.cpp
r98103 r99284 39 39 #include "QIToolButton.h" 40 40 #include "UICloudNetworkingStuff.h" 41 #include "UIExtraDataManager.h" 41 42 #include "UIIconPool.h" 42 43 #include "UIVirtualBoxEventHandler.h" … … 135 136 pCombo->clear(); 136 137 138 /* Acquire restricted accounts: */ 139 const QStringList restrictedProfiles = gEDataManager->cloudProfileManagerRestrictions(); 140 137 141 /* Iterate through existing profiles: */ 142 QStringList allowedProfileNames; 143 QStringList restrictedProfileNames; 138 144 foreach (const CCloudProfile &comProfile, listCloudProfiles(comProvider, pCenter)) 139 145 { … … 146 152 continue; 147 153 148 /* Compose item, fill the data: */ 149 pCombo->addItem(strCurrentProfileName); 150 pCombo->setItemData(pCombo->count() - 1, strCurrentProfileName, ProfileData_Name); 154 /* Compose full profile name: */ 155 const QString strFullProfileName = QString("/%1/%2").arg(strProviderShortName).arg(strCurrentProfileName); 156 /* Append to appropriate list: */ 157 if (restrictedProfiles.contains(strFullProfileName)) 158 restrictedProfileNames.append(strCurrentProfileName); 159 else 160 allowedProfileNames.append(strCurrentProfileName); 161 } 162 163 /* Add allowed items: */ 164 foreach (const QString &strAllowedProfileName, allowedProfileNames) 165 { 166 /* Compose item, fill it's data: */ 167 pCombo->addItem(strAllowedProfileName); 168 pCombo->setItemData(pCombo->count() - 1, strAllowedProfileName, ProfileData_Name); 169 QFont fnt = pCombo->font(); 170 fnt.setBold(true); 171 pCombo->setItemData(pCombo->count() - 1, fnt, Qt::FontRole); 172 } 173 /* Add restricted items: */ 174 foreach (const QString &strRestrictedProfileName, restrictedProfileNames) 175 { 176 /* Compose item, fill it's data: */ 177 pCombo->addItem(strRestrictedProfileName); 178 pCombo->setItemData(pCombo->count() - 1, strRestrictedProfileName, ProfileData_Name); 179 QBrush brsh; 180 brsh.setColor(Qt::gray); 181 pCombo->setItemData(pCombo->count() - 1, brsh, Qt::ForegroundRole); 151 182 } 152 183 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageFormat.cpp
r98103 r99284 44 44 #include "UICommon.h" 45 45 #include "UIEmptyFilePathSelector.h" 46 #include "UIExtraDataManager.h" 46 47 #include "UIIconPool.h" 47 48 #include "UINotificationCenter.h" … … 397 398 pCombo->clear(); 398 399 400 /* Acquire restricted accounts: */ 401 const QStringList restrictedProfiles = gEDataManager->cloudProfileManagerRestrictions(); 402 399 403 /* Iterate through existing profile names: */ 404 QStringList allowedProfileNames; 405 QStringList restrictedProfileNames; 400 406 foreach (const CCloudProfile &comProfile, listCloudProfiles(comProvider, pCenter)) 401 407 { … … 404 410 continue; 405 411 /* Acquire profile name: */ 406 QString str ProfileName;407 if (!cloudProfileName(comProfile, str ProfileName, pCenter))412 QString strCurrentProfileName; 413 if (!cloudProfileName(comProfile, strCurrentProfileName, pCenter)) 408 414 continue; 409 415 416 /* Compose full profile name: */ 417 const QString strFullProfileName = QString("/%1/%2").arg(strFormat).arg(strCurrentProfileName); 418 /* Append to appropriate list: */ 419 if (restrictedProfiles.contains(strFullProfileName)) 420 restrictedProfileNames.append(strCurrentProfileName); 421 else 422 allowedProfileNames.append(strCurrentProfileName); 423 } 424 425 /* Add allowed items: */ 426 foreach (const QString &strAllowedProfileName, allowedProfileNames) 427 { 410 428 /* Compose item, fill it's data: */ 411 pCombo->addItem(strProfileName); 412 pCombo->setItemData(pCombo->count() - 1, strProfileName, ProfileData_Name); 429 pCombo->addItem(strAllowedProfileName); 430 pCombo->setItemData(pCombo->count() - 1, strAllowedProfileName, ProfileData_Name); 431 QFont fnt = pCombo->font(); 432 fnt.setBold(true); 433 pCombo->setItemData(pCombo->count() - 1, fnt, Qt::FontRole); 434 } 435 /* Add restricted items: */ 436 foreach (const QString &strRestrictedProfileName, restrictedProfileNames) 437 { 438 /* Compose item, fill it's data: */ 439 pCombo->addItem(strRestrictedProfileName); 440 pCombo->setItemData(pCombo->count() - 1, strRestrictedProfileName, ProfileData_Name); 441 QBrush brsh; 442 brsh.setColor(Qt::gray); 443 pCombo->setItemData(pCombo->count() - 1, brsh, Qt::ForegroundRole); 413 444 } 414 445 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageSource.cpp
r98103 r99284 39 39 #include "UICloudNetworkingStuff.h" 40 40 #include "UIEmptyFilePathSelector.h" 41 #include "UIExtraDataManager.h" 41 42 #include "UIIconPool.h" 42 43 #include "UINotificationCenter.h" … … 195 196 pCombo->clear(); 196 197 198 /* Acquire restricted accounts: */ 199 const QStringList restrictedProfiles = gEDataManager->cloudProfileManagerRestrictions(); 200 197 201 /* Iterate through existing profile names: */ 202 QStringList allowedProfileNames; 203 QStringList restrictedProfileNames; 198 204 foreach (const CCloudProfile &comProfile, listCloudProfiles(comProvider, pCenter)) 199 205 { … … 206 212 continue; 207 213 214 /* Compose full profile name: */ 215 const QString strFullProfileName = QString("/%1/%2").arg(strSource).arg(strCurrentProfileName); 216 /* Append to appropriate list: */ 217 if (restrictedProfiles.contains(strFullProfileName)) 218 restrictedProfileNames.append(strCurrentProfileName); 219 else 220 allowedProfileNames.append(strCurrentProfileName); 221 } 222 223 /* Add allowed items: */ 224 foreach (const QString &strAllowedProfileName, allowedProfileNames) 225 { 208 226 /* Compose item, fill it's data: */ 209 pCombo->addItem(strCurrentProfileName); 210 pCombo->setItemData(pCombo->count() - 1, strCurrentProfileName, ProfileData_Name); 227 pCombo->addItem(strAllowedProfileName); 228 pCombo->setItemData(pCombo->count() - 1, strAllowedProfileName, ProfileData_Name); 229 QFont fnt = pCombo->font(); 230 fnt.setBold(true); 231 pCombo->setItemData(pCombo->count() - 1, fnt, Qt::FontRole); 232 } 233 /* Add restricted items: */ 234 foreach (const QString &strRestrictedProfileName, restrictedProfileNames) 235 { 236 /* Compose item, fill it's data: */ 237 pCombo->addItem(strRestrictedProfileName); 238 pCombo->setItemData(pCombo->count() - 1, strRestrictedProfileName, ProfileData_Name); 239 QBrush brsh; 240 brsh.setColor(Qt::gray); 241 pCombo->setItemData(pCombo->count() - 1, brsh, Qt::ForegroundRole); 211 242 } 212 243 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.cpp
r98103 r99284 39 39 #include "QIToolButton.h" 40 40 #include "UICloudNetworkingStuff.h" 41 #include "UIExtraDataManager.h" 41 42 #include "UIIconPool.h" 42 43 #include "UINotificationCenter.h" … … 136 137 pCombo->clear(); 137 138 139 /* Acquire restricted accounts: */ 140 const QStringList restrictedProfiles = gEDataManager->cloudProfileManagerRestrictions(); 141 138 142 /* Iterate through existing profiles: */ 143 QStringList allowedProfileNames; 144 QStringList restrictedProfileNames; 139 145 foreach (const CCloudProfile &comProfile, listCloudProfiles(comProvider, pCenter)) 140 146 { … … 147 153 continue; 148 154 149 /* Compose item, fill the data: */ 150 pCombo->addItem(strCurrentProfileName); 151 pCombo->setItemData(pCombo->count() - 1, strCurrentProfileName, ProfileData_Name); 155 /* Compose full profile name: */ 156 const QString strFullProfileName = QString("/%1/%2").arg(strProviderShortName).arg(strCurrentProfileName); 157 /* Append to appropriate list: */ 158 if (restrictedProfiles.contains(strFullProfileName)) 159 restrictedProfileNames.append(strCurrentProfileName); 160 else 161 allowedProfileNames.append(strCurrentProfileName); 162 } 163 164 /* Add allowed items: */ 165 foreach (const QString &strAllowedProfileName, allowedProfileNames) 166 { 167 /* Compose item, fill it's data: */ 168 pCombo->addItem(strAllowedProfileName); 169 pCombo->setItemData(pCombo->count() - 1, strAllowedProfileName, ProfileData_Name); 170 QFont fnt = pCombo->font(); 171 fnt.setBold(true); 172 pCombo->setItemData(pCombo->count() - 1, fnt, Qt::FontRole); 173 } 174 /* Add restricted items: */ 175 foreach (const QString &strRestrictedProfileName, restrictedProfileNames) 176 { 177 /* Compose item, fill it's data: */ 178 pCombo->addItem(strRestrictedProfileName); 179 pCombo->setItemData(pCombo->count() - 1, strRestrictedProfileName, ProfileData_Name); 180 QBrush brsh; 181 brsh.setColor(Qt::gray); 182 pCombo->setItemData(pCombo->count() - 1, brsh, Qt::ForegroundRole); 152 183 } 153 184
Note:
See TracChangeset
for help on using the changeset viewer.