Skip to content

Commit b5abc86

Browse files
committed
Add links to the wiki as help for many dialogs
Fix compilation problem with some Qt versions regarding QUrl header.
1 parent 7af1256 commit b5abc86

File tree

7 files changed

+38
-2
lines changed

7 files changed

+38
-2
lines changed

src/CipherDialog.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include <QPushButton>
66
#include <QRegularExpressionValidator>
7+
#include <QDesktopServices>
8+
#include <QUrl>
79

810
#include <QtCore/qmath.h>
911

@@ -149,3 +151,7 @@ void CipherDialog::toggleEncryptionSettings()
149151
ui->plaintextHeaderSize->setEnabled(true);
150152
}
151153
}
154+
155+
void CipherDialog::help() {
156+
QDesktopServices::openUrl(QUrl("https://github.com/sqlitebrowser/sqlitebrowser/wiki/Encrypted-Databases"));
157+
}

src/CipherDialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class CipherDialog : public QDialog
3131
private slots:
3232
void checkInputFields();
3333
void toggleEncryptionSettings();
34+
void help();
3435
};
3536

3637
#endif

src/CipherDialog.ui

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>712</width>
10-
<height>299</height>
10+
<height>322</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -246,7 +246,7 @@
246246
<enum>Qt::Horizontal</enum>
247247
</property>
248248
<property name="standardButtons">
249-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
249+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
250250
</property>
251251
</widget>
252252
</item>
@@ -395,6 +395,22 @@
395395
</hint>
396396
</hints>
397397
</connection>
398+
<connection>
399+
<sender>buttonBox</sender>
400+
<signal>helpRequested()</signal>
401+
<receiver>CipherDialog</receiver>
402+
<slot>help()</slot>
403+
<hints>
404+
<hint type="sourcelabel">
405+
<x>355</x>
406+
<y>300</y>
407+
</hint>
408+
<hint type="destinationlabel">
409+
<x>355</x>
410+
<y>160</y>
411+
</hint>
412+
</hints>
413+
</connection>
398414
</connections>
399415
<slots>
400416
<slot>checkInputFields()</slot>

src/ColumnDisplayFormatDialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <QMessageBox>
22
#include <QDesktopServices>
3+
#include <QUrl>
34

45
#include "ColumnDisplayFormatDialog.h"
56
#include "ui_ColumnDisplayFormatDialog.h"

src/FilterLineEdit.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <QKeyEvent>
66
#include <QMenu>
77
#include <QWhatsThis>
8+
#include <QDesktopServices>
9+
#include <QUrl>
810

911
FilterLineEdit::FilterLineEdit(QWidget* parent, std::vector<FilterLineEdit*>* filters, size_t columnnum) :
1012
QLineEdit(parent),
@@ -133,6 +135,7 @@ void FilterLineEdit::showContextMenu(const QPoint &pos)
133135

134136
QAction* whatsThisAction = new QAction(QIcon(":/icons/whatis"), tr("What's This?"), editContextMenu);
135137
connect(whatsThisAction, &QAction::triggered, this, [&]() {
138+
QDesktopServices::openUrl(QUrl("https://github.com/sqlitebrowser/sqlitebrowser/wiki/Using-the-Filters"));
136139
QWhatsThis::showText(pos, whatsThis(), this);
137140
});
138141

src/MainWindow.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include <QPushButton>
5353
#include <QTemporaryFile>
5454
#include <QToolButton>
55+
#include <QUrl>
5556

5657
#ifdef Q_OS_MACX //Needed only on macOS
5758
#include <QOpenGLWidget>

src/PlotDock.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
#include <QPrinter>
1111
#include <QPrintPreviewDialog>
12+
#include <QDesktopServices>
13+
#include <QUrl>
1214
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
1315
#include <QRandomGenerator>
1416
#endif
@@ -92,6 +94,12 @@ PlotDock::PlotDock(QWidget* parent)
9294
openPrintDialog();
9395
});
9496

97+
QAction* helpAction = new QAction(QIcon(":/icons/whatis"), tr("Help"), m_contextMenu);
98+
m_contextMenu->addAction(helpAction);
99+
connect(helpAction, &QAction::triggered, this, [&]() {
100+
QDesktopServices::openUrl(QUrl("https://github.com/sqlitebrowser/sqlitebrowser/wiki/Plot-Dock"));
101+
});
102+
95103
QAction* showLegendAction = new QAction(tr("Show legend"), m_contextMenu);
96104
showLegendAction->setCheckable(true);
97105
m_contextMenu->addAction(showLegendAction);

0 commit comments

Comments
 (0)