forked from osmocom/wireshark
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
This commit is contained in:
parent
52746c60a0
commit
c4d22dbe11
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue