Пример #1
0
int KEndingBalanceDlg::nextId() const
{
  // Starting from the current page, look for the first enabled page
  // and return that value
  // If the end of the list is encountered first, then return -1.
  for (int i = currentId() + 1; i < d->m_pages.size() && i < pageIds().size(); ++i) {
    if (d->m_pages.testBit(i))
      return pageIds()[i];
  }
  return -1;
}
Пример #2
0
void UIWizard::retranslatePages()
{
    /* Translate all the pages: */
    QList<int> ids = pageIds();
    for (int i = 0; i < ids.size(); ++i)
        qobject_cast<UIWizardPage*>(page(ids[i]))->retranslate();
}
Пример #3
0
SetupWizard::SetupWizard(const QString &exe, const QString &args,
                         QAbstractItemModel *model, QWidget *parent) :
    QWizard(parent),
    ui(new Ui::SetupWizard),
    mModel(model)
{
    mInstances.append(this);
    ui->setupUi(this);
    setWindowTitle(QFileInfo(exe).fileName());
    setWindowIcon(QPixmap::fromImage(Utils::extractIcon(exe)));
    setAttribute(Qt::WA_DeleteOnClose);
    QSettings s("winewizard", "settings");
    s.beginGroup("InstallWizard");
    QDesktopWidget *dw = QApplication::desktop();
    resize(s.value("Size", QSize(dw->width() * 0.7, dw->height() * 0.6)).toSize());
    s.endGroup();
    setPage(PageIntro, new IntroPage(exe, args, mModel, this));
    setPage(PageSolution, new SolutionPage(exe, this));
    setPage(PageInstall, new InstallPage(mModel, this));
    setPage(PageDebug, new DebugPage(mModel, this));
    setPage(PageFinal, new FinalPage(this));
    setPage(PageUpdate, new UpdatePage(mModel, this));
    for (int id : pageIds())
        connect(page(id), &QWizardPage::completeChanged, button(QWizard::BackButton), &QAbstractButton::hide);
    connect(this, &SetupWizard::currentIdChanged, button(QWizard::BackButton), &QAbstractButton::hide);
}
Пример #4
0
	void ExecuteCommandDialog::handleCurrentChanged (int id)
	{
		if (!dynamic_cast<WaitPage*> (currentPage ()))
			return;

		const auto& ids = pageIds ();

		const int pos = ids.indexOf (id);
		if (pos <= 0)
			return;

		const auto prevPage = page (ids.at (pos - 1));
		if (dynamic_cast<CommandsListPage*> (prevPage))
		{
			const AdHocCommand& cmd = dynamic_cast<CommandsListPage*> (prevPage)->GetSelectedCommand ();
			if (cmd.GetName ().isEmpty ())
				deleteLater ();
			else
				ExecuteCommand (cmd);
		}
		else if (dynamic_cast<CommandResultPage*> (prevPage))
		{
			const auto crp = dynamic_cast<CommandResultPage*> (prevPage);
			const auto& action = crp->GetSelectedAction ();
			if (action.isEmpty ())
				return;

			auto result = crp->GetResult ();
			result.SetDataForm (crp->GetForm ());
			ProceedExecuting (result, action);
		}
	}
