VirtualBox

Changeset 12695 in vbox


Ignore:
Timestamp:
Sep 24, 2008 3:25:31 PM (16 years ago)
Author:
vboxsync
Message:

Fe/Qt4: (defect #3187) VDM window doesn't have a WM task entry.
Due to the only possibility to make some window has its own task-bar entry under windows - is to make this window the root window, such windows as Virtual Disk Manager, Log Viewer, Session Information Dialog are become root.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/QIMainDialog.h

    r11343 r12695  
    6565    QPushButton* searchDefaultButton() const;
    6666
     67    void centerAccording (QWidget *aWidget) { mCenterWidget = aWidget; }
     68
    6769protected slots:
    6870
     
    8789
    8890    bool mPolished;
     91    QWidget *mCenterWidget;
    8992};
    9093
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h

    r12010 r12695  
    5959    bool startMachine (const QUuid &aId);
    6060
     61signals:
     62
     63    void closing();
     64
    6165public slots:
    6266
     
    8690    /* Events */
    8791    bool event (QEvent *aEvent);
     92    void closeEvent (QCloseEvent *aEvent);
    8893
    8994    void retranslateUi();
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMInformationDlg.h

    r11532 r12695  
    6464    void processStatistics();
    6565    void onPageChanged (int aIndex);
     66    void suicide();
    6667
    6768private:
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIMainDialog.cpp

    r11343 r12695  
    4444    , mRescode (QDialog::Rejected)
    4545    , mPolished (false)
     46    , mCenterWidget (aParent)
    4647{
    4748    qApp->installEventFilter (this);
     
    216217void QIMainDialog::showEvent (QShowEvent *aEvent)
    217218{
    218         QMainWindow::showEvent (aEvent);
     219    QMainWindow::showEvent (aEvent);
    219220
    220221    /* Polishing border */
     
    223224    mPolished = true;
    224225
    225     /* Explicit widget centering relatively to it's parent
    226      * if any or desktop if parent is missed. */
    227     vboxGlobal().centerWidget (this, parentWidget(), false);
     226    /* Explicit widget centering relatively to it's centering
     227     * widget if any or desktop if centering widget is missed. */
     228    vboxGlobal().centerWidget (this, mCenterWidget, false);
    228229}
    229230
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDiskImageManagerDlg.cpp

    r12402 r12695  
    490490
    491491/* static */
    492 void VBoxDiskImageManagerDlg::showModeless (QWidget *aParent /* = NULL */, bool aRefresh /* = true */)
     492void VBoxDiskImageManagerDlg::showModeless (QWidget *aCenterWidget /* = NULL */,
     493                                            bool aRefresh /* = true */)
    493494{
    494495    if (!mModelessDialog)
    495496    {
    496         mModelessDialog =
    497             new VBoxDiskImageManagerDlg (aParent, Qt::Window);
     497        mModelessDialog = new VBoxDiskImageManagerDlg (0, Qt::Window);
     498        mModelessDialog->centerAccording (aCenterWidget);
     499        connect (aCenterWidget, SIGNAL (closing()), mModelessDialog, SLOT (close()));
    498500        mModelessDialog->setAttribute (Qt::WA_DeleteOnClose);
    499501        mModelessDialog->setup (VBoxDefs::HD | VBoxDefs::CD | VBoxDefs::FD,
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp

    r12098 r12695  
    11041104}
    11051105
     1106void VBoxSelectorWnd::closeEvent (QCloseEvent *aEvent)
     1107{
     1108    emit closing();
     1109    return QMainWindow::closeEvent (aEvent);
     1110}
     1111
    11061112/**
    11071113 *  Sets the strings of the subwidgets using the current
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMInformationDlg.cpp

    r11950 r12695  
    3737    {
    3838        /* Creating new information dialog if there is no one existing */
    39         mSelfArray [machine.GetName()] = new VBoxVMInformationDlg (
    40             aConsole, aSession, Qt::Window);
    41         mSelfArray [machine.GetName()]->setAttribute (Qt::WA_DeleteOnClose);
     39        VBoxVMInformationDlg *id = new VBoxVMInformationDlg (aConsole,
     40                                                             aSession, Qt::Window);
     41        id->centerAccording (aConsole);
     42        connect (aConsole, SIGNAL (destroyed (QObject*)), id, SLOT (suicide()));
     43        id->setAttribute (Qt::WA_DeleteOnClose);
     44        mSelfArray [machine.GetName()] = id;
    4245    }
    4346
     
    5356                                            const CSession &aSession,
    5457                                            Qt::WindowFlags aFlags)
    55     : QIWithRetranslateUI2<QIMainDialog> (aConsole, aFlags)
     58    : QIWithRetranslateUI2<QIMainDialog> (0, aFlags)
    5659    , mIsPolished (false)
    5760    , mConsole (aConsole)
     
    294297void VBoxVMInformationDlg::showEvent (QShowEvent *aEvent)
    295298{
    296     QIMainDialog::showEvent (aEvent);
    297 
    298299    /* One may think that QWidget::polish() is the right place to do things
    299300     * below, but apparently, by the time when QWidget::polish() is called,
     
    301302     * size hint is not properly calculated. Since this is sometimes necessary,
    302303     * we provide our own "polish" implementation */
    303 
    304     if (mIsPolished)
    305         return;
    306 
    307     /* Load window size and state */
    308     resize (mWidth, mHeight);
    309     if (mMax)
    310         QTimer::singleShot (0, this, SLOT (showMaximized()));
    311     else
    312         mIsPolished = true;
    313 
    314     VBoxGlobal::centerWidget (this, parentWidget());
     304    if (!mIsPolished)
     305    {
     306        /* Load window size and state */
     307        resize (mWidth, mHeight);
     308        if (mMax)
     309            QTimer::singleShot (0, this, SLOT (showMaximized()));
     310        else
     311            mIsPolished = true;
     312    }
     313
     314    QIMainDialog::showEvent (aEvent);
    315315}
    316316
     
    345345    /* Focusing the browser on shown page */
    346346    mInfoStack->widget (aIndex)->setFocus();
     347}
     348
     349/**
     350 * Opposing to deleteLater() slot this one makes it immediately.
     351 */
     352void VBoxVMInformationDlg::suicide()
     353{
     354    delete this;
    347355}
    348356
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMLogViewer.cpp

    r10337 r12695  
    4141VBoxVMLogViewer::LogViewersMap VBoxVMLogViewer::mSelfArray = LogViewersMap();
    4242
    43 void VBoxVMLogViewer::createLogViewer (QWidget *aParent, CMachine &aMachine)
    44 {
    45     if (!mSelfArray.contains (aMachine.GetName())) 
    46     {
    47         /* creating new log viewer if there is no one existing */
    48         VBoxVMLogViewer *lv = new VBoxVMLogViewer (aParent,
    49             Qt::Window, aMachine);
    50         /* Self destroy on close event */
     43void VBoxVMLogViewer::createLogViewer (QWidget *aCenterWidget, CMachine &aMachine)
     44{
     45    if (!mSelfArray.contains (aMachine.GetName()))
     46    {
     47        /* Creating new log viewer if there is no one existing */
     48        VBoxVMLogViewer *lv = new VBoxVMLogViewer (0, Qt::Window, aMachine);
     49        lv->centerAccording (aCenterWidget);
     50        connect (aCenterWidget, SIGNAL (closing()), lv, SLOT (close()));
    5151        lv->setAttribute (Qt::WA_DeleteOnClose);
    5252        mSelfArray [aMachine.GetName()] = lv;
     
    9191    /* Add missing buttons & retrieve standard buttons */
    9292    mBtnHelp = mButtonBox->button (QDialogButtonBox::Help);
    93     mBtnFind = mButtonBox->addButton (QString::null, QDialogButtonBox::ActionRole); 
     93    mBtnFind = mButtonBox->addButton (QString::null, QDialogButtonBox::ActionRole);
    9494    mBtnSave = mButtonBox->button (QDialogButtonBox::Save);
    95     mBtnRefresh = mButtonBox->addButton (QString::null, QDialogButtonBox::ActionRole); 
     95    mBtnRefresh = mButtonBox->addButton (QString::null, QDialogButtonBox::ActionRole);
    9696    mBtnClose = mButtonBox->button (QDialogButtonBox::Close);
    97 
    98     /* Fix the tab order to ensure the dialog keys are always the last */
    99     /* @todo: Not sure if this is necessary any longer. On Linux this looks
    100      * good in the default order. Keep in mind that with the QDialogButtonBox
    101      * the order isn't fixed any more. */
    102 //    setTabOrder (mSearchPanel->focusProxy(), mBtnHelp);
    103 //    setTabOrder (mBtnHelp, mBtnFind);
    104 //    setTabOrder (mBtnFind, mBtnSave);
    105 //    setTabOrder (mBtnSave, mBtnRefresh);
    106 //    setTabOrder (mBtnRefresh, mBtnClose);
    107 //    setTabOrder (mBtnClose, mLogList);
    10897
    10998    /* Setup connections */
     
    125114    /* Loading language constants */
    126115    retranslateUi();
    127 
    128116}
    129117
     
    247235void VBoxVMLogViewer::currentLogPageChanged (int aIndex)
    248236{
    249     if (aIndex >= 0 && 
     237    if (aIndex >= 0 &&
    250238        aIndex < mLogFilesList.count())
    251239        setFileForProxyIcon (mLogFilesList.at (aIndex));
     
    263251    mBtnFind->setText (tr ("&Find"));
    264252    mBtnRefresh->setText (tr ("&Refresh"));
    265     mBtnSave->setText (tr ("&Save")); 
    266     mBtnClose->setText (tr ("Close")); 
     253    mBtnSave->setText (tr ("&Save"));
     254    mBtnClose->setText (tr ("Close"));
    267255}
    268256
     
    299287        }
    300288    }
    301 
    302     VBoxGlobal::centerWidget (this, parentWidget());
    303289}
    304290
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