even better: if the UI file is bogus for whatever reason (not just "we can't open it") call the script's createConfigurationInterface to see if that works any better

svn path=/trunk/KDE/kdelibs/; revision=1084729
This commit is contained in:
Aaron J. Seigo 2010-02-03 16:18:37 +00:00
parent afb1279b21
commit 7d33f20f40

View File

@ -1711,26 +1711,22 @@ void Applet::showConfigurationInterface()
QString uiFile = d->package->filePath("mainconfigui");
if (!uiFile.isEmpty()) {
dialog->setWindowTitle(d->configWindowTitle());
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
QUiLoader loader;
QFile f(uiFile);
if (!f.open(QIODevice::ReadOnly)) {
QUiLoader loader;
QWidget *w = loader.load(&f);
if (!w) {
delete dialog;
if (d->script) {
d->script->showConfigurationInterface();
}
return;
}
QWidget *w = loader.load(&f);
f.close();
if (w) {
dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name()));
}
dialog->setWindowTitle(d->configWindowTitle());
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
dialog->addPage(w, i18n("Settings"), icon(), i18n("%1 Settings", name()));
}
d->addGlobalShortcutsPage(dialog);