Changeset 30356 in vbox
- Timestamp:
- Jun 22, 2010 8:42:22 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 62937
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 10 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r30258 r30356 306 306 src/wizards/exportappliance/UIExportApplianceWzd.h \ 307 307 src/wizards/importappliance/UIImportApplianceWzd.h \ 308 src/widgets/VBoxApplianceEditorWgt.h \309 src/widgets/VBoxBootTable.h \310 308 src/widgets/UIDownloader.h \ 311 309 src/widgets/UIDownloaderAdditions.h \ 312 310 src/widgets/UIDownloaderUserManual.h \ 311 src/widgets/UISpacerWidgets.h \ 312 src/widgets/UISpecialControls.h \ 313 src/widgets/VBoxApplianceEditorWgt.h \ 314 src/widgets/VBoxBootTable.h \ 313 315 src/widgets/VBoxExportApplianceWgt.h \ 314 316 src/widgets/VBoxFilePathSelectorWidget.h \ … … 320 322 src/widgets/VBoxOSTypeSelectorWidget.h \ 321 323 src/widgets/VBoxProgressDialog.h \ 322 src/widgets/VBoxSpecialControls.h \323 324 src/widgets/VBoxWarningPane.h \ 324 src/widgets/UISpacerWidgets.h \325 325 src/runtime/UISession.h \ 326 326 src/runtime/UIActionsPool.h \ … … 439 439 src/wizards/exportappliance/UIExportApplianceWzd.cpp \ 440 440 src/wizards/importappliance/UIImportApplianceWzd.cpp \ 441 src/widgets/VBoxApplianceEditorWgt.cpp \442 src/widgets/VBoxBootTable.cpp \443 441 src/widgets/UIDownloader.cpp \ 444 442 src/widgets/UIDownloaderAdditions.cpp \ 445 443 src/widgets/UIDownloaderUserManual.cpp \ 444 src/widgets/UISpecialControls.cpp \ 445 src/widgets/VBoxApplianceEditorWgt.cpp \ 446 src/widgets/VBoxBootTable.cpp \ 446 447 src/widgets/VBoxExportApplianceWgt.cpp \ 447 448 src/widgets/VBoxFilePathSelectorWidget.cpp \ … … 454 455 src/widgets/VBoxOSTypeSelectorWidget.cpp \ 455 456 src/widgets/VBoxProgressDialog.cpp \ 456 src/widgets/VBoxSpecialControls.cpp \457 457 src/widgets/VBoxWarningPane.cpp \ 458 458 src/runtime/UISession.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMLogViewer.cpp
r30196 r30356 23 23 #include "QITabWidget.h" 24 24 #include "UIIconPool.h" 25 #include "UISpecialControls.h" 25 26 #include "VBoxGlobal.h" 26 27 #include "VBoxProblemReporter.h" 27 #include "VBoxSpecialControls.h"28 28 #include "VBoxUtils.h" 29 29 #include "VBoxVMLogViewer.h" … … 348 348 , mWarningSpacer (0), mWarningIcon (0), mWarningString (0) 349 349 { 350 mButtonClose = new VBoxMiniCancelButton (this);350 mButtonClose = new UIMiniCancelButton (this); 351 351 connect (mButtonClose, SIGNAL (clicked()), this, SLOT (hide())); 352 352 353 353 mSearchName = new QLabel (this); 354 mSearchString = new VBoxSearchField (this);354 mSearchString = new UISearchField (this); 355 355 mSearchString->setSizePolicy (QSizePolicy::Preferred, 356 356 QSizePolicy::Fixed); … … 358 358 this, SLOT (findCurrent (const QString &))); 359 359 360 mButtonsNextPrev = new VBoxSegmentedButton(2, this);360 mButtonsNextPrev = new UIRoundRectSegmentedButton(2, this); 361 361 mButtonsNextPrev->setEnabled (0, false); 362 362 mButtonsNextPrev->setEnabled (1, false); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMLogViewer.h
r29972 r30356 20 20 #define __VBoxVMLogViewer_h__ 21 21 22 /* Local includes */ 22 23 #include "VBoxVMLogViewer.gen.h" 23 24 #include "QIMainDialog.h" … … 25 26 #include "QIWithRetranslateUI.h" 26 27 28 /* Local forward declarations */ 29 class QITabWidget; 30 class QIToolButton; 31 class UIMiniCancelButton; 32 class UIRoundRectSegmentedButton; 33 class UISearchField; 27 34 class VBoxLogSearchPanel; 28 class QITabWidget; 35 36 /* Global forward declarations */ 37 class QCheckBox; 38 class QLabel; 29 39 class QTextEdit; 30 class VBoxSearchField;31 class QLabel;32 class QIToolButton;33 class VBoxMiniCancelButton;34 class VBoxSegmentedButton;35 class QCheckBox;36 40 37 41 class VBoxVMLogViewer : public QIWithRetranslateUI2<QIMainDialog>, … … 118 122 void toggleWarning (bool aHide); 119 123 120 VBoxVMLogViewer *mViewer;121 VBoxMiniCancelButton*mButtonClose;122 QLabel *mSearchName;123 VBoxSearchField*mSearchString;124 VBoxSegmentedButton*mButtonsNextPrev;125 QCheckBox *mCaseSensitive;126 QSpacerItem *mWarningSpacer;127 QLabel *mWarningIcon;128 QLabel *mWarningString;124 VBoxVMLogViewer *mViewer; 125 UIMiniCancelButton *mButtonClose; 126 QLabel *mSearchName; 127 UISearchField *mSearchString; 128 UIRoundRectSegmentedButton *mButtonsNextPrev; 129 QCheckBox *mCaseSensitive; 130 QSpacerItem *mWarningSpacer; 131 QLabel *mWarningIcon; 132 QLabel *mWarningString; 129 133 }; 130 134 -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIDialogButtonBox.cpp
r28800 r30356 19 19 20 20 #include "QIDialogButtonBox.h" 21 #include " VBoxSpecialControls.h"21 #include "UISpecialControls.h" 22 22 23 23 #include <iprt/assert.h> … … 111 111 /* Use our very own help button if the user requested for one. */ 112 112 if (!mHelpButton) 113 mHelpButton = new VBoxHelpButton;113 mHelpButton = new UIHelpButton; 114 114 mHelpButton->initFrom (btn); 115 115 removeButton (btn); -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIDialogButtonBox.h
r28800 r30356 28 28 class QBoxLayout; 29 29 30 class VBoxHelpButton;30 class UIHelpButton; 31 31 32 32 class QIDialogButtonBox: public QIWithRetranslateUI<QDialogButtonBox> … … 56 56 private: 57 57 58 QPointer< VBoxHelpButton> mHelpButton;58 QPointer<UIHelpButton> mHelpButton; 59 59 }; 60 60 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsInput.ui
r28800 r30356 124 124 <class>UIResetButton</class> 125 125 <extends>QAbstractButton</extends> 126 <header> VBoxSpecialControls.h</header>126 <header>UISpecialControls.h</header> 127 127 </customwidget> 128 128 </customwidgets> -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIDownloader.cpp
r28800 r30356 23 23 #include "VBoxGlobal.h" 24 24 #include "VBoxProblemReporter.h" 25 #include " VBoxSpecialControls.h"25 #include "UISpecialControls.h" 26 26 27 27 /* Global includes */ … … 32 32 : QWidget(pParent) 33 33 , m_pProgressBar(new QProgressBar(this)) 34 , m_pCancelButton(new VBoxMiniCancelButton(this))34 , m_pCancelButton(new UIMiniCancelButton(this)) 35 35 { 36 36 /* Progress Bar setup */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIDownloader.h
r28800 r30356 26 26 /* Local forward declarations */ 27 27 class QIHttp; 28 class VBoxMiniCancelButton;28 class UIMiniCancelButton; 29 29 30 30 /* Global forward declarations */ … … 64 64 /* Private member vars */ 65 65 QProgressBar *m_pProgressBar; 66 VBoxMiniCancelButton *m_pCancelButton;66 UIMiniCancelButton *m_pCancelButton; 67 67 68 68 QString m_strSource; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISpecialControls.cpp
r30352 r30356 7 7 8 8 /* 9 * Copyright (C) 2009 Oracle Corporation9 * Copyright (C) 2009-2010 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 /* VBox includes */ 21 21 #include "UIIconPool.h" 22 #include " VBoxSpecialControls.h"22 #include "UISpecialControls.h" 23 23 24 24 /* Global includes */ … … 32 32 * 33 33 ********************************************************************************/ 34 VBoxMiniCancelButton::VBoxMiniCancelButton (QWidget *aParent /* = 0 */)35 : QAbstractButton (aParent)36 { 37 setShortcut (QKeySequence(Qt::Key_Escape));38 m Button = new UICocoaButton(UICocoaButton::CancelButton, this);39 connect (mButton, SIGNAL(clicked()),40 this, SIGNAL(clicked()));41 setFixedSize (mButton->size());42 } 43 44 void VBoxMiniCancelButton::resizeEvent(QResizeEvent * /* pEvent */)45 { 46 m Button->resize(size());34 UIMiniCancelButton::UIMiniCancelButton(QWidget *pParent /* = 0 */) 35 : QAbstractButton(pParent) 36 { 37 setShortcut(QKeySequence(Qt::Key_Escape)); 38 m_pButton = new UICocoaButton(UICocoaButton::CancelButton, this); 39 connect(m_pButton, SIGNAL(clicked()), 40 this, SIGNAL(clicked())); 41 setFixedSize(m_pButton->size()); 42 } 43 44 void UIMiniCancelButton::resizeEvent(QResizeEvent * /* pEvent */) 45 { 46 m_pButton->resize(size()); 47 47 } 48 48 … … 71 71 * 72 72 ********************************************************************************/ 73 VBoxHelpButton::VBoxHelpButton (QWidget *aParent /* = 0 */)74 : QPushButton (aParent)75 { 76 setShortcut (QKeySequence(QKeySequence::HelpContents));77 m Button = new UICocoaButton(UICocoaButton::HelpButton, this);78 connect (mButton, SIGNAL(clicked()),79 this, SIGNAL(clicked()));80 setFixedSize (mButton->size());73 UIHelpButton::UIHelpButton(QWidget *pParent /* = 0 */) 74 : QPushButton(pParent) 75 { 76 setShortcut(QKeySequence(QKeySequence::HelpContents)); 77 m_pButton = new UICocoaButton(UICocoaButton::HelpButton, this); 78 connect(m_pButton, SIGNAL(clicked()), 79 this, SIGNAL(clicked())); 80 setFixedSize(m_pButton->size()); 81 81 } 82 82 … … 86 86 * 87 87 ********************************************************************************/ 88 VBoxSegmentedButton::VBoxSegmentedButton (int aCount, QWidget *aParent /* = 0 */) 89 : UICocoaSegmentedButton (aCount, UICocoaSegmentedButton::RoundRectSegment, aParent) 90 { 91 } 88 UIRoundRectSegmentedButton::UIRoundRectSegmentedButton(int cCount, QWidget *pParent /* = 0 */) 89 : UICocoaSegmentedButton(cCount, UICocoaSegmentedButton::RoundRectSegment, pParent) 90 { 91 } 92 93 UITexturedSegmentedButton::UITexturedSegmentedButton(int cCount, QWidget *pParent /* = 0 */) 94 : UICocoaSegmentedButton(cCount, UICocoaSegmentedButton::TexturedRoundedSegment, pParent) 95 { 96 } 97 92 98 /******************************************************************************** 93 99 * … … 95 101 * 96 102 ********************************************************************************/ 97 VBoxSearchField::VBoxSearchField (QWidget *aParent /* = 0 */)98 : UICocoaSearchField (aParent)103 UISearchField::UISearchField(QWidget *pParent /* = 0 */) 104 : UICocoaSearchField(pParent) 99 105 { 100 106 } … … 113 119 * 114 120 ********************************************************************************/ 115 VBoxMiniCancelButton::VBoxMiniCancelButton (QWidget *aParent /* = 0 */)116 : QIWithRetranslateUI<QIToolButton> (aParent)117 { 118 setAutoRaise 119 setFocusPolicy 120 setShortcut (QKeySequence(Qt::Key_Escape));121 UIMiniCancelButton::UIMiniCancelButton(QWidget *pParent /* = 0 */) 122 : QIWithRetranslateUI<QIToolButton>(pParent) 123 { 124 setAutoRaise(true); 125 setFocusPolicy(Qt::TabFocus); 126 setShortcut(QKeySequence(Qt::Key_Escape)); 121 127 setIcon(UIIconPool::defaultIcon(UIIconPool::DialogCancelIcon)); 122 128 } 123 129 124 void VBoxMiniCancelButton::removeBorder()130 void UIMiniCancelButton::removeBorder() 125 131 { 126 132 setStyleSheet("QToolButton { border: 0px }"); … … 138 144 static const int PushButtonBottomOffset = 4; 139 145 140 VBoxHelpButton::VBoxHelpButton (QWidget *aParent /* = 0 */)141 : QIWithRetranslateUI<QPushButton> (aParent)146 UIHelpButton::UIHelpButton(QWidget *pParent /* = 0 */) 147 : QIWithRetranslateUI<QPushButton>(pParent) 142 148 { 143 149 #ifdef Q_WS_MAC 144 m ButtonPressed = false;145 m NormalPixmap = new QPixmap(":/help_button_normal_mac_22px.png");146 m PressedPixmap = new QPixmap(":/help_button_pressed_mac_22px.png");147 m Size = mNormalPixmap->size();148 m Mask = new QImage (mNormalPixmap->mask().toImage());149 m BRect = QRect(PushButtonLeftOffset,150 m_pButtonPressed = false; 151 m_pNormalPixmap = new QPixmap(":/help_button_normal_mac_22px.png"); 152 m_pPressedPixmap = new QPixmap(":/help_button_pressed_mac_22px.png"); 153 m_size = m_pNormalPixmap->size(); 154 m_pMask = new QImage(m_pNormalPixmap->mask().toImage()); 155 m_BRect = QRect(PushButtonLeftOffset, 150 156 PushButtonTopOffset, 151 m Size.width(),152 m Size.height());157 m_size.width(), 158 m_size.height()); 153 159 #endif /* Q_WS_MAC */ 154 160 /* Applying language settings */ … … 156 162 } 157 163 158 void VBoxHelpButton::initFrom (QPushButton *aOther)159 { 160 setIcon (aOther->icon());161 setText (aOther->text());162 setShortcut (aOther->shortcut());163 setFlat (aOther->isFlat());164 setAutoDefault (aOther->autoDefault());165 setDefault (aOther->isDefault());164 void UIHelpButton::initFrom(QPushButton *pOther) 165 { 166 setIcon(pOther->icon()); 167 setText(pOther->text()); 168 setShortcut(pOther->shortcut()); 169 setFlat(pOther->isFlat()); 170 setAutoDefault(pOther->autoDefault()); 171 setDefault(pOther->isDefault()); 166 172 /* Applying language settings */ 167 173 retranslateUi(); 168 174 } 169 175 170 void VBoxHelpButton::retranslateUi()171 { 172 QPushButton::setText (tr("&Help"));176 void UIHelpButton::retranslateUi() 177 { 178 QPushButton::setText(tr("&Help")); 173 179 if (QPushButton::shortcut().isEmpty()) 174 QPushButton::setShortcut 180 QPushButton::setShortcut(QKeySequence::HelpContents); 175 181 } 176 182 177 183 #ifdef Q_WS_MAC 178 VBoxHelpButton::~VBoxHelpButton()179 { 180 delete m NormalPixmap;181 delete m PressedPixmap;182 delete m Mask;183 } 184 185 QSize VBoxHelpButton::sizeHint() const186 { 187 return QSize (mSize.width() + PushButtonLeftOffset + PushButtonRightOffset,188 mSize.height() + PushButtonTopOffset + PushButtonBottomOffset);189 } 190 191 void VBoxHelpButton::paintEvent (QPaintEvent * /* aEvent */)192 { 193 QPainter painter 194 painter.drawPixmap (PushButtonLeftOffset, PushButtonTopOffset, mButtonPressed ? *mPressedPixmap: *mNormalPixmap);195 } 196 197 bool VBoxHelpButton::hitButton(const QPoint &pos) const198 { 199 if (m BRect.contains(pos))200 return mMask->pixel(pos.x() - PushButtonLeftOffset,184 UIHelpButton::~UIHelpButton() 185 { 186 delete m_pNormalPixmap; 187 delete m_pPressedPixmap; 188 delete m_pMask; 189 } 190 191 QSize UIHelpButton::sizeHint() const 192 { 193 return QSize(m_size.width() + PushButtonLeftOffset + PushButtonRightOffset, 194 m_size.height() + PushButtonTopOffset + PushButtonBottomOffset); 195 } 196 197 void UIHelpButton::paintEvent(QPaintEvent * /* pEvent */) 198 { 199 QPainter painter(this); 200 painter.drawPixmap(PushButtonLeftOffset, PushButtonTopOffset, m_pButtonPressed ? *m_pPressedPixmap: *m_pNormalPixmap); 201 } 202 203 bool UIHelpButton::hitButton(const QPoint &pos) const 204 { 205 if (m_BRect.contains(pos)) 206 return m_pMask->pixel(pos.x() - PushButtonLeftOffset, 201 207 pos.y() - PushButtonTopOffset) == 0xff000000; 202 208 else … … 204 210 } 205 211 206 void VBoxHelpButton::mousePressEvent (QMouseEvent *aEvent)207 { 208 if (hitButton (aEvent->pos()))209 m ButtonPressed = true;210 QPushButton::mousePressEvent (aEvent);212 void UIHelpButton::mousePressEvent(QMouseEvent *pEvent) 213 { 214 if (hitButton(pEvent->pos())) 215 m_pButtonPressed = true; 216 QPushButton::mousePressEvent(pEvent); 211 217 update(); 212 218 } 213 219 214 void VBoxHelpButton::mouseReleaseEvent (QMouseEvent *aEvent)215 { 216 QPushButton::mouseReleaseEvent (aEvent);217 m ButtonPressed = false;220 void UIHelpButton::mouseReleaseEvent(QMouseEvent *pEvent) 221 { 222 QPushButton::mouseReleaseEvent(pEvent); 223 m_pButtonPressed = false; 218 224 update(); 219 225 } 220 226 221 void VBoxHelpButton::leaveEvent (QEvent * aEvent)222 { 223 QPushButton::leaveEvent (aEvent);224 m ButtonPressed = false;227 void UIHelpButton::leaveEvent(QEvent * pEvent) 228 { 229 QPushButton::leaveEvent(pEvent); 230 m_pButtonPressed = false; 225 231 update(); 226 232 } … … 232 238 * 233 239 ********************************************************************************/ 234 VBoxSegmentedButton::VBoxSegmentedButton (int aCount, QWidget *aParent /* = 0 */)235 : QWidget (aParent)236 { 237 m SignalMapper = new QSignalMapper(this);238 239 QHBoxLayout *layout = new QHBoxLayout 240 UIRoundRectSegmentedButton::UIRoundRectSegmentedButton(int aCount, QWidget *pParent /* = 0 */) 241 : QWidget(pParent) 242 { 243 m_pSignalMapper = new QSignalMapper(this); 244 245 QHBoxLayout *layout = new QHBoxLayout(this); 240 246 for (int i=0; i < aCount; ++i) 241 247 { 242 QIToolButton *button = new QIToolButton 243 button->setAutoRaise 244 button->setFocusPolicy 245 button->setToolButtonStyle 246 m Buttons.append(button);247 layout->addWidget 248 connect 249 mSignalMapper, SLOT(map()));250 m SignalMapper->setMapping(button, i);248 QIToolButton *button = new QIToolButton(this); 249 button->setAutoRaise(true); 250 button->setFocusPolicy(Qt::TabFocus); 251 button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); 252 m_pButtons.append(button); 253 layout->addWidget(button); 254 connect(button, SIGNAL(clicked()), 255 m_pSignalMapper, SLOT(map())); 256 m_pSignalMapper->setMapping(button, i); 251 257 } 252 connect (mSignalMapper, SIGNAL(mapped(int)),253 254 255 } 256 257 VBoxSegmentedButton::~VBoxSegmentedButton()258 { 259 delete m SignalMapper;260 qDeleteAll (mButtons);261 } 262 263 void VBoxSegmentedButton::setTitle (int aSegment, const QString &aTitle)264 { 265 m Buttons.at (aSegment)->setText(aTitle);266 } 267 268 void VBoxSegmentedButton::setToolTip (int aSegment, const QString &aTip)269 { 270 m Buttons.at (aSegment)->setToolTip (aTip);271 } 272 273 void VBoxSegmentedButton::setIcon (int aSegment, const QIcon &aIcon)274 { 275 m Buttons.at (aSegment)->setIcon (aIcon);276 } 277 278 void VBoxSegmentedButton::setEnabled (int aSegment, bool fEnabled)279 { 280 m Buttons.at (aSegment)->setEnabled(fEnabled);281 } 282 283 void VBoxSegmentedButton::animateClick (int aSegment)284 { 285 m Buttons.at (aSegment)->animateClick();258 connect(m_pSignalMapper, SIGNAL(mapped(int)), 259 this, SIGNAL(clicked(int))); 260 261 } 262 263 UIRoundRectSegmentedButton::~UIRoundRectSegmentedButton() 264 { 265 delete m_pSignalMapper; 266 qDeleteAll(m_pButtons); 267 } 268 269 void UIRoundRectSegmentedButton::setTitle(int iSegment, const QString &aTitle) 270 { 271 m_pButtons.at(iSegment)->setText(aTitle); 272 } 273 274 void UIRoundRectSegmentedButton::setToolTip(int iSegment, const QString &strTip) 275 { 276 m_pButtons.at(iSegment)->setToolTip(strTip); 277 } 278 279 void UIRoundRectSegmentedButton::setIcon(int iSegment, const QIcon &icon) 280 { 281 m_pButtons.at(iSegment)->setIcon(icon); 282 } 283 284 void UIRoundRectSegmentedButton::setEnabled(int iSegment, bool fEnabled) 285 { 286 m_pButtons.at(iSegment)->setEnabled(fEnabled); 287 } 288 289 void UIRoundRectSegmentedButton::animateClick(int iSegment) 290 { 291 m_pButtons.at(iSegment)->animateClick(); 286 292 } 287 293 … … 291 297 * 292 298 ********************************************************************************/ 293 VBoxSearchField::VBoxSearchField (QWidget *aParent /* = 0 */)294 : QLineEdit (aParent)295 { 296 m BaseBrush = palette().base();297 } 298 299 void VBoxSearchField::markError()299 UISearchField::UISearchField(QWidget *pParent /* = 0 */) 300 : QLineEdit(pParent) 301 { 302 m_baseBrush = palette().base(); 303 } 304 305 void UISearchField::markError() 300 306 { 301 307 QPalette pal = palette(); 302 QColor c 303 c.setAlphaF 304 pal.setBrush 305 setPalette 306 } 307 308 void VBoxSearchField::unmarkError()308 QColor c(Qt::red); 309 c.setAlphaF(0.3); 310 pal.setBrush(QPalette::Base, c); 311 setPalette(pal); 312 } 313 314 void UISearchField::unmarkError() 309 315 { 310 316 QPalette pal = palette(); 311 pal.setBrush (QPalette::Base, mBaseBrush);312 setPalette 317 pal.setBrush(QPalette::Base, m_baseBrush); 318 setPalette(pal); 313 319 } 314 320 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UISpecialControls.h
r30352 r30356 6 6 7 7 /* 8 * Copyright (C) 2009 Oracle Corporation8 * Copyright (C) 2009-2010 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 36 36 * 37 37 ********************************************************************************/ 38 class VBoxMiniCancelButton: public QAbstractButton 39 { 40 Q_OBJECT; 41 42 public: 43 VBoxMiniCancelButton (QWidget *aParent = 0); 44 45 void setText (const QString &aText) { mButton->setText (aText); } 46 void setToolTip (const QString &aTip) { mButton->setToolTip (aTip); } 47 void removeBorder() {} 48 49 protected: 50 void paintEvent (QPaintEvent * /* aEvent */) {} 51 void resizeEvent(QResizeEvent *pEvent); 52 53 private: 54 UICocoaButton *mButton; 55 }; 56 57 /******************************************************************************** 58 * 59 * A reset button in the native Cocoa version. 60 * 61 ********************************************************************************/ 62 class UIResetButton: public QAbstractButton 63 { 64 Q_OBJECT; 65 66 public: 67 UIResetButton(QWidget *pParent = 0); 38 class UIMiniCancelButton: public QAbstractButton 39 { 40 Q_OBJECT; 41 42 public: 43 UIMiniCancelButton(QWidget *pParent = 0); 68 44 69 45 void setText(const QString &strText) { m_pButton->setText(strText); } … … 81 57 /******************************************************************************** 82 58 * 59 * A reset button in the native Cocoa version. 60 * 61 ********************************************************************************/ 62 class UIResetButton: public QAbstractButton 63 { 64 Q_OBJECT; 65 66 public: 67 UIResetButton(QWidget *pParent = 0); 68 69 void setText(const QString &strText) { m_pButton->setText(strText); } 70 void setToolTip(const QString &strTip) { m_pButton->setToolTip(strTip); } 71 void removeBorder() {} 72 73 protected: 74 void paintEvent(QPaintEvent * /* pEvent */) {} 75 void resizeEvent(QResizeEvent *pEvent); 76 77 private: 78 UICocoaButton *m_pButton; 79 }; 80 81 /******************************************************************************** 82 * 83 83 * A help button in the native Cocoa version. 84 84 * 85 85 ********************************************************************************/ 86 class VBoxHelpButton: public QPushButton87 { 88 Q_OBJECT; 89 90 public: 91 VBoxHelpButton (QWidget *aParent = 0);92 93 void setToolTip (const QString &aTip) { mButton->setToolTip (aTip); }94 95 void initFrom (QPushButton * /* aOther */) {}96 97 protected: 98 void paintEvent (QPaintEvent * /* aEvent */) {}99 100 private: 101 UICocoaButton *m Button;86 class UIHelpButton: public QPushButton 87 { 88 Q_OBJECT; 89 90 public: 91 UIHelpButton(QWidget *pParent = 0); 92 93 void setToolTip(const QString &strTip) { m_pButton->setToolTip(strTip); } 94 95 void initFrom(QPushButton * /* pOther */) {} 96 97 protected: 98 void paintEvent(QPaintEvent * /* pEvent */) {} 99 100 private: 101 UICocoaButton *m_pButton; 102 102 }; 103 103 … … 107 107 * 108 108 ********************************************************************************/ 109 class VBoxSegmentedButton: public UICocoaSegmentedButton 110 { 111 Q_OBJECT; 112 113 public: 114 VBoxSegmentedButton (int aCount, QWidget *aParent = 0); 109 class UIRoundRectSegmentedButton: public UICocoaSegmentedButton 110 { 111 Q_OBJECT; 112 113 public: 114 UIRoundRectSegmentedButton(int cCount, QWidget *pParent = 0); 115 }; 116 117 class UITexturedSegmentedButton: public UICocoaSegmentedButton 118 { 119 Q_OBJECT; 120 121 public: 122 UITexturedSegmentedButton(int cCount, QWidget *pParent = 0); 115 123 }; 116 124 … … 120 128 * 121 129 ********************************************************************************/ 122 class VBoxSearchField: public UICocoaSearchField123 { 124 Q_OBJECT; 125 126 public: 127 VBoxSearchField (QWidget *aParent = 0);130 class UISearchField: public UICocoaSearchField 131 { 132 Q_OBJECT; 133 134 public: 135 UISearchField(QWidget *pParent = 0); 128 136 }; 129 137 … … 144 152 * 145 153 ********************************************************************************/ 146 class VBoxMiniCancelButton: public QIWithRetranslateUI<QIToolButton>147 { 148 Q_OBJECT; 149 150 public: 151 VBoxMiniCancelButton (QWidget *aParent = 0);154 class UIMiniCancelButton: public QIWithRetranslateUI<QIToolButton> 155 { 156 Q_OBJECT; 157 158 public: 159 UIMiniCancelButton(QWidget *pParent = 0); 152 160 void removeBorder(); 153 161 … … 161 169 * 162 170 ********************************************************************************/ 163 class UIResetButton: public VBoxMiniCancelButton171 class UIResetButton: public UIMiniCancelButton 164 172 { 165 173 Q_OBJECT; … … 167 175 public: 168 176 UIResetButton(QWidget *pParent = 0) 169 : VBoxMiniCancelButton(pParent) {}177 : UIMiniCancelButton(pParent) {} 170 178 }; 171 179 … … 175 183 * 176 184 ********************************************************************************/ 177 class VBoxHelpButton: public QIWithRetranslateUI<QPushButton>178 { 179 Q_OBJECT; 180 181 public: 182 VBoxHelpButton (QWidget *aParent = 0);185 class UIHelpButton: public QIWithRetranslateUI<QPushButton> 186 { 187 Q_OBJECT; 188 189 public: 190 UIHelpButton(QWidget *pParent = 0); 183 191 #ifdef Q_WS_MAC 184 ~ VBoxHelpButton();192 ~UIHelpButton(); 185 193 QSize sizeHint() const; 186 194 #endif /* Q_WS_MAC */ 187 195 188 void initFrom (QPushButton *aOther);196 void initFrom(QPushButton *pOther); 189 197 190 198 protected: … … 192 200 193 201 #ifdef Q_WS_MAC 194 void paintEvent (QPaintEvent *aEvent);195 196 bool hitButton 197 198 void mousePressEvent (QMouseEvent *aEvent);199 void mouseReleaseEvent (QMouseEvent *aEvent);200 void leaveEvent (QEvent *aEvent);202 void paintEvent(QPaintEvent *pEvent); 203 204 bool hitButton(const QPoint &pos) const; 205 206 void mousePressEvent(QMouseEvent *pEvent); 207 void mouseReleaseEvent(QMouseEvent *pEvent); 208 void leaveEvent(QEvent *pEvent); 201 209 202 210 private: 203 211 /* Private member vars */ 204 bool m ButtonPressed;205 206 QSize m Size;207 QPixmap *m NormalPixmap;208 QPixmap *m PressedPixmap;209 QImage *m Mask;210 QRect m BRect;212 bool m_pButtonPressed; 213 214 QSize m_size; 215 QPixmap *m_pNormalPixmap; 216 QPixmap *m_pPressedPixmap; 217 QImage *m_pMask; 218 QRect m_BRect; 211 219 #endif /* Q_WS_MAC */ 212 220 }; … … 217 225 * 218 226 ********************************************************************************/ 219 class VBoxSegmentedButton: public QWidget220 { 221 Q_OBJECT; 222 223 public: 224 VBoxSegmentedButton (int aCount, QWidget *aParent = 0);225 ~ VBoxSegmentedButton();226 227 void setTitle (int aSegment, const QString &aTitle);228 void setToolTip (int aSegment, const QString &aTip);229 void setIcon (int aSegment, const QIcon &aIcon);230 void setEnabled (int aSegment, bool fEnabled);231 232 void animateClick (int aSegment);227 class UIRoundRectSegmentedButton: public QWidget 228 { 229 Q_OBJECT; 230 231 public: 232 UIRoundRectSegmentedButton(int aCount, QWidget *pParent = 0); 233 ~UIRoundRectSegmentedButton(); 234 235 void setTitle(int iSegment, const QString &aTitle); 236 void setToolTip(int iSegment, const QString &strTip); 237 void setIcon(int iSegment, const QIcon &icon); 238 void setEnabled(int iSegment, bool fEnabled); 239 240 void animateClick(int iSegment); 233 241 234 242 signals: 235 void clicked (int aSegment);243 void clicked(int iSegment); 236 244 237 245 private: 238 246 /* Private member vars */ 239 QList<QIToolButton*> mButtons; 240 QSignalMapper *mSignalMapper; 247 QList<QIToolButton*> m_pButtons; 248 QSignalMapper *m_pSignalMapper; 249 }; 250 251 class UITexturedSegmentedButton: public UIRoundRectSegmentedButton 252 { 253 Q_OBJECT; 254 255 public: 256 UITexturedSegmentedButton(int cCount, QWidget *pParent = 0) 257 : UIRoundRectSegmentedButton(cCount, pParent) {} 241 258 }; 242 259 … … 246 263 * 247 264 ********************************************************************************/ 248 class VBoxSearchField: public QLineEdit249 { 250 Q_OBJECT; 251 252 public: 253 VBoxSearchField (QWidget *aParent = 0);265 class UISearchField: public QLineEdit 266 { 267 Q_OBJECT; 268 269 public: 270 UISearchField(QWidget *pParent = 0); 254 271 255 272 void markError(); … … 258 275 private: 259 276 /* Private member vars */ 260 QBrush m BaseBrush;277 QBrush m_baseBrush; 261 278 }; 262 279 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxProgressDialog.cpp
r28800 r30356 24 24 #include "VBoxGlobal.h" 25 25 #include "VBoxProgressDialog.h" 26 #include " VBoxSpecialControls.h"26 #include "UISpecialControls.h" 27 27 #ifdef Q_WS_MAC 28 28 # include "VBoxUtils-darwin.h" … … 90 90 if (mCancelEnabled) 91 91 { 92 mCancelBtn = new VBoxMiniCancelButton (this);92 mCancelBtn = new UIMiniCancelButton (this); 93 93 mCancelBtn->setFocusPolicy (Qt::ClickFocus); 94 94 pLayout2->addWidget (mCancelBtn, 0, Qt::AlignVCenter); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxProgressDialog.h
r28800 r30356 26 26 class CProgress; 27 27 class QILabel; 28 class VBoxMiniCancelButton;28 class UIMiniCancelButton; 29 29 30 30 /* Qt forward declarations */ … … 74 74 QString mCancelText; 75 75 QProgressBar *mProgressBar; 76 VBoxMiniCancelButton *mCancelBtn;76 UIMiniCancelButton *mCancelBtn; 77 77 bool mCancelEnabled; 78 78 const ulong mOpCount;
Note:
See TracChangeset
for help on using the changeset viewer.