summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/remote/topgroup.cpp6
-rw-r--r--noncore/tools/remote/topgroup.h1
-rw-r--r--noncore/tools/remote/topgroupconf.cpp1
3 files changed, 6 insertions, 2 deletions
diff --git a/noncore/tools/remote/topgroup.cpp b/noncore/tools/remote/topgroup.cpp
index 427cb8f..7f2366b 100644
--- a/noncore/tools/remote/topgroup.cpp
+++ b/noncore/tools/remote/topgroup.cpp
@@ -3,52 +3,56 @@ Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include "topgroup.h" 17#include "topgroup.h"
18 18
19TopGroup::TopGroup(QWidget *parent, const char *name):QWidget(parent,name) 19TopGroup::TopGroup(QWidget *parent, const char *name):QWidget(parent,name)
20{ 20{
21 QHBoxLayout *layout = new QHBoxLayout(this, 0, -1, 0); 21 QHBoxLayout *layout = new QHBoxLayout(this, 0, -1, 0);
22 22
23 QPushButton *power = new QPushButton("Power",this,"power"); 23 QPushButton *power = new QPushButton("Power",this,"power");
24 layout->addWidget(power); 24 layout->addWidget(power);
25 connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); 25 connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
26 //power->setGeometry(5, 5,40, 20); 26 //power->setGeometry(5, 5,40, 20);
27 27
28 layout->addSpacing(5); 28 layout->addSpacing(5);
29 29
30 QPushButton *source = new QPushButton("Source",this,"source"); 30 QPushButton *source = new QPushButton("Source",this,"source");
31 layout->addWidget(source); 31 layout->addWidget(source);
32 connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); 32 connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
33 //source->setGeometry(50,5,40,20); 33 //source->setGeometry(50,5,40,20);
34 34
35 remotes = new QComboBox(false, this, "remotes"); 35 remotes = new QComboBox(false, this, "remotes");
36 connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) ); 36 connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) );
37 remotes->insertItem("Select Remote"); 37 remotes->insertItem("Select Remote");
38 //remotes->setGeometry(135,5,95,20); 38 //remotes->setGeometry(135,5,95,20);
39 39
40 QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel"); 40 QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel");
41 //remoteLabel->setGeometry(90,5,40,20); 41 //remoteLabel->setGeometry(90,5,40,20);
42 remoteLabel->setAlignment(AlignRight | AlignVCenter); 42 remoteLabel->setAlignment(AlignRight | AlignVCenter);
43 43
44 layout->addWidget(remoteLabel); 44 layout->addWidget(remoteLabel);
45 layout->addWidget(remotes); 45 layout->addWidget(remotes);
46} 46}
47 47
48void TopGroup::updateRemotes(Config *cfg) 48void TopGroup::updateRemotes(Config *cfg)
49{ 49{
50 remotes->clear(); 50 remotes->clear();
51 remotes->insertItem(QString("SelectRemote"));
52 cfg->setGroup("Remotes"); 51 cfg->setGroup("Remotes");
53 remotes->insertStringList(cfg->readListEntry("remoteList", ',') ); 52 remotes->insertStringList(cfg->readListEntry("remoteList", ',') );
54} 53}
54
55QString TopGroup::getRemotesText()
56{
57 return remotes->currentText();
58}
diff --git a/noncore/tools/remote/topgroup.h b/noncore/tools/remote/topgroup.h
index 215292d..091ac14 100644
--- a/noncore/tools/remote/topgroup.h
+++ b/noncore/tools/remote/topgroup.h
@@ -1,31 +1,32 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 3Copyright (C)
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include <qpe/config.h> 17#include <qpe/config.h>
18#include <qwidget.h> 18#include <qwidget.h>
19#include <qpushbutton.h> 19#include <qpushbutton.h>
20#include <qcombobox.h> 20#include <qcombobox.h>
21#include <qlabel.h> 21#include <qlabel.h>
22#include <qlayout.h> 22#include <qlayout.h>
23 23
24class TopGroup : public QWidget 24class TopGroup : public QWidget
25{ 25{
26public: 26public:
27 TopGroup(QWidget *parent=0, const char *name=0); 27 TopGroup(QWidget *parent=0, const char *name=0);
28 void updateRemotes(Config *cfg); 28 void updateRemotes(Config *cfg);
29 QString getRemotesText();
29private: 30private:
30 QComboBox *remotes; 31 QComboBox *remotes;
31}; 32};
diff --git a/noncore/tools/remote/topgroupconf.cpp b/noncore/tools/remote/topgroupconf.cpp
index 0419a65..7df4d18 100644
--- a/noncore/tools/remote/topgroupconf.cpp
+++ b/noncore/tools/remote/topgroupconf.cpp
@@ -1,70 +1,69 @@
1/* 1/*
2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. 2Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
3Copyright (C) 2002 Thomas Stephens 3Copyright (C) 2002 Thomas Stephens
4 4
5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 5This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later 6License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7version. 7version.
8 8
9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 9This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 10implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11Public License for more details. 11Public License for more details.
12 12
13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free 13You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 14Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15*/ 15*/
16 16
17#include "topgroupconf.h" 17#include "topgroupconf.h"
18 18
19TopGroupConf::TopGroupConf(QWidget *parent, const char *name):QWidget(parent,name) 19TopGroupConf::TopGroupConf(QWidget *parent, const char *name):QWidget(parent,name)
20{ 20{
21 QHBoxLayout *layout = new QHBoxLayout(this); 21 QHBoxLayout *layout = new QHBoxLayout(this);
22 22
23 QPushButton *power = new QPushButton("Power",this,"power"); 23 QPushButton *power = new QPushButton("Power",this,"power");
24 layout->addWidget(power); 24 layout->addWidget(power);
25 connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); 25 connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
26 //power->setGeometry(5, 5,40, 20); 26 //power->setGeometry(5, 5,40, 20);
27 27
28 layout->addSpacing(5); 28 layout->addSpacing(5);
29 29
30 QPushButton *source = new QPushButton("Source",this,"source"); 30 QPushButton *source = new QPushButton("Source",this,"source");
31 layout->addWidget(source); 31 layout->addWidget(source);
32 connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); 32 connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
33 //source->setGeometry(50,5,40,20); 33 //source->setGeometry(50,5,40,20);
34 34
35 remotes = new QComboBox(true, this, "remotes"); 35 remotes = new QComboBox(true, this, "remotes");
36 remotes->insertItem(QString("Remotes"));
37 layout->addWidget(remotes); 36 layout->addWidget(remotes);
38 layout->setStretchFactor(remotes, 1); 37 layout->setStretchFactor(remotes, 1);
39 connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) ); 38 connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) );
40 39
41 40
42 QPushButton *newrem = new QPushButton("New", this, "new"); 41 QPushButton *newrem = new QPushButton("New", this, "new");
43 layout->addWidget(newrem); 42 layout->addWidget(newrem);
44 connect(newrem, SIGNAL(pressed()), this->parentWidget(), SLOT(newPressed()) ); 43 connect(newrem, SIGNAL(pressed()), this->parentWidget(), SLOT(newPressed()) );
45 44
46 45
47 /*remotes = new QComboBox(false, this, "remotes"); 46 /*remotes = new QComboBox(false, this, "remotes");
48 connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) ); 47 connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) );
49 remotes->insertItem("Select Remote"); 48 remotes->insertItem("Select Remote");
50 //remotes->setGeometry(135,5,95,20); 49 //remotes->setGeometry(135,5,95,20);
51 50
52 QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel"); 51 QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel");
53 //remoteLabel->setGeometry(90,5,40,20); 52 //remoteLabel->setGeometry(90,5,40,20);
54 remoteLabel->setAlignment(AlignRight | AlignVCenter); 53 remoteLabel->setAlignment(AlignRight | AlignVCenter);
55 54
56 layout->addWidget(remoteLabel); 55 layout->addWidget(remoteLabel);
57 layout->addWidget(remotes); 56 layout->addWidget(remotes);
58*/ 57*/
59} 58}
60 59
61void TopGroupConf::updateRemotes(QStringList list) 60void TopGroupConf::updateRemotes(QStringList list)
62{ 61{
63 remotes->insertStringList(list); 62 remotes->insertStringList(list);
64} 63}
65 64
66QString TopGroupConf::getRemotesText() 65QString TopGroupConf::getRemotesText()
67{ 66{
68 return remotes->currentText(); 67 return remotes->currentText();
69} 68}
70 69