aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/main_window.cpp
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-03-31 22:59:56 +0000
committerGuy Harris <guy@alum.mit.edu>2013-03-31 22:59:56 +0000
commit6c5c65b4867eb3c595581c40f696bc48170fe670 (patch)
tree82a3bb03fe1d971b197bebfb742beb2cd81941fa /ui/qt/main_window.cpp
parent2328de7bf87cef40e90a93e7b291cb04b6e5bf32 (diff)
Add a setTitlebarForCaptureFile() and have it set the titlebar and the
"modified" indicator. For some reason, it's not getting called in all the right places. svn path=/trunk/; revision=48682
Diffstat (limited to 'ui/qt/main_window.cpp')
-rw-r--r--ui/qt/main_window.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index f1b765bccb..24a1887fd5 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -83,6 +83,7 @@ MainWindow::MainWindow(QWidget *parent) :
{
gbl_cur_main_window = this;
main_ui_->setupUi(this);
+ setTitlebarForCaptureFile();
setMenusForCaptureFile();
setForCapturedPackets(false);
setMenusForSelectedPacket();
@@ -1113,6 +1114,24 @@ void MainWindow::captureStop() {
}
}
+// Titlebar
+void MainWindow::setTitlebarForCaptureFile()
+{
+ gchar *display_name;
+
+ if (cap_file_ && cap_file_->filename) {
+ display_name = cf_get_display_name(cap_file_);
+ setWindowModified(cap_file_->unsaved_changes);
+ // Clear the window title so that setWindowFilePath does something
+ setWindowTitle(NULL);
+ setWindowFilePath(display_name);
+ g_free(display_name);
+ } else {
+ /* We have no capture file. */
+ setWindowTitle("The Wireshark Network Analyzer");
+ }
+}
+
// Menu state
/* Enable or disable menu items based on whether you have a capture file
@@ -1259,8 +1278,7 @@ void MainWindow::setMenusForFileSet(bool enable_list_files) {
}
void MainWindow::updateForUnsavedChanges() {
-// set_titlebar_for_capture_file(cf);
-// this->setWindowModified(cf->unsaved_changes);
+ setTitlebarForCaptureFile();
setMenusForCaptureFile();
// set_toolbar_for_capture_file(cf);