[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdebase/ksplashml/kcmksplash
From: Nadeem Hasan <nhasan () nadmm ! com>
Date: 2003-06-15 2:12:36
[Download RAW message or body]
CVS commit by nhasan:
* Use KCModule::load() for what its meant for. Fixes "Reset".
* Fix margin and spacing.
* Other cleanups.
M +19 -18 installer.cpp 1.4
M +0 -3 installer.h 1.2
--- kdebase/ksplashml/kcmksplash/installer.cpp #1.3:1.4
@@ -96,9 +96,10 @@ SplashInstaller::SplashInstaller (QWidge
return;
- mGrid = new QGridLayout(this, 2, 3, 6, 6);
+ QGridLayout *grid = new QGridLayout(this, 2, 3, KDialog::marginHint(),
+ KDialog::spacingHint());
mThemesList = new ThemeListBox(this);
connect(mThemesList, SIGNAL(highlighted(int)), SLOT(slotSetTheme(int)));
connect(mThemesList, SIGNAL(filesDropped(const KURL::List&)), \
SLOT(slotFilesDropped(const KURL::List&)));
- mGrid->addMultiCellWidget(mThemesList, 0, 1, 0, 0);
+ grid->addMultiCellWidget(mThemesList, 0, 1, 0, 0);
mPreview = new QLabel(this);
@@ -106,8 +107,8 @@ SplashInstaller::SplashInstaller (QWidge
mPreview->setMinimumSize(QSize(320,240));
mPreview->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
- mGrid->addWidget(mPreview, 0, 1);
+ grid->addWidget(mPreview, 0, 1);
bbox = new KButtonBox(this, KButtonBox::Vertical, 0, 6);
- mGrid->addMultiCellWidget(bbox, 0, 1, 2, 2);
+ grid->addMultiCellWidget(bbox, 0, 1, 2, 2);
mBtnAdd = bbox->addButton(i18n("Add..."));
@@ -125,16 +126,13 @@ SplashInstaller::SplashInstaller (QWidge
mText->setMinimumSize(mText->sizeHint());
mText->setReadOnly(true);
- mGrid->addWidget(mText, 1, 1);
+ grid->addWidget(mText, 1, 1);
- mGrid->setColStretch(0, 1);
- mGrid->setColStretch(1, 3);
- mGrid->setRowStretch(0, 3);
- mGrid->setRowStretch(1, 1);
+ grid->setColStretch(0, 1);
+ grid->setColStretch(1, 3);
+ grid->setRowStretch(0, 3);
+ grid->setRowStretch(1, 1);
- KConfig cnf("ksplashrc");
- cnf.setGroup("KSplash");
- mDefaultTheme = cnf.readEntry("Theme","Default");
readThemesList();
- defaults();
+ load();
}
@@ -224,10 +222,13 @@ void SplashInstaller::readThemesList()
void SplashInstaller::defaults()
{
- mThemesList->setCurrentItem(findTheme(mDefaultTheme));
+ mThemesList->setCurrentItem(findTheme("Default"));
}
void SplashInstaller::load()
{
- kdDebug() << "SplashInstaller::load() called" << endl;
+ KConfig cnf("ksplashrc");
+ cnf.setGroup("KSplash");
+ QString curTheme = cnf.readEntry("Theme","Default");
+ mThemesList->setCurrentItem(findTheme(curTheme));
}
@@ -285,6 +286,6 @@ void SplashInstaller::slotSetTheme(int i
if (id < 0)
{
- mPreview->setText("");
- mText->setText("");
+ mPreview->setText(QString::null);
+ mText->setText(QString::null);
enabled = false;
}
@@ -341,5 +342,5 @@ void SplashInstaller::slotSetTheme(int i
else
mPreview->setText(i18n("(Could not load theme)"));
- mText->setText("");
+ mText->setText(QString::null);
KMessageBox::sorry(this, error);
}
--- kdebase/ksplashml/kcmksplash/installer.h #1.1:1.2
@@ -18,5 +18,4 @@
#include <kurl.h>
-class QGridLayout;
class QLabel;
class QMultiLineEdit;
@@ -55,6 +54,4 @@ protected:
private:
bool mGui;
- QString mDefaultTheme;
- QGridLayout *mGrid;
ThemeListBox *mThemesList;
QPushButton *mBtnAdd, *mBtnRemove, *mBtnTest;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic