Changeset 10112 in vbox for trunk/src/VBox/Frontends/VirtualBox4
- Timestamp:
- Jul 2, 2008 3:00:14 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 32622
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleView.h
r9072 r10112 167 167 wchar_t *aUniKey = NULL); 168 168 bool mouseEvent (int aType, const QPoint &aPos, const QPoint &aGlobalPos, 169 Qt::ButtonState aButton,170 169 Qt::MouseButtons aButtons, Qt::KeyboardModifiers aModifiers, 171 170 int aWheelDelta, Qt::Orientation aWheelDir); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h
r9729 r10112 63 63 VBoxConsoleWnd (VBoxConsoleWnd **aSelf, 64 64 QWidget* aParent = 0, 65 Qt::W Flags aFlags = Qt::WType_TopLevel);65 Qt::WindowFlags aFlags = Qt::Window); 66 66 virtual ~VBoxConsoleWnd(); 67 67 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r9287 r10112 536 536 static QString sizeRegexp(); 537 537 538 static Q_UINT64 parseSize (const QString &);539 static QString formatSize ( Q_UINT64, int aMode = 0);538 static quint64 parseSize (const QString &); 539 static QString formatSize (quint64, int aMode = 0); 540 540 541 541 static QString highlight (const QString &aStr, bool aToolTip = false); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxNewHDWzd.h
r9729 r10112 41 41 CHardDisk hardDisk() { return mChd; } 42 42 void setRecommendedFileName (const QString &aName); 43 void setRecommendedSize ( Q_UINT64 aSize);43 void setRecommendedSize (quint64 aSize); 44 44 45 45 protected: … … 61 61 62 62 QString imageFileName(); 63 Q_UINT64 imageSize();63 quint64 imageSize(); 64 64 bool isDynamicImage(); 65 void updateSizeToolTip ( Q_UINT64 aSizeB);65 void updateSizeToolTip (quint64 aSizeB); 66 66 bool createHardDisk(); 67 67 … … 69 69 CHardDisk mChd; 70 70 int mSliderScale; 71 Q_UINT64mMaxVDISize;72 Q_UINT64mCurrentSize;71 quint64 mMaxVDISize; 72 quint64 mCurrentSize; 73 73 }; 74 74 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h
r9729 r10112 53 53 VBoxSelectorWnd (VBoxSelectorWnd **aSelf, 54 54 QWidget* aParent = 0, 55 Qt::W Flags aFlags = Qt::WType_TopLevel);55 Qt::WindowFlags aFlags = Qt::Window); 56 56 virtual ~VBoxSelectorWnd(); 57 57 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsUtils.h
r9951 r10112 85 85 void keyPressEvent (QKeyEvent *aEvent) 86 86 { 87 if (aEvent->QInputEvent::modifiers () == Qt::Control Button)87 if (aEvent->QInputEvent::modifiers () == Qt::ControlModifier) 88 88 { 89 89 switch (aEvent->key()) -
trunk/src/VBox/Frontends/VirtualBox4/src/QIHotKeyEdit.cpp
r9820 r10112 23 23 #include "QIHotKeyEdit.h" 24 24 #include "VBoxDefs.h" 25 26 /* Qt includes */ 25 27 #include <QApplication> 26 28 #include <QStyleOption> … … 123 125 124 126 QPalette p = palette(); 125 p.setColor (QPalette::Active, Q ColorGroup::Foreground,126 p.color (QPalette::Active, Q ColorGroup::Text));127 p.setColor (QPalette::Active, Q ColorGroup::Background,128 p.color (QPalette::Active, Q ColorGroup::Base));127 p.setColor (QPalette::Active, QPalette::Foreground, 128 p.color (QPalette::Active, QPalette::Text)); 129 p.setColor (QPalette::Active, QPalette::Background, 130 p.color (QPalette::Active, QPalette::Base)); 129 131 setPalette (p); 130 132 … … 197 199 ensurePolished(); 198 200 QFontMetrics fm (font()); 199 int h = QMAX(fm.lineSpacing(), 14) + 2;201 int h = qMax (fm.lineSpacing(), 14) + 2; 200 202 int w = fm.width ('x') * 17; // "some" 201 203 int m = frameWidth() * 2; … … 215 217 ensurePolished(); 216 218 QFontMetrics fm = fontMetrics(); 217 int h = fm.height() + QMAX(2, fm.leading());219 int h = fm.height() + qMax (2, fm.leading()); 218 220 int w = fm.maxWidth(); 219 221 int m = frameWidth() * 2; … … 713 715 714 716 QPalette p = palette(); 715 p.setColor (QPalette::Active, Q ColorGroup::Foreground,716 p.color (QPalette::Active, Q ColorGroup::HighlightedText));717 p.setColor (QPalette::Active, Q ColorGroup::Background,718 p.color (QPalette::Active, Q ColorGroup::Highlight));717 p.setColor (QPalette::Active, QPalette::Foreground, 718 p.color (QPalette::Active, QPalette::HighlightedText)); 719 p.setColor (QPalette::Active, QPalette::Background, 720 p.color (QPalette::Active, QPalette::Highlight)); 719 721 setPalette (p); 720 722 } … … 725 727 726 728 QPalette p = palette(); 727 p.setColor (QPalette::Active, Q ColorGroup::Foreground,728 p.color (QPalette::Active, Q ColorGroup::Text));729 p.setColor (QPalette::Active, Q ColorGroup::Background,730 p.color (QPalette::Active, Q ColorGroup::Base));729 p.setColor (QPalette::Active, QPalette::Foreground, 730 p.color (QPalette::Active, QPalette::Text)); 731 p.setColor (QPalette::Active, QPalette::Background, 732 p.color (QPalette::Active, QPalette::Base)); 731 733 setPalette (p); 732 734 } -
trunk/src/VBox/Frontends/VirtualBox4/src/QIStateIndicator.cpp
r10105 r10112 126 126 if (aEv->button() == Qt::LeftButton) 127 127 { 128 QContextMenuEvent qme (QContextMenuEvent::Mouse, aEv->pos(), aEv->globalPos() , 0);128 QContextMenuEvent qme (QContextMenuEvent::Mouse, aEv->pos(), aEv->globalPos()); 129 129 emit contextMenuRequested (this, &qme); 130 130 if (qme.isAccepted()) -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp
r9495 r10112 1516 1516 QMouseEvent *me = (QMouseEvent *) e; 1517 1517 if (mouseEvent (me->type(), me->pos(), me->globalPos(), 1518 me->button (), me->buttons(), me->modifiers(),1518 me->buttons(), me->modifiers(), 1519 1519 0, Qt::Horizontal)) 1520 1520 return true; /* stop further event handling */ … … 1525 1525 QWheelEvent *we = (QWheelEvent *) e; 1526 1526 if (mouseEvent (we->type(), we->pos(), we->globalPos(), 1527 Qt::NoButton,we->buttons(), we->modifiers(),1527 we->buttons(), we->modifiers(), 1528 1528 we->delta(), we->orientation())) 1529 1529 return true; /* stop further event handling */ … … 2651 2651 * @return true to consume the event and false to pass it to Qt 2652 2652 */ 2653 bool VBoxConsoleView::mouseEvent (int aType, const QPoint &aPos, 2654 const QPoint &aGlobalPos, Qt::ButtonState aButton, 2653 bool VBoxConsoleView::mouseEvent (int aType, const QPoint &aPos, const QPoint &aGlobalPos, 2655 2654 Qt::MouseButtons aButtons, Qt::KeyboardModifiers aModifiers, 2656 2655 int aWheelDelta, Qt::Orientation aWheelDir) … … 2661 2660 "MOUSE: type=%03d x=%03d y=%03d btn=%03d btns=%08X mod=%08X " 2662 2661 "wdelta=%03d wdir=%03d", 2663 aType, aPos.x(), aPos.y(), aButton , aButtons, aModifiers,2662 aType, aPos.x(), aPos.y(), aButtons, aModifiers, 2664 2663 aWheelDelta, aWheelDir); 2665 2664 mMainWnd->statusBar()->message (buf); 2666 2665 #else 2667 Q_UNUSED (aButton);2668 2666 Q_UNUSED (aModifiers); 2669 2667 #endif -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp
r9495 r10112 112 112 VBoxConsoleWnd:: 113 113 VBoxConsoleWnd (VBoxConsoleWnd **aSelf, QWidget* aParent, 114 Qt::W Flags aFlags)114 Qt::WindowFlags aFlags /* = Qt::Window */) 115 115 : QIWithRetranslateUI2<QMainWindow> (aParent, aFlags) 116 116 , mMainMenu (0) -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r10105 r10112 227 227 if (sVal.isEmpty() || 228 228 sVal == QString ("%1") 229 .arg (( Q_ULLONG) vboxGlobal().mainWindow()->winId()))229 .arg ((qulonglong) vboxGlobal().mainWindow()->winId())) 230 230 *allowChange = TRUE; 231 231 else … … 278 278 } 279 279 else if (sVal == QString ("%1") 280 .arg (( Q_ULLONG) vboxGlobal().mainWindow()->winId()))280 .arg ((qulonglong) vboxGlobal().mainWindow()->winId())) 281 281 { 282 282 mIsRegDlgOwner = true; … … 2893 2893 frameh = current->frameGeometry().height() - current->height(); 2894 2894 2895 extraw = QMAX(extraw, framew);2896 extrah = QMAX(extrah, frameh);2895 extraw = qMax (extraw, framew); 2896 extrah = qMax (extrah, frameh); 2897 2897 } 2898 2898 … … 2964 2964 */ 2965 2965 /* static */ 2966 Q_UINT64 VBoxGlobal::parseSize (const QString &aText)2966 quint64 VBoxGlobal::parseSize (const QString &aText) 2967 2967 { 2968 2968 QRegExp regexp (sizeRegexp()); … … 2980 2980 } 2981 2981 2982 Q_UINT64 denom = 0;2982 quint64 denom = 0; 2983 2983 if (suff.isEmpty() || suff == "B") 2984 2984 denom = 1; … … 2994 2994 denom = _1P; 2995 2995 2996 Q_UINT64 intg = intgS.toULongLong();2996 quint64 intg = intgS.toULongLong(); 2997 2997 if (denom == 1) 2998 2998 return intg; 2999 2999 3000 Q_UINT64 hund = hundS.leftJustified (2, '0').toULongLong();3000 quint64 hund = hundS.leftJustified (2, '0').toULongLong(); 3001 3001 hund = hund * denom / 100; 3002 3002 intg = intg * denom + hund; … … 3034 3034 */ 3035 3035 /* static */ 3036 QString VBoxGlobal::formatSize ( Q_UINT64 aSize, int aMode /* = 0 */)3036 QString VBoxGlobal::formatSize (quint64 aSize, int aMode /* = 0 */) 3037 3037 { 3038 3038 static const char *Suffixes [] = { "B", "KB", "MB", "GB", "TB", "PB", NULL }; 3039 3039 3040 Q_UINT64 denom = 0;3040 quint64 denom = 0; 3041 3041 int suffix = 0; 3042 3042 … … 3072 3072 } 3073 3073 3074 Q_UINT64 intg = aSize / denom;3075 Q_UINT64 hund = aSize % denom;3074 quint64 intg = aSize / denom; 3075 quint64 hund = aSize % denom; 3076 3076 3077 3077 QString number; … … 3854 3854 * the SetExtraData() call. */ 3855 3855 mVBox.SetExtraData (VBoxDefs::GUI_RegistrationDlgWinID, 3856 QString ("%1").arg (( Q_ULLONG) mMainWindow->winId()));3856 QString ("%1").arg ((qulonglong) mMainWindow->winId())); 3857 3857 3858 3858 if (mVBox.isOk()) … … 3860 3860 /* We've got the "mutex", create a new registration dialog */ 3861 3861 VBoxRegistrationDlg *dlg = 3862 new VBoxRegistrationDlg (&mRegDlg, 0, Qt::WDestructiveClose); 3862 new VBoxRegistrationDlg (&mRegDlg, 0); 3863 dlg->setAttribute (Qt::WA_DeleteOnClose); 3863 3864 Assert (dlg == mRegDlg); 3864 3865 mRegDlg->show(); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNewHDWzd.cpp
r9089 r10112 30 30 31 31 /** Minimum VDI size in MB */ 32 static const Q_UINT64 MinVDISize = 4;32 static const quint64 MinVDISize = 4; 33 33 34 34 /** Initial VDI size in MB */ 35 static const Q_UINT64 InitialVDISize = 2 * _1K;35 static const quint64 InitialVDISize = 2 * _1K; 36 36 37 37 /** … … 60 60 } 61 61 62 static inline int log2i ( Q_UINT64 val)63 { 64 Q_UINT64 n = val;62 static inline int log2i (quint64 val) 63 { 64 quint64 n = val; 65 65 int pow = -1; 66 66 while (n) … … 72 72 } 73 73 74 static inline int sizeMBToSlider ( Q_UINT64 val, int aSliderScale)74 static inline int sizeMBToSlider (quint64 val, int aSliderScale) 75 75 { 76 76 int pow = log2i (val); 77 Q_UINT64 tickMB = Q_UINT64 (1) << pow;78 Q_UINT64 tickMBNext = Q_UINT64 (1) << (pow + 1);77 quint64 tickMB = quint64 (1) << pow; 78 quint64 tickMBNext = quint64 (1) << (pow + 1); 79 79 int step = (val - tickMB) * aSliderScale / (tickMBNext - tickMB); 80 80 return pow * aSliderScale + step; 81 81 } 82 82 83 static inline Q_UINT64 sliderToSizeMB (int val, int aSliderScale)83 static inline quint64 sliderToSizeMB (int val, int aSliderScale) 84 84 { 85 85 int pow = val / aSliderScale; 86 86 int step = val % aSliderScale; 87 Q_UINT64 tickMB = Q_UINT64 (1) << pow;88 Q_UINT64 tickMBNext = Q_UINT64 (1) << (pow + 1);87 quint64 tickMB = quint64 (1) << pow; 88 quint64 tickMBNext = quint64 (1) << (pow + 1); 89 89 return tickMB + (tickMBNext - tickMB) * step / aSliderScale; 90 90 } … … 110 110 { 111 111 int pow = log2i (mMaxVDISize); 112 Q_UINT64 tickMB = Q_UINT64 (1) << pow;112 quint64 tickMB = quint64 (1) << pow; 113 113 if (tickMB < mMaxVDISize) 114 114 { 115 Q_UINT64 tickMBNext = Q_UINT64 (1) << (pow + 1);116 Q_UINT64 gap = tickMBNext - mMaxVDISize;115 quint64 tickMBNext = quint64 (1) << (pow + 1); 116 quint64 gap = tickMBNext - mMaxVDISize; 117 117 mSliderScale = (int) ((tickMBNext - tickMB) / gap); 118 118 } 119 119 } 120 mSliderScale = QMAX(mSliderScale, 8);120 mSliderScale = qMax (mSliderScale, 8); 121 121 mLeName->setValidator (new QRegExpValidator (QRegExp( ".+" ), this)); 122 122 mLeSize->setValidator (new QRegExpValidator (QRegExp(vboxGlobal().sizeRegexp()), this)); … … 170 170 } 171 171 172 void VBoxNewHDWzd::setRecommendedSize ( Q_UINT64 aSize)172 void VBoxNewHDWzd::setRecommendedSize (quint64 aSize) 173 173 { 174 174 AssertReturnVoid (aSize >= MinVDISize && aSize <= mMaxVDISize); … … 192 192 type = VBoxGlobal::removeAccelMark (type); 193 193 194 Q_UINT64 sizeB = imageSize() * _1M;194 quint64 sizeB = imageSize() * _1M; 195 195 196 196 /* compose summary */ … … 352 352 } 353 353 354 Q_UINT64 VBoxNewHDWzd::imageSize()354 quint64 VBoxNewHDWzd::imageSize() 355 355 { 356 356 return mCurrentSize; … … 362 362 } 363 363 364 void VBoxNewHDWzd::updateSizeToolTip ( Q_UINT64 aSizeB)364 void VBoxNewHDWzd::updateSizeToolTip (quint64 aSizeB) 365 365 { 366 366 QString tip = tr ("<nobr>%1 Bytes</nobr>").arg (aSizeB); … … 372 372 { 373 373 QString src = imageFileName(); 374 Q_UINT64 size = imageSize();374 quint64 size = imageSize(); 375 375 376 376 AssertReturn (!src.isEmpty(), false); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxProblemReporter.cpp
r9652 r10112 71 71 int aMinDuration = 2000, QWidget *aCreator = 0) 72 72 : QProgressDialog (aCreator, 73 Qt:: WStyle_Customize | Qt::WStyle_DialogBorder | Qt::WStyle_Title)73 Qt::MSWindowsFixedSizeDialogHint | Qt::WindowTitleHint) 74 74 , mProgress (aProgress) 75 75 , mCalcelEnabled (true) -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r10105 r10112 387 387 VBoxSelectorWnd:: 388 388 VBoxSelectorWnd (VBoxSelectorWnd **aSelf, QWidget* aParent, 389 Qt::W Flags aFlags)389 Qt::WindowFlags aFlags /* = Qt::Window */) 390 390 : QIWithRetranslateUI2<QMainWindow> (aParent, aFlags) 391 391 , doneInaccessibleWarningOnce (false) -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMInformationDlg.cpp
r9364 r10112 38 38 /* Creating new information dialog if there is no one existing */ 39 39 mSelfArray [machine.GetName()] = new VBoxVMInformationDlg ( 40 aConsole, aSession, Qt::WType_TopLevel | Qt::WDestructiveClose); 40 aConsole, aSession, Qt::Window); 41 mSelfArray [machine.GetName()]->setAttribute (Qt::WA_DeleteOnClose); 41 42 } 42 43 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsSF.cpp
r9654 r10112 271 271 new SFTreeViewItem (mTreeView, fields, SFTreeViewItem::EllipsisEnd); 272 272 } 273 mTreeView->sortItems (0, Qt::Ascending );273 mTreeView->sortItems (0, Qt::AscendingOrder); 274 274 275 275 retranslateUi(); … … 398 398 SFTreeViewItem *item = new SFTreeViewItem (root, fields, 399 399 SFTreeViewItem::EllipsisFile); 400 mTreeView->sortItems (0, Qt::Ascending );400 mTreeView->sortItems (0, Qt::AscendingOrder); 401 401 mTreeView->scrollToItem (item); 402 402 mTreeView->setCurrentItem (item); … … 444 444 << "edited" /* mark item as edited */; 445 445 item->updateText (fields); 446 mTreeView->sortItems (0, Qt::Ascending );446 mTreeView->sortItems (0, Qt::AscendingOrder); 447 447 if (item->parent() != root) 448 448 { … … 640 640 } 641 641 aRoot->setExpanded (true); 642 mTreeView->sortItems (0, Qt::Ascending );642 mTreeView->sortItems (0, Qt::AscendingOrder); 643 643 mTreeView->setCurrentItem (aRoot->childCount() ? aRoot->child (0) : aRoot); 644 644 processCurrentChanged (aRoot->childCount() ? aRoot->child (0) : aRoot); -
trunk/src/VBox/Frontends/VirtualBox4/src/main.cpp
r9495 r10112 187 187 * different annoying color, so fixing palette button's color */ 188 188 //#warning "port me: any longer required?" 189 QPalette pal = a.palette();190 pal.setColor (QPalette::Disabled, QColorGroup::Button,191 pal.color (QPalette::Disabled, QColorGroup::Background));192 pal.setColor (QPalette::Active, QColorGroup::Button,193 pal.color (QPalette::Active, QColorGroup::Background));194 pal.setColor (QPalette::Inactive, QColorGroup::Button,195 pal.color (QPalette::Inactive, QColorGroup::Background));196 a.setPalette (pal);189 // QPalette pal = a.palette(); 190 // pal.setColor (QPalette::Disabled, QColorGroup::Button, 191 // pal.color (QPalette::Disabled, QColorGroup::Background)); 192 // pal.setColor (QPalette::Active, QColorGroup::Button, 193 // pal.color (QPalette::Active, QColorGroup::Background)); 194 // pal.setColor (QPalette::Inactive, QColorGroup::Button, 195 // pal.color (QPalette::Inactive, QColorGroup::Background)); 196 // a.setPalette (pal); 197 197 #else /* !Q_WS_MAC */ 198 198 ::darwinDisableIconsInMenus();
Note:
See TracChangeset
for help on using the changeset viewer.