Changeset 27332 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Mar 12, 2010 2:57:27 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 58759
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r27161 r27332 30 30 /* Local includes */ 31 31 #include "VBoxGlobal.h" 32 #include "VBoxMiniToolBar.h" 32 33 33 34 #include "UISession.h" 35 #include "UIActionsPool.h" 34 36 #include "UIMachineLogic.h" 35 37 #include "UIMachineView.h" … … 40 42 , UIMachineWindow(pMachineLogic, uScreenId) 41 43 , m_pMainMenu(0) 44 , m_pMiniToolBar(0) 42 45 { 43 46 /* "This" is machine window: */ … … 57 60 prepareMenu(); 58 61 62 /* Prepare machine view container: */ 63 prepareMachineViewContainer(); 64 65 /* Prepare fullscreen machine view: */ 66 prepareMachineView(); 67 68 /* Prepare mini tool-bar: */ 69 prepareMiniToolBar(); 70 59 71 /* Retranslate fullscreen window finally: */ 60 72 retranslateUi(); 61 73 62 /* Prepare machine view container: */63 prepareMachineViewContainer();64 65 /* Prepare fullscreen machine view: */66 prepareMachineView();67 68 74 /* Update all the elements: */ 69 75 updateAppearanceOf(UIVisualElement_AllStuff); … … 80 86 UIMachineWindowFullscreen::~UIMachineWindowFullscreen() 81 87 { 82 /* Cleanup normal machine view: */ 88 /* Save window settings: */ 89 saveWindowSettings(); 90 91 /* Cleanup machine view: */ 83 92 cleanupMachineView(); 84 93 … … 152 161 } 153 162 163 void UIMachineWindowFullscreen::prepareMiniToolBar() 164 { 165 /* Get current machine: */ 166 CMachine machine = session().GetConsole().GetMachine(); 167 /* Check if mini tool-bar should present: */ 168 bool fIsActive = machine.GetExtraData(VBoxDefs::GUI_ShowMiniToolBar) != "no"; 169 if (fIsActive) 170 { 171 /* Get the mini tool-bar alignment: */ 172 bool fIsAtTop = machine.GetExtraData(VBoxDefs::GUI_MiniToolBarAlignment) == "top"; 173 /* Get the mini tool-bar auto-hide feature availability: */ 174 bool fIsAutoHide = machine.GetExtraData(VBoxDefs::GUI_MiniToolBarAutoHide) != "off"; 175 m_pMiniToolBar = new VBoxMiniToolBar(centralWidget(), 176 fIsAtTop ? VBoxMiniToolBar::AlignTop : VBoxMiniToolBar::AlignBottom, 177 true, fIsAutoHide); 178 m_pMiniToolBar->updateDisplay(true, true); 179 QList<QMenu*> menus; 180 menus << uisession()->actionsPool()->action(UIActionIndex_Menu_Machine)->menu(); 181 menus << uisession()->actionsPool()->action(UIActionIndex_Menu_Devices)->menu(); 182 *m_pMiniToolBar << menus; 183 connect(m_pMiniToolBar, SIGNAL(exitAction()), 184 uisession()->actionsPool()->action(UIActionIndex_Toggle_Fullscreen), SLOT(trigger())); 185 connect(m_pMiniToolBar, SIGNAL(closeAction()), 186 uisession()->actionsPool()->action(UIActionIndex_Simple_Close), SLOT(trigger())); 187 } 188 } 189 154 190 void UIMachineWindowFullscreen::prepareMachineView() 155 191 { … … 184 220 } 185 221 222 void UIMachineWindowFullscreen::saveWindowSettings() 223 { 224 /* Get machine: */ 225 CMachine machine = session().GetConsole().GetMachine(); 226 227 /* Save extra-data settings: */ 228 { 229 /* Save mini tool-bar settings: */ 230 if (m_pMiniToolBar) 231 machine.SetExtraData(VBoxDefs::GUI_MiniToolBarAutoHide, m_pMiniToolBar->isAutoHide() ? QString() : "off"); 232 } 233 } 234 186 235 void UIMachineWindowFullscreen::cleanupMachineView() 187 236 { … … 200 249 } 201 250 251 void UIMachineWindowFullscreen::updateAppearanceOf(int iElement) 252 { 253 /* Base class update: */ 254 UIMachineWindow::updateAppearanceOf(iElement); 255 256 /* If mini tool-bar is present: */ 257 if (m_pMiniToolBar) 258 { 259 /* Get machine: */ 260 CMachine machine = session().GetConsole().GetMachine(); 261 /* Get snapshot(s): */ 262 QString strSnapshotName; 263 if (machine.GetSnapshotCount() > 0) 264 { 265 CSnapshot snapshot = machine.GetCurrentSnapshot(); 266 strSnapshotName = " (" + snapshot.GetName() + ")"; 267 } 268 /* Update mini tool-bar text: */ 269 m_pMiniToolBar->setDisplayText(machine.GetName() + strSnapshotName); 270 } 271 } 272 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.h
r27141 r27332 31 31 # include <X11/Xlib.h> 32 32 #endif 33 34 /* Local forwards */ 35 class VBoxMiniToolBar; 33 36 34 37 class UIMachineWindowFullscreen : public QIWithRetranslateUI2<QIMainDialog>, public UIMachineWindow … … 66 69 /* Prepare helpers: */ 67 70 void prepareMenu(); 71 void prepareMiniToolBar(); 68 72 void prepareMachineView(); 73 //void loadWindowSettings() {} 69 74 70 75 /* Cleanup helpers: */ 71 //void saveWindowSettings() {}76 void saveWindowSettings(); 72 77 void cleanupMachineView(); 78 //void cleanupMiniToolBar() {} 73 79 void cleanupMenu(); 80 81 /* Update routines: */ 82 void updateAppearanceOf(int iElement); 74 83 75 84 /* Private variables: */ 76 85 QMenu *m_pMainMenu; 86 VBoxMiniToolBar *m_pMiniToolBar; 77 87 78 88 /* Factory support: */
Note:
See TracChangeset
for help on using the changeset viewer.