Changeset 75642 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 21, 2018 1:55:19 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r75424 r75642 204 204 const char *UIExtraDataDefs::GUI_GuestControl_ProcessControlDialogGeometry = "GUI/GuestControl/ProcessControlDialogGeometry"; 205 205 206 /* Guest Control file manager options: */ 207 const char *UIExtraDataDefs::GUI_GuestControl_FileManagerOptions = "GUI/GuestControl/FileManagerOptions"; 208 const char *UIExtraDataDefs::GUI_GuestControl_FileManagerListDirectoriesFirst = "ListDirectoriesFirst"; 209 const char *UIExtraDataDefs::GUI_GuestControl_FileManagerShowDeleteConfirmation = "ShowDeleteConfimation"; 210 const char *UIExtraDataDefs::GUI_GuestControl_FileManagerShowHumanReadableSizes = "ShowHumanReadableSizes"; 211 206 212 /* Virtual Machine: Close dialog: */ 207 213 const char *UIExtraDataDefs::GUI_DefaultCloseAction = "GUI/DefaultCloseAction"; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r75616 r75642 365 365 /** @} */ 366 366 367 /** @name Guest Control file manager options 368 * @{ */ 369 extern const char *GUI_GuestControl_FileManagerOptions; 370 extern const char *GUI_GuestControl_FileManagerListDirectoriesFirst; 371 extern const char *GUI_GuestControl_FileManagerShowDeleteConfirmation; 372 extern const char *GUI_GuestControl_FileManagerShowHumanReadableSizes; 373 /** @} */ 374 367 375 /** @name Virtual Machine: Close dialog 368 376 * @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r75607 r75642 2034 2034 << GUI_GuestControl_ProcessControlSplitterHints 2035 2035 << GUI_GuestControl_FileManagerDialogGeometry 2036 << GUI_GuestControl_FileManagerOptions 2036 2037 << GUI_GuestControl_ProcessControlDialogGeometry 2037 2038 << GUI_DefaultCloseAction << GUI_RestrictedCloseActions … … 4245 4246 } 4246 4247 4248 void UIExtraDataManager::setGuestControlFileManagerOptions(bool fListDirectoriesFirst, 4249 bool fShowDeleteConfirmation, bool fShowHumanReadableSizes) 4250 { 4251 /* Serialize passed values: */ 4252 QStringList data; 4253 4254 if (fListDirectoriesFirst) 4255 data << GUI_GuestControl_FileManagerListDirectoriesFirst; 4256 if (fShowDeleteConfirmation) 4257 data << GUI_GuestControl_FileManagerShowDeleteConfirmation; 4258 if (fShowHumanReadableSizes) 4259 data << GUI_GuestControl_FileManagerShowHumanReadableSizes; 4260 4261 /* Re-cache corresponding extra-data: */ 4262 setExtraDataStringList(GUI_GuestControl_FileManagerOptions, data); 4263 } 4264 4265 bool UIExtraDataManager::guestControlFileManagerListDirectoriesFirst() 4266 { 4267 const QStringList data = extraDataStringList(GUI_GuestControl_FileManagerOptions); 4268 for (int i = 0; i < data.size(); ++i) 4269 { 4270 if (data[i] == GUI_GuestControl_FileManagerListDirectoriesFirst) 4271 return true; 4272 } 4273 return false; 4274 } 4275 4276 bool UIExtraDataManager::guestControlFileManagerShowDeleteConfirmation() 4277 { 4278 const QStringList data = extraDataStringList(GUI_GuestControl_FileManagerOptions); 4279 for (int i = 0; i < data.size(); ++i) 4280 { 4281 if (data[i] == GUI_GuestControl_FileManagerShowDeleteConfirmation) 4282 return true; 4283 } 4284 return false; 4285 } 4286 4287 bool UIExtraDataManager::guestControlFileManagerShowHumanReadableSizes() 4288 { 4289 const QStringList data = extraDataStringList(GUI_GuestControl_FileManagerOptions); 4290 for (int i = 0; i < data.size(); ++i) 4291 { 4292 if (data[i] == GUI_GuestControl_FileManagerShowHumanReadableSizes) 4293 return true; 4294 } 4295 return false; 4296 } 4297 4247 4298 QRect UIExtraDataManager::guestProcessControlDialogGeometry(QWidget *pWidget, const QRect &defaultGeometry) 4248 4299 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r75607 r75642 634 634 /** @} */ 635 635 636 /** @name Virtual Machine:Guest Control related dialogs636 /** @name Guest Control related dialogs 637 637 * @{ */ 638 638 void setGuestControlProcessControlSplitterHints(const QList<int> &hints); … … 646 646 void setGuestControlFileManagerVisiblePanels(const QStringList &panelNameList); 647 647 QStringList guestControlFileManagerVisiblePanels(); 648 /** @} */ 649 650 /** @name Guest Control file manager options 651 * @{ */ 652 void setGuestControlFileManagerOptions(bool fListDirectoriesFirst, 653 bool fShowDeleteConfirmation, bool fshowHumanReadableSizes); 654 bool guestControlFileManagerListDirectoriesFirst(); 655 bool guestControlFileManagerShowDeleteConfirmation(); 656 bool guestControlFileManagerShowHumanReadableSizes(); 648 657 /** @} */ 649 658 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManager.cpp
r75619 r75642 147 147 , m_pOperationsPanel(0) 148 148 { 149 loadOptions(); 149 150 prepareGuestListener(); 150 151 prepareObjects(); … … 703 704 strNameList.append(pPanel->panelName()); 704 705 gEDataManager->setGuestControlFileManagerVisiblePanels(strNameList); 706 707 /* Save the options: */ 708 UIGuestControlFileManagerSettings *pSettings = UIGuestControlFileManagerSettings::instance(); 709 if (pSettings) 710 { 711 gEDataManager->setGuestControlFileManagerOptions(pSettings->bListDirectoriesOnTop, 712 pSettings->bAskDeleteConfirmation, 713 pSettings->bShowHumanReadableSizes); 714 } 705 715 } 706 716 … … 722 732 } 723 733 734 void UIGuestControlFileManager::loadOptions() 735 { 736 /* Load options: */ 737 UIGuestControlFileManagerSettings *pSettings = UIGuestControlFileManagerSettings::instance(); 738 if (pSettings) 739 { 740 pSettings->bListDirectoriesOnTop = gEDataManager->guestControlFileManagerListDirectoriesFirst(); 741 pSettings->bAskDeleteConfirmation = gEDataManager->guestControlFileManagerShowDeleteConfirmation(); 742 pSettings->bShowHumanReadableSizes = gEDataManager->guestControlFileManagerShowHumanReadableSizes(); 743 } 744 } 745 724 746 void UIGuestControlFileManager::hidePanel(UIGuestControlFileManagerPanel* panel) 725 747 { -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlFileManager.h
r75619 r75642 143 143 /** @} */ 144 144 145 /** Saves list of panels and file manager options to the extra data. */ 145 146 void saveSettings(); 147 /** Loads settings from exra data except the file manager options. */ 146 148 void loadSettings(); 149 /** Loads file manager options. This should be done before widget creation 150 * since some widgets are initilized with these options */ 151 void loadOptions(); 147 152 void hidePanel(UIGuestControlFileManagerPanel *panel); 148 153 void showPanel(UIGuestControlFileManagerPanel *panel); 149 /** Make sure escape key is assigned to only a single widget. This is done by checking154 /** Makes sure escape key is assigned to only a single widget. This is done by checking 150 155 several things in the following order: 151 156 - when there are no more panels visible assign it to the parent dialog
Note:
See TracChangeset
for help on using the changeset viewer.