diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 37333bf25ad9a4c538250f5af2f9f1d666362883 (patch) | |
tree | c45e8df5b9efbffe07eb3d9340df7811c7e16943 /lilo-config/kde-qt-common/mainwidget.cpp | |
download | tdeadmin-37333bf25ad9a4c538250f5af2f9f1d666362883.tar.gz tdeadmin-37333bf25ad9a4c538250f5af2f9f1d666362883.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeadmin@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lilo-config/kde-qt-common/mainwidget.cpp')
-rw-r--r-- | lilo-config/kde-qt-common/mainwidget.cpp | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/lilo-config/kde-qt-common/mainwidget.cpp b/lilo-config/kde-qt-common/mainwidget.cpp new file mode 100644 index 0000000..6d76dc5 --- /dev/null +++ b/lilo-config/kde-qt-common/mainwidget.cpp @@ -0,0 +1,107 @@ +/* mainwidget.cpp +** +** Copyright (C) 2000,2001 by Bernhard Rosenkraenzer +** +** Contributions by M. Laurent and W. Bastian. +** +*/ + +/* +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program in a file called COPYING; if not, write to +** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +** MA 02110-1301, USA. +*/ + +/* +** Bug reports and questions can be sent to kde-devel@kde.org +*/ +#include "mainwidget.moc" +#include "ui.h" + +MainWidget::MainWidget(QWidget *parent, const char *name) + : QTabWidget(parent, name) +{ + l=new liloconf(); + general=new General(l, this); + connect(general, SIGNAL(configChanged()), SIGNAL(configChanged())); + images=new Images(l, this); + connect(images, SIGNAL(configChanged()), SIGNAL(configChanged())); + expert=new Expert(l, this); + connect(expert, SIGNAL(configChanged()), SIGNAL(configChanged())); + connect(expert, SIGNAL(configChanged()), images, SLOT(update())); + addTab(general, _("&General Options")); + addTab(images, _("&Operating Systems")); + addTab(expert, _("&Expert")); + connect(this, SIGNAL(selected(const QString &)), SLOT(tabChanged(const QString &))); + load(); + arrangeWidgets(); +} + +void MainWidget::makeReadOnly() +{ + general->makeReadOnly(); + images->makeReadOnly(); + expert->makeReadOnly(); +} + +void MainWidget::load() +{ + defaults(); +} + +void MainWidget::save() +{ + if(previous==_("&Expert")) + expert->saveChanges(); + else { + general->saveChanges(); + images->saveChanges(); + } + l->checked=false; + if(!l->isOk()) { + if(WarningYesNo(this, "About to write a faulty lilo.conf", "WARNING: the config file is currently NOT ok.\nDo you really want to override /etc/lilo.conf?\n\nIf you aren't sure, select \"no\" and click the \"Check configuration\" button to see the details.\nIf you don't know what's wrong, try clicking the \"Probe\" button to auto-generate a working lilo.conf.\nIf you're getting this message after using the \"Probe\" button, please send a full bug report,\nincluding the output of \"Check configuration\" and the generated lilo.conf (displayed in the \"Expert\" tab),\nto bero@kde.org.")!=IDYES) + return; + } + l->writeFile("/etc/lilo.conf"); + l->install(); +} + +void MainWidget::defaults() +{ +} + +void MainWidget::reset() +{ + load(); +} + +void MainWidget::arrangeWidgets() +{ +} +void MainWidget::tabChanged(QString const &lbl) // SLOT +{ + if(previous==_("&Expert")) + expert->saveChanges(); + else if(previous==_("&General options")) + general->saveChanges(); + else if(previous==_("&Operating systems")) + images->saveChanges(); + if(lbl==_("&Expert")) + expert->update(); + else if(lbl==_("&Operating systems")) + images->update(); + else if(lbl==_("&General options")) + general->update(); + previous=lbl; +} |