New release: 0.4.4
[qcpufreq] / src / loadpreset.cpp
1 /*
2  * QCPUFreq - a simple cpufreq GUI
3  * Copyright (C) 2010 Daniel Klaffenbach <danielklaffenbach@gmail.com>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19 #include "loadpreset.h"
20 #include "ui_loadpreset.h"
21
22 LoadPreset::LoadPreset(QWidget *parent) :
23     QDialog(parent),
24     ui(new Ui::LoadPreset)
25 {
26     ui->setupUi(this);
27
28     connect(ui->loadDefault, SIGNAL(clicked()), this, SLOT(buttonLoadDefaultPressed()));
29     connect(ui->loadIdeal, SIGNAL(clicked()), this, SLOT(buttonLoadIdealPressed()));
30     connect(ui->loadLV, SIGNAL(clicked()), this, SLOT(buttonLoadLvPressed()));
31     connect(ui->loadULV, SIGNAL(clicked()), this, SLOT(buttonLoadUlvPressed()));
32     connect(ui->loadXLV, SIGNAL(clicked()), this, SLOT(buttonLoadXlvPressed()));
33     connect(ui->loadCustom, SIGNAL(clicked()), this, SLOT(buttonLoadCustomPressed()));
34
35 }
36
37 LoadPreset::~LoadPreset()
38 {
39     delete ui;
40 }
41
42
43 /**
44   * This slot is called when the loadCustom button was pressed.
45   * It emits the "load" signal and hides the dialog.
46   *
47   * @emits: load("custom")
48   */
49 void LoadPreset::buttonLoadCustomPressed()
50 {
51     emit load("custom");
52     hide();
53 }
54
55
56 /**
57   * This slot is called when the loadDefault button was pressed.
58   * It emits the "load" signal and hides the dialog.
59   *
60   * @emits: load("default")
61   */
62 void LoadPreset::buttonLoadDefaultPressed()
63 {
64     emit load("default");
65     hide();
66 }
67
68
69 /**
70   * This slot is called when the loadIdeal button was pressed.
71   * It emits the "load" signal and hides the dialog.
72   *
73   * @emits: load("ideal")
74   */
75 void LoadPreset::buttonLoadIdealPressed()
76 {
77     emit load("ideal");
78     hide();
79 }
80
81
82 /**
83   * This slot is called when the loadLV button was pressed.
84   * It emits the "load" signal and hides the dialog.
85   *
86   * @emits: load("lv")
87   */
88 void LoadPreset::buttonLoadLvPressed()
89 {
90     emit load("lv");
91     hide();
92 }
93
94
95 /**
96   * This slot is called when the loadULV button was pressed.
97   * It emits the "load" signal and hides the dialog.
98   *
99   * @emits: load("ulv")
100   */
101 void LoadPreset::buttonLoadUlvPressed()
102 {
103     emit load("ulv");
104     hide();
105 }
106
107
108 /**
109   * This slot is called when the loadXLV button was pressed.
110   * It emits the "load" signal and hides the dialog.
111   *
112   * @emits: load("xlv")
113   */
114 void LoadPreset::buttonLoadXlvPressed()
115 {
116     emit load("xlv");
117     hide();
118 }