summaryrefslogtreecommitdiff
path: root/noncore/tools/remote/remotetab.cpp
Side-by-side diff
Diffstat (limited to 'noncore/tools/remote/remotetab.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/remote/remotetab.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/noncore/tools/remote/remotetab.cpp b/noncore/tools/remote/remotetab.cpp
index 45995fd..c89d8c2 100644
--- a/noncore/tools/remote/remotetab.cpp
+++ b/noncore/tools/remote/remotetab.cpp
@@ -42,24 +42,32 @@ RemoteTab::RemoteTab(QWidget *parent, const char *name):QWidget(parent,name)
layout->addSpacing(1);
channelGroup = new ChannelGroup(this);
// channelGroup->setMaximumHeight(91);
layout->addWidget(channelGroup, 0, 0);
this->setMaximumWidth(240);
}
int RemoteTab::sendIR()
{
+ QString curr_remote = topGroup->getRemotesText();
+ if(curr_remote != "")
+ cfg->setGroup(curr_remote);
+ else {
+ QMessageBox::warning(this, tr("Error"), tr("Please select or create\na remote layout"), QMessageBox::Ok, QMessageBox::NoButton);
+ return 0;
+ }
+
const QObject *button = sender();
QString string = cfg->readEntry(button->name());
if(string != "") {
string+='\n';
LircHandler lh;
return lh.sendIR(string.latin1());
}
else {
QMessageBox::warning(this, tr("Error"), tr("This button has not\nbeen configured"), QMessageBox::Ok, QMessageBox::NoButton);
return 0;
}
}
@@ -148,13 +156,17 @@ void RemoteTab::remoteSelected(const QString &string)
{
cfg->setGroup("Default");
((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") );
cfg->setGroup(string);
}
}
}
}
void RemoteTab::updateRemotesList()
{
topGroup->updateRemotes(cfg);
+
+ QString curr_remote = topGroup->getRemotesText();
+ if(curr_remote != "")
+ remoteSelected(curr_remote);
}