1 | /* $Id: UISettingsDefs.cpp 76606 2019-01-02 05:40:39Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UISettingsDefs implementation
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011-2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | /* GUI includes: */
|
---|
19 | #include "UISettingsDefs.h"
|
---|
20 |
|
---|
21 |
|
---|
22 | /* Using declarations: */
|
---|
23 | using namespace UISettingsDefs;
|
---|
24 |
|
---|
25 | ConfigurationAccessLevel UISettingsDefs::configurationAccessLevel(KSessionState enmSessionState, KMachineState enmMachineState)
|
---|
26 | {
|
---|
27 | /* Depending on passed arguments: */
|
---|
28 | switch (enmMachineState)
|
---|
29 | {
|
---|
30 | case KMachineState_PoweredOff:
|
---|
31 | case KMachineState_Teleported:
|
---|
32 | case KMachineState_Aborted: return enmSessionState == KSessionState_Unlocked ?
|
---|
33 | ConfigurationAccessLevel_Full :
|
---|
34 | ConfigurationAccessLevel_Partial_PoweredOff;
|
---|
35 | case KMachineState_Saved: return ConfigurationAccessLevel_Partial_Saved;
|
---|
36 | case KMachineState_Running:
|
---|
37 | case KMachineState_Paused: return ConfigurationAccessLevel_Partial_Running;
|
---|
38 | default: break;
|
---|
39 | }
|
---|
40 | /* Null by default: */
|
---|
41 | return ConfigurationAccessLevel_Null;
|
---|
42 | }
|
---|
43 |
|
---|