- Timestamp:
- Jun 17, 2013 3:52:39 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r46586 r46599 810 810 this, SLOT(sltOpenSharedFoldersDialog())); 811 811 connect(gActionPool->action(UIActionIndexRuntime_Toggle_VRDEServer), SIGNAL(toggled(bool)), 812 this, SLOT(slt SwitchVrde(bool)));812 this, SLOT(sltToggleVRDE(bool))); 813 813 connect(gActionPool->action(UIActionIndexRuntime_Toggle_VideoCapture), SIGNAL(toggled(bool)), 814 814 this, SLOT(sltToggleVideoCapture(bool))); … … 1890 1890 } 1891 1891 1892 void UIMachineLogic::sltSwitchVrde(bool fOn) 1893 { 1894 /* Prepare variables: */ 1892 void UIMachineLogic::sltToggleVRDE(bool fEnabled) 1893 { 1894 /* Do not process if window(s) missed! */ 1895 if (!isMachineWindowsCreated()) 1896 return; 1897 1898 /* Access VRDE server: */ 1895 1899 CMachine machine = session().GetMachine(); 1896 1900 CVRDEServer server = machine.GetVRDEServer(); 1897 AssertMsg(!server.isNull(), ("VRDE server should not be null!\n")); 1898 1899 /* Toggle VRDE server state: */ 1900 server.SetEnabled(fOn); 1901 if (!server.isOk()) 1902 { 1903 /* Notify about the error: */ 1904 msgCenter().cannotToggleVRDEServer(server, machine.GetName(), fOn); 1905 /* Make sure action is updated! */ 1906 uisession()->updateStatusVRDE(); 1901 AssertMsg(!server.isNull(), ("VRDE server should NOT be null!\n")); 1902 if (!machine.isOk() || server.isNull()) 1903 return; 1904 1905 /* Make sure something had changed: */ 1906 if (server.GetEnabled() == static_cast<BOOL>(fEnabled)) 1907 return; 1908 1909 /* Server is OK? */ 1910 if (server.isOk()) 1911 { 1912 /* Update VRDE server state: */ 1913 server.SetEnabled(fEnabled); 1914 /* Server still OK? */ 1915 if (server.isOk()) 1916 { 1917 /* Save machine-settings: */ 1918 machine.SaveSettings(); 1919 /* Machine still OK? */ 1920 if (!machine.isOk()) 1921 { 1922 /* Notify about the error: */ 1923 msgCenter().cannotSaveMachineSettings(machine); 1924 /* Make sure action is updated! */ 1925 uisession()->updateStatusVRDE(); 1926 } 1927 } 1928 else 1929 { 1930 /* Notify about the error: */ 1931 msgCenter().cannotToggleVRDEServer(server, machine.GetName(), fEnabled); 1932 /* Make sure action is updated! */ 1933 uisession()->updateStatusVRDE(); 1934 } 1907 1935 } 1908 1936 } … … 1933 1961 /* Machine had failed on one of steps? */ 1934 1962 if (!machine.isOk()) 1935 msgCenter().cannotSaveMachineSettings(machine , activeMachineWindow());1963 msgCenter().cannotSaveMachineSettings(machine); 1936 1964 } 1937 1965 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r46582 r46599 205 205 void sltPrepareDragAndDropMenu(); 206 206 void sltChangeDragAndDropType(QAction *pAction); 207 void slt SwitchVrde(bool fOn);207 void sltToggleVRDE(bool fEnabled); 208 208 void sltToggleVideoCapture(bool fEnabled); 209 209 void sltOpenVideoCaptureOptions();
Note:
See TracChangeset
for help on using the changeset viewer.