6 #include "icons/new.xpm"
7 #include "icons/open.xpm"
8 #include "icons/save.xpm"
9 #include "icons/copy.xpm"
10 #include "icons/cut.xpm"
11 #include "icons/preview.xpm"
12 #include "icons/print.xpm"
13 #include "icons/help.xpm"
14 //#endif // USE_XPM_BITMAPS
16 QemuUIToolBar::QemuUIToolBar(wxWindow
*parent
,long style
)
17 :wxToolBar(parent
,wxID_ANY
,wxDefaultPosition
,wxDefaultSize
,style
){
19 SetWindowStyle(style
);
24 wxBitmap(QEMU_XPM_SHUTDOWN
),
31 wxBitmap(QEMU_XPM_PAUSE
),
38 wxBitmap(QEMU_XPM_START
),
39 _("Power off this VM")
45 wxBitmap(QEMU_XPM_RESET
),
52 wxBitmap(QEMU_XPM_RESET
),
61 wxBitmap(QEMU_XPM_RESET
),
62 _("Take a snapshot of the current vm state")
66 QEMU_VM_REVERT_SNAPSHOT
,
68 wxBitmap(QEMU_XPM_RESET
),
69 _("Revert to last snapshot")
75 QEMU_TOOLBAR_DISPLAY_INFO
,
77 wxBitmap(QEMU_XPM_RESET
),
78 _("Show information about this vm"),
83 QEMU_TOOLBAR_DISPLAY_SCREEN
,
85 wxBitmap(QEMU_XPM_RESET
),
86 _("Show the screen of this vm."),
91 QEMU_TOOLBAR_DISPLAY_CONSOLE
,
93 wxBitmap(QEMU_XPM_RESET
),
94 _("Show the console of this vm."),
101 QEMU_TOOLBAR_SEND_VM_COMMAND
,
103 wxBitmap(QEMU_XPM_RESET
),
104 _("Send a command to the qemu monitor.")
107 SetToolBitmapSize(wxSize(24,24));
111 QemuUIToolBar::~QemuUIToolBar(){};
113 void QemuUIToolBar::Disable(){
120 RevertSnapshot(false);
121 DisableDisplayArea();
122 SendVMCommand(false);
125 void QemuUIToolBar::EnableDisplayArea(){
126 EnableTool(QEMU_TOOLBAR_DISPLAY_INFO
,true);
127 EnableTool(QEMU_TOOLBAR_DISPLAY_SCREEN
,true);
128 EnableTool(QEMU_TOOLBAR_DISPLAY_CONSOLE
,true);
131 void QemuUIToolBar::DisableDisplayArea(){
132 ToggleTool(QEMU_TOOLBAR_DISPLAY_INFO
,false);
133 ToggleTool(QEMU_TOOLBAR_DISPLAY_SCREEN
,false);
134 ToggleTool(QEMU_TOOLBAR_DISPLAY_CONSOLE
,false);
135 EnableTool(QEMU_TOOLBAR_DISPLAY_INFO
,false);
136 EnableTool(QEMU_TOOLBAR_DISPLAY_SCREEN
,false);
137 EnableTool(QEMU_TOOLBAR_DISPLAY_CONSOLE
,false);
140 void QemuUIToolBar::PowerOn(bool state
){
141 EnableTool(QEMU_VM_START
,state
);
144 void QemuUIToolBar::PowerOff(bool state
){
145 EnableTool(QEMU_VM_SHUTDOWN
,state
);
148 void QemuUIToolBar::Pause(bool state
){
149 EnableTool(QEMU_VM_PAUSE
,state
);
152 void QemuUIToolBar::Reset(bool state
){
153 EnableTool(QEMU_VM_RESET
,state
);
156 void QemuUIToolBar::Kill(bool state
){
157 EnableTool(QEMU_VM_KILL
,state
);
160 void QemuUIToolBar::Snapshot(bool state
){
161 EnableTool(QEMU_VM_SNAPSHOT
,state
);
164 void QemuUIToolBar::RevertSnapshot(bool state
){
165 EnableTool(QEMU_VM_REVERT_SNAPSHOT
,state
);
168 void QemuUIToolBar::ShowInfo(){
169 ToggleTool(QEMU_TOOLBAR_DISPLAY_INFO
,true);
170 ToggleTool(QEMU_TOOLBAR_DISPLAY_SCREEN
,false);
171 ToggleTool(QEMU_TOOLBAR_DISPLAY_CONSOLE
,false);
174 void QemuUIToolBar::ShowScreen(){
175 ToggleTool(QEMU_TOOLBAR_DISPLAY_INFO
,false);
176 ToggleTool(QEMU_TOOLBAR_DISPLAY_SCREEN
,true);
177 ToggleTool(QEMU_TOOLBAR_DISPLAY_CONSOLE
,false);
180 void QemuUIToolBar::ShowConsole(){
181 ToggleTool(QEMU_TOOLBAR_DISPLAY_INFO
,false);
182 ToggleTool(QEMU_TOOLBAR_DISPLAY_SCREEN
,false);
183 ToggleTool(QEMU_TOOLBAR_DISPLAY_CONSOLE
,true);
186 void QemuUIToolBar::SendVMCommand(bool state
){
187 EnableTool(QEMU_TOOLBAR_SEND_VM_COMMAND
,state
);
190 void QemuUIToolBar::EnableDisplayScreen(bool state
){
191 EnableTool(QEMU_TOOLBAR_DISPLAY_SCREEN
,state
);