kexi
kexidswelcome.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <qlayout.h>
00021 #include <qcheckbox.h>
00022 #include <qpushbutton.h>
00023
00024 #include <klocale.h>
00025 #include <kiconloader.h>
00026 #include <kglobalsettings.h>
00027 #include <kstdguiitem.h>
00028 #include <kdeversion.h>
00029
00030 #include "kexidatasourcewizard.h"
00031 #include "kexidswelcome.h"
00032
00033 KexiDSWelcome::KexiDSWelcome(KexiDataSourceWizard *parent)
00034 : QWidget(parent)
00035 {
00036 m_wiz = parent;
00037 KexiDSPixmap *pic = new KexiDSPixmap(this);
00038
00039 QLabel *lText = new QLabel(i18n("Kexi can help you with creation of %2 using data sources in almost no time with the \"%1 Wizard\""), this);
00040 lText->setAlignment(AlignTop | AlignLeft | WordBreak);
00041 QCheckBox *useWizard = new QCheckBox(i18n("Create %1 using the \"%1 Wizard\""), this);
00042 connect(useWizard, SIGNAL(toggled(bool)), this, SLOT(setUseWizard(bool)));
00043 useWizard->setChecked(true);
00044
00045 QSpacerItem *spacer = new QSpacerItem(320, 220);
00046 QCheckBox *dontShow = new QCheckBox(i18n("Do not show this wizard again"), this);
00047
00048 QGridLayout *g = new QGridLayout(this);
00049
00050 g->addMultiCellWidget(pic, 0, 4, 0, 0);
00051 g->addWidget(lText, 0, 1);
00052 g->addWidget(useWizard, 2, 1);
00053 g->addItem(spacer, 3, 1);
00054 g->addWidget(dontShow, 4, 1);
00055 }
00056
00057 void
00058 KexiDSWelcome::setUseWizard(bool use)
00059 {
00060 #if KDE_IS_VERSION(3,1,9) && !defined(Q_WS_WIN)
00061 bool useIcons = KGlobalSettings::showIconsOnPushButtons();
00062 #else
00063 bool useIcons = true;
00064 #endif
00065 if(use)
00066 {
00067 KGuiItem forward = KStdGuiItem::forward(KStdGuiItem::UseRTL);
00068
00069 if(useIcons)
00070 m_wiz->nextButton()->setIconSet( forward.iconSet() );
00071
00072 m_wiz->nextButton()->setText(i18n("&Next"));
00073 }
00074 else
00075 {
00076 if(useIcons)
00077 m_wiz->nextButton()->setIconSet(SmallIconSet("apply"));
00078
00079 m_wiz->nextButton()->setText(i18n("&Finish"));
00080 }
00081
00082 m_wiz->finishNext(!use);
00083 }
00084
00085 KexiDSWelcome::~KexiDSWelcome()
00086 {
00087 }
00088
00089 #include "kexidswelcome.moc"
00090
|