Debian Codegraph @

HercConfiguration/DevicesRename.cpp

raw symbols SCIP
1 /*
2 * File: DevicesRename.cpp
3 *
4 * Author: Jacob Dekel
5 * Created on: Nov 1, 2009
6 *
7 * Copyright (c) 2009-2013 Jacob Dekel
8 * $Id$
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 *
23 */
24 #include "DevicesRename.h"
25
26 DevicesRename::DevicesRename(int value, int newValue, QWidget *parent)
27 : QDialog(parent), mInitialDevNum(value)
28 {
29 ui.setupUi(this);
30
31 mSpinBox = new Configuration::HexSpinBox(this);
32 mSpinBox->move(180,40);
33 mSpinBox->setValue(newValue);
34
35 QString from = mSpinBox->textFromValue(value);
36 ui.fromValue->setText(from);
37
38 connect(ui.buttonBox,SIGNAL(accepted()), this, SLOT(ok()));
39 connect(ui.buttonBox,SIGNAL(rejected()), this, SLOT(notok()));
40 }
41
42 DevicesRename::~DevicesRename()
43 {
44
45 }
46
47 void DevicesRename::ok()
48 {
49 emit accepted(mSpinBox->textFromValue(mInitialDevNum), mSpinBox->textFromValue(mSpinBox->value()));
50 }
51
52 void DevicesRename::notok()
53 {
54 emit rejected();
55 }