Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ACPI shutdown to emulator control menu #101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions resources/translations/English.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3228,12 +3228,17 @@ Linux Compressed Loop image, useful only to reuse directly compressed CD-ROM ima
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="350"/>
<source>Are you sure to shutdown VM &quot;%1&quot;?</source>
<source>Are you sure you want to shutdown VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="350"/>
<source>Are you sure you want to poweroff VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="362"/>
<source>Are you sure to reboot VM &quot;%1&quot;?</source>
<source>Are you sure you want to reset VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down Expand Up @@ -5944,9 +5949,14 @@ The work of the VM is not possible!</source>
<source>Shutdown VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Main_Window.cpp" line="4862"/>
<source>Poweroff VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Main_Window.cpp" line="4901"/>
<source>Reboot VM &quot;%1&quot;?</source>
<source>Reset VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
20 changes: 15 additions & 5 deletions resources/translations/French.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3283,13 +3283,18 @@ Linux Compressed Loop image, useful only to reuse directly compressed CD-ROM ima
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="350"/>
<source>Are you sure to shutdown VM &quot;%1&quot;?</source>
<source>Are you sure you want to shutdown VM &quot;%1&quot;?</source>
<translation>Êtes-vous sûr de vouloir éteindre la VM « %1 » ?</translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="350"/>
<source>Are you sure you want to poweroff VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="362"/>
<source>Are you sure to reboot VM &quot;%1&quot;?</source>
<translation>Êtes-vous sûr de vouloir redémarrer la VM « %1 » ?</translation>
<source>Are you sure you want to reset VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="408"/>
Expand Down Expand Up @@ -6006,10 +6011,15 @@ The work of the VM is not possible!</source>
<source>Shutdown VM &quot;%1&quot;?</source>
<translation>Éteindre la VM « %1 » ?</translation>
</message>
<message>
<location filename="Main_Window.cpp" line="4862"/>
<source>Poweroff VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Main_Window.cpp" line="4901"/>
<source>Reboot VM &quot;%1&quot;?</source>
<translation>Redémarrer la VM « %1 » ?</translation>
<source>Reset VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Main_Window.cpp" line="4912"/>
Expand Down
19 changes: 15 additions & 4 deletions resources/translations/German.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3466,12 +3466,17 @@ Linux Compressed Loop image, useful only to reuse directly compressed CD-ROM ima
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="350"/>
<source>Are you sure to shutdown VM &quot;%1&quot;?</source>
<source>Are you sure you want to shutdown VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="350"/>
<source>Are you sure you want to poweroff VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="362"/>
<source>Are you sure to reboot VM &quot;%1&quot;?</source>
<source>Are you sure you want to reset VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down Expand Up @@ -3598,8 +3603,14 @@ Do you want to show this message again?</source>
<translation type="obsolete">VM &quot;%1&quot; herunterfahren?</translation>
</message>
<message>
<source>Reboot VM &quot;%1&quot;?</source>
<translation type="obsolete">VМ &quot;%1&quot; neu starten?</translation>
<location filename="Main_Window.cpp" line="4862"/>
<source>Poweroff VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Main_Window.cpp" line="4901"/>
<source>Reset VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="87"/>
Expand Down
26 changes: 16 additions & 10 deletions resources/translations/Russian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3462,13 +3462,18 @@ Linux Compressed Loop image, useful only to reuse directly compressed CD-ROM ima
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="350"/>
<source>Are you sure to shutdown VM &quot;%1&quot;?</source>
<source>Are you sure you want to shutdown VM &quot;%1&quot;?</source>
<translation>Выключить ВМ &quot;%1&quot;?</translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="350"/>
<source>Are you sure you want to poweroff VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="362"/>
<source>Are you sure to reboot VM &quot;%1&quot;?</source>
<translation>Перезагрузить ВМ &quot;%1&quot;?</translation>
<source>Are you sure you want to reset VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="592"/>
Expand Down Expand Up @@ -3595,8 +3600,14 @@ Do you want to show this message again?</source>
<translation type="obsolete">Выключить ВМ &quot;%1&quot;?</translation>
</message>
<message>
<source>Reboot VM &quot;%1&quot;?</source>
<translation type="obsolete">Перезагрузить ВМ &quot;%1&quot;?</translation>
<location filename="Main_Window.cpp" line="4862"/>
<source>Poweroff VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Main_Window.cpp" line="4901"/>
<source>Reset VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="87"/>
Expand Down Expand Up @@ -6121,11 +6132,6 @@ The work of the VM is not possible!</source>
<source>Shutdown VM &quot;%1&quot;?</source>
<translation>Выключить ВМ &quot;%1&quot;?</translation>
</message>
<message>
<location filename="Main_Window.cpp" line="4901"/>
<source>Reboot VM &quot;%1&quot;?</source>
<translation>Перезагрузить ВМ &quot;%1&quot;?</translation>
</message>
<message>
<location filename="Main_Window.cpp" line="5895"/>
<source>Image Format: </source>
Expand Down
16 changes: 13 additions & 3 deletions resources/translations/Ukrainian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3268,12 +3268,17 @@ Linux Compressed Loop image, useful only to reuse directly compressed CD-ROM ima
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="350"/>
<source>Are you sure to shutdown VM &quot;%1&quot;?</source>
<source>Are you sure you want to shutdown VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="350"/>
<source>Are you sure you want to poweroff VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Emulator_Control_Window.cpp" line="362"/>
<source>Are you sure to reboot VM &quot;%1&quot;?</source>
<source>Are you sure you want to reset VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down Expand Up @@ -6048,9 +6053,14 @@ Add This Record?</source>
<source>Shutdown VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Main_Window.cpp" line="4862"/>
<source>Poweroff VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Main_Window.cpp" line="4901"/>
<source>Reboot VM &quot;%1&quot;?</source>
<source>Reset VM &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
16 changes: 14 additions & 2 deletions src/Emulator_Control_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,10 +770,22 @@ void Emulator_Control_Window::on_actionPause_VM_triggered()
AQEMU_Service::get().call("pause",Cur_VM);
}

void Emulator_Control_Window::on_actionShutdown_triggered()
{
if ( QMessageBox::question(this, tr("Are you sure?"),
tr("Are you sure you want to shutdown VM \"%1\"?").arg(Cur_VM->Get_Machine_Name()),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No)
{
return;
}

AQEMU_Service::get().call("shutdown",Cur_VM);
}

void Emulator_Control_Window::on_actionPower_Off_triggered()
{
if( QMessageBox::question(this, tr("Are you sure?"),
tr("Are you sure to shutdown VM \"%1\"?").arg(Cur_VM->Get_Machine_Name()),
tr("Are you sure you want to poweroff VM \"%1\"?").arg(Cur_VM->Get_Machine_Name()),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No )
{
return;
Expand All @@ -785,7 +797,7 @@ void Emulator_Control_Window::on_actionPower_Off_triggered()
void Emulator_Control_Window::on_actionReset_VM_triggered()
{
if( QMessageBox::question(this, tr("Are you sure?"),
tr("Are you sure to reboot VM \"%1\"?").arg(Cur_VM->Get_Machine_Name()),
tr("Are you sure you want to reset VM \"%1\"?").arg(Cur_VM->Get_Machine_Name()),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No )
{
return;
Expand Down
1 change: 1 addition & 0 deletions src/Emulator_Control_Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class Emulator_Control_Window: public QMainWindow
void on_actionManage_Snapshots_triggered();
void on_actionCommit_triggered();
void on_actionPause_VM_triggered();
void on_actionShutdown_triggered();
void on_actionPower_Off_triggered();
void on_actionReset_VM_triggered();
void on_actionQEMU_Monitor_triggered();
Expand Down
10 changes: 10 additions & 0 deletions src/Emulator_Control_Window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<addaction name="actionCommit"/>
<addaction name="separator"/>
<addaction name="actionPause_VM"/>
<addaction name="actionShutdown"/>
<addaction name="actionPower_Off"/>
<addaction name="actionReset_VM"/>
<addaction name="separator"/>
Expand Down Expand Up @@ -654,6 +655,15 @@
<string>&amp;Grab Mouse</string>
</property>
</action>
<action name="actionShutdown">
<property name="icon">
<iconset resource="../resources/icons.qrc">
<normaloff>:/shutdown.png</normaloff>:/shutdown.png</iconset>
</property>
<property name="text">
<string>Shut&amp;down</string>
</property>
</action>
</widget>
<resources>
<include location="../resources/icons.qrc"/>
Expand Down
4 changes: 2 additions & 2 deletions src/Main_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3358,7 +3358,7 @@ void Main_Window::on_actionPower_Off_triggered()
}

if( QMessageBox::question(this, tr("Are you sure?"),
tr("Shutdown VM \"%1\"?").arg(cur_vm->Get_Machine_Name()),
tr("Poweroff VM \"%1\"?").arg(cur_vm->Get_Machine_Name()),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No )
{
return;
Expand Down Expand Up @@ -3420,7 +3420,7 @@ void Main_Window::on_actionReset_triggered()
}

if( QMessageBox::question(this, tr("Are you sure?"),
tr("Reboot VM \"%1\"?").arg(cur_vm->Get_Machine_Name()),
tr("Reset VM \"%1\"?").arg(cur_vm->Get_Machine_Name()),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No )
{
return;
Expand Down