diff options
-rw-r--r-- | ui/qt/main_window.cpp | 25 | ||||
-rw-r--r-- | ui/qt/main_window.h | 3 | ||||
-rw-r--r-- | ui/qt/main_window_slots.cpp | 2 | ||||
-rw-r--r-- | wireshark-qt.cpp | 2 |
4 files changed, 22 insertions, 10 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index 82ec00ef48..1d6adec42a 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -1843,7 +1843,7 @@ void MainWindow::setTitlebarForCaptureFile() // XXX - on non-Mac platforms, put in the application // name? // - setWindowTitle(QString("[*]%1").arg(cf_get_tempfile_source(capture_file_.capFile()))); + setWSWindowTitle(QString("[*]%1").arg(cf_get_tempfile_source(capture_file_.capFile()))); } else { // // For a user file, set the full path; that way, @@ -1863,9 +1863,9 @@ void MainWindow::setTitlebarForCaptureFile() QFileInfo fi(utf8_filename); if (utf8_filename == NULL) { // So what the heck else can we do here? - setWindowTitle(tr("(File name can't be mapped to UTF-8)")); + setWSWindowTitle(tr("(File name can't be mapped to UTF-8)")); } else { - setWindowTitle(fi.fileName()); + setWSWindowTitle(fi.fileName()); g_free(utf8_filename); } } @@ -1873,23 +1873,32 @@ void MainWindow::setTitlebarForCaptureFile() } else { /* We have no capture file. */ setWindowFilePath(NULL); - setDefaultWindowTitle(); + setWSWindowTitle(); } } -void MainWindow::setDefaultWindowTitle() +void MainWindow::setWSWindowTitle(QString title) { - setWindowTitle(tr("The Wireshark Network Analyzer")); + + if(title.isEmpty()) { + title = tr("The Wireshark Network Analyzer"); + } + + if((prefs.gui_window_title != NULL) && (*prefs.gui_window_title != '\0')) { + title.append(QString(" [%1]").arg(prefs.gui_window_title)); + } + + setWindowTitle(title); } void MainWindow::setTitlebarForCaptureInProgress() { setWindowFilePath(NULL); if (capture_file_.capFile()) { - setWindowTitle(tr("Capturing from %1").arg(cf_get_tempfile_source(capture_file_.capFile()))); + setWSWindowTitle(tr("Capturing from %1").arg(cf_get_tempfile_source(capture_file_.capFile()))); } else { /* We have no capture in progress. */ - setDefaultWindowTitle(); + setWSWindowTitle(); } } diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h index c2cdd090fb..6a2032e256 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -188,7 +188,6 @@ private: void initTimePrecisionFormatMenu(); void initFreezeActions(); - void setDefaultWindowTitle(); void setTitlebarForCaptureFile(); void setTitlebarForCaptureInProgress(); void setMenusForCaptureFile(bool force_disable = false); @@ -238,6 +237,8 @@ public slots: void updatePreferenceActions(); void updateRecentActions(); + void setWSWindowTitle(QString title = NULL); + void captureCapturePrepared(capture_session *); void captureCaptureUpdateStarted(capture_session *); void captureCaptureUpdateFinished(capture_session *); diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 29416f02f6..c396236eb2 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -765,7 +765,7 @@ void MainWindow::captureFileClosed() { main_ui_->statusBar->popFileStatus(); - setDefaultWindowTitle(); + setWSWindowTitle(); setWindowIcon(wsApp->normalIcon()); setMenusForSelectedPacket(); setMenusForSelectedTreeRow(); diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index cd63039447..c1382c967c 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -1331,6 +1331,8 @@ int main(int argc, char *argv[]) wsApp->setMonospaceFont(prefs.gui_qt_font_name); + /* For update of WindowTitle (When use gui.window_title preference) */ + main_w->setWSWindowTitle(); //////// /* Read the dynamic part of the recent file, as we have the gui now ready for |