Changeset 92492 in vbox
- Timestamp:
- Nov 18, 2021 2:00:30 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 9 edited
-
extradata/UIExtraDataDefs.cpp (modified) (1 diff)
-
extradata/UIExtraDataDefs.h (modified) (1 diff)
-
extradata/UIExtraDataManager.cpp (modified) (2 diffs)
-
extradata/UIExtraDataManager.h (modified) (1 diff)
-
medium/viso/UIVisoContentBrowser.cpp (modified) (4 diffs)
-
medium/viso/UIVisoCreator.cpp (modified) (5 diffs)
-
medium/viso/UIVisoCreator.h (modified) (5 diffs)
-
medium/viso/UIVisoHostBrowser.cpp (modified) (2 diffs)
-
medium/viso/UIVisoHostBrowser.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r92487 r92492 83 83 /* VISO Creator: */ 84 84 const char *UIExtraDataDefs::GUI_VISOCreator_RecentFolder = "GUI/VISOCreator/RecentFolder"; 85 const char *UIExtraDataDefs::GUI_VISOCreator_DialogGeometry = "GUI/VISOCreator/DialogGeometry"; 85 86 86 87 /* VirtualBox Manager: */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r92487 r92492 157 157 /** Holds recent folder for VISO creation content. */ 158 158 SHARED_LIBRARY_STUFF extern const char *GUI_VISOCreator_RecentFolder; 159 SHARED_LIBRARY_STUFF extern const char *GUI_VISOCreator_DialogGeometry; 159 160 /** @} */ 160 161 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r92437 r92492 1908 1908 << GUI_Input_SelectorShortcuts << GUI_Input_MachineShortcuts 1909 1909 << GUI_RecentFolderHD << GUI_RecentFolderCD << GUI_RecentFolderFD 1910 << GUI_VISOCreator_RecentFolder 1910 << GUI_VISOCreator_RecentFolder << GUI_VISOCreator_DialogGeometry 1911 1911 << GUI_RecentListHD << GUI_RecentListCD << GUI_RecentListFD 1912 1912 << GUI_RestrictedNetworkAttachmentTypes … … 2720 2720 } 2721 2721 2722 QRect UIExtraDataManager::visoCreatorDialogGeometry(QWidget *pWidget, QWidget *pParentWidget, const QRect &defaultGeometry) 2723 { 2724 return dialogGeometry(GUI_VISOCreator_DialogGeometry, pWidget, pParentWidget, defaultGeometry); 2725 } 2726 2727 void UIExtraDataManager::setVisoCreatorDialogGeometry(const QRect &geometry, bool fMaximized) 2728 { 2729 setDialogGeometry(GUI_VISOCreator_DialogGeometry, geometry, fMaximized); 2730 } 2731 2732 bool UIExtraDataManager::visoCreatorDialogShouldBeMaximized() 2733 { 2734 /* Get corresponding extra-data: */ 2735 const QStringList data = extraDataStringList(GUI_VISOCreator_DialogGeometry); 2736 2737 /* Make sure 5th item has required value: */ 2738 return data.size() == 5 && data[4] == GUI_Geometry_State_Max; 2739 } 2740 2722 2741 QRect UIExtraDataManager::selectorWindowGeometry(QWidget *pWidget) 2723 2742 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r92437 r92492 335 335 /** Defines recent folder for VISO creation content as @a strValue. */ 336 336 void setVISOCreatorRecentFolder(const QString &strValue); 337 /** Returns viso creator geometry using @a pWidget as the hint. */ 338 QRect visoCreatorDialogGeometry(QWidget *pWidget, QWidget *pParentWidget, const QRect &defaultGeometry); 339 /** Set viso creator geometry. */ 340 void setVisoCreatorDialogGeometry(const QRect &geometry, bool fMaximized); 341 /** Returns whether viso creator dialog should be maximized. */ 342 bool visoCreatorDialogShouldBeMaximized(); 337 343 /** @} */ 338 344 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp
r92489 r92492 23 23 #include <QHeaderView> 24 24 #include <QMimeData> 25 #include <QTableView> 25 26 #include <QTreeView> 26 27 … … 29 30 #include "UIPathOperations.h" 30 31 #include "UIVisoContentBrowser.h" 31 #include "QITableView.h"32 32 33 33 /********************************************************************************************************************************* … … 36 36 37 37 /** An QTableView extension mainly used to handle dropeed file objects from the host browser. */ 38 class UIVisoContentTableView : public Q ITableView38 class UIVisoContentTableView : public QTableView 39 39 { 40 40 Q_OBJECT; … … 77 77 *********************************************************************************************************************************/ 78 78 UIVisoContentTableView::UIVisoContentTableView(QWidget *pParent /* = 0 */) 79 :Q ITableView(pParent)79 :QTableView(pParent) 80 80 { 81 81 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp
r92490 r92492 29 29 #include "UIIconPool.h" 30 30 #include "UIMessageCenter.h" 31 #include "UIModalWindowManager.h" 31 32 #include "QIToolBar.h" 32 33 #include "UIVisoHostBrowser.h" … … 509 510 *********************************************************************************************************************************/ 510 511 UIVisoCreatorDialog::UIVisoCreatorDialog(UIActionPool *pActionPool, QWidget *pParent, const QString& strMachineName /* = QString() */) 511 : QIWithRetranslateUI<QI MainDialog>(pParent)512 : QIWithRetranslateUI<QIWithRestorableGeometry<QIMainDialog> >(pParent) 512 513 , m_strMachineName(strMachineName) 513 514 , m_pVisoCreatorWidget(0) 514 515 , m_pButtonBox(0) 515 516 , m_pActionPool(pActionPool) 517 , m_iGeometrySaveTimerId(-1) 516 518 { 517 519 /* Make sure that the base class does not close this dialog upon pressing escape. … … 520 522 prepareWidgets(); 521 523 prepareConnections(); 524 loadSettings(); 522 525 } 523 526 … … 613 616 } 614 617 618 bool UIVisoCreatorDialog::event(QEvent *pEvent) 619 { 620 if (pEvent->type() == QEvent::Resize || pEvent->type() == QEvent::Move) 621 { 622 if (m_iGeometrySaveTimerId != -1) 623 killTimer(m_iGeometrySaveTimerId); 624 m_iGeometrySaveTimerId = startTimer(300); 625 } 626 else if (pEvent->type() == QEvent::Timer) 627 { 628 QTimerEvent *pTimerEvent = static_cast<QTimerEvent*>(pEvent); 629 if (pTimerEvent->timerId() == m_iGeometrySaveTimerId) 630 { 631 killTimer(m_iGeometrySaveTimerId); 632 m_iGeometrySaveTimerId = -1; 633 saveDialogGeometry(); 634 } 635 } 636 return QIWithRetranslateUI<QIWithRestorableGeometry<QIMainDialog> >::event(pEvent); 637 } 638 615 639 void UIVisoCreatorDialog::sltSetCancelButtonShortCut(QKeySequence keySequence) 616 640 { … … 618 642 m_pButtonBox->button(QDialogButtonBox::Cancel)->setShortcut(keySequence); 619 643 } 644 645 void UIVisoCreatorDialog::loadSettings() 646 { 647 const QRect availableGeo = gpDesktop->availableGeometry(this); 648 int iDefaultWidth = availableGeo.width() / 2; 649 int iDefaultHeight = availableGeo.height() * 3 / 4; 650 QRect defaultGeo(0, 0, iDefaultWidth, iDefaultHeight); 651 652 QWidget *pParent = windowManager().realParentWindow(parentWidget() ? parentWidget() : windowManager().mainWindowShown()); 653 /* Load geometry from extradata: */ 654 const QRect geo = gEDataManager->visoCreatorDialogGeometry(this, pParent, defaultGeo); 655 LogRel2(("GUI: UISoftKeyboard: Restoring geometry to: Origin=%dx%d, Size=%dx%d\n", 656 geo.x(), geo.y(), geo.width(), geo.height())); 657 658 restoreGeometry(geo); 659 } 660 661 void UIVisoCreatorDialog::saveDialogGeometry() 662 { 663 const QRect geo = currentGeometry(); 664 LogRel2(("GUI: UIMediumSelector: Saving geometry as: Origin=%dx%d, Size=%dx%d\n", 665 geo.x(), geo.y(), geo.width(), geo.height())); 666 gEDataManager->setVisoCreatorDialogGeometry(geo, isCurrentlyMaximized()); 667 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h
r92490 r92492 27 27 /* GUI includes: */ 28 28 #include "QIMainDialog.h" 29 #include "QIWithRestorableGeometry.h" 29 30 #include "QIWithRetranslateUI.h" 30 31 … … 174 175 175 176 176 class SHARED_LIBRARY_STUFF UIVisoCreatorDialog : public QIWithRetranslateUI<QI MainDialog>177 class SHARED_LIBRARY_STUFF UIVisoCreatorDialog : public QIWithRetranslateUI<QIWithRestorableGeometry<QIMainDialog> > 177 178 { 178 179 Q_OBJECT; … … 188 189 void setCurrentPath(const QString &strPath); 189 190 191 protected: 192 193 virtual bool event(QEvent *pEvent) final override; 194 190 195 private slots: 191 196 … … 196 201 void prepareConnections(); 197 202 virtual void retranslateUi() final override; 203 void loadSettings(); 204 void saveDialogGeometry(); 198 205 199 206 QString m_strMachineName; … … 201 208 QIDialogButtonBox *m_pButtonBox; 202 209 QPointer<UIActionPool> m_pActionPool; 210 int m_iGeometrySaveTimerId; 203 211 }; 204 212 #endif /* !FEQT_INCLUDED_SRC_medium_viso_UIVisoCreator_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoHostBrowser.cpp
r91328 r92492 22 22 #include <QTextEdit> 23 23 #include <QTreeView> 24 #include <QTableView> 24 25 25 26 /* GUI includes: */ 26 #include "QITableView.h"27 27 #include "UIVisoHostBrowser.h" 28 28 … … 150 150 } 151 151 152 m_pTableView = new Q ITableView;152 m_pTableView = new QTableView; 153 153 if (m_pTableView) 154 154 { -
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoHostBrowser.h
r91328 r92492 27 27 /* Forward declarations: */ 28 28 class QItemSelection; 29 class Q ITableView;29 class QTableView; 30 30 class UIVisoHostBrowserModel; 31 31 … … 72 72 UIVisoHostBrowserModel *m_pTreeModel; 73 73 UIVisoHostBrowserModel *m_pTableModel; 74 Q ITableView *m_pTableView;74 QTableView *m_pTableView; 75 75 }; 76 76
Note:
See TracChangeset
for help on using the changeset viewer.

