Block some dialogs if others open
This commit is contained in:
@@ -2268,6 +2268,10 @@ void MainWindow::toggleDockManager()
|
||||
// }
|
||||
// }
|
||||
|
||||
#ifdef ENABLE_KDE_SUPPORT
|
||||
#define DIALOG_ERROR KMessageBox::error(this, i18n("Action is not currently possible, due to other open dialogs.")); return
|
||||
#endif
|
||||
|
||||
#ifdef TAGLIB_FOUND
|
||||
void MainWindow::editTags()
|
||||
{
|
||||
@@ -2275,6 +2279,16 @@ void MainWindow::editTags()
|
||||
return;
|
||||
}
|
||||
|
||||
if (0!=ActionDialog::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DEVICES_SUPPORT
|
||||
if (0!=TrackOrganiser::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
QList<Song> songs;
|
||||
if (libraryPage->isVisible()) {
|
||||
songs=libraryPage->selectedSongs();
|
||||
@@ -2322,6 +2336,16 @@ void MainWindow::organiseFiles()
|
||||
return;
|
||||
}
|
||||
|
||||
if (0!=TagEditor::instanceCount() || 0!=ActionDialog::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_REPLAYGAIN_SUPPORT
|
||||
if (0!=RgDialog::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
QList<Song> songs;
|
||||
if (libraryPage->isVisible()) {
|
||||
songs=libraryPage->selectedSongs();
|
||||
@@ -2380,6 +2404,21 @@ void MainWindow::copyToDevice(const QString &from, const QString &to, const QLis
|
||||
return;
|
||||
}
|
||||
|
||||
if (0!=TagEditor::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DEVICES_SUPPORT
|
||||
if (0!=TrackOrganiser::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
#endif
|
||||
#ifdef ENABLE_REPLAYGAIN_SUPPORT
|
||||
if (0!=RgDialog::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
ActionDialog *dlg=new ActionDialog(this);
|
||||
dlg->copy(from, to, songs);
|
||||
}
|
||||
@@ -2390,6 +2429,21 @@ void MainWindow::deleteSongs(const QString &from, const QList<Song> &songs)
|
||||
return;
|
||||
}
|
||||
|
||||
if (0!=TagEditor::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DEVICES_SUPPORT
|
||||
if (0!=TrackOrganiser::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
#endif
|
||||
#ifdef ENABLE_REPLAYGAIN_SUPPORT
|
||||
if (0!=RgDialog::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
ActionDialog *dlg=new ActionDialog(this);
|
||||
dlg->remove(from, songs);
|
||||
}
|
||||
@@ -2402,6 +2456,16 @@ void MainWindow::replayGain()
|
||||
return;
|
||||
}
|
||||
|
||||
if (0!=ActionDialog::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DEVICES_SUPPORT
|
||||
if (0!=TrackOrganiser::instanceCount()) {
|
||||
DIALOG_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
QList<Song> songs;
|
||||
if (libraryPage->isVisible()) {
|
||||
songs=libraryPage->selectedSongs();
|
||||
|
||||
Reference in New Issue
Block a user