-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Config dialog for XYZ tile connections + editing of existin…
…g ones As a bonus, also made zmin/zmax configuration visible to users
- Loading branch information
Showing
8 changed files
with
243 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*************************************************************************** | ||
qgsxyzconnectiondialog.cpp | ||
--------------------- | ||
begin : February 2017 | ||
copyright : (C) 2017 by Martin Dobias | ||
email : wonder dot sk at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsxyzconnectiondialog.h" | ||
|
||
#include "qgsxyzconnection.h" | ||
|
||
QgsXyzConnectionDialog::QgsXyzConnectionDialog( QWidget *parent ) | ||
: QDialog( parent ) | ||
{ | ||
setupUi( this ); | ||
} | ||
|
||
void QgsXyzConnectionDialog::setConnection( const QgsXyzConnection& conn ) | ||
{ | ||
mEditName->setText( conn.name ); | ||
mEditUrl->setText( conn.url ); | ||
mCheckBoxZMin->setChecked( conn.zMin != -1 ); | ||
mSpinZMin->setValue( conn.zMin != -1 ? conn.zMin : 0 ); | ||
mCheckBoxZMax->setChecked( conn.zMax != -1 ); | ||
mSpinZMax->setValue( conn.zMax != -1 ? conn.zMax : 18 ); | ||
} | ||
|
||
QgsXyzConnection QgsXyzConnectionDialog::connection() const | ||
{ | ||
QgsXyzConnection conn; | ||
conn.name = mEditName->text(); | ||
conn.url = mEditUrl->text(); | ||
if ( mCheckBoxZMin->isChecked() ) | ||
conn.zMin = mSpinZMin->value(); | ||
if ( mCheckBoxZMax->isChecked() ) | ||
conn.zMax = mSpinZMax->value(); | ||
return conn; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/*************************************************************************** | ||
qgsxyzconnectiondialog.h | ||
--------------------- | ||
begin : February 2017 | ||
copyright : (C) 2017 by Martin Dobias | ||
email : wonder dot sk at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSXYZCONNECTIONDIALOG_H | ||
#define QGSXYZCONNECTIONDIALOG_H | ||
|
||
#include <QDialog> | ||
|
||
#include "ui_qgsxyzconnectiondialog.h" | ||
|
||
struct QgsXyzConnection; | ||
|
||
|
||
class QgsXyzConnectionDialog : public QDialog, public Ui::QgsXyzConnectionDialog | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit QgsXyzConnectionDialog( QWidget *parent = 0 ); | ||
|
||
void setConnection( const QgsXyzConnection& conn ); | ||
|
||
QgsXyzConnection connection() const; | ||
|
||
}; | ||
|
||
#endif // QGSXYZCONNECTIONDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>QgsXyzConnectionDialog</class> | ||
<widget class="QDialog" name="QgsXyzConnectionDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>746</width> | ||
<height>426</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>XYZ Connection</string> | ||
</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> | ||
</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> | ||
</widget> | ||
</item> | ||
<item row="2" column="1"> | ||
<widget class="QSpinBox" name="mSpinZMin"/> | ||
</item> | ||
<item row="3" column="0"> | ||
<widget class="QCheckBox" name="mCheckBoxZMax"> | ||
<property name="text"> | ||
<string>Max. Zoom Level</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="3" column="1"> | ||
<widget class="QSpinBox" name="mSpinZMax"> | ||
<property name="value"> | ||
<number>18</number> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="buttonBox"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<tabstops> | ||
<tabstop>mEditName</tabstop> | ||
<tabstop>mEditUrl</tabstop> | ||
<tabstop>mCheckBoxZMin</tabstop> | ||
<tabstop>mSpinZMin</tabstop> | ||
<tabstop>mCheckBoxZMax</tabstop> | ||
<tabstop>mSpinZMax</tabstop> | ||
<tabstop>buttonBox</tabstop> | ||
</tabstops> | ||
<resources/> | ||
<connections> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>accepted()</signal> | ||
<receiver>QgsXyzConnectionDialog</receiver> | ||
<slot>accept()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>224</x> | ||
<y>381</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>157</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>rejected()</signal> | ||
<receiver>QgsXyzConnectionDialog</receiver> | ||
<slot>reject()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>292</x> | ||
<y>387</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>286</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
</ui> |
4cd4ea1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
4cd4ea1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wonder-sk , thanks for the z min/max bonus, it's v. useful.