2014-12-22 23:51:36 +00:00
|
|
|
/* wireshark_dialog.cpp
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @file General dialog base class
|
|
|
|
*
|
|
|
|
* Base class which provides convenience methods for dialogs that handle
|
|
|
|
* capture files. "General" is a misnomer but we already have a class named
|
|
|
|
* "CaptureFileDialog".
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include "wireshark_dialog.h"
|
|
|
|
|
|
|
|
#include "wireshark_application.h"
|
|
|
|
|
|
|
|
// To do:
|
|
|
|
// - Use a dynamic property + Q_PROPERTY for the subtitle.
|
2015-02-14 00:18:57 +00:00
|
|
|
// - Save and load recent geometry.
|
2014-12-22 23:51:36 +00:00
|
|
|
|
2015-02-13 03:31:13 +00:00
|
|
|
WiresharkDialog::WiresharkDialog(QWidget &, CaptureFile &capture_file) :
|
|
|
|
QDialog(NULL, Qt::Window),
|
2014-12-22 23:51:36 +00:00
|
|
|
cap_file_(capture_file),
|
|
|
|
file_closed_(false)
|
|
|
|
{
|
2015-02-17 20:29:31 +00:00
|
|
|
setWindowIcon(wsApp->normalIcon());
|
2014-12-22 23:51:36 +00:00
|
|
|
connect(&cap_file_, SIGNAL(captureFileClosing()), this, SLOT(captureFileClosing()));
|
|
|
|
connect(&cap_file_, SIGNAL(captureFileClosed()), this, SLOT(captureFileClosing()));
|
2014-12-29 22:12:43 +00:00
|
|
|
setWindowTitleFromSubtitle();
|
2014-12-22 23:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiresharkDialog::setWindowSubtitle(const QString &subtitle)
|
|
|
|
{
|
|
|
|
subtitle_ = subtitle;
|
2014-12-29 22:12:43 +00:00
|
|
|
setWindowTitleFromSubtitle();
|
2014-12-22 23:51:36 +00:00
|
|
|
}
|
|
|
|
|
2014-12-29 22:12:43 +00:00
|
|
|
void WiresharkDialog::setWindowTitleFromSubtitle()
|
2014-12-22 23:51:36 +00:00
|
|
|
{
|
|
|
|
QString title = wsApp->windowTitleString(QStringList() << subtitle_ << cap_file_.fileTitle());
|
|
|
|
QDialog::setWindowTitle(title);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WiresharkDialog::updateWidgets()
|
|
|
|
{
|
2014-12-29 22:12:43 +00:00
|
|
|
setWindowTitleFromSubtitle();
|
2014-12-22 23:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WiresharkDialog::captureFileClosing()
|
|
|
|
{
|
|
|
|
file_closed_ = true;
|
2014-12-29 22:12:43 +00:00
|
|
|
setWindowTitleFromSubtitle();
|
2014-12-22 23:51:36 +00:00
|
|
|
updateWidgets();
|
|
|
|
}
|
2014-12-29 16:11:01 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines
|
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|