mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-23 18:32:51 +00:00
kemu: make it easy to control ACPI
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
0d66697afd
commit
1509daa12b
2 changed files with 28 additions and 15 deletions
37
kemu/kemu.ui
37
kemu/kemu.ui
|
@ -83,20 +83,20 @@
|
|||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>CD-ROM image</string>
|
||||
<string>Hard Disk image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="KUrlRequester" name="CDROMInput"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Hard Drive image</string>
|
||||
<string>CD-ROM image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -173,9 +173,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="KLineEdit" name="argumentsLineEdit"/>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="KVMCheckBox">
|
||||
<property name="text">
|
||||
|
@ -186,7 +183,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<item row="9" column="1">
|
||||
<widget class="KLineEdit" name="argumentsLineEdit"/>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -199,7 +199,14 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<item row="5" column="1">
|
||||
<widget class="KIntNumInput" name="CPUInput">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Extra arguments</string>
|
||||
|
@ -213,10 +220,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="KIntNumInput" name="CPUInput">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="ACPICheckBox">
|
||||
<property name="text">
|
||||
<string>Advanced Configuration and Power Interface</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -130,6 +130,7 @@ KEmuMainWindow::KEmuMainWindow(QWidget *parent, Qt::WindowFlags flags)
|
|||
connect(m_kemuui->RAMInput, SIGNAL(valueChanged(int)), this, SLOT(machineSave(int)));
|
||||
connect(m_kemuui->CPUInput, SIGNAL(valueChanged(int)), this, SLOT(machineSave(int)));
|
||||
connect(m_kemuui->KVMCheckBox, SIGNAL(stateChanged(int)), this, SLOT(machineSave(int)));
|
||||
connect(m_kemuui->ACPICheckBox, SIGNAL(stateChanged(int)), this, SLOT(machineSave(int)));
|
||||
connect(m_kemuui->argumentsLineEdit, SIGNAL(textChanged(QString)), this, SLOT(machineSave(QString)));
|
||||
}
|
||||
|
||||
|
@ -197,6 +198,7 @@ void KEmuMainWindow::machineSave(const QString ignored)
|
|||
m_settings->setValue(machine + "/ram", m_kemuui->RAMInput->value());
|
||||
m_settings->setValue(machine + "/cpu", m_kemuui->CPUInput->value());
|
||||
m_settings->setValue(machine + "/kvm", m_kemuui->KVMCheckBox->isChecked());
|
||||
m_settings->setValue(machine + "/acpi", m_kemuui->ACPICheckBox->isChecked());
|
||||
m_settings->setValue(machine + "/args", m_kemuui->argumentsLineEdit->text());
|
||||
m_settings->sync();
|
||||
}
|
||||
|
@ -222,6 +224,7 @@ void KEmuMainWindow::machineLoad(const QString machine)
|
|||
m_kemuui->RAMInput->setValue(m_settings->value(machine + "/ram", 32).toInt());
|
||||
m_kemuui->CPUInput->setValue(m_settings->value(machine + "/cpu", 1).toInt());
|
||||
m_kemuui->KVMCheckBox->setChecked(m_settings->value(machine + "/kvm", false).toBool());
|
||||
m_kemuui->ACPICheckBox->setChecked(m_settings->value(machine + "/acpi", false).toBool());
|
||||
m_kemuui->argumentsLineEdit->setText(m_settings->value(machine + "/args").toString());
|
||||
}
|
||||
|
||||
|
@ -309,6 +312,9 @@ void KEmuMainWindow::startStopMachine()
|
|||
if (m_kemuui->KVMCheckBox->isChecked()) {
|
||||
machineArgs << "-enable-kvm";
|
||||
}
|
||||
if (!m_kemuui->ACPICheckBox->isChecked()) {
|
||||
machineArgs << "-no-acpi";
|
||||
}
|
||||
const QString extraArgs = m_kemuui->argumentsLineEdit->text();
|
||||
if (!extraArgs.isEmpty()) {
|
||||
foreach (const QString argument, extraArgs.split(" ")) {
|
||||
|
|
Loading…
Add table
Reference in a new issue