aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-05-27 16:15:03 -0700
committerGerald Combs <gerald@wireshark.org>2015-05-28 02:21:33 +0000
commite08bc0dd6238b593b276609ce4ab78f512bf7c09 (patch)
tree991e10e908932e0bffee3606d1dd7dd5163b6308 /ui
parent6d5fa70976c28a7e967ff7db3ade8733663f6e2a (diff)
Don't warn about overwriting filename preferences.
When specifying a filename preference (e.g. the SSL pre-master secret log filename) don't warn about overwriting the file. Most of the time we're reading the file and when we're not (e.g. for the SSL debug log) overwriting it is kind of the point. Preference descriptions are plain text. We display them in tooltips as rich text. Convert them accordingly. Fixup some of the SSL preference descriptions. Bug: 11010 Change-Id: I4f1b1f3dd270c01648d9dd52ae20381c3c0d2e37 Reviewed-on: https://code.wireshark.org/review/8665 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/module_preferences_scroll_area.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/ui/qt/module_preferences_scroll_area.cpp b/ui/qt/module_preferences_scroll_area.cpp
index 016700f291..fea965c99f 100644
--- a/ui/qt/module_preferences_scroll_area.cpp
+++ b/ui/qt/module_preferences_scroll_area.cpp
@@ -40,8 +40,10 @@
#include <QRadioButton>
#include <QScrollBar>
#include <QSpacerItem>
-
-#include <QDebug>
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+// Qt::escape
+#include <QTextDocument>
+#endif
Q_DECLARE_METATYPE(pref_t *)
@@ -66,7 +68,16 @@ pref_show(pref_t *pref, gpointer layout_ptr)
QVBoxLayout *vb = static_cast<QVBoxLayout *>(layout_ptr);
if (!pref || !vb) return 0;
- QString tooltip = QString("<span>%1</span>").arg(pref->description);
+
+ // Convert the pref description from plain text to rich text.
+ QString description;
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+ description = Qt::escape(pref->description);
+#else
+ description = QString(pref->description).toHtmlEscaped();
+#endif
+ description.replace('\n', "<br>");
+ QString tooltip = QString("<span>%1</span>").arg(description);
switch (pref->type) {
case PREF_UINT:
@@ -484,7 +495,8 @@ void ModulePreferencesScrollArea::filenamePushButtonPressed()
if (!pref) return;
QString filename = QFileDialog::getSaveFileName(this, wsApp->windowTitleString(pref->title),
- pref->stashed_val.string);
+ pref->stashed_val.string, QString(), NULL,
+ QFileDialog::DontConfirmOverwrite);
if (!filename.isEmpty()) {
g_free((void *)pref->stashed_val.string);