Allow opening another window

This commit is contained in:
Martchus 2020-11-25 18:14:40 +01:00
parent fcf07aa46f
commit 0a4cbe42aa
4 changed files with 25 additions and 2 deletions

View File

@ -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

View File

@ -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).
*/

View File

@ -69,6 +69,7 @@ private Q_SLOTS:
void handleCurrentPathChanged(const QString &newPath);
// settings
void showNewWindow();
void showSettingsDlg();
void applySettingsFromDialog();

View File

@ -46,7 +46,7 @@
<x>0</x>
<y>0</y>
<width>1225</width>
<height>26</height>
<height>30</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -82,6 +82,7 @@
<property name="title">
<string>A&amp;pplication</string>
</property>
<addaction name="actionNew_window"/>
<addaction name="actionSettings"/>
<addaction name="actionOpen_MusicBrainz_search"/>
<addaction name="lockLayout"/>
@ -363,6 +364,14 @@
<string>&amp;Lock layout</string>
</property>
</action>
<action name="actionNew_window">
<property name="icon">
<iconset theme="window-new"/>
</property>
<property name="text">
<string>New window</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>