Commit cd6e6ba4 authored by Ludovic Fauvet's avatar Ludovic Fauvet

Wizard: add widgets to open existing projects

parent b0f05b29
......@@ -23,6 +23,7 @@
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <QMessageBox>
#include "WelcomePage.h"
WelcomePage::WelcomePage( QWidget* parent )
......@@ -34,6 +35,18 @@ WelcomePage::WelcomePage( QWidget* parent )
setSubTitle( tr( "Open or create a project" ) );
}
void WelcomePage::changeEvent( QEvent *e )
{
switch ( e->type() )
{
case QEvent::LanguageChange:
m_ui.retranslateUi( this );
break;
default:
break;
}
}
int WelcomePage::nextId() const
{
if ( m_ui.createRadioButton->isChecked() )
......@@ -42,14 +55,15 @@ int WelcomePage::nextId() const
return ProjectWizard::Page_Open;
}
void WelcomePage::changeEvent( QEvent *e )
bool WelcomePage::validatePage()
{
switch ( e->type() )
if ( m_ui.openRadioButton->isChecked() &&
m_ui.projectsListWidget->count() == 0 )
{
case QEvent::LanguageChange:
m_ui.retranslateUi( this );
break;
default:
break;
QMessageBox::information( this, tr( "Sorry" ),
tr( "You first need to select a project from "
"the list.\nThen click next to continue..." ) );
return false;
}
return true;
}
......@@ -40,6 +40,7 @@ class WelcomePage : public QWizardPage
protected:
virtual void changeEvent( QEvent *e );
virtual bool validatePage();
private:
Ui::WelcomePage m_ui;
......
......@@ -6,15 +6,15 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>521</width>
<height>414</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<item row="0" column="0" colspan="4">
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
......@@ -31,7 +31,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="2" column="0">
<item row="2" column="0" colspan="4">
<widget class="QRadioButton" name="createRadioButton">
<property name="font">
<font>
......@@ -47,14 +47,14 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="3" column="0">
<item row="3" column="0" colspan="4">
<widget class="QRadioButton" name="openRadioButton">
<property name="text">
<string>Open an existing project</string>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="6" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -67,7 +67,7 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="1" column="0">
<item row="1" column="1">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -83,6 +83,65 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="4" column="1" rowspan="2">
<widget class="QListWidget" name="projectsListWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QPushButton" name="openPushButton">
<property name="text">
<string>Open...</string>
</property>
</widget>
</item>
<item row="5" column="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment