Skip to content

Commit

Permalink
Add Help button and some fixes to automated placement widget
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored and nyalldawson committed Mar 5, 2018
1 parent 0e80b72 commit ee43d54
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 57 deletions.
7 changes: 7 additions & 0 deletions src/app/qgslabelengineconfigdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "qgslabelingenginesettings.h"
#include "qgsproject.h"
#include "pal/pal.h"
#include "qgshelp.h"

#include <QPushButton>

Expand All @@ -26,6 +27,7 @@ QgsLabelEngineConfigDialog::QgsLabelEngineConfigDialog( QWidget *parent )
setupUi( this );

connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsLabelEngineConfigDialog::onOK );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsLabelEngineConfigDialog::showHelp );
connect( buttonBox->button( QDialogButtonBox::RestoreDefaults ), &QAbstractButton::clicked,
this, &QgsLabelEngineConfigDialog::setDefaults );

Expand Down Expand Up @@ -80,3 +82,8 @@ void QgsLabelEngineConfigDialog::setDefaults()
chkShowPartialsLabels->setChecked( p.getShowPartial() );
mDrawOutlinesChkBox->setChecked( true );
}

void QgsLabelEngineConfigDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#labels-properties" ) );
}
4 changes: 4 additions & 0 deletions src/app/qgslabelengineconfigdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class APP_EXPORT QgsLabelEngineConfigDialog : public QDialog, private Ui::QgsLab
void onOK();
void setDefaults();


private slots:
void showHelp();

protected:
};

Expand Down
69 changes: 12 additions & 57 deletions src/ui/qgslabelengineconfigdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@
<rect>
<x>0</x>
<y>0</y>
<width>336</width>
<height>430</height>
<width>420</width>
<height>358</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>336</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Automated Placement Engine</string>
</property>
Expand Down Expand Up @@ -215,76 +209,37 @@
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="3" column="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="3">
<item row="3" column="0">
<widget class="QCheckBox" name="chkShowCandidates">
<property name="text">
<string>Show candidates (for debugging)</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>(i.e. including colliding objects)</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<item row="2" column="0">
<widget class="QCheckBox" name="chkShowAllLabels">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="inputMethodHints">
<set>Qt::ImhNone</set>
</property>
<property name="text">
<string>Show all labels for all layers</string>
<string>Show all labels for all layers (i.e. including colliding objects)</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>8</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="3">
<item row="0" column="0">
<widget class="QCheckBox" name="mDrawOutlinesChkBox">
<property name="text">
<string>Draw text as outlines (recommended)</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<item row="1" column="0">
<widget class="QCheckBox" name="chkShowPartialsLabels">
<property name="text">
<string>Show partial labels</string>
Expand Down Expand Up @@ -312,7 +267,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
</property>
</widget>
</item>
Expand Down

0 comments on commit ee43d54

Please sign in to comment.