Skip to content
Permalink
Browse files

Merge pull request #8031 from DelazJ/patch-4

 Fix save style dialog expansion and UI cleanup
  • Loading branch information
3nids committed Oct 5, 2018
2 parents 9fa8c35 + d9517f7 commit a86c68391356ca6a0af8fab5c84159bcfa86bc84
@@ -62,7 +62,7 @@ QgsVectorLayerSaveStyleDialog::QgsVectorLayerSaveStyleDialog( QgsVectorLayer *la
mDbStyleUIFileWidget->setDefaultRoot( myLastUsedDir );
mDbStyleUIFileWidget->setFilter( tr( "Qt Designer UI file (*.ui)" ) );
connect( mDbStyleUIFileWidget, &QgsFileWidget::fileChanged, this, &QgsVectorLayerSaveStyleDialog::readUiFileContent );
connect( mHelpButton, &QPushButton::clicked, this, &QgsVectorLayerSaveStyleDialog::showDbHelp );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsVectorLayerSaveStyleDialog::showHelp );

// save to file setup
connect( mFileWidget, &QgsFileWidget::fileChanged, this, &QgsVectorLayerSaveStyleDialog::updateSaveButtonState );
@@ -154,7 +154,7 @@ void QgsVectorLayerSaveStyleDialog::readUiFileContent( const QString &filePath )
}
}

void QgsVectorLayerSaveStyleDialog::showDbHelp()
void QgsVectorLayerSaveStyleDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#save-and-share-layer-properties" ) );
}
@@ -53,7 +53,7 @@ class QgsVectorLayerSaveStyleDialog : public QDialog, private Ui::QgsVectorLayer

private slots:
void updateSaveButtonState();
void showDbHelp();
void showHelp();
void readUiFileContent( const QString &filePath );

private:
@@ -14,9 +14,42 @@
<string>Save layer style</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0" colspan="2">
<widget class="QWidget" name="mSaveToDbWidget" native="true">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QComboBox" name="mStyleTypeComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="mModeLabel">
<property name="text">
<string>Save style</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QWidget" name="mSaveToFileWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
@@ -30,83 +63,38 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
<widget class="QLabel" name="label">
<property name="text">
<string>Style name</string>
</property>
<property name="buddy">
<cstring>mDbStyleNameEdit</cstring>
<string>File</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="mDbStyleNameEdit"/>
<widget class="QgsFileWidget" name="mFileWidget" native="true"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="descriptionLabel">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Description</string>
<string>Categories</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPlainTextEdit" name="mDbStyleDescriptionEdit"/>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Optionally pick an input form for attribute editing (QT Designer UI format), it will be stored in the database</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="mUILabel">
<property name="text">
<string>UI</string>
</property>
<property name="buddy">
<cstring>mDbStyleNameEdit</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QgsFileWidget" name="mDbStyleUIFileWidget" native="true"/>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="mHelpButton">
<property name="text">
<string>Help</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="mDbStyleUseAsDefault">
<property name="text">
<string>Use as default style for this layer</string>
<widget class="QListView" name="mStyleCategoriesListView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QWidget" name="mSaveToFileWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0" colspan="2">
<widget class="QWidget" name="mSaveToDbWidget" native="true">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
@@ -120,75 +108,55 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="nameLabel">
<property name="text">
<string>File</string>
<string>Style name</string>
</property>
<property name="buddy">
<cstring>mDbStyleNameEdit</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QgsFileWidget" name="mFileWidget" native="true"/>
<widget class="QLineEdit" name="mDbStyleNameEdit"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="descriptionLabel">
<property name="text">
<string>Categories</string>
<string>Description</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QListView" name="mStyleCategoriesListView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QPlainTextEdit" name="mDbStyleDescriptionEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mUILabel">
<property name="text">
<string>UI</string>
</property>
<property name="buddy">
<cstring>mDbStyleNameEdit</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="mDbStyleUseAsDefault">
<property name="text">
<string>Use as default style for this layer</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QgsFileWidget" name="mDbStyleUIFileWidget" native="true">
<property name="toolTip">
<string>Optionally pick an input form for attribute editing (QT Designer UI format), it will be stored in the database</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="mStyleTypeComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="mModeLabel">
<property name="text">
<string>Save style</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<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>
<item row="3" column="0">
<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>
</layout>
</widget>
<customwidgets>
@@ -199,6 +167,13 @@
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mStyleTypeComboBox</tabstop>
<tabstop>mStyleCategoriesListView</tabstop>
<tabstop>mDbStyleNameEdit</tabstop>
<tabstop>mDbStyleDescriptionEdit</tabstop>
<tabstop>mDbStyleUseAsDefault</tabstop>
</tabstops>
<resources/>
<connections>
<connection>

0 comments on commit a86c683

Please sign in to comment.
You can’t perform that action at this time.