Changeset 20047 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 26, 2009 4:08:25 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r19961 r20047 254 254 include/VBoxConsoleWnd.h \ 255 255 include/VBoxConsoleView.h \ 256 include/VBoxMiniToolBar.h \ 256 257 include/VBoxProblemReporter.h \ 257 258 include/VBoxProgressDialog.h \ … … 345 346 src/VBoxConsoleView.cpp \ 346 347 src/VBoxConsoleWnd.cpp \ 348 src/VBoxMiniToolBar.cpp \ 347 349 src/VBoxDownloaderWgt.cpp \ 348 350 src/VBoxVMListView.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/VirtualBox.qrc
r19877 r20047 340 340 <file alias="chipset_disabled_16px.png">images/chipset_disabled_16px.png</file> 341 341 <file alias="chipset_disabled_32px.png">images/chipset_disabled_32px.png</file> 342 <file alias="pin_16px.png">images/pin_16px.png</file> 343 <file alias="restore_16px.png">images/restore_16px.png</file> 342 344 </qresource> 343 345 </RCC> -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
r17730 r20047 57 57 58 58 class VBoxChangeDockIconUpdateEvent; 59 60 class VBoxMiniToolBar; 59 61 60 62 /* We want to make the first action highlighted but not … … 250 252 void setViewInSeamlessMode (const QRect &aTargetRect); 251 253 254 void mtExitMode(); 255 void mtCloseVM(); 256 252 257 private: 253 258 … … 307 312 308 313 QMenu *mVMMenu; 314 QMenu *mMiniVMMenu; 309 315 QMenu *mDevicesMenu; 310 316 QMenu *mDevicesMountFloppyMenu; … … 392 398 CGDisplayFadeReservationToken mFadeToken; 393 399 #endif 400 401 VBoxMiniToolBar *mMiniToolBar; 394 402 }; 395 403 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxToolBar.h
r17349 r20047 30 30 31 31 /* Qt includes */ 32 #include <QLayout> 33 #include <QMainWindow> 32 34 #include <QToolBar> 33 #include <QMainWindow>34 35 35 36 /* Note: This styles are available on _all_ platforms. */ … … 123 124 ::darwinSetShowsToolbarButton (this, aShow); 124 125 #else /* Q_WS_MAC */ 125 NOREF(aShow);126 Q_UNUSED (aShow); 126 127 #endif /* !Q_WS_MAC */ 127 128 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r19844 r20047 2603 2603 doResizeHint (newSize); 2604 2604 } 2605 2606 /* Reactivate the console window to preserve the focus position. 2607 * Else focus will move to the mini-tool-bar. */ 2608 activateWindow(); 2605 2609 } 2606 2610 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r19904 r20047 32 32 #include "VBoxGlobal.h" 33 33 #include "VBoxProblemReporter.h" 34 #include "VBoxMiniToolBar.h" 34 35 35 36 #include "QIStateIndicator.h" … … 503 504 504 505 mHelpActions.addTo (mHelpMenu); 506 507 /* Machine submenu for mini toolbar */ 508 mMiniVMMenu = new QMenu (this); 509 mMiniVMMenu->addAction (mVmTypeCADAction); 510 #ifdef Q_WS_X11 511 mMiniVMMenu->addAction (mVmTypeCABSAction); 512 #endif 513 mMiniVMMenu->addSeparator(); 514 mMiniVMMenu->addAction (mVmTakeSnapshotAction); 515 mMiniVMMenu->addSeparator(); 516 mMiniVMMenu->addAction (mVmShowInformationDlgAction); 517 mMiniVMMenu->addSeparator(); 518 mMiniVMMenu->addAction (mVmResetAction); 519 mMiniVMMenu->addAction (mVmPauseAction); 520 mMiniVMMenu->addAction (mVmACPIShutdownAction); 521 522 /* Mini toolbar */ 523 QList <QMenu*> menuList; 524 menuList.append (mMiniVMMenu); 525 menuList.append (mDevicesMenu); 526 mMiniToolBar = new VBoxMiniToolBar (menuList); 527 connect (mMiniToolBar, SIGNAL (exitAction()), this, SLOT (mtExitMode())); 528 connect (mMiniToolBar, SIGNAL (closeAction()), this, SLOT (mtCloseVM())); 529 connect (this, SIGNAL (closing()), mMiniToolBar, SLOT (close())); 505 530 506 531 ///// Status bar //////////////////////////////////////////////////////// … … 1742 1767 // mVMMenu->setIcon (VBoxGlobal::iconSet (":/machine_16px.png")); 1743 1768 1769 mMiniVMMenu->setTitle (tr ("&Machine")); 1770 1744 1771 mDevicesMenu->setTitle (tr ("&Devices")); 1745 1772 // mDevicesMenu->setIcon (VBoxGlobal::iconSet (":/settings_16px.png")); … … 1806 1833 " [" + vboxGlobal().toString (machine_state) + "] - " + 1807 1834 caption_prefix); 1835 mMiniToolBar->setDisplayText (cmachine.GetName() + snapshotName); 1808 1836 //#ifdef Q_WS_MAC 1809 1837 // SetWindowTitleWithCFString (reinterpret_cast <WindowPtr> (this->winId()), CFSTR("sfds")); … … 2327 2355 2328 2356 /* Hide all but the central widget containing the console view. */ 2329 QList<QWidget *> list = findChildren<QWidget *>(); 2357 QList <QWidget*> list (findChildren <QWidget*> ()); 2358 QList <QWidget*> excludes; 2359 excludes << centralWidget() << centralWidget()->findChildren <QWidget*> (); 2330 2360 foreach (QWidget *w, list) 2331 2361 { 2332 /* todo: The list is now recursive. So think about a better way to 2333 * prevent the childrens of the centralWidget to be hidden */ 2334 if (w != centralWidget() && 2335 w != console && 2336 w != console->viewport()) 2362 if (!excludes.contains (w)) 2337 2363 { 2338 2364 if (!w->isHidden()) … … 2401 2427 mIsWaitingModeResize = true; 2402 2428 2429 if (!aOn) 2430 { 2431 /* Animation takes a bit long, the mini toolbar is still disappearing 2432 * when switched to normal mode so hide it completely */ 2433 mMiniToolBar->hide(); 2434 mMiniToolBar->updateDisplay (false, true); 2435 } 2436 2403 2437 /* Toggle qt full-screen mode */ 2404 2438 switchToFullscreen (aOn, aSeamless); 2439 2440 if (aOn) 2441 { 2442 mMiniToolBar->updateDisplay (true, true); 2443 } 2405 2444 2406 2445 #ifdef Q_WS_MAC … … 2519 2558 NOREF (aTargetRect); 2520 2559 #endif // !Q_WS_MAC 2560 } 2561 2562 void VBoxConsoleWnd::mtExitMode() 2563 { 2564 if (mIsSeamless) 2565 mVmSeamlessAction->toggle(); 2566 else 2567 mVmFullscreenAction->toggle(); 2568 } 2569 2570 void VBoxConsoleWnd::mtCloseVM() 2571 { 2572 mVmCloseAction->trigger(); 2521 2573 } 2522 2574
Note:
See TracChangeset
for help on using the changeset viewer.