Changeset 100887 in vbox for trunk/src/VBox
- Timestamp:
- Aug 16, 2023 6:00:51 PM (16 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/guestctrl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.cpp
r100880 r100887 256 256 } 257 257 258 m_pPanel = new UIFileManagerPanel ;258 m_pPanel = new UIFileManagerPanel(this, UIFileManagerOptions::instance()); 259 259 AssertReturnVoid(m_pPanel); 260 260 m_pVerticalSplitter->addWidget(m_pPanel); … … 321 321 this, &UIFileManager::sltHandleShowPanel); 322 322 } 323 323 if (m_pPanel) 324 { 325 connect(m_pPanel, &UIFileManagerPanel::sigOptionsChanged, 326 this, &UIFileManager::sltHandleOptionsUpdated); 327 } 324 328 if (m_pOperationsPanel) 325 329 { … … 333 337 connect(m_pHostFileTable, &UIFileManagerHostTable::sigLogOutput, 334 338 this, &UIFileManager::sltReceieveLogOutput); 339 connect(m_pHostFileTable, &UIFileManagerHostTable::sigDeleteConfirmationOptionChanged, 340 this, &UIFileManager::sltHandleOptionsUpdated); 335 341 connect(m_pHostFileTable, &UIFileManagerGuestTable::sigSelectionChanged, 336 342 this, &UIFileManager::sltFileTableSelectionChanged); … … 504 510 if (m_pHostFileTable) 505 511 m_pHostFileTable->setEnabled(fIsRunning); 512 } 513 514 void UIFileManager::sltHandleOptionsUpdated() 515 { 516 if (m_pPanel) 517 m_pPanel->update(); 518 519 for (int i = 0; i < m_pGuestTablesContainer->count(); ++i) 520 { 521 UIFileManagerGuestTable *pTable = qobject_cast<UIFileManagerGuestTable*>(m_pGuestTablesContainer->widget(i)); 522 if (pTable) 523 pTable->optionsUpdated(); 524 } 525 if (m_pHostFileTable) 526 m_pHostFileTable->optionsUpdated(); 527 saveOptions(); 506 528 } 507 529 … … 805 827 connect(pGuestFileTable, &UIFileManagerGuestTable::sigStateChanged, 806 828 this, &UIFileManager::sltGuestFileTableStateChanged); 829 connect(pGuestFileTable, &UIFileManagerGuestTable::sigDeleteConfirmationOptionChanged, 830 this, &UIFileManager::sltHandleOptionsUpdated); 807 831 } 808 832 } -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManager.h
r100880 r100887 128 128 void sltCurrentTabChanged(int iIndex); 129 129 void sltGuestFileTableStateChanged(bool fIsRunning); 130 void sltHandleOptionsUpdated(); 130 131 131 132 private: -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerPanel.cpp
r100880 r100887 35 35 /* GUI includes: */ 36 36 #include "UIFileManagerPanel.h" 37 #include "UIFileManager.h" 37 38 38 39 /* Other VBox includes: */ 39 40 #include <iprt/assert.h> 40 41 41 UIFileManagerPanel::UIFileManagerPanel(QWidget *pParent /* = 0 */)42 UIFileManagerPanel::UIFileManagerPanel(QWidget *pParent, UIFileManagerOptions *pFileManagerOptions) 42 43 : QIWithRetranslateUI<QWidget>(pParent) 43 44 , m_pTabWidget(0) … … 46 47 , m_pHumanReabableSizesCheckBox(0) 47 48 , m_pShowHiddenObjectsCheckBox(0) 49 , m_pFileManagerOptions(pFileManagerOptions) 48 50 { 49 51 prepare(); … … 77 79 AssertReturnVoid(m_pShowHiddenObjectsCheckBox); 78 80 79 connect(m_pListDirectoriesOnTopCheckBox, &QCheckBox::toggled, this, &UIFileManagerPanel::sigListDirectoryCheckBoxToogled); 80 connect(m_pDeleteConfirmationCheckBox, &QCheckBox::toggled, this, &UIFileManagerPanel::sigDeleteConfirmationCheckBoxToogled); 81 connect(m_pHumanReabableSizesCheckBox, &QCheckBox::toggled, this, &UIFileManagerPanel::sigHumanReabableSizesCheckBoxToogled); 82 connect(m_pShowHiddenObjectsCheckBox, &QCheckBox::toggled, this, &UIFileManagerPanel::sigShowHiddenObjectsCheckBoxToggled); 81 if (m_pFileManagerOptions) 82 { 83 if (m_pListDirectoriesOnTopCheckBox) 84 m_pListDirectoriesOnTopCheckBox->setChecked(m_pFileManagerOptions->fListDirectoriesOnTop); 85 if (m_pDeleteConfirmationCheckBox) 86 m_pDeleteConfirmationCheckBox->setChecked(m_pFileManagerOptions->fAskDeleteConfirmation); 87 if (m_pHumanReabableSizesCheckBox) 88 m_pHumanReabableSizesCheckBox->setChecked(m_pFileManagerOptions->fShowHumanReadableSizes); 89 if (m_pShowHiddenObjectsCheckBox) 90 m_pShowHiddenObjectsCheckBox->setChecked(m_pFileManagerOptions->fShowHiddenObjects); 91 } 92 93 connect(m_pListDirectoriesOnTopCheckBox, &QCheckBox::toggled, 94 this, &UIFileManagerPanel::sltListDirectoryCheckBoxToogled); 95 96 connect(m_pDeleteConfirmationCheckBox, &QCheckBox::toggled, 97 this, &UIFileManagerPanel::sltDeleteConfirmationCheckBoxToogled); 98 99 connect(m_pHumanReabableSizesCheckBox, &QCheckBox::toggled, 100 this, &UIFileManagerPanel::sltHumanReabableSizesCheckBoxToogled); 101 102 103 connect(m_pShowHiddenObjectsCheckBox, &QCheckBox::toggled, 104 this, &UIFileManagerPanel::sltShowHiddenObjectsCheckBoxToggled); 83 105 84 106 QGridLayout *pPreferencesLayout = new QGridLayout(m_pPreferencesTab); … … 92 114 } 93 115 94 116 void UIFileManagerPanel::sltListDirectoryCheckBoxToogled(bool bChecked) 117 { 118 if (!m_pFileManagerOptions) 119 return; 120 m_pFileManagerOptions->fListDirectoriesOnTop = bChecked; 121 emit sigOptionsChanged(); 122 } 123 124 void UIFileManagerPanel::sltDeleteConfirmationCheckBoxToogled(bool bChecked) 125 { 126 if (!m_pFileManagerOptions) 127 return; 128 m_pFileManagerOptions->fAskDeleteConfirmation = bChecked; 129 emit sigOptionsChanged(); 130 } 131 132 void UIFileManagerPanel::sltHumanReabableSizesCheckBoxToogled(bool bChecked) 133 { 134 if (!m_pFileManagerOptions) 135 return; 136 m_pFileManagerOptions->fShowHumanReadableSizes = bChecked; 137 emit sigOptionsChanged(); 138 } 139 140 void UIFileManagerPanel::sltShowHiddenObjectsCheckBoxToggled(bool bChecked) 141 { 142 if (!m_pFileManagerOptions) 143 return; 144 m_pFileManagerOptions->fShowHiddenObjects = bChecked; 145 emit sigOptionsChanged(); 146 } 95 147 96 148 void UIFileManagerPanel::retranslateUi() … … 123 175 } 124 176 177 void UIFileManagerPanel::update() 178 { 179 if (!m_pFileManagerOptions) 180 return; 181 182 if (m_pListDirectoriesOnTopCheckBox) 183 { 184 m_pListDirectoriesOnTopCheckBox->blockSignals(true); 185 m_pListDirectoriesOnTopCheckBox->setChecked(m_pFileManagerOptions->fListDirectoriesOnTop); 186 m_pListDirectoriesOnTopCheckBox->blockSignals(false); 187 } 188 189 if (m_pDeleteConfirmationCheckBox) 190 { 191 m_pDeleteConfirmationCheckBox->blockSignals(true); 192 m_pDeleteConfirmationCheckBox->setChecked(m_pFileManagerOptions->fAskDeleteConfirmation); 193 m_pDeleteConfirmationCheckBox->blockSignals(false); 194 } 195 196 if (m_pHumanReabableSizesCheckBox) 197 { 198 m_pHumanReabableSizesCheckBox->blockSignals(true); 199 m_pHumanReabableSizesCheckBox->setChecked(m_pFileManagerOptions->fShowHumanReadableSizes); 200 m_pHumanReabableSizesCheckBox->blockSignals(false); 201 } 202 203 if (m_pShowHiddenObjectsCheckBox) 204 { 205 m_pShowHiddenObjectsCheckBox->blockSignals(true); 206 m_pShowHiddenObjectsCheckBox->setChecked(m_pFileManagerOptions->fShowHiddenObjects); 207 m_pShowHiddenObjectsCheckBox->blockSignals(false); 208 } 209 } 125 210 126 211 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerPanel.h
r100879 r100887 36 36 #include "QIWithRetranslateUI.h" 37 37 /* Forward declarations: */ 38 38 39 class QTabWidget; 39 40 class QCheckBox; 41 class UIFileManagerOptions; 40 42 41 43 class UIFileManagerPanel : public QIWithRetranslateUI<QWidget> … … 45 47 signals: 46 48 47 void sigListDirectoryCheckBoxToogled(bool bChecked); 48 void sigDeleteConfirmationCheckBoxToogled(bool bChecked); 49 void sigHumanReabableSizesCheckBoxToogled(bool bChecked); 50 void sigShowHiddenObjectsCheckBoxToggled(bool bChecked); 49 void sigOptionsChanged(); 51 50 52 51 public: 53 52 54 UIFileManagerPanel(QWidget *pParent = 0); 53 UIFileManagerPanel(QWidget *pParent, UIFileManagerOptions *pFileManagerOptions); 54 void update(); 55 55 56 56 protected: … … 60 60 private slots: 61 61 62 void sltListDirectoryCheckBoxToogled(bool bChecked); 63 void sltDeleteConfirmationCheckBoxToogled(bool bChecked); 64 void sltHumanReabableSizesCheckBoxToogled(bool bChecked); 65 void sltShowHiddenObjectsCheckBoxToggled(bool bChecked); 62 66 63 67 private: … … 74 78 QCheckBox *m_pHumanReabableSizesCheckBox; 75 79 QCheckBox *m_pShowHiddenObjectsCheckBox; 80 UIFileManagerOptions *m_pFileManagerOptions; 76 81 /** @} */ 77 82
Note:
See TracChangeset
for help on using the changeset viewer.