New menu item "New window".

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-08-01 16:14:10 +03:00
parent 9acd880dd6
commit 4b62d4a20b
2 changed files with 12 additions and 0 deletions

View File

@ -377,6 +377,9 @@ void TMainWindow::FileSaveAs()
void TMainWindow::AboutToShowWindowMenu() void TMainWindow::AboutToShowWindowMenu()
{ {
ui->menuWindow->clear(); ui->menuWindow->clear();
ui->menuWindow->addAction(tr("&New Window"), this, SLOT(NewWindow()));
ui->menuWindow->addSeparator();
QList<TMainWindow*> windows = qApp->MainWindows(); QList<TMainWindow*> windows = qApp->MainWindows();
for (int i = 0; i < windows.count(); ++i) for (int i = 0; i < windows.count(); ++i)
{ {
@ -1100,6 +1103,13 @@ void TMainWindow::SaveMFullName()
ui->tableWidget->blockSignals(false); ui->tableWidget->blockSignals(false);
} }
//---------------------------------------------------------------------------------------------------------------------
void TMainWindow::NewWindow()
{
qApp->NewMainWindow();
qApp->MainWindow()->activateWindow();
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void TMainWindow::SetupMenu() void TMainWindow::SetupMenu()
{ {

View File

@ -102,6 +102,8 @@ private slots:
void SaveMDescription(); void SaveMDescription();
void SaveMFullName(); void SaveMFullName();
void NewWindow();
private: private:
Q_DISABLE_COPY(TMainWindow) Q_DISABLE_COPY(TMainWindow)
Ui::TMainWindow *ui; Ui::TMainWindow *ui;