Changeset 7397 in vbox
- Timestamp:
- Mar 10, 2008 12:53:51 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/QIStateIndicator.h
r7381 r7397 30 30 public: 31 31 32 QIStateIndicator (int aState , QWidget *aParent);32 QIStateIndicator (int aState); 33 33 ~QIStateIndicator(); 34 34 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h
r7378 r7397 24 24 /* Qt includes */ 25 25 #include <QMainWindow> 26 27 #include <qmap.h> 28 #include <qobject.h> 29 #include <qcolor.h> 30 #include <qdialog.h> 31 //Added by qt3to4: 32 #include <QContextMenuEvent> 33 #include <q3hbox.h> 34 #include <QLabel> 35 #include <QEvent> 36 #include <Q3ActionGroup> 37 #include <QShowEvent> 38 #include <QCloseEvent> 26 #include <QMap> 27 #include <QColor> 28 #include <QDialog> 29 39 30 40 31 #ifdef VBOX_WITH_DEBUGGER_GUI … … 48 39 49 40 class QAction; 50 class Q3ActionGroup; 51 class Q3HBox; 41 class QActionGroup; 52 42 class QLabel; 53 43 class QSpacerItem; … … 67 57 68 58 VBoxConsoleWnd (VBoxConsoleWnd **aSelf, 69 QWidget* aParent = 0, const char* aName = 0,59 QWidget* aParent = 0, 70 60 Qt::WFlags aFlags = Qt::WType_TopLevel); 71 61 virtual ~VBoxConsoleWnd(); … … 206 196 QMenu *mMainMenu; 207 197 208 Q 3ActionGroup *mRunningActions;209 Q 3ActionGroup *mRunningOrPausedActions;198 QActionGroup *mRunningActions; 199 QActionGroup *mRunningOrPausedActions; 210 200 211 201 // Machine actions … … 301 291 QIStateIndicator *autoresize_state; 302 292 QIStateIndicator *vrdp_state; 303 Q 3HBox*hostkey_hbox;293 QWidget *hostkey_hbox; 304 294 QLabel *hostkey_name; 305 295 -
trunk/src/VBox/Frontends/VirtualBox4/src/QIStateIndicator.cpp
r7390 r7397 38 38 * the initial indicator state 39 39 */ 40 QIStateIndicator::QIStateIndicator (int aState, 41 QWidget *aParent) 42 : QFrame (aParent) 40 QIStateIndicator::QIStateIndicator (int aState) 43 41 // : QFrame (aParent, aName, aFlags | Qt::WStaticContents | Qt::WMouseNoMask) 44 42 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp
r7390 r7397 31 31 32 32 /* Qt includes */ 33 #include <qaction.h> 34 #include <qmenubar.h> 35 #include <q3buttongroup.h> 36 #include <qradiobutton.h> 37 #include <qfile.h> 38 #include <qdir.h> 39 #include <qpushbutton.h> 40 #include <qcursor.h> 41 #include <qtimer.h> 42 #include <qeventloop.h> 43 #include <qregexp.h> 44 //Added by qt3to4: 33 #include <QActionGroup> 45 34 #include <QDesktopWidget> 46 #include <QResizeEvent> 47 #include <QContextMenuEvent> 48 #include <QLabel> 49 #include <QCloseEvent> 50 #include <Q3GridLayout> 51 #include <QShowEvent> 52 #include <q3mimefactory.h> 53 #include <Q3HBoxLayout> 54 #include <QEvent> 55 #include <Q3VBoxLayout> 56 #include <Q3Frame> 57 #include <Q3ActionGroup> 35 #include <QMenuBar> 36 #include <QFileInfo> 37 #include <QDir> 58 38 #ifdef Q_WS_X11 59 39 # include <QX11Info> … … 119 99 */ 120 100 VBoxConsoleWnd:: 121 VBoxConsoleWnd (VBoxConsoleWnd **aSelf, QWidget* aParent, const char* aName,101 VBoxConsoleWnd (VBoxConsoleWnd **aSelf, QWidget* aParent, 122 102 Qt::WFlags aFlags) 123 : QMainWindow (aParent, a Name, aFlags)103 : QMainWindow (aParent, aFlags) 124 104 , mMainMenu (0) 125 105 #ifdef VBOX_WITH_DEBUGGER_GUI … … 159 139 /* default application icon (will change to the VM-specific icon in 160 140 * openView()) */ 161 set Icon (QPixmap(":/ico40x01.png"));141 setWindowIcon (QIcon (":/ico40x01.png")); 162 142 163 143 /* ensure status bar is created */ … … 169 149 * Note that only actions whose enabled state depends exclusively on the 170 150 * execution state of the VM are added to this group. */ 171 mRunningActions = new Q 3ActionGroup (this);151 mRunningActions = new QActionGroup (this); 172 152 mRunningActions->setExclusive (false); 173 153 … … 175 155 * paused. Note that only actions whose enabled state depends exclusively 176 156 * on the execution state of the VM are added to this group. */ 177 mRunningOrPausedActions = new Q 3ActionGroup (this);157 mRunningOrPausedActions = new QActionGroup (this); 178 158 mRunningOrPausedActions->setExclusive (false); 179 159 180 160 /* VM menu actions */ 181 161 182 vmFullscreenAction = new QAction (this , "vmFullscreenAction");183 vmFullscreenAction->setIcon Set(162 vmFullscreenAction = new QAction (this); 163 vmFullscreenAction->setIcon ( 184 164 VBoxGlobal::iconSet (":/fullscreen_16px.png", ":/fullscreen_disabled_16px.png")); 185 vmFullscreenAction->set ToggleAction(true);186 187 vmSeamlessAction = new QAction (this , "vmSeamlessAction");188 vmSeamlessAction->setIcon Set(165 vmFullscreenAction->setCheckable (true); 166 167 vmSeamlessAction = new QAction (this); 168 vmSeamlessAction->setIcon ( 189 169 VBoxGlobal::iconSet (":/nw_16px.png", ":/nw_disabled_16px.png")); 190 vmSeamlessAction->set ToggleAction(true);191 192 vmAutoresizeGuestAction = new QAction (mRunningActions , "vmAutoresizeGuestAction");193 vmAutoresizeGuestAction->setIcon Set(170 vmSeamlessAction->setCheckable (true); 171 172 vmAutoresizeGuestAction = new QAction (mRunningActions); 173 vmAutoresizeGuestAction->setIcon ( 194 174 VBoxGlobal::iconSet (":/auto_resize_on_16px.png", ":/auto_resize_on_disabled_16px.png")); 195 vmAutoresizeGuestAction->set ToggleAction(true);175 vmAutoresizeGuestAction->setCheckable (true); 196 176 vmAutoresizeGuestAction->setEnabled (false); 197 177 198 vmAdjustWindowAction = new QAction (this , "vmAdjustWindowAction");199 vmAdjustWindowAction->setIcon Set(178 vmAdjustWindowAction = new QAction (this); 179 vmAdjustWindowAction->setIcon ( 200 180 VBoxGlobal::iconSet (":/adjust_win_size_16px.png", 201 181 ":/adjust_win_size_disabled_16px.png")); 202 182 203 vmTypeCADAction = new QAction (mRunningActions , "vmTypeCADAction");204 vmTypeCADAction->setIcon Set(VBoxGlobal::iconSet (":/hostkey_16px.png",183 vmTypeCADAction = new QAction (mRunningActions); 184 vmTypeCADAction->setIcon (VBoxGlobal::iconSet (":/hostkey_16px.png", 205 185 ":/hostkey_disabled_16px.png")); 206 186 207 187 #if defined(Q_WS_X11) 208 vmTypeCABSAction = new QAction (mRunningActions , "vmTypeCABSAction");209 vmTypeCABSAction->setIcon Set(VBoxGlobal::iconSet (":/hostkey_16px.png",188 vmTypeCABSAction = new QAction (mRunningActions); 189 vmTypeCABSAction->setIcon (VBoxGlobal::iconSet (":/hostkey_16px.png", 210 190 ":/hostkey_disabled_16px.png")); 211 191 #endif 212 192 213 vmResetAction = new QAction (mRunningActions , "vmResetAction");214 vmResetAction->setIcon Set(VBoxGlobal::iconSet (":/reset_16px.png",193 vmResetAction = new QAction (mRunningActions); 194 vmResetAction->setIcon (VBoxGlobal::iconSet (":/reset_16px.png", 215 195 ":/reset_disabled_16px.png")); 216 196 217 vmPauseAction = new QAction (this , "vmPauseAction");218 vmPauseAction->setIcon Set(VBoxGlobal::iconSet (":/pause_16px.png"));219 vmPauseAction->set ToggleAction(true);220 221 vmACPIShutdownAction = new QAction (mRunningActions , "vmACPIShutdownAction");222 vmACPIShutdownAction->setIcon Set(197 vmPauseAction = new QAction (this); 198 vmPauseAction->setIcon (VBoxGlobal::iconSet (":/pause_16px.png")); 199 vmPauseAction->setCheckable (true); 200 201 vmACPIShutdownAction = new QAction (mRunningActions); 202 vmACPIShutdownAction->setIcon ( 223 203 VBoxGlobal::iconSet (":/acpi_16px.png", ":/acpi_disabled_16px.png")); 224 204 225 vmCloseAction = new QAction (this , "vmCloseAction");226 vmCloseAction->setIcon Set(VBoxGlobal::iconSet (":/exit_16px.png"));227 228 vmTakeSnapshotAction = new QAction (mRunningOrPausedActions , "vmTakeSnapshotAction");229 vmTakeSnapshotAction->setIcon Set(VBoxGlobal::iconSet (205 vmCloseAction = new QAction (this); 206 vmCloseAction->setIcon (VBoxGlobal::iconSet (":/exit_16px.png")); 207 208 vmTakeSnapshotAction = new QAction (mRunningOrPausedActions); 209 vmTakeSnapshotAction->setIcon (VBoxGlobal::iconSet ( 230 210 ":/take_snapshot_16px.png", ":/take_snapshot_dis_16px.png")); 231 211 232 vmShowInformationDlgAction = new QAction (this , "vmShowInformationDlgAction");233 vmShowInformationDlgAction->setIcon Set(VBoxGlobal::iconSet (212 vmShowInformationDlgAction = new QAction (this); 213 vmShowInformationDlgAction->setIcon (VBoxGlobal::iconSet ( 234 214 ":/description_16px.png", ":/description_disabled_16px.png")); 235 215 236 vmDisableMouseIntegrAction = new QAction (this , "vmDisableMouseIntegrAction");237 vmDisableMouseIntegrAction->setIcon Set(VBoxGlobal::iconSet (216 vmDisableMouseIntegrAction = new QAction (this); 217 vmDisableMouseIntegrAction->setIcon (VBoxGlobal::iconSet ( 238 218 ":/mouse_can_seamless_16px.png", ":/mouse_can_seamless_disabled_16px.png")); 239 vmDisableMouseIntegrAction->set ToggleAction(true);219 vmDisableMouseIntegrAction->setCheckable (true); 240 220 241 221 /* Devices menu actions */ 242 222 243 devicesMountFloppyImageAction = new QAction (mRunningOrPausedActions, 244 "devicesMountFloppyImageAction"); 245 246 devicesUnmountFloppyAction = new QAction (this, "devicesUnmountFloppyAction"); 247 devicesUnmountFloppyAction->setIconSet (VBoxGlobal::iconSet (":/fd_unmount_16px.png", 223 devicesMountFloppyImageAction = new QAction (mRunningOrPausedActions); 224 225 devicesUnmountFloppyAction = new QAction (this); 226 devicesUnmountFloppyAction->setIcon (VBoxGlobal::iconSet (":/fd_unmount_16px.png", 248 227 ":/fd_unmount_dis_16px.png")); 249 228 250 devicesMountDVDImageAction = new QAction (mRunningOrPausedActions, 251 "devicesMountISOImageAction"); 252 253 devicesUnmountDVDAction = new QAction (this, "devicesUnmountDVDAction"); 254 devicesUnmountDVDAction->setIconSet (VBoxGlobal::iconSet (":/cd_unmount_16px.png", 229 devicesMountDVDImageAction = new QAction (mRunningOrPausedActions); 230 231 devicesUnmountDVDAction = new QAction (this); 232 devicesUnmountDVDAction->setIcon (VBoxGlobal::iconSet (":/cd_unmount_16px.png", 255 233 ":/cd_unmount_dis_16px.png")); 256 234 257 devicesSFDialogAction = new QAction (mRunningOrPausedActions, 258 "devicesSFDialogAction"); 259 devicesSFDialogAction->setIconSet (VBoxGlobal::iconSet (":/shared_folder_16px.png", 235 devicesSFDialogAction = new QAction (mRunningOrPausedActions); 236 devicesSFDialogAction->setIcon (VBoxGlobal::iconSet (":/shared_folder_16px.png", 260 237 ":/shared_folder_disabled_16px.png")); 261 238 262 devicesSwitchVrdpAction = new QAction (mRunningOrPausedActions, 263 "devicesSwitchVrdpAction"); 264 devicesSwitchVrdpAction->setIconSet (VBoxGlobal::iconSet (":/vrdp_16px.png", 239 devicesSwitchVrdpAction = new QAction (mRunningOrPausedActions); 240 devicesSwitchVrdpAction->setIcon (VBoxGlobal::iconSet (":/vrdp_16px.png", 265 241 ":/vrdp_disabled_16px.png")); 266 devicesSwitchVrdpAction->setToggleAction (true); 267 268 devicesInstallGuestToolsAction = new QAction (mRunningActions, 269 "devicesInstallGuestToolsAction"); 270 devicesInstallGuestToolsAction->setIconSet (VBoxGlobal::iconSet (":/guesttools_16px.png", 242 devicesSwitchVrdpAction->setCheckable (true); 243 244 devicesInstallGuestToolsAction = new QAction (mRunningActions); 245 devicesInstallGuestToolsAction->setIcon (VBoxGlobal::iconSet (":/guesttools_16px.png", 271 246 ":/guesttools_disabled_16px.png")); 272 247 … … 274 249 if (vboxGlobal().isDebuggerEnabled()) 275 250 { 276 dbgStatisticsAction = new QAction (this , "dbgStatisticsAction");277 dbgCommandLineAction = new QAction (this , "dbgCommandLineAction");251 dbgStatisticsAction = new QAction (this); 252 dbgCommandLineAction = new QAction (this); 278 253 } 279 254 else … … 286 261 /* Help menu actions */ 287 262 288 helpContentsAction = new QAction (this , "helpContentsAction");289 helpContentsAction->setIcon Set(VBoxGlobal::iconSet (":/help_16px.png"));290 helpWebAction = new QAction (this , "helpWebAction");291 helpWebAction->setIcon Set(VBoxGlobal::iconSet (":/site_16px.png"));292 helpRegisterAction = new QAction (this , "helpRegisterAction");293 helpRegisterAction->setIcon Set(VBoxGlobal::iconSet (":/register_16px.png",263 helpContentsAction = new QAction (this); 264 helpContentsAction->setIcon (VBoxGlobal::iconSet (":/help_16px.png")); 265 helpWebAction = new QAction (this); 266 helpWebAction->setIcon (VBoxGlobal::iconSet (":/site_16px.png")); 267 helpRegisterAction = new QAction (this); 268 helpRegisterAction->setIcon (VBoxGlobal::iconSet (":/register_16px.png", 294 269 ":/register_disabled_16px.png")); 295 helpAboutAction = new QAction (this , "helpAboutAction");296 helpAboutAction->setIcon Set(VBoxGlobal::iconSet (":/about_16px.png"));297 helpResetMessagesAction = new QAction (this , "helpResetMessagesAction");298 helpResetMessagesAction->setIcon Set(VBoxGlobal::iconSet (":/reset_16px.png"));270 helpAboutAction = new QAction (this); 271 helpAboutAction->setIcon (VBoxGlobal::iconSet (":/about_16px.png")); 272 helpResetMessagesAction = new QAction (this); 273 helpResetMessagesAction->setIcon (VBoxGlobal::iconSet (":/reset_16px.png")); 299 274 300 275 ///// Menubar /////////////////////////////////////////////////////////// … … 311 286 true /* inverted toggle state */); 312 287 313 vm FullscreenAction->addTo (vmMenu);314 vm SeamlessAction->addTo (vmMenu);315 vm AdjustWindowAction->addTo (vmMenu);316 vm AutoresizeGuestAction->addTo (vmMenu);317 vmMenu-> insertSeparator();318 vm DisableMouseIntegrAction->addTo (vmMenu);319 vmMenu-> insertSeparator();320 vm TypeCADAction->addTo (vmMenu);288 vmMenu->addAction (vmFullscreenAction); 289 vmMenu->addAction (vmSeamlessAction); 290 vmMenu->addAction (vmAdjustWindowAction); 291 vmMenu->addAction (vmAutoresizeGuestAction); 292 vmMenu->addSeparator(); 293 vmMenu->addAction (vmDisableMouseIntegrAction); 294 vmMenu->addSeparator(); 295 vmMenu->addAction (vmTypeCADAction); 321 296 #if defined(Q_WS_X11) 322 vm TypeCABSAction->addTo (vmMenu);323 #endif 324 vmMenu-> insertSeparator();325 vm TakeSnapshotAction->addTo (vmMenu);326 vmMenu-> insertSeparator();327 vm ShowInformationDlgAction->addTo (vmMenu);328 vmMenu-> insertSeparator();329 vm ResetAction->addTo (vmMenu);330 vm PauseAction->addTo (vmMenu);331 vm ACPIShutdownAction->addTo (vmMenu);332 vmMenu-> insertSeparator();333 vm CloseAction->addTo (vmMenu);297 vmMenu->addAction (vmTypeCABSAction); 298 #endif 299 vmMenu->addSeparator(); 300 vmMenu->addAction (vmTakeSnapshotAction); 301 vmMenu->addSeparator(); 302 vmMenu->addAction (vmShowInformationDlgAction); 303 vmMenu->addSeparator(); 304 vmMenu->addAction (vmResetAction); 305 vmMenu->addAction (vmPauseAction); 306 vmMenu->addAction (vmACPIShutdownAction); 307 vmMenu->addSeparator(); 308 vmMenu->addAction (vmCloseAction); 334 309 335 310 menuBar()->insertItem (QString::null, vmMenu, vmMenuId); … … 350 325 devicesMenu->insertItem (VBoxGlobal::iconSet (":/cd_16px.png", ":/cd_disabled_16px.png"), 351 326 QString::null, devicesMountDVDMenu, devicesMountDVDMenuId); 352 devices UnmountDVDAction->addTo (devicesMenu);353 devicesMenu-> insertSeparator();327 devicesMenu->addAction (devicesUnmountDVDAction); 328 devicesMenu->addSeparator(); 354 329 355 330 devicesMenu->insertItem (VBoxGlobal::iconSet (":/fd_16px.png", ":/fd_disabled_16px.png"), 356 331 QString::null, devicesMountFloppyMenu, devicesMountFloppyMenuId); 357 devices UnmountFloppyAction->addTo (devicesMenu);358 devicesMenu-> insertSeparator();332 devicesMenu->addAction (devicesUnmountFloppyAction); 333 devicesMenu->addSeparator(); 359 334 360 335 devicesMenu->insertItem (VBoxGlobal::iconSet (":/nw_16px.png", ":/nw_disabled_16px.png"), 361 336 QString::null, devicesNetworkMenu, devicesNetworkMenuId); 362 devicesMenu-> insertSeparator();337 devicesMenu->addSeparator(); 363 338 364 339 devicesMenu->insertItem (VBoxGlobal::iconSet (":/usb_16px.png", ":/usb_disabled_16px.png"), … … 366 341 devicesUSBMenuSeparatorId = devicesMenu->insertSeparator(); 367 342 368 devices SFDialogAction->addTo (devicesMenu);343 devicesMenu->addAction (devicesSFDialogAction); 369 344 devicesSFMenuSeparatorId = devicesMenu->insertSeparator(); 370 devices SFDialogAction->addTo (devicesSFMenu);371 372 devices SwitchVrdpAction->addTo (devicesMenu);345 devicesMenu->addAction (devicesSFDialogAction); 346 347 devicesMenu->addAction (devicesSwitchVrdpAction); 373 348 devicesVRDPMenuSeparatorId = devicesMenu->insertSeparator(); 374 349 375 devices InstallGuestToolsAction->addTo (devicesMenu);350 devicesMenu->addAction (devicesInstallGuestToolsAction); 376 351 377 352 menuBar()->insertItem (QString::null, devicesMenu, devicesMenuId); … … 388 363 { 389 364 dbgMenu = new QMenu (this); 390 dbg StatisticsAction->addTo (dbgMenu);391 dbg CommandLineAction->addTo (dbgMenu);365 dbgMenu->addAction (dbgStatisticsAction); 366 dbgMenu->addAction (dbgCommandLineAction); 392 367 menuBar()->insertItem (QString::null, dbgMenu, dbgMenuId); 393 368 mMainMenu->insertItem (QString::null, dbgMenu, dbgMenuId); … … 401 376 QMenu *helpMenu = new QMenu (this); 402 377 403 help ContentsAction->addTo (helpMenu);404 help WebAction->addTo( helpMenu);405 helpMenu-> insertSeparator();378 helpMenu->addAction (helpContentsAction); 379 helpMenu->addAction (helpWebAction); 380 helpMenu->addSeparator(); 406 381 #ifdef VBOX_WITH_REGISTRATION 407 help RegisterAction->addTo (helpMenu);382 helpMenu->addAction (helpRegisterAction); 408 383 helpRegisterAction->setEnabled (vboxGlobal().virtualBox(). 409 384 GetExtraData (VBoxDefs::GUI_RegistrationDlgWinID).isEmpty()); 410 385 #endif 411 help AboutAction->addTo( helpMenu);412 helpMenu-> insertSeparator();413 help ResetMessagesAction->addTo (helpMenu);386 helpMenu->addAction (helpAboutAction); 387 helpMenu->addSeparator(); 388 helpMenu->addAction (helpResetMessagesAction); 414 389 415 390 menuBar()->insertItem( QString::null, helpMenu, helpMenuId ); … … 418 393 ///// Status bar //////////////////////////////////////////////////////// 419 394 420 Q3HBox *indicatorBox = new Q3HBox (0, "indicatorBox"); 421 indicatorBox->setSpacing (5); 395 QWidget *indicatorBox = new QWidget (); 396 QHBoxLayout *indicatorBoxHLayout = new QHBoxLayout (indicatorBox); 397 indicatorBoxHLayout->setContentsMargins (0, 0, 0, 0); 398 indicatorBoxHLayout->setSpacing (5); 422 399 /* i/o devices */ 423 hd_light = new QIStateIndicator (KDeviceActivity_Idle , indicatorBox);400 hd_light = new QIStateIndicator (KDeviceActivity_Idle); 424 401 hd_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/hd_16px.png")); 425 402 hd_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/hd_read_16px.png")); 426 403 hd_light->setStateIcon (KDeviceActivity_Writing, QPixmap (":/hd_write_16px.png")); 427 404 hd_light->setStateIcon (KDeviceActivity_Null, QPixmap (":/hd_disabled_16px.png")); 428 cd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox); 405 indicatorBoxHLayout->addWidget (hd_light); 406 cd_light = new QIStateIndicator (KDeviceActivity_Idle); 429 407 cd_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/cd_16px.png")); 430 408 cd_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/cd_read_16px.png")); 431 409 cd_light->setStateIcon (KDeviceActivity_Writing, QPixmap (":/cd_write_16px.png")); 432 410 cd_light->setStateIcon (KDeviceActivity_Null, QPixmap (":/cd_disabled_16px.png")); 433 fd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox); 411 indicatorBoxHLayout->addWidget (cd_light); 412 fd_light = new QIStateIndicator (KDeviceActivity_Idle); 434 413 fd_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/fd_16px.png")); 435 414 fd_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/fd_read_16px.png")); 436 415 fd_light->setStateIcon (KDeviceActivity_Writing, QPixmap (":/fd_write_16px.png")); 437 416 fd_light->setStateIcon (KDeviceActivity_Null, QPixmap (":/fd_disabled_16px.png")); 438 net_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox); 417 indicatorBoxHLayout->addWidget (fd_light); 418 net_light = new QIStateIndicator (KDeviceActivity_Idle); 439 419 net_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/nw_16px.png")); 440 420 net_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/nw_read_16px.png")); 441 421 net_light->setStateIcon (KDeviceActivity_Writing, QPixmap (":/nw_write_16px.png")); 442 422 net_light->setStateIcon (KDeviceActivity_Null, QPixmap (":/nw_disabled_16px.png")); 443 usb_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox); 423 indicatorBoxHLayout->addWidget (net_light); 424 usb_light = new QIStateIndicator (KDeviceActivity_Idle); 444 425 usb_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/usb_16px.png")); 445 426 usb_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/usb_read_16px.png")); 446 427 usb_light->setStateIcon (KDeviceActivity_Writing, QPixmap (":/usb_write_16px.png")); 447 428 usb_light->setStateIcon (KDeviceActivity_Null, QPixmap (":/usb_disabled_16px.png")); 448 sf_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox); 429 indicatorBoxHLayout->addWidget (usb_light); 430 sf_light = new QIStateIndicator (KDeviceActivity_Idle); 449 431 sf_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/shared_folder_16px.png")); 450 432 sf_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/shared_folder_read_16px.png")); 451 433 sf_light->setStateIcon (KDeviceActivity_Writing, QPixmap (":/shared_folder_write_16px.png")); 452 434 sf_light->setStateIcon (KDeviceActivity_Null, QPixmap (":/shared_folder_disabled_16px.png")); 453 454 (new Q3Frame (indicatorBox))->setFrameStyle (Q3Frame::VLine | Q3Frame::Sunken); 435 indicatorBoxHLayout->addWidget (sf_light); 436 437 QFrame *separator = new QFrame(); 438 separator->setFrameStyle (QFrame::VLine | QFrame::Sunken); 439 indicatorBoxHLayout->addWidget (separator); 455 440 456 441 #if 0 // do not show these indicators, information overload … … 468 453 469 454 /* mouse */ 470 mouse_state = new QIStateIndicator (0 , indicatorBox);455 mouse_state = new QIStateIndicator (0); 471 456 mouse_state->setStateIcon (0, QPixmap (":/mouse_disabled_16px.png")); 472 457 mouse_state->setStateIcon (1, QPixmap (":/mouse_16px.png")); … … 474 459 mouse_state->setStateIcon (3, QPixmap (":/mouse_can_seamless_16px.png")); 475 460 mouse_state->setStateIcon (4, QPixmap (":/mouse_can_seamless_uncaptured_16px.png")); 461 indicatorBoxHLayout->addWidget (mouse_state); 476 462 /* host key */ 477 hostkey_hbox = new Q3HBox (indicatorBox, "hostkey_hbox"); 478 hostkey_hbox->setSpacing (3); 479 hostkey_state = new QIStateIndicator (0, hostkey_hbox); 463 hostkey_hbox = new QWidget(); 464 QHBoxLayout *hostkeyHBoxLayout = new QHBoxLayout (hostkey_hbox); 465 hostkeyHBoxLayout->setContentsMargins (0, 0, 0, 0); 466 hostkeyHBoxLayout->setSpacing (3); 467 indicatorBoxHLayout->addWidget (hostkey_hbox); 468 469 hostkey_state = new QIStateIndicator (0); 480 470 hostkey_state->setStateIcon (0, QPixmap (":/hostkey_16px.png")); 481 471 hostkey_state->setStateIcon (1, QPixmap (":/hostkey_captured_16px.png")); 482 472 hostkey_state->setStateIcon (2, QPixmap (":/hostkey_pressed_16px.png")); 483 473 hostkey_state->setStateIcon (3, QPixmap (":/hostkey_captured_pressed_16px.png")); 484 hostkey_name = new QLabel (QIHotKeyEdit::keyName (vboxGlobal().settings().hostKey()), 485 hostkey_hbox, "hostkey_name"); 474 hostkeyHBoxLayout->addWidget (hostkey_state); 475 hostkey_name = new QLabel (QIHotKeyEdit::keyName (vboxGlobal().settings().hostKey())); 476 hostkeyHBoxLayout->addWidget (hostkey_name); 486 477 /* add to statusbar */ 487 statusBar()->add Widget (indicatorBox, 0, true);478 statusBar()->addPermanentWidget (indicatorBox, 0); 488 479 489 480 ///////////////////////////////////////////////////////////////////////// … … 491 482 languageChange(); 492 483 493 set Caption(caption_prefix);484 setWindowTitle (caption_prefix); 494 485 495 486 ///// Connections /////////////////////////////////////////////////////// … … 657 648 if (!centralWidget()) 658 649 { 659 setCentralWidget (new QWidget (this, "centralWidget")); 660 Q3GridLayout *pMainLayout = new Q3GridLayout(centralWidget(), 3, 3, 0, 0); 650 setCentralWidget (new QWidget (this)); 651 QGridLayout *pMainLayout = new QGridLayout(centralWidget()); 652 pMainLayout->setContentsMargins (0, 0, 0, 0); 653 pMainLayout->setSpacing (0); 654 661 655 mShiftingSpacerLeft = new QSpacerItem (0, 0, 662 QSizePolicy:: Fixed,663 QSizePolicy:: Fixed);656 QSizePolicy::Preferred, 657 QSizePolicy::Preferred); 664 658 mShiftingSpacerTop = new QSpacerItem (0, 0, 665 QSizePolicy:: Fixed,666 QSizePolicy:: Fixed);659 QSizePolicy::Preferred, 660 QSizePolicy::Preferred); 667 661 mShiftingSpacerRight = new QSpacerItem (0, 0, 668 QSizePolicy:: Fixed,669 QSizePolicy:: Fixed);662 QSizePolicy::Preferred, 663 QSizePolicy::Preferred); 670 664 mShiftingSpacerBottom = new QSpacerItem (0, 0, 671 QSizePolicy:: Fixed,672 QSizePolicy:: Fixed);673 pMainLayout->addItem (mShiftingSpacerLeft, 1, 0);674 pMainLayout->add MultiCell(mShiftingSpacerTop, 0, 0, 0, 2);675 pMainLayout->addItem (mShiftingSpacerRight, 1, 2);676 pMainLayout->add MultiCell(mShiftingSpacerBottom, 2, 2, 0, 2);665 QSizePolicy::Preferred, 666 QSizePolicy::Preferred); 667 pMainLayout->addItem (mShiftingSpacerTop, 0, 0, 1, -1); 668 pMainLayout->addItem (mShiftingSpacerLeft, 1, 0); 669 pMainLayout->addItem (mShiftingSpacerRight, 1, 2); 670 pMainLayout->addItem (mShiftingSpacerBottom, 2, 0, 1, -1); 677 671 } 678 672 … … 689 683 activateUICustomizations(); 690 684 691 static_cast<Q 3GridLayout*>(centralWidget()->layout())->addWidget(console, 1, 1, Qt::AlignVCenter | Qt::AlignHCenter);685 static_cast<QGridLayout*>(centralWidget()->layout())->addWidget(console, 1, 1, Qt::AlignVCenter | Qt::AlignHCenter); 692 686 693 687 CMachine cmachine = csession.GetMachine(); … … 696 690 /* Not on Mac OS X. The dock icon is handled below. */ 697 691 #ifndef Q_WS_MAC 698 set Icon (vboxGlobal().vmGuestOSTypeIcon (cmachine.GetOSTypeId()));692 setWindowIcon (vboxGlobal().vmGuestOSTypeIcon (cmachine.GetOSTypeId())); 699 693 #endif 700 694 … … 803 797 /* start an idle timer that will update device lighths */ 804 798 connect (idle_timer, SIGNAL (timeout()), SLOT (updateDeviceLights())); 805 idle_timer->start (50 , false);799 idle_timer->start (50); 806 800 807 801 connect (console, SIGNAL (mouseStateChanged (int)), … … 1010 1004 console->detach(); 1011 1005 1012 centralWidget()->layout()->remove ( console);1006 centralWidget()->layout()->removeWidget (console); 1013 1007 delete console; 1014 1008 console = 0; … … 1134 1128 1135 1129 mMainMenu->popup (pos); 1136 mMainMenu-> setActiveWindow();1130 mMainMenu->activateWindow(); 1137 1131 mMainMenu->setActiveItem (0); 1138 1132 } … … 1177 1171 { 1178 1172 StatusTipEvent *ev = (StatusTipEvent*) e; 1179 statusBar()-> message (ev->mTip);1173 statusBar()->showMessage (ev->mTip); 1180 1174 break; 1181 1175 } … … 1254 1248 1255 1249 /* make the Discard checkbox invisible if there are no snapshots */ 1256 dlg.cbDiscardCurState->set Shown((cmachine.GetSnapshotCount() > 0));1250 dlg.cbDiscardCurState->setVisible ((cmachine.GetSnapshotCount() > 0)); 1257 1251 1258 1252 if (machine_state != KMachineState_Stuck) … … 1260 1254 /* read the last user's choice for the given VM */ 1261 1255 QStringList lastAction = 1262 QStringList::split (',', cmachine.GetExtraData (VBoxDefs::GUI_LastCloseAction));1256 cmachine.GetExtraData (VBoxDefs::GUI_LastCloseAction).split (','); 1263 1257 AssertWrapperOk (cmachine); 1264 1258 if (lastAction [0] == kPowerOff) … … 1342 1336 1343 1337 /* discard the current state if requested */ 1344 if (dlg.cbDiscardCurState->is Shown() &&1338 if (dlg.cbDiscardCurState->isVisible() && 1345 1339 dlg.cbDiscardCurState->isChecked()) 1346 1340 { … … 1612 1606 1613 1607 #if 0 1614 QToolTip::add (autoresize_state,1608 autoresize_state->setToolTip ( 1615 1609 tr ("Indicates whether the guest display auto-resize function is On " 1616 1610 "(<img src=:/auto_resize_on_16px.png/>) or Off (<img src=:/auto_resize_off_16px.png/>). " 1617 1611 "Note that this function requires Guest Additions to be installed in the guest OS.")); 1618 1612 #endif 1619 QToolTip::add (mouse_state,1613 mouse_state->setToolTip ( 1620 1614 tr ("Indicates whether the host mouse pointer is captured by the guest OS:<br>" 1621 1615 "<nobr><img src=:/mouse_disabled_16px.png/> pointer is not captured</nobr><br>" … … 1625 1619 "<nobr><img src=:/mouse_can_seamless_uncaptured_16px.png/> MI is Off, pointer is not captured</nobr><br>" 1626 1620 "Note that the mouse integration feature requires Guest Additions to be installed in the guest OS.")); 1627 QToolTip::add (hostkey_state,1621 hostkey_state->setToolTip ( 1628 1622 tr ("Indicates whether the keyboard is captured by the guest OS " 1629 1623 "(<img src=:/hostkey_captured_16px.png/>) or not (<img src=:/hostkey_16px.png/>).")); 1630 QToolTip::add (hostkey_name,1624 hostkey_name->setToolTip ( 1631 1625 tr ("Shows the currently assigned Host key.<br>" 1632 1626 "This key, when pressed alone, toggles the the keyboard and mouse " … … 1656 1650 snapshotName = " (" + snapshot.GetName() + ")"; 1657 1651 } 1658 set Caption(cmachine.GetName() + snapshotName +1659 " [" + vboxGlobal().toString (machine_state) + "] - " +1660 caption_prefix);1652 setWindowTitle (cmachine.GetName() + snapshotName + 1653 " [" + vboxGlobal().toString (machine_state) + "] - " + 1654 caption_prefix); 1661 1655 //#ifdef Q_WS_MAC 1662 1656 // SetWindowTitleWithCFString (reinterpret_cast <WindowPtr> (this->winId()), CFSTR("sfds")); … … 1706 1700 AssertMsgFailed (("Invalid floppy drive state: %d\n", state)); 1707 1701 } 1708 QToolTip::add (fd_light,tip.arg (name));1702 fd_light->setToolTip (tip.arg (name)); 1709 1703 } 1710 1704 if (element & DVDStuff) … … 1750 1744 AssertMsgFailed (("Invalid DVD drive state: %d\n", state)); 1751 1745 } 1752 QToolTip::add (cd_light,tip.arg (name));1746 cd_light->setToolTip (tip.arg (name)); 1753 1747 } 1754 1748 if (element & HardDiskStuff) … … 1774 1768 data += tr ("<br><nobr><b>No hard disks attached</b></nobr>", 1775 1769 "HDD tooltip"); 1776 QToolTip::add (hd_light,tip.arg (data));1770 hd_light->setToolTip (tip.arg (data)); 1777 1771 hd_light->setState (hasDisks ? KDeviceActivity_Idle : KDeviceActivity_Null); 1778 1772 } … … 1814 1808 "Network adapters tooltip"); 1815 1809 1816 QToolTip::add (net_light,ttip.arg (info));1810 net_light->setToolTip (ttip.arg (info)); 1817 1811 } 1818 1812 if (element & USBStuff) … … 1851 1845 } 1852 1846 1853 QToolTip::add (usb_light,ttip.arg (info));1847 usb_light->setToolTip (ttip.arg (info)); 1854 1848 } 1855 1849 } … … 1872 1866 if (vrdpsrv.GetEnabled()) 1873 1867 tip += tr ("<hr>VRDP Server is listening on port %1").arg (vrdpsrv.GetPort()); 1874 QToolTip::add (vrdp_state,tip);1868 vrdp_state->setToolTip (tip); 1875 1869 #endif 1876 1870 } … … 1902 1896 } 1903 1897 1904 for (QMap <QString, QString>::ConstIterator it = sfs.begin();1905 it != sfs. end(); ++it)1898 for (QMap<QString, QString>::const_iterator it = sfs.constBegin(); 1899 it != sfs.constEnd(); ++it) 1906 1900 { 1907 1901 /* select slashes depending on the OS type */ … … 1909 1903 data += QString ("<tr><td><nobr><b>\\\\vboxsvr\\%1</b></nobr></td>" 1910 1904 "<td><nobr>%2</nobr></td>") 1911 .arg (it.key(), it. data());1905 .arg (it.key(), it.value()); 1912 1906 else 1913 1907 data += QString ("<tr><td><nobr><b>%1</b></nobr></td>" 1914 1908 "<td><nobr>%2</nobr></td></tr>") 1915 .arg (it.key(), it. data());1909 .arg (it.key(), it.value()); 1916 1910 } 1917 1911 … … 1923 1917 "width=100%>%1</table>").arg (data); 1924 1918 1925 QToolTip::add (sf_light,tip.arg (data));1919 sf_light->setToolTip (tip.arg (data)); 1926 1920 } 1927 1921 if (element & PauseAction) … … 2009 2003 QString hotKey = aSeamless ? vmSeamlessAction->text() : 2010 2004 vmFullscreenAction->text(); 2011 hotKey = QStringList::split ('\t', hotKey)[1];2005 hotKey = hotKey.split ('\t')[1]; 2012 2006 Assert (!hotKey.isEmpty()); 2013 2007 … … 2094 2088 2095 2089 /* Hide all but the central widget containing the console view. */ 2096 Q ObjectList list = queryList (NULL, NULL, false, false);2097 foreach (Q Object *obj, list)2098 { 2099 if ( obj->isWidgetType() && obj!= centralWidget())2090 QList<QWidget *> list = findChildren<QWidget *>(); 2091 foreach (QWidget *w, list) 2092 { 2093 if (w != centralWidget()) 2100 2094 { 2101 QWidget *w = (QWidget *) obj;2102 2095 if (!w->isHidden()) 2103 2096 { … … 2176 2169 2177 2170 /* Reset the shifting spacer. */ 2178 mShiftingSpacerLeft->changeSize (0, 0, QSizePolicy:: Fixed, QSizePolicy::Fixed);2179 mShiftingSpacerTop->changeSize (0, 0, QSizePolicy:: Fixed, QSizePolicy::Fixed);2180 mShiftingSpacerRight->changeSize (0, 0, QSizePolicy:: Fixed, QSizePolicy::Fixed);2181 mShiftingSpacerBottom->changeSize (0, 0, QSizePolicy:: Fixed, QSizePolicy::Fixed);2171 mShiftingSpacerLeft->changeSize (0, 0, QSizePolicy::Preferred, QSizePolicy::Preferred); 2172 mShiftingSpacerTop->changeSize (0, 0, QSizePolicy::Preferred, QSizePolicy::Preferred); 2173 mShiftingSpacerRight->changeSize (0, 0, QSizePolicy::Preferred, QSizePolicy::Preferred); 2174 mShiftingSpacerBottom->changeSize (0, 0, QSizePolicy::Preferred, QSizePolicy::Preferred); 2182 2175 2183 2176 /* Restore the previous scroll-view minimum size before the exiting … … 2440 2433 /* Check the current snapshot name */ 2441 2434 QString name = index.GetName(); 2442 int pos = regExp. search(name);2435 int pos = regExp.indexIn (name); 2443 2436 if (pos != -1) 2444 2437 maxSnapShotIndex = regExp.cap (1).toInt() > maxSnapShotIndex ? … … 2454 2447 2455 2448 CProgress progress = 2456 cconsole.TakeSnapshot (dlg.leName->text(). stripWhiteSpace(),2449 cconsole.TakeSnapshot (dlg.leName->text().trimmed(), 2457 2450 dlg.txeDescription->text()); 2458 2451 … … 2631 2624 /* compare the name part ignoring the file case*/ 2632 2625 QString fn = QFileInfo (path).fileName(); 2633 if (RTPathCompare (name. utf8(), fn.utf8()) == 0)2626 if (RTPathCompare (name.toUtf8().constData(), fn.toUtf8().constData()) == 0) 2634 2627 return installGuestAdditionsFrom (path); 2635 2628 } … … 2642 2635 .arg (vbox.GetVersion().remove ("_OSE")) + name; 2643 2636 QString target = QDir (vboxGlobal().virtualBox().GetHomeFolder()) 2644 .abs FilePath (name);2637 .absoluteFilePath (name); 2645 2638 2646 2639 new VBoxDownloaderWgt (statusBar(), devicesInstallGuestToolsAction, … … 2790 2783 2791 2784 if (devicesMountFloppyMenu->count() > 0) 2792 devicesMountFloppyMenu-> insertSeparator();2793 devicesMountFloppy ImageAction->addTo (devicesMountFloppyMenu);2785 devicesMountFloppyMenu->addSeparator(); 2786 devicesMountFloppyMenu->addAction (devicesMountFloppyImageAction); 2794 2787 2795 2788 /* if shown as a context menu */ 2796 2789 if (devicesMenu->itemParameter (devicesMountFloppyMenuId)) 2797 2790 { 2798 devicesMountFloppyMenu-> insertSeparator();2799 devices UnmountFloppyAction->addTo (devicesMountFloppyMenu);2791 devicesMountFloppyMenu->addSeparator(); 2792 devicesMountFloppyMenu->addAction (devicesUnmountFloppyAction); 2800 2793 } 2801 2794 } … … 2836 2829 2837 2830 if (devicesMountDVDMenu->count() > 0) 2838 devicesMountDVDMenu-> insertSeparator();2839 devicesMountDVD ImageAction->addTo (devicesMountDVDMenu);2831 devicesMountDVDMenu->addSeparator(); 2832 devicesMountDVDMenu->addAction (devicesMountDVDImageAction); 2840 2833 2841 2834 /* if shown as a context menu */ … … 2843 2836 if (devicesMenu->itemParameter (devicesMountDVDMenuId)) 2844 2837 { 2845 devicesMountDVDMenu-> insertSeparator();2846 devices UnmountDVDAction->addTo (devicesMountDVDMenu);2838 devicesMountDVDMenu->addSeparator(); 2839 devicesMountDVDMenu->addAction (devicesUnmountDVDAction); 2847 2840 } 2848 2841 } … … 2904 2897 { 2905 2898 if (statusBarChangedInside) 2906 statusBar()->clear ();2899 statusBar()->clearMessage(); 2907 2900 } 2908 2901 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r7382 r7397 896 896 * from the below constructor or from constructors/methods it calls. 897 897 */ 898 VBoxConsoleWnd *w = new VBoxConsoleWnd (&mConsoleWnd, 0 , "consoleWnd");898 VBoxConsoleWnd *w = new VBoxConsoleWnd (&mConsoleWnd, 0); 899 899 Assert (w == mConsoleWnd); 900 900 NOREF(w);
Note:
See TracChangeset
for help on using the changeset viewer.