Changeset 23142 in vbox
- Timestamp:
- Sep 18, 2009 3:39:59 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
r23054 r23142 222 222 void prepareFloppyMenu(); 223 223 void prepareDVDMenu(); 224 void prepareNetworkMenu(); 225 void prepareSFMenu(); 224 226 225 227 void captureFloppy (QAction *aAction); … … 322 324 QMenu *mDevicesMountFloppyMenu; 323 325 QMenu *mDevicesMountDVDMenu; 324 /* see showIndicatorContextMenu for a description of mDevicesSFMenu */325 /* QMenu *mDevicesSFMenu; */326 QMenu *mDevicesSFMenu; 327 QMenu *mDevicesNetworkMenu; 326 328 VBoxUSBMenu *mDevicesUSBMenu; 327 329 /* VBoxSwitchMenu *mDevicesVRDPMenu; */ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r23054 r23142 416 416 417 417 mMainMenu = new QIMenu (this); 418 mDevicesNetworkMenu = new QMenu(this); 419 mDevicesSFMenu = new QMenu(this); 418 420 419 421 /* Machine submenu */ … … 474 476 mDevicesUSBMenuSeparator = mDevicesMenu->addSeparator(); 475 477 476 /* see showIndicatorContextMenu for a description of mDevicesSFMenu */477 /* mDevicesSFMenu = mDevicesMenu->addMenu (QString::null); */478 478 mDevicesMenu->addAction (mDevicesSFDialogAction); 479 479 mDevicesSFMenuSeparator = mDevicesMenu->addSeparator(); … … 664 664 connect (mDevicesMountFloppyMenu, SIGNAL(aboutToShow()), this, SLOT(prepareFloppyMenu())); 665 665 connect (mDevicesMountDVDMenu, SIGNAL(aboutToShow()), this, SLOT(prepareDVDMenu())); 666 connect (mDevicesNetworkMenu, SIGNAL(aboutToShow()), this, SLOT(prepareNetworkMenu())); 667 connect (mDevicesSFMenu, SIGNAL(aboutToShow()), this, SLOT(prepareSFMenu())); 666 668 667 669 connect (statusBar(), SIGNAL(messageChanged (const QString &)), this, SLOT(statusTipChanged (const QString &))); … … 1983 1985 1984 1986 mDevicesNetworkDialogAction->setEnabled (isRunningOrPaused && count > 0); 1987 mDevicesNetworkMenu->setEnabled (isRunningOrPaused && count > 0); 1985 1988 1986 1989 /* update tooltip */ … … 2079 2082 QString data; 2080 2083 QMap <QString, QString> sfs; 2084 2085 mDevicesSFMenu->setEnabled (true); 2081 2086 2082 2087 /// @todo later: add global folders … … 3244 3249 } 3245 3250 3251 void VBoxConsoleWnd::prepareNetworkMenu() 3252 { 3253 mDevicesNetworkMenu->clear(); 3254 mDevicesNetworkMenu->addAction (mDevicesNetworkDialogAction); 3255 } 3256 3257 void VBoxConsoleWnd::prepareSFMenu() 3258 { 3259 mDevicesSFMenu->clear(); 3260 mDevicesSFMenu->addAction (mDevicesSFDialogAction); 3261 } 3262 3246 3263 void VBoxConsoleWnd::statusTipChanged (const QString & /*aMes*/) 3247 3264 { … … 3395 3412 if (ind == sf_light) 3396 3413 { 3397 /* Showing the context menu that always contains a single item is a 3398 * bit stupid; let's better execute this item's action directly. The 3399 * menu itself is kept just in case if we need more than one item in 3400 * the future. */ 3401 /* mDevicesSFMenu->exec (e->globalPos()); */ 3402 if (mDevicesSFDialogAction->isEnabled()) 3403 mDevicesSFDialogAction->trigger(); 3414 if (mDevicesSFMenu->isEnabled()) 3415 { 3416 mDevicesSFMenu->menuAction()->setData (true); 3417 mDevicesSFMenu->exec (e->globalPos()); 3418 mDevicesSFMenu->menuAction()->setData (false); 3419 } 3404 3420 } 3405 3421 else 3406 3422 if (ind == net_light) 3407 3423 { 3408 if (mDevicesNetworkDialogAction->isEnabled()) 3409 mDevicesNetworkDialogAction->trigger(); 3424 if (mDevicesNetworkMenu->isEnabled()) 3425 { 3426 mDevicesNetworkMenu->menuAction()->setData (true); 3427 mDevicesNetworkMenu->exec (e->globalPos()); 3428 mDevicesNetworkMenu->menuAction()->setData (false); 3429 } 3410 3430 } 3411 3431 }
Note:
See TracChangeset
for help on using the changeset viewer.