Skip to content

Commit

Permalink
Update UI for XYZ Connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsunni committed Mar 12, 2017
1 parent 7293c05 commit 43b5ea1
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 16 deletions.
24 changes: 24 additions & 0 deletions src/providers/wms/qgsxyzconnectiondialog.cpp
Expand Up @@ -44,3 +44,27 @@ QgsXyzConnection QgsXyzConnectionDialog::connection() const
conn.zMax = mSpinZMax->value();
return conn;
}

void QgsXyzConnectionDialog::on_mCheckBoxZMin_stateChanged( int state )
{
if ( state == Qt::Checked )
{
mSpinZMin->setEnabled( true );
}
else
{
mSpinZMin->setEnabled( false );
}
}

void QgsXyzConnectionDialog::on_mCheckBoxZMax_stateChanged( int state )
{
if ( state == Qt::Checked )
{
mSpinZMax->setEnabled( true );
}
else
{
mSpinZMax->setEnabled( false );
}
}
4 changes: 4 additions & 0 deletions src/providers/wms/qgsxyzconnectiondialog.h
Expand Up @@ -33,6 +33,10 @@ class QgsXyzConnectionDialog : public QDialog, public Ui::QgsXyzConnectionDialog

QgsXyzConnection connection() const;

public slots:
void on_mCheckBoxZMin_stateChanged( int state );
void on_mCheckBoxZMax_stateChanged( int state );

};

#endif // QGSXYZCONNECTIONDIALOG_H
64 changes: 48 additions & 16 deletions src/ui/qgsxyzconnectiondialog.ui
Expand Up @@ -15,57 +15,89 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name</string>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<widget class="QLineEdit" name="mEditUrl">
<property name="placeholderText">
<string>http://example.com/{z}/{x}/{y}.png</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="mEditName"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>URL</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="mEditUrl">
<property name="placeholderText">
<string>http://example.com/{z}/{x}/{y}.png</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="mCheckBoxZMin">
<property name="text">
<string>Min. Zoom Level</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="mSpinZMin"/>
<widget class="QSpinBox" name="mSpinZMin">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="mCheckBoxZMax">
<property name="text">
<string>Max. Zoom Level</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="mSpinZMax">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="value">
<number>18</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="mEditName"/>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<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>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
Expand Down

0 comments on commit 43b5ea1

Please sign in to comment.