aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/qt/main_window.cpp22
-rw-r--r--ui/qt/main_window.h1
-rw-r--r--ui/qt/main_window_slots.cpp3
3 files changed, 22 insertions, 4 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);
diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h
index 2ee55568cb..5ad595c2a4 100644
--- a/ui/qt/main_window.h
+++ b/ui/qt/main_window.h
@@ -124,6 +124,7 @@ private:
bool testCaptureFileClose(bool from_quit = false, QString& before_what = *new QString());
void captureStop();
+ void setTitlebarForCaptureFile();
void setMenusForCaptureFile(bool force_disable = false);
void setMenusForCaptureInProgress(bool capture_in_progress = false);
void setMenusForCaptureStopping();
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index 6d21c716f6..1c4e02bdec 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -313,12 +313,11 @@ void MainWindow::captureFileReadFinished(const capture_file *cf) {
// wsApp->setLastOpenDir(dir_path);
// g_free(dir_path);
// }
-// set_titlebar_for_capture_file(cf);
/* Update the appropriate parts of the main window. */
updateForUnsavedChanges();
-// /* Enable menu items that make sense if you have some captured packets. */
+ /* Enable menu items that make sense if you have some captured packets. */
setForCapturedPackets(true);
main_ui_->statusBar->popFileStatus();