diff options
| author | 2015-09-14 23:59:34 +0200 | |
|---|---|---|
| committer | 2015-09-14 23:59:34 +0200 | |
| commit | 47c689858406fbaff052785be14a1e6e23b6787c (patch) | |
| tree | 20d15af7e7c691657add1dfe7fb7ada354469d1a /src/modules | |
| parent | Add the possibility of resetting the IRC colors to default. Also add an infor... (diff) | |
| download | KVIrc-47c689858406fbaff052785be14a1e6e23b6787c.tar.gz KVIrc-47c689858406fbaff052785be14a1e6e23b6787c.tar.bz2 KVIrc-47c689858406fbaff052785be14a1e6e23b6787c.zip | |
Add the ability to not store the icons when saving a theme
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/theme/SaveThemeDialog.cpp | 21 | ||||
| -rw-r--r-- | src/modules/theme/SaveThemeDialog.h | 2 | ||||
| -rw-r--r-- | src/modules/theme/ThemeFunctions.cpp | 12 |
3 files changed, 25 insertions, 10 deletions
diff --git a/src/modules/theme/SaveThemeDialog.cpp b/src/modules/theme/SaveThemeDialog.cpp index 01d29d15e..09e748510 100644 --- a/src/modules/theme/SaveThemeDialog.cpp +++ b/src/modules/theme/SaveThemeDialog.cpp @@ -53,6 +53,7 @@ #include <QDateTime> #include <QBuffer> #include <QLabel> +#include <QCheckBox> @@ -146,6 +147,23 @@ SaveThemeDialog::SaveThemeDialog(QWidget * pParent) setNextEnabled(pPage,true); setFinishEnabled(pPage,false); + + // options page ================================================================================== + pPage = new QWidget(this); + pLayout = new QGridLayout(pPage); + + m_pSaveIconsCheckBox = new QCheckBox(__tr2qs_ctx("Save icons","theme"),this); + m_pSaveIconsCheckBox->setChecked(true); + + pLayout->addWidget(m_pSaveIconsCheckBox,0,0); + pLayout->setRowStretch(1,1); + + addPage(pPage,__tr2qs_ctx("Options","theme")); + setBackEnabled(pPage,true); + setNextEnabled(pPage,true); + setHelpEnabled(pPage,false); + setFinishEnabled(pPage,false); + // screenshot/logo/icon ================================================================================ pPage = new QWidget(this); @@ -180,6 +198,7 @@ SaveThemeDialog::SaveThemeDialog(QWidget * pParent) setHelpEnabled(pPage,false); setNextEnabled(pPage,true); setFinishEnabled(pPage,true); + } SaveThemeDialog::~SaveThemeDialog() @@ -264,7 +283,7 @@ bool SaveThemeDialog::saveTheme() return false; } - if(!KviTheme::save(sto)) + if(!KviTheme::save(sto,m_pSaveIconsCheckBox->isChecked())) { QString szErr = sto.lastError(); QString szMsg2 = QString(__tr2qs_ctx("Unable to save theme: %1","theme")).arg(szErr); diff --git a/src/modules/theme/SaveThemeDialog.h b/src/modules/theme/SaveThemeDialog.h index f28347be7..747b80ede 100644 --- a/src/modules/theme/SaveThemeDialog.h +++ b/src/modules/theme/SaveThemeDialog.h @@ -35,6 +35,7 @@ class QLineEdit; class QPushButton; class QLabel; class QTextEdit; +class QCheckBox; class KviFileSelector; @@ -54,6 +55,7 @@ protected: QLineEdit * m_pAuthorNameEdit; QWidget * m_pImageSelectionPage; QPushButton * m_pOkButton; + QCheckBox * m_pSaveIconsCheckBox; protected: virtual void accept(); bool saveTheme(); diff --git a/src/modules/theme/ThemeFunctions.cpp b/src/modules/theme/ThemeFunctions.cpp index 084a094a1..eec3e4bed 100644 --- a/src/modules/theme/ThemeFunctions.cpp +++ b/src/modules/theme/ThemeFunctions.cpp @@ -101,22 +101,16 @@ namespace ThemeFunctions } pValue = pInfoFields->find("ThemeCount"); - if(!pValue){ - qDebug("no theme count"); + if(!pValue) return notAValidThemePackage(szError); - } bool bOk; int iThemeCount = pValue->toInt(&bOk); - if(!bOk){ - qDebug("no theme count 2"); + if(!bOk) return notAValidThemePackage(szError); - } - if(iThemeCount < 1){ - qDebug("no theme count 2"); + if(iThemeCount < 1) return notAValidThemePackage(szError); - } // ok.. it should be really valid at this point |
