VirtualBox

Ignore:
Timestamp:
Apr 5, 2013 2:41:52 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Integrating multi-screen support for the messaging system; Removing some obsolete stuff around the application.

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  
    2020/* VBox includes */
    2121#include "VBoxGlobal.h"
     22#include "UIModalWindowManager.h"
     23#include "UIMessageCenter.h"
    2224#include "QIFileDialog.h"
    2325
     
    265267            QString result;
    266268
    267             QWidget *topParent = mParent ? mParent->window() : vboxGlobal().mainWindow();
     269            QWidget *topParent = mwManager().realParentWindow(mParent ? mParent : msgCenter().mainWindowShown());
    268270            QString title = mCaption.isNull() ? tr ("Select a directory") : mCaption;
    269271
     
    466468            QString title = mCaption.isNull() ? tr ("Select a file") : mCaption;
    467469
    468             QWidget *topParent = mParent ? mParent->window() : vboxGlobal().mainWindow();
     470            QWidget *topParent = mwManager().realParentWindow(mParent ? mParent : msgCenter().mainWindowShown());
    469471            QString winFilters = winFilter (mFilters);
    470472            AssertCompile (sizeof (TCHAR) == sizeof (QChar));
     
    715717            QString title = mCaption.isNull() ? tr ("Select a file") : mCaption;
    716718
    717             QWidget *topParent = mParent ? mParent->window() : vboxGlobal().mainWindow();
     719            QWidget *topParent = mwManager().realParentWindow(mParent ? mParent : msgCenter().mainWindowShown());
    718720            QString winFilters = winFilter (mFilters);
    719721            AssertCompile (sizeof (TCHAR) == sizeof (QChar));
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r45371 r45377  
    325325    if (vboxGlobal().isVMConsoleProcess())
    326326    {
    327         /* It will be currently active machine window if visible: */
    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();
    330330    }
    331331    /* Otherwise: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r45374 r45377  
    270270    , mSelectorWnd (NULL)
    271271    , m_pVirtualMachine(0)
    272     , mMainWindow (NULL)
    273272    , mMediaEnumThread (NULL)
    274273    , mIsKWinManaged (false)
     
    457456}
    458457
    459 QWidget* VBoxGlobal::vmWindow()
     458QWidget* VBoxGlobal::activeMachineWindow()
    460459{
    461460    /* Null if that is NOT console-process or machine not yet created: */
    462461    if (!isVMConsoleProcess() || !m_pVirtualMachine)
    463462        return 0;
    464     /* Main machine-window otherwise: */
    465     return m_pVirtualMachine->mainWindow();
     463    /* Active machine-window otherwise: */
     464    return m_pVirtualMachine->activeWindow();
    466465}
    467466
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r45374 r45377  
    9090    bool startMachine(const QString &strMachineId);
    9191    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();
    9793
    9894    bool is3DAvailable() const { return m3DAvailable; }
     
    451447    UISelectorWindow *mSelectorWnd;
    452448    UIMachine *m_pVirtualMachine;
    453     QWidget* mMainWindow;
    454449
    455450    QString vmUuid;
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r45374 r45377  
    483483            if (vboxGlobal().isVMConsoleProcess())
    484484            {
    485                 if (vboxGlobal().startMachine (vboxGlobal().managedVMUuid()))
    486                 {
    487                     vboxGlobal().setMainWindow (vboxGlobal().vmWindow());
     485                if (vboxGlobal().startMachine(vboxGlobal().managedVMUuid()))
    488486                    rc = a.exec();
    489                 }
    490487            }
    491488            else if (noSelector)
     
    497494#ifdef VBOX_BLEEDING_EDGE
    498495                msgCenter().showBEBWarning();
    499 #else
     496#else /* VBOX_BLEEDING_EDGE */
    500497# ifndef DEBUG
    501498                /* Check for BETA version */
     
    509506                        msgCenter().showBETAWarning();
    510507                }
    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();
    517512            }
    518513        }
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r45362 r45377  
    218218    /* Apply UI decorations */
    219219    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);
    220224
    221225    /* Apply window icons */
     
    562566        mModelessDialog->setup (UIMediumType_All, false /* aDoSelect */, aRefresh);
    563567
    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 
    568568        /* listen to events that may change the media status and refresh
    569569         * the contents of the modeless dialog */
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.cpp

    r45342 r45377  
    168168
    169169    /* Center according current main application window: */
    170     vboxGlobal().centerWidget(this, vboxGlobal().mainWindow(), false);
     170    vboxGlobal().centerWidget(this, msgCenter().mainWindowShown(), false);
    171171
    172172    /* Pass event to the base-class: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r45224 r45377  
    415415}
    416416
    417 QWidget* UIMachine::mainWindow() const
     417QWidget* UIMachine::activeWindow() const
    418418{
    419419    /* Null if machine-logic not yet created: */
    420420    if (!machineLogic())
    421421        return 0;
    422     /* Main machine-window otherwise: */
    423     return machineLogic()->mainMachineWindow();
     422    /* Active machine-window otherwise: */
     423    return machineLogic()->activeMachineWindow();
    424424}
    425425
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r45224 r45377  
    4747
    4848    /* Public getters: */
    49     QWidget* mainWindow() const;
     49    QWidget* activeWindow() const;
    5050    UISession *uisession() const { return m_pSession; }
    5151
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r45224 r45377  
    182182    setWindowIcon(vboxGlobal().vmGuestOSTypeIcon(machine().GetOSTypeId()));
    183183#endif /* !Q_WS_MAC */
    184 
    185     /* Set the main application window for VBoxGlobal: */
    186     if (m_uScreenId == 0)
    187         vboxGlobal().setMainWindow(this);
    188184}
    189185
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r45374 r45377  
    10261026}
    10271027
    1028 void UISelectorWindow::closeEvent(QCloseEvent *pEvent)
    1029 {
    1030     // TODO: Such things are obsolete, rework required!
    1031     emit closing();
    1032     QMainWindow::closeEvent(pEvent);
    1033 }
    1034 
    10351028#ifdef Q_WS_MAC
    10361029bool UISelectorWindow::eventFilter(QObject *pObject, QEvent *pEvent)
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h

    r45290 r45377  
    4646{
    4747    Q_OBJECT;
    48 
    49 signals:
    50 
    51     /* Obsolete: Signal to notify listeners about this dialog closed: */
    52     void closing();
    5348
    5449public:
     
    117112    void showEvent(QShowEvent *pEvent);
    118113    void polishEvent(QShowEvent *pEvent);
    119     void closeEvent(QCloseEvent *pEvent);
    120114#ifdef Q_WS_MAC
    121115    bool eventFilter(QObject *pObject, QEvent *pEvent);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette