aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-09-18 22:52:34 +0000
committerGerald Combs <gerald@wireshark.org>2012-09-18 22:52:34 +0000
commitc4d22dbe11ad66c7e09c39fa823d75b8846c6832 (patch)
tree317c490fa161cf6eea278876bc1a946c32cb6282 /ui
parent52746c60a0cd74388f27d98f46ab4dc82c7ac9b8 (diff)
downloadwireshark-c4d22dbe11ad66c7e09c39fa823d75b8846c6832.tar.gz
wireshark-c4d22dbe11ad66c7e09c39fa823d75b8846c6832.tar.bz2
wireshark-c4d22dbe11ad66c7e09c39fa823d75b8846c6832.zip
import_text_dialog.cpp: Use the common help URL routines.
main_window.cpp: QMessageBox::exec returns a StandardButton, not a ButtonRole. help_dlg.c: Remove extra blank lines. svn path=/trunk/; revision=44991
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/help_dlg.c4
-rw-r--r--ui/qt/import_text_dialog.cpp9
-rw-r--r--ui/qt/main_window.cpp26
3 files changed, 22 insertions, 17 deletions
diff --git a/ui/gtk/help_dlg.c b/ui/gtk/help_dlg.c
index 262905e794..7b7e5d5c94 100644
--- a/ui/gtk/help_dlg.c
+++ b/ui/gtk/help_dlg.c
@@ -67,7 +67,6 @@ typedef struct {
static GSList *help_text_pages = NULL;
-
/**
* Redraw all help pages, to use a new font.
*/
@@ -86,7 +85,6 @@ void help_redraw(void)
}
}
-
static void
topic_action(topic_action_e action)
{
@@ -100,14 +98,12 @@ topic_action(topic_action_e action)
}
}
-
void
topic_cb(GtkWidget *w _U_, topic_action_e action)
{
topic_action(action);
}
-
gboolean
topic_menu_cb(GtkWidget *w _U_, GdkEventButton *event _U_, gpointer user_data)
{
diff --git a/ui/qt/import_text_dialog.cpp b/ui/qt/import_text_dialog.cpp
index e8fe4cf48d..58180a3461 100644
--- a/ui/qt/import_text_dialog.cpp
+++ b/ui/qt/import_text_dialog.cpp
@@ -37,6 +37,7 @@
#include "ui/text_import_scanner.h"
#include "ui/last_open_dir.h"
#include "ui/alert_box.h"
+#include "ui/help_url.h"
#include "file.h"
#include "wsutil/file_util.h"
@@ -449,6 +450,10 @@ void ImportTextDialog::on_maxLengthLineEdit_textChanged(const QString &max_frame
void ImportTextDialog::on_buttonBox_helpRequested()
{
- qDebug() << "Fix: text file import help topic (and remove QDesktopServices & QUrl includes)";
- QDesktopServices::openUrl(QUrl("http://www.wireshark.org/docs/wsug_html_chunked/ChIOImportSection.html"));
+ gchar *url = topic_action_url(HELP_IMPORT_DIALOG);
+
+ if(url != NULL) {
+ QDesktopServices::openUrl(QUrl(url));
+ g_free(url);
+ }
}
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 0c7dfc234b..d820e4e4e2 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -595,6 +595,7 @@ void MainWindow::importCaptureFile() {
import_dlg.exec();
if (import_dlg.result() != QDialog::Accepted) {
+ main_ui_->mainStack->setCurrentWidget(main_welcome_);
return;
}
@@ -701,7 +702,7 @@ bool MainWindow::testCaptureFileClose(capture_file *cf, bool from_quit, QString
switch (response) {
- case QMessageBox::AcceptRole:
+ case QMessageBox::Save:
#ifdef HAVE_LIBPCAP
/* If there's a capture in progress, we have to stop the capture
and then do the save. */
@@ -712,25 +713,29 @@ bool MainWindow::testCaptureFileClose(capture_file *cf, bool from_quit, QString
saveCapture(cf, TRUE);
break;
- case QMessageBox::DestructiveRole:
+ case QMessageBox::Discard:
+ qDebug() << "DESTROY!";
#ifdef HAVE_LIBPCAP
- /* If there's a capture in progress; we have to stop the capture
- and then do the close. */
+ /*
+ * If there's a capture in progress; we have to stop the capture
+ * and then do the close.
+ */
if (capture_in_progress)
captureStop(cf);
#endif
/* Just close the file, discarding changes */
cf_close(cf);
+ return true;
break;
- case QMessageBox::RejectRole:
+ case QMessageBox::Cancel:
default:
/* Don't close the file (and don't stop any capture in progress). */
- return FALSE; /* file not closed */
+ return false; /* file not closed */
break;
}
} else {
- /* unchanged file, just close it */
+ /* Unchanged file, just close it */
cf_close(cf);
}
} else {
@@ -745,7 +750,7 @@ bool MainWindow::testCaptureFileClose(capture_file *cf, bool from_quit, QString
cf_close(cf);
}
- return TRUE; /* file closed */
+ return true; /* File closed */
}
void MainWindow::captureStop(capture_file *cf) {
@@ -1230,9 +1235,8 @@ void MainWindow::on_actionFileImport_triggered()
}
void MainWindow::on_actionFileClose_triggered() {
- testCaptureFileClose(&cfile);
-
- main_ui_->mainStack->setCurrentWidget(main_welcome_);
+ if (testCaptureFileClose(&cfile))
+ main_ui_->mainStack->setCurrentWidget(main_welcome_);
}
// View Menu