Пример #5
0
void ConnectFriendWizard::updateStylesheet()
{
	/* add stylesheet to title */
	QList<int> ids = pageIds();
	for (QList<int>::iterator pageIt = ids.begin(); pageIt != ids.end(); ++pageIt) {
		QWizardPage *p = page(*pageIt);

		QString title;
		QMap<QWizardPage*, QString>::iterator it = mTitleString.find(p);
		if (it == mTitleString.end()) {
			/* Save title string */
			title = p->title();
			mTitleString[p] = title;
		} else {
			title = it.value();
		}

		QString stylesheet = "<span style=\"";

		if (mTitleFontSize) {
			stylesheet += QString("font-size:%1pt; ").arg(mTitleFontSize);
		}
		if (mTitleFontWeight) {
			stylesheet += QString("font-weight:%1; ").arg(mTitleFontWeight);
		}
		if (!mTitleColor.isEmpty()) {
			stylesheet += QString("color:%1; ").arg(mTitleColor);
		}

		stylesheet += QString("\">%1</span>").arg(title);

		p->setTitle(stylesheet);
	}
}
Пример #6
0
void OracleWizard::retranslateUi()
{
    setWindowTitle(tr("Oracle Importer"));
    QWizard::setButtonText(QWizard::FinishButton, tr("Save"));
    
    for (int i = 0; i < pageIds().count(); i++)
        dynamic_cast<OracleWizardPage *>(page(i))->retranslateUi();
}
Пример #7
0
void DecWizard::retranslateUI()
{
    setWindowTitle(tr("DECRYPT_WIZARD_TITLE"));

    QList<int> ids = pageIds();
    DecWizardPage* p = NULL;
    for (int i = 0; i < ids.size(); i++)
    {
        p = dynamic_cast<DecWizardPage*>(page(i));
        if (p)
        {
            p->retranslateUI();
        }
    }
}
Пример #8
0
void UIWizard::prepare()
{
    /* Translate wizard: */
    retranslateUi();
    /* Translate wizard pages: */
    retranslatePages();

    /* Resize wizard to 'golden ratio': */
    resizeToGoldenRatio();

    /* Notify pages they are ready: */
    QList<int> ids = pageIds();
    for (int i = 0; i < ids.size(); ++i)
        qobject_cast<UIWizardPage*>(page(ids[i]))->markReady();

    /* Make sure custom buttons shown even if final page is first to show: */
    sltCurrentIdChanged(startId());
}
Пример #9
0
ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
    QWizard(parent), ui(new Ui::ConnectFriendWizard)
{
    ui->setupUi(this);

    /* add stylesheet to title */
    QList<int> ids = pageIds();
    for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it) {
        QWizardPage *p = page(*it);
        p->setTitle(QString("<span style=\"font-size:16pt; font-weight:500; color:white;\">%1</span>").arg(p->title()));
    }

// this define comes from Qt example. I don't have mac, so it wasn't tested
#ifndef Q_WS_MAC
    setWizardStyle(ModernStyle);
#endif

    setStartId(Page_Intro);

// at this moment I don't know, what information should be in help
//	setOption(HaveHelpButton, true);
//	connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));

    setPixmap(QWizard::LogoPixmap, QPixmap(":/images/connect/connectFriendLogo.png"));

// we have no good pictures for watermarks
//	setPixmap(QWizard::WatermarkPixmap, QPixmap(":/images/connectFriendWatermark.png"));
    setPixmap(QWizard::BannerPixmap, QPixmap(":/images/connect/connectFriendBanner1.png"));

    /* register global fields */
    ui->ErrorMessagePage->registerField("errorMessage", ui->messageLabel, "text");

    /* disable not used pages */
    ui->foffRadioButton->hide();
    ui->rsidRadioButton->hide();

    connect(ui->acceptNoSignGPGCheckBox,SIGNAL(toggled(bool)), ui->optionsFrame,SLOT(setEnabled(bool))) ;
    connect(ui->addKeyToKeyring_CB,SIGNAL(toggled(bool)), ui->acceptNoSignGPGCheckBox,SLOT(setChecked(bool))) ;
}
Пример #10
0
void UIWizard::cleanup()
{
    /* Remove all the pages: */
    QList<int> ids = pageIds();
    for (int i = ids.size() - 1; i >= 0 ; --i)
    {
        /* Get enumerated page ID: */
        int iId = ids[i];
        /* Get corresponding page: */
        QWizardPage *pWizardPage = page(iId);

        /* Remove page from the wizard: */
        removePage(iId);
        /* Delete page finally: */
        delete pWizardPage;
    }

#ifndef Q_WS_MAC
    /* Cleanup watermark: */
    if (!m_strWatermarkName.isEmpty())
        setPixmap(QWizard::WatermarkPixmap, QPixmap());
#endif /* !Q_WS_MAC */
}