Changeset 45377 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 5, 2013 2:41:52 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIFileDialog.cpp
r44529 r45377 20 20 /* VBox includes */ 21 21 #include "VBoxGlobal.h" 22 #include "UIModalWindowManager.h" 23 #include "UIMessageCenter.h" 22 24 #include "QIFileDialog.h" 23 25 … … 265 267 QString result; 266 268 267 QWidget *topParent = m Parent ? mParent->window() : vboxGlobal().mainWindow();269 QWidget *topParent = mwManager().realParentWindow(mParent ? mParent : msgCenter().mainWindowShown()); 268 270 QString title = mCaption.isNull() ? tr ("Select a directory") : mCaption; 269 271 … … 466 468 QString title = mCaption.isNull() ? tr ("Select a file") : mCaption; 467 469 468 QWidget *topParent = m Parent ? mParent->window() : vboxGlobal().mainWindow();470 QWidget *topParent = mwManager().realParentWindow(mParent ? mParent : msgCenter().mainWindowShown()); 469 471 QString winFilters = winFilter (mFilters); 470 472 AssertCompile (sizeof (TCHAR) == sizeof (QChar)); … … 715 717 QString title = mCaption.isNull() ? tr ("Select a file") : mCaption; 716 718 717 QWidget *topParent = m Parent ? mParent->window() : vboxGlobal().mainWindow();719 QWidget *topParent = mwManager().realParentWindow(mParent ? mParent : msgCenter().mainWindowShown()); 718 720 QString winFilters = winFilter (mFilters); 719 721 AssertCompile (sizeof (TCHAR) == sizeof (QChar)); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r45371 r45377 325 325 if (vboxGlobal().isVMConsoleProcess()) 326 326 { 327 /* It will be currently active machine 328 if (vboxGlobal(). vmWindow()->isVisible())329 return vboxGlobal(). vmWindow();327 /* It will be currently active machine-window if visible: */ 328 if (vboxGlobal().activeMachineWindow()->isVisible()) 329 return vboxGlobal().activeMachineWindow(); 330 330 } 331 331 /* Otherwise: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r45374 r45377 270 270 , mSelectorWnd (NULL) 271 271 , m_pVirtualMachine(0) 272 , mMainWindow (NULL)273 272 , mMediaEnumThread (NULL) 274 273 , mIsKWinManaged (false) … … 457 456 } 458 457 459 QWidget* VBoxGlobal:: vmWindow()458 QWidget* VBoxGlobal::activeMachineWindow() 460 459 { 461 460 /* Null if that is NOT console-process or machine not yet created: */ 462 461 if (!isVMConsoleProcess() || !m_pVirtualMachine) 463 462 return 0; 464 /* Mainmachine-window otherwise: */465 return m_pVirtualMachine-> mainWindow();463 /* Active machine-window otherwise: */ 464 return m_pVirtualMachine->activeWindow(); 466 465 } 467 466 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r45374 r45377 90 90 bool startMachine(const QString &strMachineId); 91 91 UIMachine* virtualMachine(); 92 QWidget* vmWindow(); 93 94 /* Main application window storage: */ 95 void setMainWindow(QWidget *pMainWindow) { mMainWindow = pMainWindow; } 96 QWidget* mainWindow() const { return mMainWindow; } 92 QWidget* activeMachineWindow(); 97 93 98 94 bool is3DAvailable() const { return m3DAvailable; } … … 451 447 UISelectorWindow *mSelectorWnd; 452 448 UIMachine *m_pVirtualMachine; 453 QWidget* mMainWindow;454 449 455 450 QString vmUuid; -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r45374 r45377 483 483 if (vboxGlobal().isVMConsoleProcess()) 484 484 { 485 if (vboxGlobal().startMachine (vboxGlobal().managedVMUuid())) 486 { 487 vboxGlobal().setMainWindow (vboxGlobal().vmWindow()); 485 if (vboxGlobal().startMachine(vboxGlobal().managedVMUuid())) 488 486 rc = a.exec(); 489 }490 487 } 491 488 else if (noSelector) … … 497 494 #ifdef VBOX_BLEEDING_EDGE 498 495 msgCenter().showBEBWarning(); 499 #else 496 #else /* VBOX_BLEEDING_EDGE */ 500 497 # ifndef DEBUG 501 498 /* Check for BETA version */ … … 509 506 msgCenter().showBETAWarning(); 510 507 } 511 # endif 512 #endif 513 514 vboxGlobal().setMainWindow (&vboxGlobal().selectorWnd()); 515 vboxGlobal().selectorWnd().show(); 516 rc = a.exec(); 508 # endif /* !DEBUG */ 509 #endif /* !VBOX_BLEEDING_EDGE*/ 510 vboxGlobal().selectorWnd().show(); 511 rc = a.exec(); 517 512 } 518 513 } -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r45362 r45377 218 218 /* Apply UI decorations */ 219 219 Ui::UIMediumManager::setupUi (this); 220 221 /* No need to count that window as important for application, 222 * it will NOT be taken into account when other top-level windows will be closed: */ 223 setAttribute(Qt::WA_QuitOnClose, false); 220 224 221 225 /* Apply window icons */ … … 562 566 mModelessDialog->setup (UIMediumType_All, false /* aDoSelect */, aRefresh); 563 567 564 /* Setup 'closing' connection if main window is UISelectorWindow: */565 if (vboxGlobal().mainWindow() && vboxGlobal().mainWindow()->inherits("UISelectorWindow"))566 connect(vboxGlobal().mainWindow(), SIGNAL(closing()), mModelessDialog, SLOT(close()));567 568 568 /* listen to events that may change the media status and refresh 569 569 * the contents of the modeless dialog */ -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.cpp
r45342 r45377 168 168 169 169 /* Center according current main application window: */ 170 vboxGlobal().centerWidget(this, vboxGlobal().mainWindow(), false);170 vboxGlobal().centerWidget(this, msgCenter().mainWindowShown(), false); 171 171 172 172 /* Pass event to the base-class: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r45224 r45377 415 415 } 416 416 417 QWidget* UIMachine:: mainWindow() const417 QWidget* UIMachine::activeWindow() const 418 418 { 419 419 /* Null if machine-logic not yet created: */ 420 420 if (!machineLogic()) 421 421 return 0; 422 /* Mainmachine-window otherwise: */423 return machineLogic()-> mainMachineWindow();422 /* Active machine-window otherwise: */ 423 return machineLogic()->activeMachineWindow(); 424 424 } 425 425 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r45224 r45377 47 47 48 48 /* Public getters: */ 49 QWidget* mainWindow() const;49 QWidget* activeWindow() const; 50 50 UISession *uisession() const { return m_pSession; } 51 51 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r45224 r45377 182 182 setWindowIcon(vboxGlobal().vmGuestOSTypeIcon(machine().GetOSTypeId())); 183 183 #endif /* !Q_WS_MAC */ 184 185 /* Set the main application window for VBoxGlobal: */186 if (m_uScreenId == 0)187 vboxGlobal().setMainWindow(this);188 184 } 189 185 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r45374 r45377 1026 1026 } 1027 1027 1028 void UISelectorWindow::closeEvent(QCloseEvent *pEvent)1029 {1030 // TODO: Such things are obsolete, rework required!1031 emit closing();1032 QMainWindow::closeEvent(pEvent);1033 }1034 1035 1028 #ifdef Q_WS_MAC 1036 1029 bool UISelectorWindow::eventFilter(QObject *pObject, QEvent *pEvent) -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h
r45290 r45377 46 46 { 47 47 Q_OBJECT; 48 49 signals:50 51 /* Obsolete: Signal to notify listeners about this dialog closed: */52 void closing();53 48 54 49 public: … … 117 112 void showEvent(QShowEvent *pEvent); 118 113 void polishEvent(QShowEvent *pEvent); 119 void closeEvent(QCloseEvent *pEvent);120 114 #ifdef Q_WS_MAC 121 115 bool eventFilter(QObject *pObject, QEvent *pEvent);
Note:
See TracChangeset
for help on using the changeset viewer.