diff --git a/CMakeLists.txt b/CMakeLists.txt index 487d9f1..badaa1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,7 +175,8 @@ set(REQUIRED_ICONS system-file-manager document-save view-media-lyrics - image-resize-symbolic) + image-resize-symbolic + window-new) # find c++utilities set(CONFIGURATION_PACKAGE_SUFFIX diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 8273650..5222530 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -114,6 +114,7 @@ MainWindow::MainWindow(QWidget *parent) // connect signals and slots, install event filter // menu: application + connect(m_ui->actionNew_window, &QAction::triggered, this, &MainWindow::showNewWindow); connect(m_ui->actionSettings, &QAction::triggered, this, &MainWindow::showSettingsDlg); connect(m_ui->actionOpen_MusicBrainz_search, &QAction::triggered, this, &MainWindow::toggleDbQueryWidget); connect(m_ui->lockLayout, &QAction::triggered, this, &MainWindow::toggleLayoutLocked); @@ -378,6 +379,17 @@ void MainWindow::showAboutDlg() } } + +/*! + * \brief MainWindow::showNewWindow + */ +void MainWindow::showNewWindow() +{ + auto *const newWindow = new MainWindow; + newWindow->setAttribute(Qt::WA_DeleteOnClose); + newWindow->show(); +} + /*! * \brief Shows the settings dialog (modal). */ diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 2ff7da8..b36878e 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -69,6 +69,7 @@ private Q_SLOTS: void handleCurrentPathChanged(const QString &newPath); // settings + void showNewWindow(); void showSettingsDlg(); void applySettingsFromDialog(); diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index 84e8b67..3a8e6e8 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -46,7 +46,7 @@ 0 0 1225 - 26 + 30 @@ -82,6 +82,7 @@ A&pplication + @@ -363,6 +364,14 @@ &Lock layout + + + + + + New window + +