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>
This commit is contained in:
Gerald Combs 2015-05-27 16:15:03 -07:00
parent 6d5fa70976
commit e08bc0dd62
3 changed files with 20 additions and 8 deletions

View File

@ -6587,11 +6587,11 @@ void
ssl_common_register_options(module_t *module, ssl_common_options_t *options)
{
prefs_register_string_preference(module, "psk", "Pre-Shared-Key",
"Pre-Shared-Key as HEX string, should be 0 to 16 bytes",
"Pre-Shared-Key as HEX string. Should be 0 to 16 bytes.",
&(options->psk));
prefs_register_filename_preference(module, "keylog_file", "(Pre)-Master-Secret log filename",
"The filename of a file which contains a list of \n"
"The name of a file which contains a list of \n"
"(pre-)master secrets in one of the following formats:\n"
"\n"
"RSA <EPMS> <PMS>\n"

View File

@ -4156,8 +4156,8 @@ proto_register_ssl(void)
ssldecrypt_uat);
prefs_register_filename_preference(ssl_module, "debug_file", "SSL debug file",
"Redirect SSL debug to file name; leave empty to disable debugging, "
"or use \"" SSL_DEBUG_USE_STDERR "\" to redirect output to stderr\n",
"Redirect SSL debug to the file specified. Leave empty to disable debugging "
"or use \"" SSL_DEBUG_USE_STDERR "\" to redirect output to stderr.",
&ssl_debug_file_name);
prefs_register_string_preference(ssl_module, "keys_list", "RSA keys list (deprecated)",

View File

@ -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);