forked from qt-creator/qt-creator
JsonFilePage: Take InitialPath and InitialFileName for initialization
... during initializePage. This allows the JsonWizard to change the default file name based on secetions on earlier pages. Change-Id: I8569c23958339782ea21d56b54208812f6fa608e Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
|
||||
#include "jsonfilepage.h"
|
||||
|
||||
#include "jsonwizard.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QVariant>
|
||||
|
||||
@@ -39,6 +41,18 @@ JsonFilePage::JsonFilePage(QWidget *parent) :
|
||||
Utils::FileWizardPage(parent)
|
||||
{ }
|
||||
|
||||
void JsonFilePage::initializePage()
|
||||
{
|
||||
JsonWizard *wiz = qobject_cast<JsonWizard *>(wizard());
|
||||
if (!wiz)
|
||||
return;
|
||||
|
||||
if (fileName().isEmpty())
|
||||
setFileName(wiz->value(QLatin1String("InitialFileName")).toString());
|
||||
if (path().isEmpty())
|
||||
setPath(wiz->value(QLatin1String("InitialPath")).toString());
|
||||
}
|
||||
|
||||
bool JsonFilePage::validatePage()
|
||||
{
|
||||
if (path().isEmpty() || fileName().isEmpty())
|
||||
|
||||
Reference in New Issue
Block a user