--- /dev/null
+/*
+ * QCPUFreq - a simple cpufreq GUI
+ * Copyright (C) 2010 Daniel Klaffenbach <danielklaffenbach@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "loadpreset.h"
+#include "ui_loadpreset.h"
+
+LoadPreset::LoadPreset(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::LoadPreset)
+{
+ ui->setupUi(this);
+
+ connect(ui->loadDefault, SIGNAL(toggled()), this, SLOT(buttonPressed("loadDefault")));
+ connect(ui->loadIdeal, SIGNAL(toggled()), this, SLOT(buttonPressed("loadIdeal")));
+ connect(ui->loadLV, SIGNAL(toggled()), this, SLOT(buttonPressed("loadLV")));
+ connect(ui->loadULV, SIGNAL(toggled()), this, SLOT(buttonPressed("loadULV")));
+ connect(ui->loadXLV, SIGNAL(toggled()), this, SLOT(buttonPressed("loadXLV")));
+ connect(ui->loadCustom, SIGNAL(toggled()), this, SLOT(buttonPressed("loadCustom")));
+
+}
+
+LoadPreset::~LoadPreset()
+{
+ delete ui;
+}
+
+
+/**
+ * This slot is called when a button was pressed. It takes care of emmiting
+ * the "load" signal. The load signal will contain the actual name of the
+ * preset which needs to be loaded.
+ *
+ * @emits: load(QString)
+ */
+void LoadPreset::buttonPressed(QString buttonName)
+{
+ if (buttonName == "loadDefault") {
+ emit load("default");
+ } else if (buttonName == "loadIdeal") {
+ emit load("ideal");
+ } else if (buttonName == "loadLV") {
+ emit load("lv");
+ } else if (buttonName == "loadULV") {
+ emit load("ulv");
+ } else if (buttonName == "loadXLV")
+ emit load("xlv");
+ } else if (buttonName == "loadCustom") {
+ emit load("custom");
+ }
+}
--- /dev/null
+/*
+ * QCPUFreq - a simple cpufreq GUI
+ * Copyright (C) 2010 Daniel Klaffenbach <danielklaffenbach@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LOADPRESET_H
+#define LOADPRESET_H
+
+#include <QDialog>
+
+namespace Ui {
+ class LoadPreset;
+}
+
+class LoadPreset : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit LoadPreset(QWidget *parent = 0);
+ ~LoadPreset();
+
+signals:
+ void load(QString presetName);
+
+public slots:
+ void buttonPressed(QString buttonName);
+
+private:
+ Ui::LoadPreset *ui;
+};
+
+#endif // LOADPRESET_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>LoadPreset</class>
+ <widget class="QDialog" name="LoadPreset">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>451</width>
+ <height>88</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Load preset</string>
+ </property>
+ <property name="locale">
+ <locale language="English" country="UnitedStates"/>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QPushButton" name="loadDefault">
+ <property name="text">
+ <string>Default</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QPushButton" name="loadIdeal">
+ <property name="text">
+ <string>Ideal</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QPushButton" name="loadLV">
+ <property name="text">
+ <string>LV</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="loadULV">
+ <property name="text">
+ <string>ULV</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QPushButton" name="loadXLV">
+ <property name="text">
+ <string>XLV</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QPushButton" name="loadCustom">
+ <property name="text">
+ <string>Custom</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>