summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/remote/configtab.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/noncore/tools/remote/configtab.cpp b/noncore/tools/remote/configtab.cpp
index af2b5ff..7951772 100644
--- a/noncore/tools/remote/configtab.cpp
+++ b/noncore/tools/remote/configtab.cpp
@@ -182,48 +182,56 @@ void ConfigTab::remoteSelected(const QString &string)
((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") );
}
else
{
cfg->setGroup("Default");
((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") );
cfg->setGroup(string);
}
}
}
objList = channelGroupConf->children();
for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next())
{
if(obj->inherits("QPushButton"))
{
if(cfg->hasKey((QString)obj->name()+"Label"))
{
((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") );
}
else
{
cfg->setGroup("Default");
((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") );
cfg->setGroup(string);
}
}
}
}
void ConfigTab::buttonPressed()
{
+ QString curr_remote = topGroupConf->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;
+ }
+
const QObject *button = sender();
QString string = button->name();
QString action = cfg->readEntry(string);
ButtonDialog *bd = new ButtonDialog(((QPushButton *)button)->text(), action, this, "BD", true, 0);
if( bd->exec() == 1)
{
cfg->writeEntry(string, bd->getAction().latin1());
cfg->writeEntry(string+"Label", bd->getLabel().latin1());
cfg->write();
((QPushButton *)button)->setText(bd->getLabel());
}
delete bd;
}