Changeset 32760 in vbox for trunk/src/VBox
- Timestamp:
- Sep 24, 2010 1:41:31 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 21 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r32758 r32760 470 470 src/widgets/UIPopupBox.cpp \ 471 471 src/widgets/UISpecialControls.cpp \ 472 src/widgets/UIToolBar.cpp \ 472 473 src/widgets/VBoxApplianceEditorWgt.cpp \ 473 474 src/widgets/VBoxBootTable.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp
r31568 r32760 39 39 #include "UINewHDWzd.h" 40 40 #include "VBoxProblemReporter.h" 41 #include " VBoxToolBar.h"41 #include "UIToolBar.h" 42 42 #include "QIFileDialog.h" 43 43 #include "QILabel.h" … … 318 318 319 319 /* Toolbar composing */ 320 mToolBar = new VBoxToolBar (this);320 mToolBar = new UIToolBar (this); 321 321 mToolBar->setIconSize (QSize (22, 22)); 322 322 mToolBar->setToolButtonStyle (Qt::ToolButtonTextUnderIcon); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.h
r30677 r32760 31 31 class MediaItem; 32 32 class VBoxProgressBar; 33 class VBoxToolBar;33 class UIToolBar; 34 34 35 35 class VBoxMediaManagerDlg : public QIWithRetranslateUI2<QIMainDialog>, … … 152 152 QMenu *mActionsContextMenu; 153 153 QMenu *mActionsMenu; 154 VBoxToolBar *mToolBar;154 UIToolBar *mToolBar; 155 155 QAction *mNewAction; 156 156 QAction *mAddAction; -
trunk/src/VBox/Frontends/VirtualBox/src/precomp.h
r32667 r32760 244 244 #include "VBoxSpecialControls.h" 245 245 #include "VBoxTakeSnapshotDlg.h" 246 #include " VBoxToolBar.h"246 #include "UIToolBar.h" 247 247 #include "VBoxUpdateDlg.h" 248 248 #include "VBoxUtils-darwin.h" -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp
r31500 r32760 31 31 #include "UIVirtualBoxEventHandler.h" 32 32 #include "VBoxSnapshotsWgt.h" 33 #include " VBoxToolBar.h"33 #include "UIToolBar.h" 34 34 35 35 #include "VBoxUtils.h" … … 1325 1325 }; 1326 1326 1327 UIVMDesktop::UIVMDesktop( VBoxToolBar *pToolBar, QAction *pRefreshAction, QWidget *pParent /* = 0 */)1327 UIVMDesktop::UIVMDesktop(UIToolBar *pToolBar, QAction *pRefreshAction, QWidget *pParent /* = 0 */) 1328 1328 : QIWithRetranslateUI<QWidget>(pParent) 1329 1329 { -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.h
r31500 r32760 33 33 class UIVMItem; 34 34 class VBoxSnapshotsWgt; 35 class VBoxToolBar;35 class UIToolBar; 36 36 37 37 class UIVMDesktop: public QIWithRetranslateUI<QWidget> … … 41 41 public: 42 42 43 UIVMDesktop( VBoxToolBar *pToolBar, QAction *pRefreshAction, QWidget *pParent = 0);43 UIVMDesktop(UIToolBar *pToolBar, QAction *pRefreshAction, QWidget *pParent = 0); 44 44 45 45 void updateDetails(UIVMItem *pVMItem, const CMachine& machine); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp
r32759 r32760 35 35 #include "VBoxSelectorWnd.h" 36 36 #include "UISettingsDialogSpecific.h" 37 #include " VBoxToolBar.h"37 #include "UIToolBar.h" 38 38 #include "VBoxVMLogViewer.h" 39 39 … … 42 42 # include "UIExtraDataEventHandler.h" 43 43 #endif /* VBOX_GUI_WITH_SYSTRAY */ 44 45 #ifdef Q_WS_MAC 46 # include "VBoxUtils.h" 47 #endif 44 48 45 49 /* Global includes */ … … 162 166 163 167 /* VM list toolbar */ 164 mVMToolBar = new VBoxToolBar(this);168 mVMToolBar = new UIToolBar(this); 165 169 mVMToolBar->setContextMenuPolicy(Qt::CustomContextMenu); 166 170 #ifndef Q_WS_MAC -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.h
r32759 r32760 40 40 class UIVMItemModel; 41 41 class UIVMListView; 42 class VBoxToolBar;42 class UIToolBar; 43 43 class VBoxTrayIcon; 44 44 class VBoxVMLogViewer; … … 144 144 UIBar *m_pBar; 145 145 #endif /* !Q_WS_MAC */ 146 VBoxToolBar *mVMToolBar;146 UIToolBar *mVMToolBar; 147 147 148 148 /* VM list context menu */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
r31070 r32760 27 27 #include "VBoxSnapshotsWgt.h" 28 28 #include "VBoxTakeSnapshotDlg.h" 29 #include " VBoxToolBar.h"29 #include "UIToolBar.h" 30 30 #include "UIVirtualBoxEventHandler.h" 31 31 … … 35 35 #include <QMenu> 36 36 #include <QScrollBar> 37 #include <QWindowsStyle> 37 38 38 39 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 349 350 350 351 /* ToolBar creation */ 351 VBoxToolBar *toolBar = new VBoxToolBar (this);352 UIToolBar *toolBar = new UIToolBar (this); 352 353 toolBar->setUsesTextLabel (false); 353 354 toolBar->setIconSize (QSize (22, 22)); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r32667 r32760 31 31 #include "VBoxSettingsSelector.h" 32 32 #include "VBoxSettingsPage.h" 33 #include " VBoxToolBar.h"33 #include "UIToolBar.h" 34 34 #include "UIIconPool.h" 35 35 #ifdef Q_WS_MAC … … 81 81 /* Create modern tool-bar selector: */ 82 82 m_pSelector = new VBoxSettingsToolBarSelector(this); 83 static_cast< VBoxToolBar*>(m_pSelector->widget())->setMacToolbar();83 static_cast<UIToolBar*>(m_pSelector->widget())->setMacToolbar(); 84 84 addToolBar(qobject_cast<QToolBar*>(m_pSelector->widget())); 85 85 /* No title in this mode, we change the title of the window: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/VBoxSettingsSelector.cpp
r29972 r32760 26 26 #include "VBoxSettingsPage.h" 27 27 #include "VBoxGlobal.h" 28 #include " VBoxToolBar.h"28 #include "UIToolBar.h" 29 29 #include "QITreeWidget.h" 30 30 #include "QITabWidget.h" … … 371 371 { 372 372 /* Init the toolbar */ 373 mTbSelector = new VBoxToolBar (aParent);373 mTbSelector = new UIToolBar (aParent); 374 374 mTbSelector->setUsesTextLabel (true); 375 375 mTbSelector->setIconSize (QSize (32, 32)); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/VBoxSettingsSelector.h
r28800 r32760 24 24 25 25 class QITreeWidget; 26 class VBoxToolBar;26 class UIToolBar; 27 27 class VBoxSettingsPage; 28 28 class SelectorItem; … … 168 168 169 169 /* Private member vars */ 170 VBoxToolBar *mTbSelector;170 UIToolBar *mTbSelector; 171 171 QActionGroup *mActionGroup; 172 172 }; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsNetwork.ui
r28800 r32760 97 97 </property> 98 98 <item> 99 <widget class=" VBoxToolBar" name="mTbActions">99 <widget class="UIToolBar" name="mTbActions"> 100 100 <property name="orientation"> 101 101 <enum>Qt::Horizontal</enum> … … 158 158 <customwidgets> 159 159 <customwidget> 160 <class> VBoxToolBar</class>160 <class>UIToolBar</class> 161 161 <extends>QToolBar</extends> 162 <header> VBoxToolBar.h</header>162 <header>UIToolBar.h</header> 163 163 </customwidget> 164 164 </customwidgets> -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsHD.cpp
r32074 r32760 25 25 #include "VBoxMediaManagerDlg.h" 26 26 #include "VBoxProblemReporter.h" 27 #include "VBoxToolBar.h"28 27 #include "VBoxVMSettingsHD.h" 29 28 … … 36 35 #include <QStylePainter> 37 36 #include <QTimer> 37 #include <QCommonStyle> 38 38 39 39 /* String Tags */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsHD.ui
r28804 r32760 87 87 </item> 88 88 <item> 89 <widget class=" VBoxToolBar" native="1" name="mTbStorageBar" />89 <widget class="UIToolBar" native="1" name="mTbStorageBar" /> 90 90 </item> 91 91 </layout> … … 519 519 </customwidget> 520 520 <customwidget> 521 <class> VBoxToolBar</class>521 <class>UIToolBar</class> 522 522 <extends>QWidget</extends> 523 <header> VBoxToolBar.h</header>523 <header>UIToolBar.h</header> 524 524 <container>1</container> 525 525 </customwidget> -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsPortForwardingDlg.cpp
r32460 r32760 33 33 #include "VBoxGlobal.h" 34 34 #include "VBoxProblemReporter.h" 35 #include " VBoxToolBar.h"35 #include "UIToolBar.h" 36 36 #include "QITableView.h" 37 37 #include "QIDialogButtonBox.h" … … 458 458 459 459 /* Create toolbar: */ 460 m_pToolBar = new VBoxToolBar(this);460 m_pToolBar = new UIToolBar(this); 461 461 m_pToolBar->setIconSize(QSize(16, 16)); 462 462 m_pToolBar->setOrientation(Qt::Vertical); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsPortForwardingDlg.h
r31563 r32760 27 27 /* Forward declarations: */ 28 28 class QITableView; 29 class VBoxToolBar;29 class UIToolBar; 30 30 class QIDialogButtonBox; 31 31 class UIPortForwardingModel; … … 133 133 /* Widgets: */ 134 134 QITableView *m_pTableView; 135 VBoxToolBar *m_pToolBar;135 UIToolBar *m_pToolBar; 136 136 QIDialogButtonBox *m_pButtonBox; 137 137 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsSF.ui
r31002 r32760 88 88 </item> 89 89 <item> 90 <widget class=" VBoxToolBar" native="1" name="mTbFolders"/>90 <widget class="UIToolBar" native="1" name="mTbFolders"/> 91 91 </item> 92 92 </layout> … … 102 102 </customwidget> 103 103 <customwidget> 104 <class> VBoxToolBar</class>104 <class>UIToolBar</class> 105 105 <extends>QWidget</extends> 106 <header> VBoxToolBar.h</header>106 <header>UIToolBar.h</header> 107 107 <container>1</container> 108 108 </customwidget> -
trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsUSB.cpp
r31946 r32760 22 22 #include "UIIconPool.h" 23 23 #include "VBoxGlobal.h" 24 #include " VBoxToolBar.h"24 #include "UIToolBar.h" 25 25 #include "VBoxVMSettingsUSB.h" 26 26 #include "VBoxVMSettingsUSBFilterDetails.h" … … 83 83 84 84 /* Prepare toolbar */ 85 VBoxToolBar *toolBar = new VBoxToolBar (mWtFilterHandler);85 UIToolBar *toolBar = new UIToolBar (mWtFilterHandler); 86 86 toolBar->setUsesTextLabel (false); 87 87 toolBar->setIconSize (QSize (16, 16)); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIToolBar.cpp
r32746 r32760 2 2 * 3 3 * VBox frontends: Qt GUI ("VirtualBox"): 4 * VBoxToolBar class declaration & implementation4 * UIToolBar class declaration & implementation 5 5 */ 6 6 7 7 /* 8 * Copyright (C) 2006-20 07Oracle Corporation8 * Copyright (C) 2006-2010 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 17 17 */ 18 18 19 #ifndef ___VBoxToolBar_h___ 20 #define ___VBoxToolBar_h___ 21 22 #include <QGlobalStatic> /* for Q_WS_MAC */ 19 /* Local includes */ 20 #include "UIToolBar.h" 23 21 #ifdef Q_WS_MAC 24 22 # include "VBoxUtils.h" 25 23 #endif 26 24 27 /* Qtincludes */25 /* Global includes */ 28 26 #include <QLayout> 29 27 #include <QMainWindow> 30 #include <QToolBar>31 32 28 /* Note: This styles are available on _all_ platforms. */ 33 29 #include <QCleanlooksStyle> 34 30 #include <QWindowsStyle> 35 31 36 /** 37 * The VBoxToolBar class is a simple QToolBar reimplementation to disable 38 * its built-in context menu and add some default behavior we need. 39 */ 40 class VBoxToolBar : public QToolBar 32 UIToolBar::UIToolBar(QWidget *pParent) 33 : QToolBar(pParent) 34 , m_pMainWindow(qobject_cast <QMainWindow*>(pParent)) 41 35 { 36 setFloatable(false); 37 setMovable(false); 42 38 43 public: 39 /* Remove that ugly frame panel around the toolbar. 40 * Doing that currently for Cleanlooks & Windows styles. */ 41 if (qobject_cast <QCleanlooksStyle*>(QToolBar::style()) || 42 qobject_cast <QWindowsStyle*>(QToolBar::style())) 43 setStyleSheet("QToolBar { border: 0px none black; }"); 44 44 45 VBoxToolBar (QWidget *aParent) 46 : QToolBar (aParent) 47 , mMainWindow (qobject_cast <QMainWindow*> (aParent)) 48 { 49 setFloatable (false); 50 setMovable (false); 45 if (layout()) 46 layout()->setContentsMargins(0, 0, 0, 0);; 51 47 52 /* Remove that ugly frame panel around the toolbar. 53 * Doing that currently for Cleanlooks & Windows styles. */ 54 if (qobject_cast <QCleanlooksStyle*> (QToolBar::style()) || 55 qobject_cast <QWindowsStyle*> (QToolBar::style())) 56 setStyleSheet ("QToolBar { border: 0px none black; }"); 57 58 if (layout()) 59 layout()->setContentsMargins (0, 0, 0, 0);; 60 61 setContextMenuPolicy (Qt::NoContextMenu); 62 } 48 setContextMenuPolicy(Qt::NoContextMenu); 49 } 63 50 64 51 #ifdef Q_WS_MAC 65 voidsetMacToolbar()66 67 if (mMainWindow)68 mMainWindow->setUnifiedTitleAndToolBarOnMac(true);69 52 void UIToolBar::setMacToolbar() 53 { 54 if (m_pMainWindow) 55 m_pMainWindow->setUnifiedTitleAndToolBarOnMac(true); 56 } 70 57 71 void setShowToolBarButton (bool aShow)72 73 ::darwinSetShowsToolbarButton (this, aShow);74 58 void UIToolBar::setShowToolBarButton(bool fShow) 59 { 60 ::darwinSetShowsToolbarButton(this, fShow); 61 } 75 62 #endif /* Q_WS_MAC */ 76 63 77 voidupdateLayout()78 64 void UIToolBar::updateLayout() 65 { 79 66 #ifdef Q_WS_MAC 80 81 82 83 84 85 86 87 88 89 67 /* There is a bug in Qt Cocoa which result in showing a "more arrow" when 68 the necessary size of the toolbar is increased. Also for some languages 69 the with doesn't match if the text increase. So manually adjust the size 70 after changing the text. */ 71 QSizePolicy sp = sizePolicy(); 72 setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 73 adjustSize(); 74 setSizePolicy(sp); 75 layout()->invalidate(); 76 layout()->activate(); 90 77 #endif /* Q_WS_MAC */ 91 78 } 92 79 93 void setUsesTextLabel (bool aEnable)94 95 96 if (!aEnable)97 80 void UIToolBar::setUsesTextLabel(bool fEnable) 81 { 82 Qt::ToolButtonStyle tbs = Qt::ToolButtonTextUnderIcon; 83 if (!fEnable) 84 tbs = Qt::ToolButtonIconOnly; 98 85 99 if (mMainWindow)100 mMainWindow->setToolButtonStyle(tbs);101 102 setToolButtonStyle(tbs);103 86 if (m_pMainWindow) 87 m_pMainWindow->setToolButtonStyle(tbs); 88 else 89 setToolButtonStyle(tbs); 90 } 104 91 105 private:106 107 QMainWindow *mMainWindow;108 };109 110 #endif // !___VBoxToolBar_h___111 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIToolBar.h
r32746 r32760 2 2 * 3 3 * VBox frontends: Qt GUI ("VirtualBox"): 4 * VBoxToolBar class declaration & implementation4 * UIToolBar class declaration & implementation 5 5 */ 6 6 7 7 /* 8 * Copyright (C) 2006-20 07Oracle Corporation8 * Copyright (C) 2006-2010 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 17 17 */ 18 18 19 #ifndef ___ VBoxToolBar_h___20 #define ___ VBoxToolBar_h___19 #ifndef ___UIToolBar_h___ 20 #define ___UIToolBar_h___ 21 21 22 #include <QGlobalStatic> /* for Q_WS_MAC */ 23 #ifdef Q_WS_MAC 24 # include "VBoxUtils.h" 25 #endif 26 27 /* Qt includes */ 28 #include <QLayout> 29 #include <QMainWindow> 22 /* Global includes */ 30 23 #include <QToolBar> 31 24 32 /* Note: This styles are available on _all_ platforms. */ 33 #include <QCleanlooksStyle> 34 #include <QWindowsStyle> 25 /* Global forward declarations */ 26 class QMainWindow; 35 27 36 28 /** 37 * The VBoxToolBar class is a simple QToolBar reimplementation to disable29 * The UIToolBar class is a simple QToolBar reimplementation to disable 38 30 * its built-in context menu and add some default behavior we need. 39 31 */ 40 class VBoxToolBar : public QToolBar32 class UIToolBar : public QToolBar 41 33 { 42 43 34 public: 44 35 45 VBoxToolBar (QWidget *aParent) 46 : QToolBar (aParent) 47 , mMainWindow (qobject_cast <QMainWindow*> (aParent)) 48 { 49 setFloatable (false); 50 setMovable (false); 51 52 /* Remove that ugly frame panel around the toolbar. 53 * Doing that currently for Cleanlooks & Windows styles. */ 54 if (qobject_cast <QCleanlooksStyle*> (QToolBar::style()) || 55 qobject_cast <QWindowsStyle*> (QToolBar::style())) 56 setStyleSheet ("QToolBar { border: 0px none black; }"); 57 58 if (layout()) 59 layout()->setContentsMargins (0, 0, 0, 0);; 60 61 setContextMenuPolicy (Qt::NoContextMenu); 62 } 36 UIToolBar(QWidget *pParent); 63 37 64 38 #ifdef Q_WS_MAC 65 void setMacToolbar() 66 { 67 if (mMainWindow) 68 mMainWindow->setUnifiedTitleAndToolBarOnMac (true); 69 } 70 71 void setShowToolBarButton (bool aShow) 72 { 73 ::darwinSetShowsToolbarButton (this, aShow); 74 } 39 void setMacToolbar(); 40 void setShowToolBarButton(bool fShow); 75 41 #endif /* Q_WS_MAC */ 76 42 77 void updateLayout() 78 { 79 #ifdef Q_WS_MAC 80 /* There is a bug in Qt Cocoa which result in showing a "more arrow" when 81 the necessary size of the toolbar is increased. Also for some languages 82 the with doesn't match if the text increase. So manually adjust the size 83 after changing the text. */ 84 QSizePolicy sp = sizePolicy(); 85 setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 86 adjustSize(); 87 setSizePolicy(sp); 88 layout()->invalidate(); 89 layout()->activate(); 90 #endif /* Q_WS_MAC */ 91 } 92 93 void setUsesTextLabel (bool aEnable) 94 { 95 Qt::ToolButtonStyle tbs = Qt::ToolButtonTextUnderIcon; 96 if (!aEnable) 97 tbs = Qt::ToolButtonIconOnly; 98 99 if (mMainWindow) 100 mMainWindow->setToolButtonStyle (tbs); 101 else 102 setToolButtonStyle (tbs); 103 } 43 void updateLayout(); 44 void setUsesTextLabel(bool fEnable); 104 45 105 46 private: 106 47 107 QMainWindow *mMainWindow; 48 /* Private member vars */ 49 QMainWindow *m_pMainWindow; 108 50 }; 109 51 110 #endif // !___ VBoxToolBar_h___52 #endif // !___UIToolBar_h___ 111 53 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxMiniToolBar.cpp
r31954 r32760 38 38 /* Mini-toolbar constructor */ 39 39 VBoxMiniToolBar::VBoxMiniToolBar(QWidget *pParent, Alignment alignment, bool fActive, bool fAutoHide) 40 : VBoxToolBar(pParent)40 : UIToolBar(pParent) 41 41 , m_pAutoHideAction(0) 42 42 , m_pDisplayLabel(0) … … 238 238 } 239 239 /* Base-class event-filter: */ 240 return VBoxToolBar::eventFilter(pObject, pEvent);240 return UIToolBar::eventFilter(pObject, pEvent); 241 241 } 242 242 … … 251 251 } 252 252 /* Base-class mouse-move event processing: */ 253 VBoxToolBar::mouseMoveEvent(pEvent);253 UIToolBar::mouseMoveEvent(pEvent); 254 254 } 255 255 … … 346 346 } 347 347 /* Base-class show event processing: */ 348 VBoxToolBar::showEvent(pEvent);348 UIToolBar::showEvent(pEvent); 349 349 } 350 350 … … 358 358 painter.end(); 359 359 /* Base-class paint event processing: */ 360 VBoxToolBar::paintEvent(pEvent);360 UIToolBar::paintEvent(pEvent); 361 361 } 362 362 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxMiniToolBar.h
r31866 r32760 24 24 25 25 /* Local includes */ 26 #include " VBoxToolBar.h"26 #include "UIToolBar.h" 27 27 28 28 /* Global forwards */ … … 34 34 * It supports auto hiding and animated sliding up/down. 35 35 */ 36 class VBoxMiniToolBar : public VBoxToolBar36 class VBoxMiniToolBar : public UIToolBar 37 37 { 38 38 Q_OBJECT;
Note:
See TracChangeset
for help on using the changeset viewer.