diff options
| author | 2007-07-13 16:05:46 +0000 | |
|---|---|---|
| committer | 2007-07-13 16:05:46 +0000 | |
| commit | 3bd06b2a40331c8f1656fe6c142bd2448feb2586 (patch) | |
| tree | a738fed060d9727ab20baf642d7f1613d3d16fa9 /src | |
| parent | git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@661 17fca916-40b9-46aa-a4ea-... (diff) | |
| download | KVIrc-3bd06b2a40331c8f1656fe6c142bd2448feb2586.tar.gz KVIrc-3bd06b2a40331c8f1656fe6c142bd2448feb2586.tar.bz2 KVIrc-3bd06b2a40331c8f1656fe6c142bd2448feb2586.zip | |
Rewritten KviTalWizard in a QtX independent form, working on a new setup too...
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@674 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
| -rw-r--r-- | src/kvilib/build/Makefile.am | 11 | ||||
| -rw-r--r-- | src/kvilib/tal/kvi_tal_wizard.cpp | 554 | ||||
| -rw-r--r-- | src/kvilib/tal/kvi_tal_wizard.h | 137 | ||||
| -rw-r--r-- | src/kvilib/tal/kvi_tal_wizard_qt3.h | 39 | ||||
| -rw-r--r-- | src/kvilib/tal/kvi_tal_wizard_qt4.h | 39 | ||||
| -rw-r--r-- | src/kvirc/kernel/kvi_theme.h | 117 | ||||
| -rw-r--r-- | src/modules/mircimport/libkvimircimport.cpp | 6 | ||||
| -rw-r--r-- | src/modules/objects/class_wizard.cpp | 25 | ||||
| -rw-r--r-- | src/modules/reguser/wizard.cpp | 4 | ||||
| -rw-r--r-- | src/modules/setup/setupwizard.cpp | 66 | ||||
| -rw-r--r-- | src/modules/setup/setupwizard.h | 7 | ||||
| -rw-r--r-- | src/modules/theme/packthemedialog.cpp | 2 | ||||
| -rw-r--r-- | src/modules/theme/savethemedialog.cpp | 2 |
13 files changed, 829 insertions, 180 deletions
diff --git a/src/kvilib/build/Makefile.am b/src/kvilib/build/Makefile.am index 3bc8f5fe1..e344d9971 100644 --- a/src/kvilib/build/Makefile.am +++ b/src/kvilib/build/Makefile.am @@ -27,9 +27,8 @@ nodist_libkvilib_la_SOURCES = \ ../net/moc_kvi_dns.cpp \ ../net/moc_kvi_http.cpp \ ../system/moc_kvi_locale.cpp \ - ../system/moc_kvi_thread.cpp - - + ../system/moc_kvi_thread.cpp \ + ../tal/moc_kvi_tal_wizard.cpp libkvilib_la_SOURCES = \ ../core/kvi_error.cpp \ @@ -239,8 +238,6 @@ headers_HEADERS = \ ../tal/kvi_tal_widgetstack_qt3.h \ ../tal/kvi_tal_widgetstack_qt4.h \ ../tal/kvi_tal_wizard.h \ - ../tal/kvi_tal_wizard_qt3.h \ - ../tal/kvi_tal_wizard_qt4.h \ ../tal/kvi_tal_windowstate.h @@ -307,11 +304,9 @@ headers_HEADERS = \ ../tal/kvi_tal_toolbar.cpp: ../tal/kvi_tal_toolbar_qt3.moc ../tal/kvi_tal_toolbar.cpp: ../tal/kvi_tal_toolbar_qt4.moc ../tal/kvi_tal_toolbar.cpp: ../tal/kvi_tal_toolbar_kde.moc +../tal/kvi_tal_tooltip.cpp: ../tal/kvi_tal_tooltip.moc ../tal/kvi_tal_widgetstack.cpp: ../tal/kvi_tal_widgetstack_qt3.moc ../tal/kvi_tal_widgetstack.cpp: ../tal/kvi_tal_widgetstack_qt4.moc -../tal/kvi_tal_wizard.cpp: ../tal/kvi_tal_wizard_qt3.moc -../tal/kvi_tal_wizard.cpp: ../tal/kvi_tal_wizard_qt4.moc -../tal/kvi_tal_tooltip.cpp: ../tal/kvi_tal_tooltip.moc # # All the cpp files depend on symlinks beging up-to-date diff --git a/src/kvilib/tal/kvi_tal_wizard.cpp b/src/kvilib/tal/kvi_tal_wizard.cpp index 6ab9e84f0..281fbdab7 100644 --- a/src/kvilib/tal/kvi_tal_wizard.cpp +++ b/src/kvilib/tal/kvi_tal_wizard.cpp @@ -24,11 +24,561 @@ #define __KVILIB__ #include "kvi_tal_wizard.h" +#include "kvi_tal_hbox.h" +#include "kvi_list.h" +#include "kvi_locale.h" +#ifdef COMPILE_USE_QT4 + #include <QShowEvent> + #include <QLabel> + #include <QPushButton> + #include <QGridLayout> + #include <QFrame> + #include <QStackedWidget> + #include <QPalette> +#else + #include <qlabel.h> + #include <qpushbutton.h> + #include <qlayout.h> + #include <qevent.h> + #include <qframe.h> + #include <qwidgetstack.h> + #include <qpalette.h> +#endif + + +class KviTalWizardPageData +{ +public: + enum EnableFlags + { + EnableNext = 1, + EnableBack = 2, + EnableHelp = 4, + EnableCancel = 8, + EnableFinish = 16 + }; +public: + QWidget * pWidget; + QString szTitle; + bool bEnabled; + int iEnableFlags; + int iVisibleIndex; +}; + +class KviTalWizardPrivate +{ +public: + KviPtrList<KviTalWizardPageData> * pPageList; + int iEnabledPageCount; + KviTalWizardPageData * pCurrentPage; + QGridLayout * pLayout; + QLabel * pTitleLabel; + QLabel * pStepsLabel; + QPushButton * pBackButton; + QPushButton * pCancelButton; + QPushButton * pHelpButton; + QPushButton * pNextButton; + QWidget * pNextSpacer; + QPushButton * pFinishButton; + QWidget * pFinishSpacer; +#ifdef COMPILE_USE_QT4 + QStackedWidget * pWidgetStack; +#else + QWidgetStack * pWidgetStack; +#endif +public: + KviTalWizardPageData * findPage(QWidget * pWidget) + { + for(KviTalWizardPageData * pData = pPageList->first();pData;pData = pPageList->next()) + { + if(pData->pWidget == pWidget) + return pData; + } + return NULL; + } + + KviTalWizardPageData * findFirstEnabledPage() + { + KviTalWizardPageData * pData; + for(pData = pPageList->first();pData;pData = pPageList->next()) + { + if(pData->bEnabled) + return pData; + } + return NULL; + } + + KviTalWizardPageData * findLastEnabledPage() + { + KviTalWizardPageData * pData; + for(pData = pPageList->last();pData;pData = pPageList->prev()) + { + if(pData->bEnabled) + return pData; + } + return NULL; + } + + KviTalWizardPageData * findNextEnabledPage(QWidget * pReference) + { + if(!pReference) + return findFirstEnabledPage(); + KviTalWizardPageData * pData = findPage(pReference); + if(!pData) + return NULL; + for(pData = pPageList->next();pData;pData = pPageList->next()) + { + if(pData->bEnabled) + return pData; + } + return NULL; + } + + KviTalWizardPageData * findPrevEnabledPage(QWidget * pReference) + { + if(!pReference) + return findLastEnabledPage(); + KviTalWizardPageData * pData = findPage(pReference); + if(!pData) + return NULL; + for(pData = pPageList->prev();pData;pData = pPageList->prev()) + { + if(pData->bEnabled) + return pData; + } + return NULL; + } + + int reindexPages() + { + int iEnabledCount = 0; + for(KviTalWizardPageData * pData = pPageList->next();pData;pData = pPageList->next()) + { + if(pData->bEnabled) + { + iEnabledCount++; + pData->iVisibleIndex = iEnabledCount; + } + } + return iEnabledCount; + } +}; + + +KviTalWizard::KviTalWizard(QWidget * pParent) +: QDialog(pParent) +{ + m_p = new KviTalWizardPrivate; + m_p->pPageList = new KviPtrList<KviTalWizardPageData>; + m_p->pPageList->setAutoDelete(true); + m_p->pCurrentPage = NULL; + m_p->iEnabledPageCount = 0; + m_p->pLayout = new QGridLayout(this); + + m_p->pTitleLabel = new QLabel(this); +#ifdef COMPILE_USE_QT4 + m_p->pLayout->addWidget(m_p->pTitleLabel,0,0,1,3); +#else + m_p->pLayout->addMultiCellWidget(m_p->pTitleLabel,0,0,0,3); +#endif + m_p->pStepsLabel = new QLabel(this); + m_p->pStepsLabel->setMinimumWidth(80); + m_p->pStepsLabel->setAlignment(Qt::AlignRight); +#ifdef COMPILE_USE_QT4 + m_p->pLayout->addWidget(m_p->pStepsLabel,0,4,1,3); +#else + m_p->pLayout->addMultiCellWidget(m_p->pStepsLabel,0,0,4,6); +#endif + + QFrame * f1 = new QFrame(this); + f1->setFrameStyle(QFrame::Sunken | QFrame::HLine); +#ifdef COMPILE_USE_QT4 + m_p->pLayout->addWidget(f1,1,0,1,7); +#else + m_p->pLayout->addMultiCellWidget(f1,1,1,0,6); +#endif + +#ifdef COMPILE_USE_QT4 + m_p->pWidgetStack = new QStackedWidget(this); + m_p->pLayout->addWidget(m_p->pWidgetStack,2,0,1,7); +#else + m_p->pWidgetStack = new QWidgetStack(this); + m_p->pLayout->addMultiCellWidget(m_p->pWidgetStack,2,2,0,6); +#endif + + QFrame * f2 = new QFrame(this); + f2->setFrameStyle(QFrame::Sunken | QFrame::HLine); +#ifdef COMPILE_USE_QT4 + m_p->pLayout->addWidget(f2,3,0,1,7); +#else + m_p->pLayout->addMultiCellWidget(f2,3,3,0,6); +#endif + + KviTalHBox * pButtonBox = new KviTalHBox(this); +#ifdef COMPILE_USE_QT4 + m_p->pLayout->addWidget(pButtonBox,4,0,1,7); +#else + m_p->pLayout->addMultiCellWidget(pButtonBox,4,4,0,6); +#endif + + pButtonBox->setMargin(0); + pButtonBox->setSpacing(0); + + + m_p->pCancelButton = new QPushButton(__tr("Cancel"),pButtonBox); + m_p->pCancelButton->setMinimumWidth(80); + QObject::connect( + m_p->pCancelButton, + SIGNAL(clicked()), + this, + SLOT(cancelButtonClicked()) + ); + QWidget * pSpacer = new QWidget(pButtonBox); + pSpacer->setFixedWidth(4); + + m_p->pHelpButton = new QPushButton(__tr("Help"),pButtonBox); + m_p->pHelpButton->setMinimumWidth(80); + QObject::connect( + m_p->pHelpButton, + SIGNAL(clicked()), + this, + SLOT(helpButtonClicked()) + ); + + QWidget * pLargeSpacer = new QWidget(pButtonBox); + pLargeSpacer->setMinimumWidth(50); + pButtonBox->setStretchFactor(pLargeSpacer,100); + + QString szText = "< "; + szText += __tr("Back"); + m_p->pBackButton = new QPushButton(szText,pButtonBox); + m_p->pBackButton->setMinimumWidth(80); + QObject::connect( + m_p->pBackButton, + SIGNAL(clicked()), + this, + SLOT(backButtonClicked()) + ); + + m_p->pNextSpacer = new QWidget(pButtonBox); + m_p->pNextSpacer->setFixedWidth(4); + + szText = __tr("Next"); + szText += " >"; + m_p->pNextButton = new QPushButton(szText,pButtonBox); + m_p->pNextButton->setMinimumWidth(80); + QObject::connect( + m_p->pNextButton, + SIGNAL(clicked()), + this, + SLOT(nextButtonClicked()) + ); + + m_p->pFinishSpacer = new QWidget(pButtonBox); + m_p->pFinishSpacer->setFixedWidth(4); + + m_p->pFinishButton = new QPushButton(__tr("Finish"),pButtonBox); + m_p->pFinishButton->setMinimumWidth(80); + QObject::connect( + m_p->pFinishButton, + SIGNAL(clicked()), + this, + SLOT(finishButtonClicked()) + ); + + m_p->pLayout->setMargin(8); + m_p->pLayout->setSpacing(4); + m_p->pLayout->setRowStretch(2,1); + m_p->pLayout->setColStretch(0,1); +} + +KviTalWizard::~KviTalWizard() +{ + delete m_p->pPageList; + delete m_p; +} + +void KviTalWizard::insertPage(QWidget * pWidget,const QString &szTitle,int iIndex) +{ + KviTalWizardPageData * pPageData = m_p->findPage(pWidget); + if(!pPageData) + { + pPageData = new KviTalWizardPageData; + pPageData->pWidget = pWidget; + pPageData->iEnableFlags = \ + KviTalWizardPageData::EnableNext | \ + KviTalWizardPageData::EnableCancel | \ + KviTalWizardPageData::EnableBack; + if(iIndex < 0) + { + m_p->pPageList->append(pPageData); + m_p->iEnabledPageCount++; + pPageData->iVisibleIndex = m_p->iEnabledPageCount; + } else { + m_p->pPageList->insert(iIndex,pPageData); + m_p->iEnabledPageCount = m_p->reindexPages(); + } + m_p->pWidgetStack->addWidget(pWidget); + } + pPageData->szTitle = szTitle; + pPageData->bEnabled = true; + +} + +void KviTalWizard::addPage(QWidget * pWidget,const QString &szTitle) +{ + insertPage(pWidget,szTitle,-1); +} + +bool KviTalWizard::setPageEnabled(QWidget * pWidget,bool bEnabled) +{ + KviTalWizardPageData * pData = m_p->findPage(pWidget); + if(!pData) + return false; + pData->bEnabled = bEnabled; + m_p->iEnabledPageCount = m_p->reindexPages(); + setCurrentPage(m_p->pCurrentPage); + return true; +} + +bool KviTalWizard::setPageTitle(QWidget * pWidget,const QString &szTitle) +{ + KviTalWizardPageData * pData = m_p->findPage(pWidget); + if(!pData) + return false; + pData->szTitle = szTitle; + return true; +} + +bool KviTalWizard::setCurrentPage(QWidget * pWidget) +{ + KviTalWizardPageData * pData = m_p->findPage(pWidget); + if(!pData) + return false; + setCurrentPage(pData); + return true; +} + +QWidget * KviTalWizard::currentPage() +{ + if(!m_p->pCurrentPage) + return NULL; + return m_p->pCurrentPage->pWidget; +} + +void KviTalWizard::setCurrentPage(KviTalWizardPageData * pData) +{ + m_p->pCurrentPage = pData; + + bool bCancelEnabled = true; + bool bNextEnabled = false; + bool bBackEnabled = false; + bool bHelpEnabled = false; + bool bFinishEnabled = false; + + QString szTitle; + QString szSteps; + + if(pData) + { + bNextEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableNext) && m_p->findNextEnabledPage(pData->pWidget); + bBackEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableBack) && m_p->findPrevEnabledPage(pData->pWidget); + bCancelEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableCancel); + bFinishEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableFinish); + bHelpEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableHelp); #ifdef COMPILE_USE_QT4 - #include "kvi_tal_wizard_qt4.moc" + m_p->pWidgetStack->setCurrentWidget(pData->pWidget); #else - #include "kvi_tal_wizard_qt3.moc" + m_p->pWidgetStack->raiseWidget(pData->pWidget); #endif + szTitle = "<b>"; + szTitle += pData->szTitle; + szTitle += "</b>"; + QPalette pal = m_p->pStepsLabel->palette(); +#ifdef COMPILE_USE_QT4 + QColor clrWin = pal.color(QPalette::Normal,QPalette::Window); + QColor clrTxt = pal.color(QPalette::Normal,QPalette::WindowText); +#else + QColor clrWin = pal.color(QPalette::Normal,QColorGroup::Foreground); + QColor clrTxt = pal.color(QPalette::Normal,QColorGroup::Background); +#endif + QColor clrMid = qRgb( + (clrWin.red() + clrTxt.red()) / 2, + (clrWin.green() + clrTxt.green()) / 2, + (clrWin.blue() + clrTxt.blue()) / 2 + ); + + szSteps = "<nobr><font color=\""; + szSteps += clrMid.name(); + szSteps += "\"><b>["; + szSteps += QString("Step %1 of %2").arg(pData->iVisibleIndex).arg(m_p->iEnabledPageCount); + szSteps += "]</b></font></nobr>"; + } + + m_p->pTitleLabel->setText(szTitle); + m_p->pStepsLabel->setText(szSteps); + + m_p->pNextButton->setEnabled(bNextEnabled); + if(bNextEnabled) + { + m_p->pNextButton->show(); + m_p->pNextSpacer->show(); + } else { + m_p->pNextButton->hide(); + m_p->pNextSpacer->hide(); + } + m_p->pBackButton->setEnabled(bBackEnabled); + m_p->pHelpButton->setEnabled(bHelpEnabled); + if(bHelpEnabled) + m_p->pHelpButton->show(); + else + m_p->pHelpButton->hide(); + m_p->pCancelButton->setEnabled(bCancelEnabled); + m_p->pFinishButton->setEnabled(bFinishEnabled); + if(bFinishEnabled) + { + m_p->pFinishButton->show(); + m_p->pFinishSpacer->show(); + } else { + m_p->pFinishButton->hide(); + m_p->pFinishSpacer->hide(); + } +} + +void KviTalWizard::showEvent(QShowEvent * e) +{ + if(!(m_p->pCurrentPage)) + { + // display the first page + KviTalWizardPageData * pData = m_p->findFirstEnabledPage(); + if(pData) + setCurrentPage(pData->pWidget); + } + QDialog::showEvent(e); +} + +void KviTalWizard::closeEvent(QCloseEvent * e) +{ + e->ignore(); + cancelButtonClicked(); +} + +void KviTalWizard::backButtonClicked() +{ + if(!m_p->pCurrentPage) + return; + setCurrentPage(m_p->findPrevEnabledPage(m_p->pCurrentPage->pWidget)); +} + +void KviTalWizard::nextButtonClicked() +{ + setCurrentPage(m_p->findNextEnabledPage(m_p->pCurrentPage->pWidget)); +} + +void KviTalWizard::helpButtonClicked() +{ + emit helpClicked(); +} + +void KviTalWizard::cancelButtonClicked() +{ + reject(); +} + +void KviTalWizard::finishButtonClicked() +{ + accept(); +} + +void KviTalWizard::setHelpEnabled(QWidget * pWidget,bool bEnabled) +{ + KviTalWizardPageData * pData = m_p->findPage(pWidget); + if(!pData) + return; + if(bEnabled) + pData->iEnableFlags |= KviTalWizardPageData::EnableHelp; + else + pData->iEnableFlags &= ~KviTalWizardPageData::EnableHelp; + if(pData == m_p->pCurrentPage) + setCurrentPage(pData); +} + +void KviTalWizard::setCancelEnabled(QWidget * pWidget,bool bEnabled) +{ + KviTalWizardPageData * pData = m_p->findPage(pWidget); + if(!pData) + return; + if(bEnabled) + pData->iEnableFlags |= KviTalWizardPageData::EnableCancel; + else + pData->iEnableFlags &= ~KviTalWizardPageData::EnableCancel; + if(pData == m_p->pCurrentPage) + setCurrentPage(pData); +} + +void KviTalWizard::setFinishEnabled(QWidget * pWidget,bool bEnabled) +{ + KviTalWizardPageData * pData = m_p->findPage(pWidget); + if(!pData) + return; + if(bEnabled) + pData->iEnableFlags |= KviTalWizardPageData::EnableFinish; + else + pData->iEnableFlags &= ~KviTalWizardPageData::EnableFinish; + if(pData == m_p->pCurrentPage) + setCurrentPage(pData); +} + +void KviTalWizard::setNextEnabled(QWidget * pWidget,bool bEnabled) +{ + KviTalWizardPageData * pData = m_p->findPage(pWidget); + if(!pData) + return; + if(bEnabled) + pData->iEnableFlags |= KviTalWizardPageData::EnableNext; + else + pData->iEnableFlags &= ~KviTalWizardPageData::EnableNext; + if(pData == m_p->pCurrentPage) + setCurrentPage(pData); +} + +void KviTalWizard::setBackEnabled(QWidget * pWidget,bool bEnabled) +{ + KviTalWizardPageData * pData = m_p->findPage(pWidget); + if(!pData) + return; + if(bEnabled) + pData->iEnableFlags |= KviTalWizardPageData::EnableBack; + else + pData->iEnableFlags &= ~KviTalWizardPageData::EnableBack; + if(pData == m_p->pCurrentPage) + setCurrentPage(pData); +} + +QPushButton * KviTalWizard::cancelButton() +{ + return m_p->pCancelButton; +} + +QPushButton * KviTalWizard::helpButton() +{ + return m_p->pHelpButton; +} + +QPushButton * KviTalWizard::finishButton() +{ + return m_p->pFinishButton; +} + +QPushButton * KviTalWizard::nextButton() +{ + return m_p->pNextButton; +} + +QPushButton * KviTalWizard::backButton() +{ + return m_p->pBackButton; +} diff --git a/src/kvilib/tal/kvi_tal_wizard.h b/src/kvilib/tal/kvi_tal_wizard.h index c0121d625..8cd38d389 100644 --- a/src/kvilib/tal/kvi_tal_wizard.h +++ b/src/kvilib/tal/kvi_tal_wizard.h @@ -28,9 +28,142 @@ #include "kvi_settings.h" #ifdef COMPILE_USE_QT4 - #include "kvi_tal_wizard_qt4.h" + #include <QDialog> #else - #include "kvi_tal_wizard_qt3.h" + #include <qdialog.h> #endif +class QShowEvent; +class QPushButton; +class KviTalWizardPrivate; +class KviTalWizardPageData; + +/// +/// \class KviTalWizard +/// +/// \brief Provides a wizard-style dialog with steps +/// +class KVILIB_API KviTalWizard : public QDialog +{ + Q_OBJECT +public: + KviTalWizard(QWidget * pParent); + ~KviTalWizard(); +protected: + KviTalWizardPrivate * m_p; +public: + /// + /// Adds a page to the wizard with the specified title. + /// The pages are displayed in order they're added. + /// Adding a page a second time is equivalent to calling + /// setPageTitle() and enabling the page. + /// + void addPage(QWidget * pWidget,const QString &szTitle); + /// + /// Adds a page to the wizard with the specified title + /// and in the specified position. + /// Adding a page a second time is equivalent to calling + /// setPageTitle() and enabling the page. + /// + void insertPage(QWidget * pWidget,const QString &szTitle,int iIndex); + /// + /// Enables or disables a page. A disabled page + /// is skipped when the user presses "Next" in the + /// previous page or "Back" in the page after. + /// Disabling the current page has no effect. + /// + /// Returns true on success or false if the pWidget + /// does not identify a page that has been added to this wizard. + /// + bool setPageEnabled(QWidget * pWidget,bool bEnabled); + /// + /// Changes a page title. + /// + /// Returns true on success or false if the pWidget + /// does not identify a page that has been added to this wizard. + /// + bool setPageTitle(QWidget * pWidget,const QString &szTitle); + /// + /// Switches the wizard to the specified page. + /// Please note that this class handles page switching + /// automatically so you usually don't need to call this function. + /// + /// Returns true on success or false if the pWidget + /// does not identify a page that has been added to this wizard. + /// + bool setCurrentPage(QWidget * pWidget); + /// + /// Returns a pointer to the current page + /// + QWidget * currentPage(); + /// + /// Enables or disables the help button for the specified page. + /// By default the help button is always disabled. + /// + void setHelpEnabled(QWidget * pWidget,bool bEnabled); + /// + /// Enables or disables the cancel button for the specified page. + /// By default the cancel button is always enabled. + /// + void setCancelEnabled(QWidget * pWidget,bool bEnabled); + /// + /// Enables or disables the finish button for the specified page. + /// By default the finish button is always disabled. + /// + void setFinishEnabled(QWidget * pWidget,bool bEnabled); + /// + /// Enables or disables the next button for the specified page. + /// By default the next button is always enabled. + /// + void setNextEnabled(QWidget * pWidget,bool bEnabled); + /// + /// Enables or disables the prev button for the specified page. + /// By default the prev button is always enabled. + /// + void setBackEnabled(QWidget * pWidget,bool bEnabled); + /// + /// Returns a pointer to the cancel button displayed in the dialog. + /// + QPushButton * cancelButton(); + /// + /// Returns a pointer to the help button displayed in the dialog. + /// + QPushButton * helpButton(); + /// + /// Returns a pointer to the finish button displayed in the dialog. + /// + QPushButton * finishButton(); + /// + /// Returns a pointer to the next button displayed in the dialog. + /// + QPushButton * nextButton(); + /// + /// Returns a pointer to the back button displayed in the dialog. + /// + QPushButton * backButton(); +signals: + /// + /// Emitted when the help button is clicked. + /// + void helpClicked(); +protected: + /// + /// Displays the first page if no other page is shown yet. + /// + virtual void showEvent(QShowEvent * e); + /// + /// Handles redirects the close button to the "cancel" operation. + /// + virtual void closeEvent(QCloseEvent * e); +protected: + void setCurrentPage(KviTalWizardPageData * pData); +protected slots: + void backButtonClicked(); + void nextButtonClicked(); + void helpButtonClicked(); + void cancelButtonClicked(); + void finishButtonClicked(); +}; + + #endif // _KVI_TAL_WIZARD_H_ diff --git a/src/kvilib/tal/kvi_tal_wizard_qt3.h b/src/kvilib/tal/kvi_tal_wizard_qt3.h deleted file mode 100644 index aa8736a5a..000000000 --- a/src/kvilib/tal/kvi_tal_wizard_qt3.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _KVI_TAL_WIZARD_QT3_H_ -#define _KVI_TAL_WIZARD_QT3_H_ - -//============================================================================= -// -// File : kvi_tal_wizard_qt3.h -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. If not, write to the Free Software Foundation, -// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//============================================================================= - -#include <qwizard.h> - -class KVILIB_API KviTalWizard : public QWizard -{ - Q_OBJECT -public: - KviTalWizard(QWidget * pParent = 0,const char * name = 0,bool bModal = false) - : QWizard(pParent,name,bModal) {}; - ~KviTalWizard() {}; -}; - -#endif // _KVI_TAL_WIZARD_QT3_H_ diff --git a/src/kvilib/tal/kvi_tal_wizard_qt4.h b/src/kvilib/tal/kvi_tal_wizard_qt4.h deleted file mode 100644 index aa2ef093c..000000000 --- a/src/kvilib/tal/kvi_tal_wizard_qt4.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _KVI_TAL_WIZARD_QT4_H_ -#define _KVI_TAL_WIZARD_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_wizard_qt4.h -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// 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 opinion) 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. If not, write to the Free Software Foundation, -// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//============================================================================= - -#include <q3wizard.h> - -class KVILIB_API KviTalWizard : public Q3Wizard -{ - Q_OBJECT -public: - KviTalWizard(QWidget * pParent = 0,const char * name = 0,bool bModal = false) - : Q3Wizard(pParent,name,bModal) {}; - ~KviTalWizard() {}; -}; - -#endif // _KVI_TAL_WIZARD_QT4_H_ diff --git a/src/kvirc/kernel/kvi_theme.h b/src/kvirc/kernel/kvi_theme.h index c4acfbdbf..fdf75e259 100644 --- a/src/kvirc/kernel/kvi_theme.h +++ b/src/kvirc/kernel/kvi_theme.h @@ -38,35 +38,51 @@ #define KVI_THEMEINFO_CONFIG_GROUP "ThemeInfo" #define KVI_THEMEDATA_CONFIG_GROUP "ThemeData" -// The current theme engine version: bump up if you make INCOMPATIBLE -// changes in the method of saving the theme. +/// +/// The current theme engine version: bump up if you make INCOMPATIBLE +/// changes in the method of saving the theme. +/// #define KVI_CURRENT_THEME_ENGINE_VERSION "1.0.0" +/// +/// \class KviThemeInfo +/// +/// \brief A set of informations about a KVIrc theme +/// +/// This object contains a set of informations about +/// a theme that can be read and stored to a standard +/// KVIrc configuration file (which is usually named +/// themeinfo.kvc but this is not strictly necessary). +/// class KVIRC_API KviThemeInfo : public KviHeapObject { public: KviThemeInfo(); ~KviThemeInfo(); protected: - QString m_szName; // name of the theme - QString m_szVersion; // version of the theme - QString m_szSubdirectory; // subdirectory of $LOCALKVIRCDIR/themes where the theme is saved to (not always used) - QString m_szAbsoluteDirectory; // absolute directory where the theme should be saved to (or is loaded from) - QString m_szAuthor; // author of the theme - QString m_szDescription; // description of the theme - QString m_szDate; // theme creation date - QString m_szApplication; // theme creation (KVIrc) version - QString m_szThemeEngineVersion; // the theme engine version that saved this theme + QString m_szName; //< name of the theme + QString m_szVersion; //< version of the theme + QString m_szSubdirectory; //< subdirectory of $LOCALKVIRCDIR/themes where the theme is saved to (not always used) + QString m_szAbsoluteDirectory; //< absolute directory where the theme should be saved to (or is loaded from) + QString m_szAuthor; //< author of the theme + QString m_szDescription; //< description of the theme + QString m_szDate; //< theme creation date + QString m_szApplication; //< theme creation (KVIrc) version + QString m_szThemeEngineVersion; //< the theme engine version that saved this theme - QString m_szLastError; // reported when some function fails + QString m_szLastError; //< reported when some function fails - QPixmap m_pixScreenshotLarge; - QPixmap m_pixScreenshotMedium; - QPixmap m_pixScreenshotSmall; + QPixmap m_pixScreenshotLarge; //< the large screenshot pixmap + QPixmap m_pixScreenshotMedium; //< the medium screenshot pixmap + QPixmap m_pixScreenshotSmall; //< the small screenshot pixmap public: - // load a specified themeinfo file + /// + /// load data from a specified theme config file + /// bool load(const QString &szThemeFileName); - // save the currently defined themeinfo in the specified file + /// + /// save the currently defined theme configuration in the specified file + /// bool save(const QString &szThemeFileName); const QString & lastError(){ return m_szLastError; }; @@ -90,39 +106,64 @@ public: const QString & themeEngineVersion(){ return m_szThemeEngineVersion; }; void setThemeEngineVersion(const QString &szThemeEngineVersion){ m_szThemeEngineVersion = szThemeEngineVersion; }; - // Attempt to load a themeinfo file present in the specified directory - // This function will fail if the directory contains a valid themeinfo - // file but no themedata file unless bIgnoreThemeData is set to true + /// + /// Attempt to load a themeinfo.kvc file present in the specified directory. + /// This function will fail if the directory contains a valid themeinfo.kvc + /// file but no themedata.kvc file unless bIgnoreThemeData is set to true + /// bool loadFromDirectory(const QString &szThemeDirectory,bool bIgnoreThemeData = false); - // Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png - // These functions will work only if the absoluteDirectory() of the theme - // has been set, otherwise the returned pixmaps will be null. + /// + /// Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png + /// This function will work only if the absoluteDirectory() of the theme + /// has been set, otherwise the returned pixmap will be null. + /// const QPixmap & smallScreenshot(); + /// + /// Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png + /// This function will work only if the absoluteDirectory() of the theme + /// has been set, otherwise the returned pixmap will be null. + /// const QPixmap & mediumScreenshot(); + /// + /// Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png + /// This function will work only if the absoluteDirectory() of the theme + /// has been set, otherwise the returned pixmap will be null. + /// const QPixmap & largeScreenshot(); + /// + /// Attempt to load the theme screenshot from THEMEDIR/screenshot_*.png + /// This function will work only if the absoluteDirectory() of the theme + /// has been set, otherwise the returned pixmap will be null. + /// QString smallScreenshotPath(); }; namespace KviTheme { - // Attempt to load (apply) a theme in the specified directory - // Will return true on success and false on failure. - // On success this function will return the theme informations in the buffer. - // On failure this function will also set buffer.lastError() to a meaningful value - // Note that for convenience this function is implemented in kvi_options.cpp + /// + /// Attempt to load (apply) a theme in the specified directory + /// Will return true on success and false on failure. + /// On success this function will return the theme informations in the buffer. + /// On failure this function will also set buffer.lastError() to a meaningful value + /// Note that for convenience this function is implemented in kvi_options.cpp + /// bool KVIRC_API load(const QString &szThemeDir,KviThemeInfo &buffer); - // Save a theme given the specified options. - // Will return true on success and false on failure. - // On failure this function will also set options.lastError() to a meaningful value - // This function requires both absoluteDirectory() and subdirectory() to be - // set to the right values. In theory this function could save a theme - // in a directory different than $KVIRC_LOCAL_DIR/themes/subdirectory - // but this feature is actually unused. - // Note that for convenience this function is implemented in kvi_options.cpp + /// + /// Save a theme given the specified options. + /// Will return true on success and false on failure. + /// On failure this function will also set options.lastError() to a meaningful value + /// This function requires both absoluteDirectory() and subdirectory() to be + /// set to the right values. In theory this function could save a theme + /// in a directory different than $KVIRC_LOCAL_DIR/themes/subdirectory + /// but this feature is actually unused. + /// Note that for convenience this function is implemented in kvi_options.cpp + /// bool KVIRC_API save(KviThemeInfo &options); - // Save the theme screenshots in the given EXISTING directory and given - // an existing screenshot on disk. + /// + /// Save the theme screenshots in the given EXISTING directory and given + /// an existing screenshot on disk (usually in the tmp directory). + /// bool KVIRC_API saveScreenshots(KviThemeInfo &options,const QString &szOriginalScreenshotPath); }; diff --git a/src/modules/mircimport/libkvimircimport.cpp b/src/modules/mircimport/libkvimircimport.cpp index 7bfa1d340..42245778e 100644 --- a/src/modules/mircimport/libkvimircimport.cpp +++ b/src/modules/mircimport/libkvimircimport.cpp @@ -28,6 +28,7 @@ #include "kvi_locale.h" #include "kvi_config.h" #include "kvi_app.h" +#include "kvi_qstring.h" #include <qmessagebox.h> @@ -107,8 +108,9 @@ int KviMircServersIniImport::doImport(const QString& filename) } } while(!entry.isEmpty()); } else { - KviStr tmp(KviStr::Format,__tr("%s doesn't look like a servers.ini file.\nImport failed."),filename); - QMessageBox::warning(0,__tr2qs("Warning - KVIrc"),__tr2qs(tmp.ptr())); + QString tmp; + KviQString::sprintf(tmp,__tr2qs("%Q doesn't look like a servers.ini file.\nImport failed."),&filename); + QMessageBox::warning(0,__tr2qs("Warning - KVIrc"),tmp); } return iCount; } diff --git a/src/modules/objects/class_wizard.cpp b/src/modules/objects/class_wizard.cpp index 83117af97..ca3302f3f 100644 --- a/src/modules/objects/class_wizard.cpp +++ b/src/modules/objects/class_wizard.cpp @@ -51,8 +51,6 @@ Add a page with title.<page_widget> must be a widget's object. !fn: $insertPage(<page_widget>,<title:string>,<index:integer>) Inserts a page at the position <index>. If index is -1, page will appended to the end of the wizard's page sequenze. - !fn: $removePage(<page_widget:object>) - Remove a page from the wizard sequence. !fn: $setTitle(<page>,<title:string>) Sets the title for page page to title text. !fn: $setBackEnabled(<page_widget>,<bEnabled:boolean>) @@ -95,7 +93,6 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_wizard,"wizard","widget") KVSO_REGISTER_HANDLER(KviKvsObject_wizard,"addPage", functionaddPage) KVSO_REGISTER_HANDLER(KviKvsObject_wizard,"insertPage", functioninsertPage) - KVSO_REGISTER_HANDLER(KviKvsObject_wizard,"removePage", functionremovePage) KVSO_REGISTER_HANDLER(KviKvsObject_wizard,"setTitle", functionsetTitle) KVSO_REGISTER_HANDLER(KviKvsObject_wizard,"setBackEnabled", functionsetBackEnabled); @@ -172,23 +169,7 @@ bool KviKvsObject_wizard::functioninsertPage(KviKvsObjectFunctionCall *c) return true; } -bool KviKvsObject_wizard::functionremovePage(KviKvsObjectFunctionCall *c) -{ - KviKvsObject *ob; - kvs_hobject_t hObject; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("page_widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if(!widget())return true; - if(!ob->object()->isWidgetType()) - { - c->warning(__tr2qs("Not a widget object")); - return true; - } - ((KviTalWizard *)widget())->removePage(((QWidget *)(ob->object()))); - return true; -} + bool KviKvsObject_wizard::functionsetTitle(KviKvsObjectFunctionCall *c) { KviKvsObject *ob; @@ -205,7 +186,7 @@ bool KviKvsObject_wizard::functionsetTitle(KviKvsObjectFunctionCall *c) c->warning(__tr2qs("Widget object required")); return true; } - ((KviTalWizard *)widget())->setTitle(((QWidget *)(ob->object())),szTitle); + ((KviTalWizard *)widget())->setPageTitle(((QWidget *)(ob->object())),szTitle); return true; } bool KviKvsObject_wizard::functionsetBackEnabled(KviKvsObjectFunctionCall *c) @@ -360,7 +341,7 @@ void KviKvsObject_wizard::backClicked() callFunction(this,"backClickedEvent",params); } KviKvsMdmWizard::KviKvsMdmWizard(QWidget * par,const char * name,KviKvsObject_wizard * parent) -:KviTalWizard( par,name) +:KviTalWizard(par) { m_pParentScript=parent; connect (this->backButton(),SIGNAL(clicked()),this,SLOT(slotBackClicked())); diff --git a/src/modules/reguser/wizard.cpp b/src/modules/reguser/wizard.cpp index 6fefff089..327612824 100644 --- a/src/modules/reguser/wizard.cpp +++ b/src/modules/reguser/wizard.cpp @@ -49,10 +49,12 @@ extern KVIRC_API KviRegisteredUserDataBase * g_pRegisteredUserDataBase; extern KviPtrList<KviRegistrationWizard> * g_pRegistrationWizardList; KviRegistrationWizard::KviRegistrationWizard(const char * startMask,KviRegisteredUserDataBase * db,QWidget * par,bool bModal) -: KviTalWizard(par,"regusers_wizard",bModal) +: KviTalWizard(par) { m_pDb = db; + setModal(bModal); + m_bModal = bModal; KviIrcMask mask(startMask ? startMask : "*!*@*"); diff --git a/src/modules/setup/setupwizard.cpp b/src/modules/setup/setupwizard.cpp index 8201e3a55..8618b164d 100644 --- a/src/modules/setup/setupwizard.cpp +++ b/src/modules/setup/setupwizard.cpp @@ -113,8 +113,10 @@ KviSetupPage::~KviSetupPage() KviSetupWizard::KviSetupWizard() -: KviTalWizard(0,0,true) +: KviTalWizard(0) { + setModal(true); + g_bFoundMirc = false; QString szLabelText; @@ -148,19 +150,10 @@ KviSetupWizard::KviSetupWizard() addPage(m_pWelcome,__tr2qs("Welcome to KVIrc")); -#ifdef COMPILE_ON_WINDOWS - m_pCreateUrlHandlers = new QCheckBox(__tr2qs("Make KVIrc default IRC client"),m_pWelcome->m_pVBox); - m_pCreateUrlHandlers->setChecked(true); -#endif -#ifdef COMPILE_KDE_SUPPORT - m_pCreateDesktopShortcut = new QCheckBox(__tr2qs("Create desktop shortcut"),m_pWelcome->m_pVBox); - m_pCreateDesktopShortcut->setChecked(true); -#endif setBackEnabled(m_pWelcome,false); setHelpEnabled(m_pWelcome,false); - ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // License #ifndef COMPILE_ON_WINDOWS //it have been already shown by installer @@ -465,6 +458,34 @@ KviSetupWizard::KviSetupWizard() setHelpEnabled(m_pTheme,false);*/ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Desktop integration + + m_pDesktopIntegration = new KviSetupPage(this); + + szText = __tr2qs( \ + "<p>" \ + "Here you can choose how much KVIrc will integrate with " \ + "your system." \ + "<br><br>" \ + "The default settings are fine for most users so if " \ + "you're in doubt just click \"<b>Next</b>\" and go to the next screen." \ + "</p>"); + + m_pDesktopIntegration->m_pTextLabel->setText(szText); + + addPage(m_pDesktopIntegration,__tr2qs("Desktop Integration")); + +#ifdef COMPILE_ON_WINDOWS + m_pCreateUrlHandlers = new QCheckBox(__tr2qs("Make KVIrc default IRC client"),m_pDesktopIntegration->m_pVBox); + m_pCreateUrlHandlers->setChecked(true); +#endif +#ifdef COMPILE_KDE_SUPPORT + m_pCreateDesktopShortcut = new QCheckBox(__tr2qs("Create desktop shortcut"),m_pDesktopIntegration->m_pVBox); + m_pCreateDesktopShortcut->setChecked(true); +#endif + setHelpEnabled(m_pDesktopIntegration,false); + + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Server config m_pServers = new KviSetupPage(this); @@ -512,7 +533,7 @@ KviSetupWizard::KviSetupWizard() KviConfig cfg(szTmp,KviConfig::Read); cfg.setGroup("Setup"); if(cfg.readBoolEntry("hideServerList",FALSE)) { - setAppropriate(m_pServers,false); + setPageEnabled(m_pServers,false); setFinishEnabled(m_pIdentity,true); KVI_OPTION_BOOL(KviOption_boolShowChannelsJoinOnIrc) = false; KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = false; @@ -524,11 +545,11 @@ KviSetupWizard::KviSetupWizard() { case 1: m_pDirUseNew->toggle(); - setAppropriate(m_pDirectory,false); + setPageEnabled(m_pDirectory,false); break; case 2: m_pDirMakePortable->toggle(); - setAppropriate(m_pDirectory,false); + setPageEnabled(m_pDirectory,false); break; } } @@ -607,9 +628,9 @@ void KviSetupWizard::oldDirClicked() m_pNewPathBox->setEnabled(false); m_pNewIncomingBox->setEnabled(false); - if(m_pIdentity) setAppropriate(m_pIdentity,false); -// if(m_pTheme) setAppropriate(m_pTheme,false); - if(m_pServers) setAppropriate(m_pServers,false); + if(m_pIdentity) setPageEnabled(m_pIdentity,false); +// if(m_pTheme) setPageEnabled(m_pTheme,false); + if(m_pServers) setPageEnabled(m_pServers,false); if(m_pOldDataPathEdit->text().isEmpty()) setNextEnabled(m_pDirectory,false); else setNextEnabled(m_pDirectory,true); @@ -636,9 +657,9 @@ void KviSetupWizard::newDirClicked() m_pNewPathBox->setEnabled(true); m_pNewIncomingBox->setEnabled(true); - if(m_pIdentity) setAppropriate(m_pIdentity,true); -// if(m_pTheme) setAppropriate(m_pTheme,true); - if(m_pServers) setAppropriate(m_pServers,true); + if(m_pIdentity) setPageEnabled(m_pIdentity,true); +// if(m_pTheme) setPageEnabled(m_pTheme,true); + if(m_pServers) setPageEnabled(m_pServers,true); if(m_pDataPathEdit->text().isEmpty() || m_pIncomingPathEdit->text().isEmpty()) setNextEnabled(m_pDirectory,false); else setNextEnabled(m_pDirectory,true); @@ -886,7 +907,7 @@ void KviSetupWizard::accept() KviMessageBox::warning(__tr("Cannot create directory %s.\n" \ "You may not have write permission " \ "for that path. Please go back and choose another directory.")); - showPage(m_pDirectory); + setCurrentPage(m_pDirectory); return; } } /*else { @@ -917,7 +938,7 @@ void KviSetupWizard::accept() KviMessageBox::warning(__tr("Cannot create directory %s.\n" \ "You may not have write permission " \ "for that path. Please go back and choose another directory.")); - showPage(m_pDirectory); + setCurrentPage(m_pDirectory); return; } } @@ -1038,7 +1059,8 @@ void KviSetupWizard::accept() } } #ifdef COMPILE_ON_WINDOWS - if(m_pDirMakePortable->isOn()) { + if(m_pDirMakePortable->isOn()) + { KviFileUtils::writeFile(g_pApp->applicationDirPath()+KVI_PATH_SEPARATOR_CHAR+"portable","true"); } else { #endif diff --git a/src/modules/setup/setupwizard.h b/src/modules/setup/setupwizard.h index 0ffe90807..260de0838 100644 --- a/src/modules/setup/setupwizard.h +++ b/src/modules/setup/setupwizard.h @@ -1,11 +1,12 @@ #ifndef _SETUPWIZARD_H_ #define _SETUPWIZARD_H_ +//============================================================================= // // File : setupwizard.h // Creation date : Sat Oct 6 02:06:51 2001 GMT by Szymon Stefanek // // This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) +// Copyright (C) 2001-2007 Szymon Stefanek (pragma at kvirc dot net) // // This program is FREE software. You can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -21,6 +22,7 @@ // along with this program. If not, write to the Free Software Foundation, // Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // +//============================================================================= #include <kvi_tal_wizard.h> @@ -79,11 +81,10 @@ public: KviSetupPage * m_pDirectory; KviSetupPage * m_pIdentity; // KviSetupPage * m_pTheme; + KviSetupPage * m_pDesktopIntegration; KviSetupPage * m_pServers; // Theme - - KviTalVButtonGroup * m_pThemeButtonGroup; QRadioButton * m_pThemeHiRes; diff --git a/src/modules/theme/packthemedialog.cpp b/src/modules/theme/packthemedialog.cpp index 5b9a23428..53fe5de98 100644 --- a/src/modules/theme/packthemedialog.cpp +++ b/src/modules/theme/packthemedialog.cpp @@ -386,7 +386,7 @@ bool KviPackThemeDialog::packTheme() { QMessageBox::critical(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected image: please fix it","theme"), QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); - showPage(m_pImageSelectionPage); + setCurrentPage(m_pImageSelectionPage); return false; } } diff --git a/src/modules/theme/savethemedialog.cpp b/src/modules/theme/savethemedialog.cpp index a85be1fda..a98780a7d 100644 --- a/src/modules/theme/savethemedialog.cpp +++ b/src/modules/theme/savethemedialog.cpp @@ -285,7 +285,7 @@ bool KviSaveThemeDialog::saveTheme() { QMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected screenshot image: please fix it","theme"), QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); - showPage(m_pImageSelectionPage); + setCurrentPage(m_pImageSelectionPage); return false; } } |
