Skip to content

Commit ef10781

Browse files
DelazJnyalldawson
authored andcommitted
Add link to user manual for annotation dialogs
(cherry picked from commit 6e9c2a3)
1 parent a3dc4b6 commit ef10781

10 files changed

Lines changed: 31 additions & 2 deletions

src/app/qgsformannotationdialog.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "qgsproject.h"
2121
#include "qgsannotationmanager.h"
2222
#include "qgsgui.h"
23+
#include "qgshelp.h"
2324
#include <QFileDialog>
2425
#include <QFileInfo>
2526
#include <QGraphicsScene>
@@ -44,6 +45,7 @@ QgsFormAnnotationDialog::QgsFormAnnotationDialog( QgsMapCanvasAnnotationItem *it
4445
}
4546

4647
QObject::connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsFormAnnotationDialog::applySettingsToItem );
48+
QObject::connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsFormAnnotationDialog::showHelp );
4749
QPushButton *deleteButton = new QPushButton( tr( "Delete" ) );
4850
QObject::connect( deleteButton, &QPushButton::clicked, this, &QgsFormAnnotationDialog::deleteItem );
4951
mButtonBox->addButton( deleteButton, QDialogButtonBox::RejectRole );
@@ -94,3 +96,7 @@ void QgsFormAnnotationDialog::mButtonBox_clicked( QAbstractButton *button )
9496
}
9597
}
9698

99+
void QgsFormAnnotationDialog::showHelp()
100+
{
101+
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#annotation-tools" ) );
102+
}

src/app/qgsformannotationdialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class APP_EXPORT QgsFormAnnotationDialog: public QDialog, private Ui::QgsFormAnn
3636
void mBrowseToolButton_clicked();
3737
void deleteItem();
3838
void mButtonBox_clicked( QAbstractButton *button );
39+
void showHelp();
3940
};
4041

4142
#endif // QGSFORMANNOTATIONDIALOG_H

src/app/qgshtmlannotationdialog.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "qgsproject.h"
2121
#include "qgsannotationmanager.h"
2222
#include "qgsgui.h"
23+
#include "qgshelp.h"
2324
#include <QFileDialog>
2425
#include <QFileInfo>
2526
#include <QGraphicsScene>
@@ -45,6 +46,7 @@ QgsHtmlAnnotationDialog::QgsHtmlAnnotationDialog( QgsMapCanvasAnnotationItem *it
4546
}
4647

4748
QObject::connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsHtmlAnnotationDialog::applySettingsToItem );
49+
QObject::connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsHtmlAnnotationDialog::showHelp );
4850
QPushButton *deleteButton = new QPushButton( tr( "Delete" ) );
4951
QObject::connect( deleteButton, &QPushButton::clicked, this, &QgsHtmlAnnotationDialog::deleteItem );
5052
mButtonBox->addButton( deleteButton, QDialogButtonBox::RejectRole );
@@ -99,3 +101,7 @@ void QgsHtmlAnnotationDialog::mButtonBox_clicked( QAbstractButton *button )
99101
}
100102
}
101103

104+
void QgsHtmlAnnotationDialog::showHelp()
105+
{
106+
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#annotation-tools" ) );
107+
}

src/app/qgshtmlannotationdialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class APP_EXPORT QgsHtmlAnnotationDialog: public QDialog, private Ui::QgsFormAnn
3636
void mBrowseToolButton_clicked();
3737
void deleteItem();
3838
void mButtonBox_clicked( QAbstractButton *button );
39+
void showHelp();
3940
};
4041

4142
#endif // QgsHTMLAnnotationDialog_H

src/app/qgssvgannotationdialog.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "qgsproject.h"
2323
#include "qgsannotationmanager.h"
2424
#include "qgsgui.h"
25+
#include "qgshelp.h"
2526
#include <QFileDialog>
2627
#include <QFileInfo>
2728
#include <QGraphicsScene>
@@ -47,6 +48,7 @@ QgsSvgAnnotationDialog::QgsSvgAnnotationDialog( QgsMapCanvasAnnotationItem *item
4748
}
4849

4950
QObject::connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsSvgAnnotationDialog::applySettingsToItem );
51+
QObject::connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsSvgAnnotationDialog::showHelp );
5052
QPushButton *deleteButton = new QPushButton( tr( "Delete" ) );
5153
QObject::connect( deleteButton, &QPushButton::clicked, this, &QgsSvgAnnotationDialog::deleteItem );
5254
mButtonBox->addButton( deleteButton, QDialogButtonBox::RejectRole );
@@ -96,3 +98,8 @@ void QgsSvgAnnotationDialog::mButtonBox_clicked( QAbstractButton *button )
9698
applySettingsToItem();
9799
}
98100
}
101+
102+
void QgsSvgAnnotationDialog::showHelp()
103+
{
104+
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#annotation-tools" ) );
105+
}

src/app/qgssvgannotationdialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class APP_EXPORT QgsSvgAnnotationDialog: public QDialog, private Ui::QgsFormAnno
3535
void applySettingsToItem();
3636
void deleteItem();
3737
void mButtonBox_clicked( QAbstractButton *button );
38+
void showHelp();
3839

3940
private:
4041
QgsSvgAnnotationDialog() = delete; //forbidden

src/app/qgstextannotationdialog.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "qgsannotationmanager.h"
2323
#include "qgsproject.h"
2424
#include "qgsgui.h"
25+
#include "qgshelp.h"
2526
#include <QColorDialog>
2627
#include <QGraphicsScene>
2728

@@ -54,6 +55,7 @@ QgsTextAnnotationDialog::QgsTextAnnotationDialog( QgsMapCanvasAnnotationItem *it
5455
setCurrentFontPropertiesToGui();
5556

5657
QObject::connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsTextAnnotationDialog::applyTextToItem );
58+
QObject::connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsTextAnnotationDialog::showHelp );
5759
QObject::connect( mFontComboBox, &QFontComboBox::currentFontChanged, this, &QgsTextAnnotationDialog::changeCurrentFormat );
5860
QObject::connect( mFontSizeSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsTextAnnotationDialog::changeCurrentFormat );
5961
QObject::connect( mBoldPushButton, &QPushButton::toggled, this, &QgsTextAnnotationDialog::changeCurrentFormat );
@@ -168,3 +170,7 @@ void QgsTextAnnotationDialog::deleteItem()
168170
mItem = nullptr;
169171
}
170172

173+
void QgsTextAnnotationDialog::showHelp()
174+
{
175+
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#annotation-tools" ) );
176+
}

src/app/qgstextannotationdialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class APP_EXPORT QgsTextAnnotationDialog: public QDialog, private Ui::QgsTextAnn
5151
void deleteItem();
5252
void mButtonBox_clicked( QAbstractButton *button );
5353
void backgroundColorChanged( const QColor &color );
54+
void showHelp();
5455
};
5556

5657
#endif // QGSTEXTANNOTATIONDIALOG_H

src/ui/qgsformannotationdialogbase.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<enum>Qt::Horizontal</enum>
4141
</property>
4242
<property name="standardButtons">
43-
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
43+
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
4444
</property>
4545
</widget>
4646
</item>

src/ui/qgstextannotationdialogbase.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<enum>Qt::Horizontal</enum>
9898
</property>
9999
<property name="standardButtons">
100-
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
100+
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
101101
</property>
102102
</widget>
103103
</item>

0 commit comments

Comments
 (0)