Diffstat (limited to 'noncore/tools/remote/topgroup.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/tools/remote/topgroup.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/noncore/tools/remote/topgroup.cpp b/noncore/tools/remote/topgroup.cpp new file mode 100644 index 0000000..94ea622 --- a/dev/null +++ b/noncore/tools/remote/topgroup.cpp | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | ||
3 | Copyright (C) 2002 Thomas Stephens | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | ||
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | ||
7 | version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | ||
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
11 | Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | ||
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
15 | */ | ||
16 | |||
17 | #include "topgroup.h" | ||
18 | |||
19 | TopGroup::TopGroup(QWidget *parent=0, const char *name=0):QWidget(parent,name) | ||
20 | { | ||
21 | QHBoxLayout *layout = new QHBoxLayout(this, 0, -1, 0); | ||
22 | |||
23 | QPushButton *power = new QPushButton("Power",this,"power"); | ||
24 | layout->addWidget(power); | ||
25 | connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); | ||
26 | //power->setGeometry(5, 5,40, 20); | ||
27 | |||
28 | layout->addSpacing(5); | ||
29 | |||
30 | QPushButton *source = new QPushButton("Source",this,"source"); | ||
31 | layout->addWidget(source); | ||
32 | connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); | ||
33 | //source->setGeometry(50,5,40,20); | ||
34 | |||
35 | remotes = new QComboBox(false, this, "remotes"); | ||
36 | connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) ); | ||
37 | remotes->insertItem("Select Remote"); | ||
38 | //remotes->setGeometry(135,5,95,20); | ||
39 | |||
40 | QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel"); | ||
41 | //remoteLabel->setGeometry(90,5,40,20); | ||
42 | remoteLabel->setAlignment(AlignRight | AlignVCenter); | ||
43 | |||
44 | layout->addWidget(remoteLabel); | ||
45 | layout->addWidget(remotes); | ||
46 | } | ||
47 | |||
48 | void TopGroup::updateRemotes(Config *cfg) | ||
49 | { | ||
50 | remotes->clear(); | ||
51 | remotes->insertItem(QString("SelectRemote")); | ||
52 | cfg->setGroup("Remotes"); | ||
53 | remotes->insertStringList(cfg->readListEntry("remoteList", ',') ); | ||
54 | } | ||