00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "topgroup.h"
00018
00019 TopGroup::TopGroup(QWidget *parent, const char *name):QWidget(parent,name)
00020 {
00021 QHBoxLayout *layout = new QHBoxLayout(this, 0, -1, 0);
00022
00023 QPushButton *power = new QPushButton("Power",this,"power");
00024 layout->addWidget(power);
00025 connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
00026
00027
00028 layout->addSpacing(5);
00029
00030 QPushButton *source = new QPushButton("Source",this,"source");
00031 layout->addWidget(source);
00032 connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
00033
00034
00035 remotes = new QComboBox(false, this, "remotes");
00036 connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) );
00037 remotes->insertItem("Select Remote");
00038
00039
00040 QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel");
00041
00042 remoteLabel->setAlignment(AlignRight | AlignVCenter);
00043
00044 layout->addWidget(remoteLabel);
00045 layout->addWidget(remotes);
00046 }
00047
00048 void TopGroup::updateRemotes(Config *cfg)
00049 {
00050 remotes->clear();
00051 remotes->insertItem(QString("SelectRemote"));
00052 cfg->setGroup("Remotes");
00053 remotes->insertStringList(cfg->readListEntry("remoteList", ',') );
00054 }