From b318bc1eadaf09d9ddc66f2feaf2d5869e12d59a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 18 Jul 2015 15:50:34 +0300 Subject: [PATCH] Correct name in list of windows. --HG-- branch : feature --- src/app/tape/tmainwindow.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index ce2a88f56..b921e1c16 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -50,6 +50,8 @@ TMainWindow::TMainWindow(QWidget *parent) ui->tabWidget->setVisible(false); SetupMenu(); + + setWindowTitle(tr("untitled")); } //--------------------------------------------------------------------------------------------------------------------- @@ -213,7 +215,15 @@ void TMainWindow::AboutToShowWindowMenu() for (int i = 0; i < windows.count(); ++i) { TMainWindow *window = windows.at(i); - QAction *action = ui->menuWindow->addAction(window->windowTitle(), this, SLOT(ShowWindow())); + + QString title = window->windowTitle(); + const int index = title.lastIndexOf("[*]"); + if (index != -1) + { + title.replace(index, 3, "*"); + } + + QAction *action = ui->menuWindow->addAction(title, this, SLOT(ShowWindow())); action->setData(i); action->setCheckable(true); if (window == this)