summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantinos Smanis <konstantinos.smanis@gmail.com>2013-10-10 20:26:06 (GMT)
committerKonstantinos Smanis <konstantinos.smanis@gmail.com>2013-10-10 20:26:06 (GMT)
commitf008456b4a7819d2f374d4f59cbd5ab155be478b (patch)
tree786d92a45b4db19e88f86671b9c76f46048acbd7
parent93ca506c5bbe1a61f5ce1ad93316e26523135313 (diff)
*FIXED: Improved security by detecting GRUB paths at compile-time.
GRUB paths are no longer detected at run-time and passed around to the helper. They remain fixed after compilation. This is a strict rule so that the helper cannot read/write to an arbitrary file. It also allows package maintainers to fine-tune the module according to each distribution's naming conventions. If no user interaction is detected, CMake will automatically try and resolve these paths. Package maintainers are *highly* encouraged to manually specify these paths. For more information check the updated INSTALL file.
-rw-r--r--CMakeLists.txt1
-rw-r--r--INSTALL65
-rw-r--r--cmake/modules/GRUBPaths.cmake59
-rw-r--r--config.h.cmake17
-rw-r--r--src/helper/helper.cpp72
-rw-r--r--src/helper/helper.h1
-rw-r--r--src/installDlg.cpp5
-rw-r--r--src/installDlg.h3
-rw-r--r--src/kcm_grub2.cpp106
-rw-r--r--src/kcm_grub2.h15
-rw-r--r--ui/kcm_grub2.ui1203
11 files changed, 777 insertions, 770 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee3bbbb..a94864d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
find_package(Qt4 4.6.0 REQUIRED)
find_package(KDE4 4.4.0 REQUIRED)
include(KDE4Defaults)
+include(GRUBPaths)
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
diff --git a/INSTALL b/INSTALL
index 66411ff..1d3204a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,3 +1,7 @@
+/==========================\
+| Build & Run Instructions |
+\==========================/
+
Enter the directory where you extracted the source code and run:
$ mkdir build
@@ -6,19 +10,70 @@ $ cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`
$ make
$ sudo make install
-You may then find the GRUB2 KCModule under "Startup and Shutdown" in System Settings.
-You may also launch it running:
+You may then find the GRUB2 KCModule under "Startup and Shutdown" in
+System Settings. You may also launch it running:
$ kcmshell4 kcm_grub2
-In order to appear in System Settings the first time you install the GRUB2 KCModule, you may have to run:
+In order to appear in System Settings the first time you install the
+GRUB2 KCModule, you may have to run:
$ kbuildsycoca4
+Note: '$' indicates a shell prompt.
+
+/=============================\
+| Dependencies & Requirements |
+\=============================/
+
Requires KDE >= 4.4, Qt >= 4.6, GRUB2.
Suggests ImageMagick for GRUB splash image management.
Suggests hwinfo for valid GRUB resolution detection.
Suggests LibQApt or QPackageKit for removing old entries.
-Minimum requirement is kdebase-runtime. Install kdebase-workspace for System Settings integration.
-Note: '$' indicates a shell prompt.
+Minimum KDE requirement is kdebase-runtime.
+Install kdebase-workspace instead for System Settings integration.
+
+/======================\
+| GRUB Path Resolution |
+\======================/
+
+Almost every distribution has different paths for GRUB executable and
+configuration files. Thus, the need to automatically detect them arises.
+Hopefully the most prevalent naming schemes boil down to three cases:
+
+* vanilla grub-foo executables and boot directory,
+* modified grub2-foo executables and boot directory (allows for parallel
+ installation of both major versions of GRUB),
+* and as a third, last case we consider BURG installations with vanilla
+ burg-foo executables and boot directory.
+
+CMake will detect the above cases in the order specified and
+appropriately fill in the following variables:
+
+* GRUB_INSTALL_EXE = executable which installs GRUB
+* GRUB_MKCONFIG_EXE = executable which generates GRUB's menu file
+* GRUB_PROBE_EXE = executable which probes devices for GRUB information
+* GRUB_SET_DEFAULT_EXE = executable which sets the default entry in
+ GRUB's environment file
+* GRUB_MENU = GRUB's menu file
+* GRUB_CONFIG = GRUB's main configuration file
+* GRUB_ENV = GRUB's environment file
+* GRUB_MEMTEST = script installed by memtest (usually under /etc/grub.d)
+
+For security reasons these variables can only be set at compile time and
+will be embedded in the binary, so that they cannot be altered
+afterwards.
+
+The following options exist:
+
+* Do not manually specify any of the above variables, in which case
+ CMake will try to resolve them automatically. If it fails you will be
+ prompted to manually specify them all.
+* If you specify at least one of the *_EXE variables, you will have to
+ specify all other variables as well.
+* You can make changes to the non-EXE variables as long as you don't
+ alter any of the *_EXE ones.
+
+Package maintainers are encouraged to manually specify all of the above
+variables in order to fit with each distribution's naming scheme.
diff --git a/cmake/modules/GRUBPaths.cmake b/cmake/modules/GRUBPaths.cmake
new file mode 100644
index 0000000..7c30e1d
--- /dev/null
+++ b/cmake/modules/GRUBPaths.cmake
@@ -0,0 +1,59 @@
+if(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE AND GRUB_MENU AND GRUB_CONFIG AND GRUB_ENV AND GRUB_MEMTEST)
+ message(STATUS "All GRUB paths were defined in the CMake cache. By-passing automatic resolution.")
+elseif(NOT (GRUB_INSTALL_EXE OR GRUB_MKCONFIG_EXE OR GRUB_PROBE_EXE OR GRUB_SET_DEFAULT_EXE))
+ find_program(GRUB_INSTALL_EXE NAMES grub-install DOC "GRUB install executable file path.")
+ find_program(GRUB_MKCONFIG_EXE NAMES grub-mkconfig DOC "GRUB mkconfig executable file path.")
+ find_program(GRUB_PROBE_EXE NAMES grub-probe DOC "GRUB probe executable file path.")
+ find_program(GRUB_SET_DEFAULT_EXE NAMES grub-set-default DOC "GRUB set-default executable file path.")
+ if(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE)
+ set(GRUB_MENU "/boot/grub/grub.cfg" CACHE FILEPATH "GRUB menu file path.")
+ set(GRUB_CONFIG "/etc/default/grub" CACHE FILEPATH "GRUB configuration file path.")
+ set(GRUB_ENV "/boot/grub/grubenv" CACHE FILEPATH "GRUB environment file path.")
+ set(GRUB_MEMTEST "/etc/grub.d/20_memtest86+" CACHE FILEPATH "GRUB memtest file path.")
+ else(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE)
+ unset(GRUB_INSTALL_EXE CACHE)
+ unset(GRUB_MKCONFIG_EXE CACHE)
+ unset(GRUB_PROBE_EXE CACHE)
+ unset(GRUB_SET_DEFAULT_EXE CACHE)
+ find_program(GRUB_INSTALL_EXE NAMES grub2-install DOC "GRUB install executable file path.")
+ find_program(GRUB_MKCONFIG_EXE NAMES grub2-mkconfig DOC "GRUB mkconfig executable file path.")
+ find_program(GRUB_PROBE_EXE NAMES grub2-probe DOC "GRUB probe executable file path.")
+ find_program(GRUB_SET_DEFAULT_EXE NAMES grub2-set-default DOC "GRUB set-default executable file path.")
+ if(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE)
+ set(GRUB_MENU "/boot/grub2/grub.cfg" CACHE FILEPATH "GRUB menu file path.")
+ set(GRUB_CONFIG "/etc/default/grub" CACHE FILEPATH "GRUB configuration file path.")
+ set(GRUB_ENV "/boot/grub2/grubenv" CACHE FILEPATH "GRUB environment file path.")
+ set(GRUB_MEMTEST "/etc/grub.d/20_memtest86+" CACHE FILEPATH "GRUB memtest file path.")
+ else(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE)
+ unset(GRUB_INSTALL_EXE CACHE)
+ unset(GRUB_MKCONFIG_EXE CACHE)
+ unset(GRUB_PROBE_EXE CACHE)
+ unset(GRUB_SET_DEFAULT_EXE CACHE)
+ find_program(GRUB_INSTALL_EXE NAMES burg-install DOC "GRUB install executable file path.")
+ find_program(GRUB_MKCONFIG_EXE NAMES burg-mkconfig DOC "GRUB mkconfig executable file path.")
+ find_program(GRUB_PROBE_EXE NAMES burg-probe DOC "GRUB probe executable file path.")
+ find_program(GRUB_SET_DEFAULT_EXE NAMES burg-set-default DOC "GRUB set-default executable file path.")
+ if(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE)
+ set(GRUB_MENU "/boot/burg/burg.cfg" CACHE FILEPATH "GRUB menu file path.")
+ set(GRUB_CONFIG "/etc/default/burg" CACHE FILEPATH "GRUB configuration file path.")
+ set(GRUB_ENV "/boot/burg/burgenv" CACHE FILEPATH "GRUB environment file path.")
+ set(GRUB_MEMTEST "/etc/burg.d/20_memtest86+" CACHE FILEPATH "GRUB memtest file path.")
+ else(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE)
+ message(FATAL_ERROR "Could not automatically resolve GRUB paths. Please specify all of them manually.")
+ endif(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE)
+ endif(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE)
+ endif(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE)
+else(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE AND GRUB_MENU AND GRUB_CONFIG AND GRUB_ENV AND GRUB_MEMTEST)
+ message(FATAL_ERROR "Some, but not all, GRUB paths were defined in the CMake cache. Please define them all or let CMake do it. In the latter case define none.")
+endif(GRUB_INSTALL_EXE AND GRUB_MKCONFIG_EXE AND GRUB_PROBE_EXE AND GRUB_SET_DEFAULT_EXE AND GRUB_MENU AND GRUB_CONFIG AND GRUB_ENV AND GRUB_MEMTEST)
+
+message(STATUS "--------------------------------------------------------------------------")
+message(STATUS "GRUB_INSTALL_EXE: ${GRUB_INSTALL_EXE}")
+message(STATUS "GRUB_MKCONFIG_EXE: ${GRUB_MKCONFIG_EXE}")
+message(STATUS "GRUB_PROBE_EXE: ${GRUB_PROBE_EXE}")
+message(STATUS "GRUB_SET_DEFAULT_EXE: ${GRUB_SET_DEFAULT_EXE}")
+message(STATUS "GRUB_MENU: ${GRUB_MENU}")
+message(STATUS "GRUB_CONFIG: ${GRUB_CONFIG}")
+message(STATUS "GRUB_ENV: ${GRUB_ENV}")
+message(STATUS "GRUB_MEMTEST: ${GRUB_MEMTEST}")
+message(STATUS "--------------------------------------------------------------------------")
diff --git a/config.h.cmake b/config.h.cmake
index fabe1a4..5d57a67 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -2,10 +2,27 @@
#define CONFIG_H
#define KCM_GRUB2_VERSION "@KCM_GRUB2_VERSION@"
+
#define HAVE_IMAGEMAGICK @HAVE_IMAGEMAGICK@
#define HAVE_HD @HAVE_HD@
#define HAVE_QAPT @HAVE_QAPT@
#define HAVE_QPACKAGEKIT @HAVE_QPACKAGEKIT@
#define QAPT_VERSION_MAJOR @QAPT_VERSION_MAJOR@
+#define GRUB_INSTALL_EXE "@GRUB_INSTALL_EXE@"
+#define GRUB_MKCONFIG_EXE "@GRUB_MKCONFIG_EXE@"
+#define GRUB_PROBE_EXE "@GRUB_PROBE_EXE@"
+#define GRUB_SET_DEFAULT_EXE "@GRUB_SET_DEFAULT_EXE@"
+#define GRUB_MENU "@GRUB_MENU@"
+#define GRUB_CONFIG "@GRUB_CONFIG@"
+#define GRUB_ENV "@GRUB_ENV@"
+#define GRUB_MEMTEST "@GRUB_MEMTEST@"
+
+enum GrubFile {
+ GrubMenuFile,
+ GrubConfigurationFile,
+ GrubEnvironmentFile,
+ GrubMemtestFile
+};
+
#endif
diff --git a/src/helper/helper.cpp b/src/helper/helper.cpp
index 5136cc7..20316a9 100644
--- a/src/helper/helper.cpp
+++ b/src/helper/helper.cpp
@@ -26,9 +26,9 @@
//KDE
#include <KDebug>
+#include <KGlobal>
#include <KLocale>
#include <KProcess>
-#include <KStandardDirs>
#include <KAuth/HelperSupport>
//Project
@@ -39,23 +39,13 @@
#endif
//The $PATH environment variable is emptied by D-Bus activation,
-//so let's provide a sane default. To be used as a fallback.
+//so let's provide a sane default. Needed for os-prober to work.
static const QString path = QLatin1String("/usr/sbin:/usr/bin:/sbin:/bin");
Helper::Helper()
{
KGlobal::locale()->insertCatalog("kcm-grub2");
- //-l stands for --login. A login shell is needed in order to properly
- //source /etc/profile, ~/.profile and/or other shell-specific login
- //scripts (such as ~/.bash_profile for Bash).
- //Not all shells implement this option, in which case we have the fallback.
- //Bash, DASH, ksh and Zsh seem to work properly.
- ActionReply pathReply = executeCommand(QStringList() << findShell() << "-l" << "-c" << "echo $PATH");
- if (pathReply.succeeded()) {
- qputenv("PATH", pathReply.data().value("output").toByteArray().trimmed());
- } else {
- qputenv("PATH", path.toLatin1());
- }
+ qputenv("PATH", path.toLatin1());
}
ActionReply Helper::executeCommand(const QStringList &command)
@@ -76,31 +66,12 @@ ActionReply Helper::executeCommand(const QStringList &command)
reply.addData("output", process.readAll());
return reply;
}
-QString Helper::findShell()
-{
- QString shell = QFile::symLinkTarget(QLatin1String("/bin/sh"));
- if (shell.isEmpty()) {
- shell = KStandardDirs::findExe(QLatin1String("bash"), path);
- if (shell.isEmpty()) {
- shell = KStandardDirs::findExe(QLatin1String("dash"), path);
- if (shell.isEmpty()) {
- shell = KStandardDirs::findExe(QLatin1String("ksh"), path);
- if (shell.isEmpty()) {
- shell = KStandardDirs::findExe(QLatin1String("zsh"), path);
- if (shell.isEmpty()) {
- shell = QLatin1String("/bin/sh");
- }
- }
- }
- }
- }
- return shell;
-}
ActionReply Helper::defaults(QVariantMap args)
{
+ Q_UNUSED(args)
ActionReply reply;
- QString configFileName = args.value("configFileName").toString();
+ QString configFileName = GRUB_CONFIG;
QString originalConfigFileName = configFileName + ".original";
if (!QFile::exists(originalConfigFileName)) {
@@ -123,7 +94,6 @@ ActionReply Helper::defaults(QVariantMap args)
ActionReply Helper::install(QVariantMap args)
{
ActionReply reply;
- QString installExePath = args.value("installExePath").toString();
QString partition = args.value("partition").toString();
QString mountPoint = args.value("mountPoint").toString();
bool mbrInstall = args.value("mbrInstall").toBool();
@@ -142,7 +112,7 @@ ActionReply Helper::install(QVariantMap args)
}
QStringList grub_installCommand;
- grub_installCommand << installExePath << "--root-directory" << mountPoint;
+ grub_installCommand << GRUB_INSTALL_EXE << "--root-directory" << mountPoint;
if (mbrInstall) {
grub_installCommand << partition.remove(QRegExp("\\d+"));
} else {
@@ -153,7 +123,18 @@ ActionReply Helper::install(QVariantMap args)
ActionReply Helper::load(QVariantMap args)
{
ActionReply reply;
- QString fileName = args.value("fileName").toString();
+ QString fileName;
+ switch (args.value("grubFile").toInt()) {
+ case GrubMenuFile:
+ fileName = GRUB_MENU;
+ break;
+ case GrubConfigurationFile:
+ fileName = GRUB_CONFIG;
+ break;
+ case GrubEnvironmentFile:
+ fileName = GRUB_ENV;
+ break;
+ }
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
@@ -167,13 +148,12 @@ ActionReply Helper::load(QVariantMap args)
ActionReply Helper::probe(QVariantMap args)
{
ActionReply reply;
- QString probeExePath = args.value("probeExePath").toString();
QStringList mountPoints = args.value("mountPoints").toStringList();
QStringList grubPartitions;
HelperSupport::progressStep(0);
for (int i = 0; i < mountPoints.size(); i++) {
- ActionReply grub_probeReply = executeCommand(QStringList() << probeExePath << "-t" << "drive" << mountPoints.at(i));
+ ActionReply grub_probeReply = executeCommand(QStringList() << GRUB_PROBE_EXE << "-t" << "drive" << mountPoints.at(i));
if (grub_probeReply.failed()) {
return grub_probeReply;
}
@@ -211,13 +191,9 @@ ActionReply Helper::probevbe(QVariantMap args)
ActionReply Helper::save(QVariantMap args)
{
ActionReply reply;
- QString mkconfigExePath = args.value("mkconfigExePath").toString();
- QString set_defaultExePath = args.value("set_defaultExePath").toString();
- QString configFileName = args.value("configFileName").toString();
+ QString configFileName = GRUB_CONFIG;
QByteArray rawConfigFileContents = args.value("rawConfigFileContents").toByteArray();
- QString menuFileName = args.value("menuFileName").toString();
QByteArray rawDefaultEntry = args.value("rawDefaultEntry").toByteArray();
- QString memtestFileName = args.value("memtestFileName").toString();
bool memtest = args.value("memtest").toBool();
QFile::copy(configFileName, configFileName + ".original");
@@ -232,21 +208,21 @@ ActionReply Helper::save(QVariantMap args)
file.close();
if (args.contains("memtest")) {
- QFile::Permissions permissions = QFile::permissions(memtestFileName);
+ QFile::Permissions permissions = QFile::permissions(GRUB_MEMTEST);
if (memtest) {
permissions |= (QFile::ExeOwner | QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther);
} else {
permissions &= ~(QFile::ExeOwner | QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther);
}
- QFile::setPermissions(memtestFileName, permissions);
+ QFile::setPermissions(GRUB_MEMTEST, permissions);
}
- ActionReply grub_mkconfigReply = executeCommand(QStringList() << mkconfigExePath << "-o" << menuFileName);
+ ActionReply grub_mkconfigReply = executeCommand(QStringList() << GRUB_MKCONFIG_EXE << "-o" << GRUB_MENU);
if (grub_mkconfigReply.failed()) {
return grub_mkconfigReply;
}
- ActionReply grub_set_defaultReply = executeCommand(QStringList() << set_defaultExePath << rawDefaultEntry);
+ ActionReply grub_set_defaultReply = executeCommand(QStringList() << GRUB_SET_DEFAULT_EXE << rawDefaultEntry);
if (grub_set_defaultReply.failed()) {
return grub_set_defaultReply;
}
diff --git a/src/helper/helper.h b/src/helper/helper.h
index e84af67..782d382 100644
--- a/src/helper/helper.h
+++ b/src/helper/helper.h
@@ -29,7 +29,6 @@ public:
Helper();
private:
ActionReply executeCommand(const QStringList &command);
- QString findShell();
public Q_SLOTS:
ActionReply defaults(QVariantMap args);
ActionReply install(QVariantMap args);
diff --git a/src/installDlg.cpp b/src/installDlg.cpp
index 97f8c80..ceff92c 100644
--- a/src/installDlg.cpp
+++ b/src/installDlg.cpp
@@ -35,7 +35,7 @@ using namespace KAuth;
//Ui
#include "ui_installDlg.h"
-InstallDialog::InstallDialog(const QString installExePath, QWidget *parent, Qt::WFlags flags) : KDialog(parent, flags)
+InstallDialog::InstallDialog(QWidget *parent, Qt::WFlags flags) : KDialog(parent, flags)
{
QWidget *widget = new QWidget(this);
ui = new Ui::InstallDialog;
@@ -48,8 +48,6 @@ InstallDialog::InstallDialog(const QString installExePath, QWidget *parent, Qt::
setInitialSize(parent->size());
}
- m_installExePath = installExePath;
-
ui->treeWidget_recover->headerItem()->setText(0, QString());
ui->treeWidget_recover->header()->setResizeMode(QHeaderView::Stretch);
ui->treeWidget_recover->header()->setResizeMode(0, QHeaderView::ResizeToContents);
@@ -90,7 +88,6 @@ void InstallDialog::slotButtonClicked(int button)
for (int i = 0; i < ui->treeWidget_recover->topLevelItemCount(); i++) {
QRadioButton *radio = qobject_cast<QRadioButton *>(ui->treeWidget_recover->itemWidget(ui->treeWidget_recover->topLevelItem(i), 0));
if (radio && radio->isChecked()) {
- installAction.addArgument("installExePath", m_installExePath);
installAction.addArgument("partition", ui->treeWidget_recover->topLevelItem(i)->text(1));
installAction.addArgument("mountPoint", ui->treeWidget_recover->topLevelItem(i)->text(2));
installAction.addArgument("mbrInstall", !ui->checkBox_partition->isChecked());
diff --git a/src/installDlg.h b/src/installDlg.h
index 384f63c..e5ddc93 100644
--- a/src/installDlg.h
+++ b/src/installDlg.h
@@ -31,12 +31,11 @@ class InstallDialog : public KDialog
{
Q_OBJECT
public:
- explicit InstallDialog(const QString installExePath, QWidget *parent = 0, Qt::WFlags flags = 0);
+ explicit InstallDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
virtual ~InstallDialog();
protected Q_SLOTS:
virtual void slotButtonClicked(int button);
private:
- QString m_installExePath;
Ui::InstallDialog *ui;
};
diff --git a/src/kcm_grub2.cpp b/src/kcm_grub2.cpp
index 56e0466..b6b324d 100644
--- a/src/kcm_grub2.cpp
+++ b/src/kcm_grub2.cpp
@@ -34,15 +34,12 @@
#include <KMessageBox>
#include <kmountpoint.h>
#include <KPluginFactory>
-#include <KProcess>
#include <KProgressDialog>
-#include <KStandardDirs>
#include <KAuth/ActionWatcher>
using namespace KAuth;
//Project
#include "common.h"
-#include <config.h>
#if HAVE_IMAGEMAGICK
#include "convertDlg.h"
#endif
@@ -71,9 +68,6 @@ KCMGRUB2::KCMGRUB2(QWidget *parent, const QVariantList &list) : KCModule(GRUB2Fa
ui->setupUi(this);
setupObjects();
setupConnections();
- if (check()) {
- ui->stackedWidget->setCurrentIndex(1);
- }
}
KCMGRUB2::~KCMGRUB2()
{
@@ -84,7 +78,6 @@ void KCMGRUB2::defaults()
{
Action defaultsAction("org.kde.kcontrol.kcmgrub2.defaults");
defaultsAction.setHelperID("org.kde.kcontrol.kcmgrub2");
- defaultsAction.addArgument("configFileName", configPath);
#if KDE_IS_VERSION(4,6,0)
defaultsAction.setParentWidget(this);
#endif
@@ -101,10 +94,6 @@ void KCMGRUB2::defaults()
}
void KCMGRUB2::load()
{
- if (ui->stackedWidget->currentIndex() == 0) {
- return;
- }
-
readEntries();
readSettings();
readEnv();
@@ -202,9 +191,9 @@ void KCMGRUB2::load()
}
ui->checkBox_recovery->setChecked(unquoteWord(m_settings.value("GRUB_DISABLE_RECOVERY")).compare("true") != 0);
- if (QFile::exists(memtestPath)) {
+ if (QFile::exists(GRUB_MEMTEST)) {
ui->checkBox_memtest->setVisible(true);
- ui->checkBox_memtest->setChecked(QFile::permissions(memtestPath) & (QFile::ExeOwner | QFile::ExeGroup | QFile::ExeOther));
+ ui->checkBox_memtest->setChecked(QFile::permissions(GRUB_MEMTEST) & (QFile::ExeOwner | QFile::ExeGroup | QFile::ExeOther));
} else {
ui->checkBox_memtest->setVisible(false);
}
@@ -471,14 +460,9 @@ void KCMGRUB2::save()
Action saveAction("org.kde.kcontrol.kcmgrub2.save");
saveAction.setHelperID("org.kde.kcontrol.kcmgrub2");
- saveAction.addArgument("mkconfigExePath", mkconfigExePath);
- saveAction.addArgument("set_defaultExePath", set_defaultExePath);
- saveAction.addArgument("configFileName", configPath);
saveAction.addArgument("rawConfigFileContents", configFileContents.toLocal8Bit());
- saveAction.addArgument("menuFileName", menuPath);
saveAction.addArgument("rawDefaultEntry", !m_entries.isEmpty() ? grubDefault : m_settings.value("GRUB_DEFAULT").toLocal8Bit());
if (m_dirtyBits.testBit(memtestDirty)) {
- saveAction.addArgument("memtestFileName", memtestPath);
saveAction.addArgument("memtest", ui->checkBox_memtest->isChecked());
}
#if KDE_IS_VERSION(4,6,0)
@@ -571,7 +555,7 @@ void KCMGRUB2::slotGrubDisableOsProberChanged()
}
void KCMGRUB2::slotInstallBootloader()
{
- QPointer<InstallDialog> installDlg = new InstallDialog(installExePath, this);
+ QPointer<InstallDialog> installDlg = new InstallDialog(this);
installDlg->exec();
delete installDlg;
}
@@ -947,64 +931,6 @@ void KCMGRUB2::setupConnections()
connect(ui->kpushbutton_install, SIGNAL(clicked(bool)), this, SLOT(slotInstallBootloader()));
}
-QString KCMGRUB2::findExe(const QString &exeName)
-{
- QString exePath = KStandardDirs::findExe(exeName);
- if (!exePath.isEmpty()) {
- return exePath;
- }
- KProcess whereis;
- whereis << "whereis" << "-b" << exeName;
- whereis.setOutputChannelMode(KProcess::OnlyStdoutChannel);
- if (whereis.execute() == 0) {
- QString output = whereis.readAllStandardOutput();
- if (output.startsWith(exeName + ':')) {
- return output.mid(exeName.length() + 1).trimmed();
- }
- }
- return QString();
-}
-bool KCMGRUB2::check()
-{
- installExePath = findExe("grub-install");
- mkconfigExePath = findExe("grub-mkconfig");
- probeExePath = findExe("grub-probe");
- set_defaultExePath = findExe("grub-set-default");
- if (!installExePath.isEmpty() && !mkconfigExePath.isEmpty() && !probeExePath.isEmpty() && !set_defaultExePath.isEmpty()) {
- kDebug() << "GRUB2 installation detected!";
- menuPath = "/boot/grub/grub.cfg";
- configPath = "/etc/default/grub";
- envPath = "/boot/grub/grubenv";
- memtestPath = "/etc/grub.d/20_memtest86+";
- return true;
- }
- installExePath = findExe("grub2-install");
- mkconfigExePath = findExe("grub2-mkconfig");
- probeExePath = findExe("grub2-probe");
- set_defaultExePath = findExe("grub2-set-default");
- if (!installExePath.isEmpty() && !mkconfigExePath.isEmpty() && !probeExePath.isEmpty() && !set_defaultExePath.isEmpty()) {
- kDebug() << "GRUB2 (RPM) installation detected!";
- menuPath = "/boot/grub2/grub.cfg";
- configPath = "/etc/default/grub";
- envPath = "/boot/grub2/grubenv";
- memtestPath = "/etc/grub.d/20_memtest86+";
- return true;
- }
- installExePath = findExe("burg-install");
- mkconfigExePath = findExe("burg-mkconfig");
- probeExePath = findExe("burg-probe");
- set_defaultExePath = findExe("burg-set-default");
- if (!installExePath.isEmpty() && !mkconfigExePath.isEmpty() && !probeExePath.isEmpty() && !set_defaultExePath.isEmpty()) {
- kDebug() << "BURG installation detected!";
- menuPath = "/boot/burg/burg.cfg";
- configPath = "/etc/default/burg";
- envPath = "/boot/burg/burgenv";
- memtestPath = "/etc/burg.d/20_memtest86+";
- return true;
- }
- return false;
-}
-
QString KCMGRUB2::convertToGRUBFileName(const QString &fileName)
{
QString grubFileName = fileName;
@@ -1034,8 +960,23 @@ QString KCMGRUB2::convertToLocalFileName(const QString &grubFileName)
return fileName;
}
-QString KCMGRUB2::readFile(const QString &fileName)
+QString KCMGRUB2::readFile(GrubFile grubFile)
{
+ QString fileName;
+ switch (grubFile) {
+ case GrubMenuFile:
+ fileName = GRUB_MENU;
+ break;
+ case GrubConfigurationFile:
+ fileName = GRUB_CONFIG;
+ break;
+ case GrubEnvironmentFile:
+ fileName = GRUB_ENV;
+ break;
+ case GrubMemtestFile:
+ return QString();
+ }
+
QFile file(fileName);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream stream(&file);
@@ -1044,7 +985,7 @@ QString KCMGRUB2::readFile(const QString &fileName)
Action loadAction("org.kde.kcontrol.kcmgrub2.load");
loadAction.setHelperID("org.kde.kcontrol.kcmgrub2");
- loadAction.addArgument("fileName", fileName);
+ loadAction.addArgument("grubFile", grubFile);
#if KDE_IS_VERSION(4,6,0)
loadAction.setParentWidget(this);
#endif
@@ -1060,21 +1001,21 @@ QString KCMGRUB2::readFile(const QString &fileName)
}
void KCMGRUB2::readEntries()
{
- QString fileContents = readFile(menuPath);
+ QString fileContents = readFile(GrubMenuFile);
m_entries.clear();
parseEntries(fileContents);
}
void KCMGRUB2::readSettings()
{
- QString fileContents = readFile(configPath);
+ QString fileContents = readFile(GrubConfigurationFile);
m_settings.clear();
parseSettings(fileContents);
}
void KCMGRUB2::readEnv()
{
- QString fileContents = readFile(envPath);
+ QString fileContents = readFile(GrubEnvironmentFile);
m_env.clear();
parseEnv(fileContents);
@@ -1090,7 +1031,6 @@ void KCMGRUB2::readDevices()
Action probeAction("org.kde.kcontrol.kcmgrub2.probe");
probeAction.setHelperID("org.kde.kcontrol.kcmgrub2");
- probeAction.addArgument("probeExePath", probeExePath);
probeAction.addArgument("mountPoints", mountPoints);
#if KDE_IS_VERSION(4,6,0)
probeAction.setParentWidget(this);
diff --git a/src/kcm_grub2.h b/src/kcm_grub2.h
index 605029f..6afb0e0 100644
--- a/src/kcm_grub2.h
+++ b/src/kcm_grub2.h
@@ -29,6 +29,7 @@ namespace KAuth
}
//Project
+#include "config.h"
class Entry;
//Ui
@@ -83,14 +84,11 @@ private:
void setupObjects();
void setupConnections();
- QString findExe(const QString &exeName);
- bool check();
-
//TODO: Maybe remove?
QString convertToGRUBFileName(const QString &fileName);
QString convertToLocalFileName(const QString &grubFileName);
- QString readFile(const QString &fileName);
+ QString readFile(GrubFile grubFile);
void readEntries();
void readSettings();
void readEnv();
@@ -135,15 +133,6 @@ private:
};
QBitArray m_dirtyBits;
- QString installExePath;
- QString mkconfigExePath;
- QString probeExePath;
- QString set_defaultExePath;
- QString menuPath;
- QString configPath;
- QString envPath;
- QString memtestPath;
-
QList<Entry> m_entries;
QHash<QString, QString> m_settings;
QHash<QString, QString> m_env;
diff --git a/ui/kcm_grub2.ui b/ui/kcm_grub2.ui
index 24acc06..8a4bc41 100644
--- a/ui/kcm_grub2.ui
+++ b/ui/kcm_grub2.ui
@@ -6,635 +6,610 @@
<rect>
<x>0</x>
<y>0</y>
- <width>492</width>
- <height>507</height>
+ <width>484</width>
+ <height>499</height>
</rect>
</property>
- <layout class="QGridLayout" name="gridLayout_7">
+ <layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
- <widget class="QStackedWidget" name="stackedWidget">
+ <widget class="KTabWidget" name="ktabwidget">
<property name="currentIndex">
<number>0</number>
</property>
- <widget class="QWidget" name="page">
- <layout class="QGridLayout" name="gridLayout_9">
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string comment="@title:tab Refers to settings.">General</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_5">
+ <item row="1" column="0">
+ <widget class="QGroupBox" name="groupBox_timeout">
+ <property name="title">
+ <string comment="@title:group">Timeout</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_4">
+ <item row="0" column="0" colspan="2">
+ <layout class="QFormLayout" name="formLayout_2">
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="checkBox_hiddenTimeout">
+ <property name="text">
+ <string comment="@option:check">Hide the menu for:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSpinBox" name="spinBox_hiddenTimeout">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="suffix">
+ <string comment="@label:spinbox seconds (suffix)">s</string>
+ </property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="checkBox_hiddenTimeoutShowTimer">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string comment="@option:check">Show countdown timer</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="2">
+ <widget class="QCheckBox" name="checkBox_timeout">
+ <property name="text">
+ <string comment="@option:check">Automatically boot the default entry after showing the menu</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="1">
+ <widget class="QRadioButton" name="radioButton_timeout0">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string comment="@option:radio">Immediately</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="1">
+ <layout class="QFormLayout" name="formLayout_3">
+ <item row="0" column="0">
+ <widget class="QRadioButton" name="radioButton_timeout">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string comment="@option:radio">After:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSpinBox" name="spinBox_timeout">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="suffix">
+ <string comment="@label:spinbox seconds (suffix)">s</string>
+ </property>
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>43</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="0">
+ <widget class="QGroupBox" name="groupBox_entries">
+ <property name="title">
+ <string comment="@title:group">Generated Entries</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="checkBox_recovery">
+ <property name="text">
+ <string comment="@option:check">Generate recovery entries</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="checkBox_memtest">
+ <property name="text">
+ <string comment="@option:check">Generate memtest entries</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="checkBox_osProber">
+ <property name="text">
+ <string comment="@option:check">Probe for operating systems</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item row="0" column="0">
- <widget class="QLabel" name="label_info">
- <property name="text">
- <string comment="@info">No valid GRUB2/BURG installation could be detected!</string>
+ <widget class="QGroupBox" name="groupBox_default">
+ <property name="title">
+ <string comment="@title:group">Default Entry</string>
</property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_default">
+ <property name="text">
+ <string comment="@label:listbox">Default Entry:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="KComboBox" name="kcombobox_default">
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KPushButton" name="kpushbutton_remove">
+ <property name="text">
+ <string comment="@action:button">Remove Old Entries</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" colspan="2">
+ <widget class="QCheckBox" name="checkBox_savedefault">
+ <property name="text">
+ <string comment="@option:check">The next booted entry will become default</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_3">
+ <attribute name="title">
+ <string comment="@title:tab">Appearance</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="groupBox_resolutions">
+ <property name="title">
+ <string comment="@title:group">Resolutions</string>
</property>
+ <layout class="QFormLayout" name="formLayout_9">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_gfxmode">
+ <property name="text">
+ <string comment="@label:listbox">GRUB:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="KComboBox" name="kcombobox_gfxmode">
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_gfxpayload">
+ <property name="text">
+ <string comment="@label:listbox">Linux Kernel:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="KComboBox" name="kcombobox_gfxpayload">
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
+ <item row="1" column="0">
+ <widget class="QGroupBox" name="groupBox_colors">
+ <property name="title">
+ <string comment="@title:group">Colors</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <layout class="QFormLayout" name="formLayout_11">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_normalForeground">
+ <property name="text">
+ <string comment="@label:chooser">Normal Foreground (Text):</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="KComboBox" name="kcombobox_normalForeground"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_highlightForeground">
+ <property name="text">
+ <string comment="@label:chooser">Highlight Foreground (Text):</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="KComboBox" name="kcombobox_highlightForeground"/>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1">
+ <layout class="QFormLayout" name="formLayout_10">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_normalBackground">
+ <property name="text">
+ <string comment="@label:chooser">Normal Background:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="KComboBox" name="kcombobox_normalBackground"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_highlightBackground">
+ <property name="text">
+ <string comment="@label:chooser">Highlight Background:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="KComboBox" name="kcombobox_highlightBackground"/>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QGroupBox" name="groupBox_background">
+ <property name="title">
+ <string comment="@title:group Refers to the image shown behind the boot menu.">Background</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_12">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_background">
+ <property name="text">
+ <string comment="@label:textbox">Wallpaper:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_7">
+ <item>
+ <widget class="KUrlRequester" name="kurlrequester_background"/>
+ </item>
+ <item>
+ <widget class="KPushButton" name="kpushbutton_preview">
+ <property name="text">
+ <string comment="@action:button">Preview</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KPushButton" name="kpushbutton_create">
+ <property name="text">
+ <string comment="@action:button">Create</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_theme">
+ <property name="text">
+ <string comment="@label:textbox">Theme:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="KUrlRequester" name="kurlrequester_theme"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>69</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
- <widget class="QWidget" name="page_2">
- <layout class="QGridLayout" name="gridLayout_6">
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string comment="@title:tab Refers to settings.">Advanced</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
- <widget class="KTabWidget" name="ktabwidget">
- <property name="currentIndex">
- <number>0</number>
+ <widget class="QGroupBox" name="groupBox_linux">
+ <property name="title">
+ <string comment="@title:group">Linux Kernel Arguments</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_8">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_cmdlineDefault">
+ <property name="text">
+ <string comment="@label:textbox">Normal Entries:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="KLineEdit" name="klineedit_cmdlineDefault"/>
+ </item>
+ <item>
+ <widget class="KPushButton" name="kpushbutton_cmdlineDefaultSuggestions">
+ <property name="text">
+ <string comment="@action:button">Suggestions</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_cmdline">
+ <property name="text">
+ <string comment="@label:textbox">All Entries:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="KLineEdit" name="klineedit_cmdline"/>
+ </item>
+ <item>
+ <widget class="KPushButton" name="kpushbutton_cmdlineSuggestions">
+ <property name="text">
+ <string comment="@action:button">Suggestions</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QGroupBox" name="groupBox_terminal">
+ <property name="title">
+ <string comment="@title:group Noun.">Terminal</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_7">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_terminal">
+ <property name="text">
+ <string comment="@label:textbox Noun.">Terminal:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="KLineEdit" name="klineedit_terminal"/>
+ </item>
+ <item>
+ <widget class="KPushButton" name="kpushbutton_terminalSuggestions">
+ <property name="text">
+ <string comment="@action:button">Suggestions</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_terminalInput">
+ <property name="text">
+ <string comment="@label:textbox">Input Terminal:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <widget class="KLineEdit" name="klineedit_terminalInput"/>
+ </item>
+ <item>
+ <widget class="KPushButton" name="kpushbutton_terminalInputSuggestions">
+ <property name="text">
+ <string comment="@action:button">Suggestions</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_terminalOutput">
+ <property name="text">
+ <string comment="@label:textbox">Output Terminal:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <widget class="KLineEdit" name="klineedit_terminalOutput"/>
+ </item>
+ <item>
+ <widget class="KPushButton" name="kpushbutton_terminalOutputSuggestions">
+ <property name="text">
+ <string comment="@action:button">Suggestions</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QGroupBox" name="groupBox_other">
+ <property name="title">
+ <string comment="@title:group Refers to settings.">Other</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_5">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_distributor">
+ <property name="text">
+ <string comment="@label:textbox">Distributor:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="KLineEdit" name="klineedit_distributor"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_serial">
+ <property name="text">
+ <string comment="@label:textbox">Serial Command:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="KLineEdit" name="klineedit_serial"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_initTune">
+ <property name="text">
+ <string comment="@label:textbox">Init Tune:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="KLineEdit" name="klineedit_initTune"/>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_uuid">
+ <property name="text">
+ <string comment="@option:check">Enable UUIDs:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QCheckBox" name="checkBox_uuid"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>43</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="0">
+ <widget class="QGroupBox" name="groupBox_tools">
+ <property name="title">
+ <string comment="@title:group">Tools</string>
</property>
- <widget class="QWidget" name="tab">
- <attribute name="title">
- <string comment="@title:tab Refers to settings.">General</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_5">
- <item row="1" column="0">
- <widget class="QGroupBox" name="groupBox_timeout">
- <property name="title">
- <string comment="@title:group">Timeout</string>
- </property>
- <layout class="QFormLayout" name="formLayout_4">
- <item row="0" column="0" colspan="2">
- <layout class="QFormLayout" name="formLayout_2">
- <item row="0" column="0">
- <widget class="QCheckBox" name="checkBox_hiddenTimeout">
- <property name="text">
- <string comment="@option:check">Hide the menu for:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QSpinBox" name="spinBox_hiddenTimeout">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="suffix">
- <string comment="@label:spinbox seconds (suffix)">s</string>
- </property>
- <property name="minimum">
- <number>1</number>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Minimum</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="checkBox_hiddenTimeoutShowTimer">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string comment="@option:check">Show countdown timer</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QCheckBox" name="checkBox_timeout">
- <property name="text">
- <string comment="@option:check">Automatically boot the default entry after showing the menu</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="3" column="1">
- <widget class="QRadioButton" name="radioButton_timeout0">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string comment="@option:radio">Immediately</string>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <spacer name="horizontalSpacer_4">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>21</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="1">
- <layout class="QFormLayout" name="formLayout_3">
- <item row="0" column="0">
- <widget class="QRadioButton" name="radioButton_timeout">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string comment="@option:radio">After:</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QSpinBox" name="spinBox_timeout">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="suffix">
- <string comment="@label:spinbox seconds (suffix)">s</string>
- </property>
- <property name="minimum">
- <number>1</number>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="3" column="0">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>43</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="0">
- <widget class="QGroupBox" name="groupBox_entries">
- <property name="title">
- <string comment="@title:group">Generated Entries</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0">
- <widget class="QCheckBox" name="checkBox_recovery">
- <property name="text">
- <string comment="@option:check">Generate recovery entries</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QCheckBox" name="checkBox_memtest">
- <property name="text">
- <string comment="@option:check">Generate memtest entries</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QCheckBox" name="checkBox_osProber">
- <property name="text">
- <string comment="@option:check">Probe for operating systems</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QGroupBox" name="groupBox_default">
- <property name="title">
- <string comment="@title:group">Default Entry</string>
- </property>
- <layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label_default">
- <property name="text">
- <string comment="@label:listbox">Default Entry:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="KComboBox" name="kcombobox_default">
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="KPushButton" name="kpushbutton_remove">
- <property name="text">
- <string comment="@action:button">Remove Old Entries</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0" colspan="2">
- <widget class="QCheckBox" name="checkBox_savedefault">
- <property name="text">
- <string comment="@option:check">The next booted entry will become default</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="tab_3">
- <attribute name="title">
- <string comment="@title:tab">Appearance</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_3">
- <item row="0" column="0">
- <widget class="QGroupBox" name="groupBox_resolutions">
- <property name="title">
- <string comment="@title:group">Resolutions</string>
- </property>
- <layout class="QFormLayout" name="formLayout_9">
- <item row="0" column="0">
- <widget class="QLabel" name="label_gfxmode">
- <property name="text">
- <string comment="@label:listbox">GRUB:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="KComboBox" name="kcombobox_gfxmode">
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_gfxpayload">
- <property name="text">
- <string comment="@label:listbox">Linux Kernel:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="KComboBox" name="kcombobox_gfxpayload">
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QGroupBox" name="groupBox_colors">
- <property name="title">
- <string comment="@title:group">Colors</string>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <layout class="QFormLayout" name="formLayout_11">
- <item row="0" column="0">
- <widget class="QLabel" name="label_normalForeground">
- <property name="text">
- <string comment="@label:chooser">Normal Foreground (Text):</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="KComboBox" name="kcombobox_normalForeground"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_highlightForeground">
- <property name="text">
- <string comment="@label:chooser">Highlight Foreground (Text):</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="KComboBox" name="kcombobox_highlightForeground"/>
- </item>
- </layout>
- </item>
- <item row="0" column="1">
- <layout class="QFormLayout" name="formLayout_10">
- <item row="0" column="0">
- <widget class="QLabel" name="label_normalBackground">
- <property name="text">
- <string comment="@label:chooser">Normal Background:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="KComboBox" name="kcombobox_normalBackground"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_highlightBackground">
- <property name="text">
- <string comment="@label:chooser">Highlight Background:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="KComboBox" name="kcombobox_highlightBackground"/>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QGroupBox" name="groupBox_background">
- <property name="title">
- <string comment="@title:group Refers to the image shown behind the boot menu.">Background</string>
- </property>
- <layout class="QFormLayout" name="formLayout_12">
- <item row="0" column="0">
- <widget class="QLabel" name="label_background">
- <property name="text">
- <string comment="@label:textbox">Wallpaper:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_7">
- <item>
- <widget class="KUrlRequester" name="kurlrequester_background"/>
- </item>
- <item>
- <widget class="KPushButton" name="kpushbutton_preview">
- <property name="text">
- <string comment="@action:button">Preview</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="KPushButton" name="kpushbutton_create">
- <property name="text">
- <string comment="@action:button">Create</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_theme">
- <property name="text">
- <string comment="@label:textbox">Theme:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="KUrlRequester" name="kurlrequester_theme"/>
- </item>
- </layout>
- </widget>
- </item>
- <item row="3" column="0">
- <spacer name="verticalSpacer_3">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>69</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="tab_2">
- <attribute name="title">
- <string comment="@title:tab Refers to settings.">Advanced</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QGroupBox" name="groupBox_linux">
- <property name="title">
- <string comment="@title:group">Linux Kernel Arguments</string>
- </property>
- <layout class="QFormLayout" name="formLayout_8">
- <item row="0" column="0">
- <widget class="QLabel" name="label_cmdlineDefault">
- <property name="text">
- <string comment="@label:textbox">Normal Entries:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <item>
- <widget class="KLineEdit" name="klineedit_cmdlineDefault"/>
- </item>
- <item>
- <widget class="KPushButton" name="kpushbutton_cmdlineDefaultSuggestions">
- <property name="text">
- <string comment="@action:button">Suggestions</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_cmdline">
- <property name="text">
- <string comment="@label:textbox">All Entries:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <item>
- <widget class="KLineEdit" name="klineedit_cmdline"/>
- </item>
- <item>
- <widget class="KPushButton" name="kpushbutton_cmdlineSuggestions">
- <property name="text">
- <string comment="@action:button">Suggestions</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QGroupBox" name="groupBox_terminal">
- <property name="title">
- <string comment="@title:group Noun.">Terminal</string>
- </property>
- <layout class="QFormLayout" name="formLayout_7">
- <item row="0" column="0">
- <widget class="QLabel" name="label_terminal">
- <property name="text">
- <string comment="@label:textbox Noun.">Terminal:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_4">
- <item>
- <widget class="KLineEdit" name="klineedit_terminal"/>
- </item>
- <item>
- <widget class="KPushButton" name="kpushbutton_terminalSuggestions">
- <property name="text">
- <string comment="@action:button">Suggestions</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_terminalInput">
- <property name="text">
- <string comment="@label:textbox">Input Terminal:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_5">
- <item>
- <widget class="KLineEdit" name="klineedit_terminalInput"/>
- </item>
- <item>
- <widget class="KPushButton" name="kpushbutton_terminalInputSuggestions">
- <property name="text">
- <string comment="@action:button">Suggestions</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_terminalOutput">
- <property name="text">
- <string comment="@label:textbox">Output Terminal:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout_6">
- <item>
- <widget class="KLineEdit" name="klineedit_terminalOutput"/>
- </item>
- <item>
- <widget class="KPushButton" name="kpushbutton_terminalOutputSuggestions">
- <property name="text">
- <string comment="@action:button">Suggestions</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QGroupBox" name="groupBox_other">
- <property name="title">
- <string comment="@title:group Refers to settings.">Other</string>
- </property>
- <layout class="QFormLayout" name="formLayout_5">
- <item row="0" column="0">
- <widget class="QLabel" name="label_distributor">
- <property name="text">
- <string comment="@label:textbox">Distributor:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="KLineEdit" name="klineedit_distributor"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_serial">
- <property name="text">
- <string comment="@label:textbox">Serial Command:</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="KLineEdit" name="klineedit_serial"/>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_initTune">
- <property name="text">
- <string comment="@label:textbox">Init Tune:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="KLineEdit" name="klineedit_initTune"/>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_uuid">
- <property name="text">
- <string comment="@option:check">Enable UUIDs:</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QCheckBox" name="checkBox_uuid"/>
- </item>
- </layout>
- </widget>
- </item>
- <item row="4" column="0">
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>43</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="3" column="0">
- <widget class="QGroupBox" name="groupBox_tools">
- <property name="title">
- <string comment="@title:group">Tools</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_8">
- <item row="0" column="0">
- <widget class="KPushButton" name="kpushbutton_install">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string comment="@action:button">Install/Recover Bootloader</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
+ <layout class="QGridLayout" name="gridLayout_8">
+ <item row="0" column="0">
+ <widget class="KPushButton" name="kpushbutton_install">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string comment="@action:button">Install/Recover Bootloader</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
</layout>