Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add link to user manual for annotation dialogs
  • Loading branch information
DelazJ authored and nyalldawson committed Nov 4, 2018
1 parent 8c5f795 commit 6e9c2a3
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/app/qgsformannotationdialog.cpp
Expand Up @@ -20,6 +20,7 @@
#include "qgsproject.h"
#include "qgsannotationmanager.h"
#include "qgsgui.h"
#include "qgshelp.h"
#include <QFileDialog>
#include <QFileInfo>
#include <QGraphicsScene>
Expand All @@ -44,6 +45,7 @@ QgsFormAnnotationDialog::QgsFormAnnotationDialog( QgsMapCanvasAnnotationItem *it
}

QObject::connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsFormAnnotationDialog::applySettingsToItem );
QObject::connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsFormAnnotationDialog::showHelp );
QPushButton *deleteButton = new QPushButton( tr( "Delete" ) );
QObject::connect( deleteButton, &QPushButton::clicked, this, &QgsFormAnnotationDialog::deleteItem );
mButtonBox->addButton( deleteButton, QDialogButtonBox::RejectRole );
Expand Down Expand Up @@ -94,3 +96,7 @@ void QgsFormAnnotationDialog::mButtonBox_clicked( QAbstractButton *button )
}
}

void QgsFormAnnotationDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#annotation-tools" ) );
}
1 change: 1 addition & 0 deletions src/app/qgsformannotationdialog.h
Expand Up @@ -36,6 +36,7 @@ class APP_EXPORT QgsFormAnnotationDialog: public QDialog, private Ui::QgsFormAnn
void mBrowseToolButton_clicked();
void deleteItem();
void mButtonBox_clicked( QAbstractButton *button );
void showHelp();
};

#endif // QGSFORMANNOTATIONDIALOG_H
6 changes: 6 additions & 0 deletions src/app/qgshtmlannotationdialog.cpp
Expand Up @@ -20,6 +20,7 @@
#include "qgsproject.h"
#include "qgsannotationmanager.h"
#include "qgsgui.h"
#include "qgshelp.h"
#include <QFileDialog>
#include <QFileInfo>
#include <QGraphicsScene>
Expand All @@ -45,6 +46,7 @@ QgsHtmlAnnotationDialog::QgsHtmlAnnotationDialog( QgsMapCanvasAnnotationItem *it
}

QObject::connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsHtmlAnnotationDialog::applySettingsToItem );
QObject::connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsHtmlAnnotationDialog::showHelp );
QPushButton *deleteButton = new QPushButton( tr( "Delete" ) );
QObject::connect( deleteButton, &QPushButton::clicked, this, &QgsHtmlAnnotationDialog::deleteItem );
mButtonBox->addButton( deleteButton, QDialogButtonBox::RejectRole );
Expand Down Expand Up @@ -99,3 +101,7 @@ void QgsHtmlAnnotationDialog::mButtonBox_clicked( QAbstractButton *button )
}
}

void QgsHtmlAnnotationDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#annotation-tools" ) );
}
1 change: 1 addition & 0 deletions src/app/qgshtmlannotationdialog.h
Expand Up @@ -36,6 +36,7 @@ class APP_EXPORT QgsHtmlAnnotationDialog: public QDialog, private Ui::QgsFormAnn
void mBrowseToolButton_clicked();
void deleteItem();
void mButtonBox_clicked( QAbstractButton *button );
void showHelp();
};

#endif // QgsHTMLAnnotationDialog_H
7 changes: 7 additions & 0 deletions src/app/qgssvgannotationdialog.cpp
Expand Up @@ -22,6 +22,7 @@
#include "qgsproject.h"
#include "qgsannotationmanager.h"
#include "qgsgui.h"
#include "qgshelp.h"
#include <QFileDialog>
#include <QFileInfo>
#include <QGraphicsScene>
Expand All @@ -47,6 +48,7 @@ QgsSvgAnnotationDialog::QgsSvgAnnotationDialog( QgsMapCanvasAnnotationItem *item
}

QObject::connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsSvgAnnotationDialog::applySettingsToItem );
QObject::connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsSvgAnnotationDialog::showHelp );
QPushButton *deleteButton = new QPushButton( tr( "Delete" ) );
QObject::connect( deleteButton, &QPushButton::clicked, this, &QgsSvgAnnotationDialog::deleteItem );
mButtonBox->addButton( deleteButton, QDialogButtonBox::RejectRole );
Expand Down Expand Up @@ -96,3 +98,8 @@ void QgsSvgAnnotationDialog::mButtonBox_clicked( QAbstractButton *button )
applySettingsToItem();
}
}

void QgsSvgAnnotationDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#annotation-tools" ) );
}
1 change: 1 addition & 0 deletions src/app/qgssvgannotationdialog.h
Expand Up @@ -35,6 +35,7 @@ class APP_EXPORT QgsSvgAnnotationDialog: public QDialog, private Ui::QgsFormAnno
void applySettingsToItem();
void deleteItem();
void mButtonBox_clicked( QAbstractButton *button );
void showHelp();

private:
QgsSvgAnnotationDialog() = delete; //forbidden
Expand Down
6 changes: 6 additions & 0 deletions src/app/qgstextannotationdialog.cpp
Expand Up @@ -22,6 +22,7 @@
#include "qgsannotationmanager.h"
#include "qgsproject.h"
#include "qgsgui.h"
#include "qgshelp.h"
#include <QColorDialog>
#include <QGraphicsScene>

Expand Down Expand Up @@ -54,6 +55,7 @@ QgsTextAnnotationDialog::QgsTextAnnotationDialog( QgsMapCanvasAnnotationItem *it
setCurrentFontPropertiesToGui();

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

void QgsTextAnnotationDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#annotation-tools" ) );
}
1 change: 1 addition & 0 deletions src/app/qgstextannotationdialog.h
Expand Up @@ -51,6 +51,7 @@ class APP_EXPORT QgsTextAnnotationDialog: public QDialog, private Ui::QgsTextAnn
void deleteItem();
void mButtonBox_clicked( QAbstractButton *button );
void backgroundColorChanged( const QColor &color );
void showHelp();
};

#endif // QGSTEXTANNOTATIONDIALOG_H
2 changes: 1 addition & 1 deletion src/ui/qgsformannotationdialogbase.ui
Expand Up @@ -40,7 +40,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgstextannotationdialogbase.ui
Expand Up @@ -97,7 +97,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
Expand Down

0 comments on commit 6e9c2a3

Please sign in to comment.