Don't compile devices on windows
This commit is contained in:
parent
246f82bfad
commit
97ec12b5b3
|
@ -248,16 +248,6 @@ set(SOURCES
|
||||||
globalshortcuts/qxtglobalshortcutbackend.cpp
|
globalshortcuts/qxtglobalshortcutbackend.cpp
|
||||||
globalshortcuts/globalshortcutgrabber.cpp
|
globalshortcuts/globalshortcutgrabber.cpp
|
||||||
|
|
||||||
device/connecteddevice.cpp
|
|
||||||
device/devicedatabasebackend.cpp
|
|
||||||
device/devicelister.cpp
|
|
||||||
device/devicemanager.cpp
|
|
||||||
device/deviceproperties.cpp
|
|
||||||
device/devicestatefiltermodel.cpp
|
|
||||||
device/deviceview.cpp
|
|
||||||
device/deviceviewcontainer.cpp
|
|
||||||
device/filesystemdevice.cpp
|
|
||||||
|
|
||||||
internet/internetmodel.cpp
|
internet/internetmodel.cpp
|
||||||
internet/internetservice.cpp
|
internet/internetservice.cpp
|
||||||
internet/internetplaylistitem.cpp
|
internet/internetplaylistitem.cpp
|
||||||
|
@ -422,16 +412,6 @@ set(HEADERS
|
||||||
globalshortcuts/gnomeglobalshortcutbackend.h
|
globalshortcuts/gnomeglobalshortcutbackend.h
|
||||||
globalshortcuts/globalshortcutgrabber.h
|
globalshortcuts/globalshortcutgrabber.h
|
||||||
|
|
||||||
device/connecteddevice.h
|
|
||||||
device/devicedatabasebackend.h
|
|
||||||
device/devicelister.h
|
|
||||||
device/devicemanager.h
|
|
||||||
device/deviceproperties.h
|
|
||||||
device/devicestatefiltermodel.h
|
|
||||||
device/deviceviewcontainer.h
|
|
||||||
device/deviceview.h
|
|
||||||
device/filesystemdevice.h
|
|
||||||
|
|
||||||
internet/internetmodel.h
|
internet/internetmodel.h
|
||||||
internet/internetservice.h
|
internet/internetservice.h
|
||||||
internet/internetmimedata.h
|
internet/internetmimedata.h
|
||||||
|
@ -500,9 +480,6 @@ set(UI
|
||||||
widgets/fileview.ui
|
widgets/fileview.ui
|
||||||
widgets/loginstatewidget.ui
|
widgets/loginstatewidget.ui
|
||||||
|
|
||||||
device/deviceproperties.ui
|
|
||||||
device/deviceviewcontainer.ui
|
|
||||||
|
|
||||||
globalshortcuts/globalshortcutgrabber.ui
|
globalshortcuts/globalshortcutgrabber.ui
|
||||||
|
|
||||||
tidal/tidalsearchview.ui
|
tidal/tidalsearchview.ui
|
||||||
|
@ -679,6 +656,32 @@ optional_source(HAVE_DBUS
|
||||||
core/mpris2.h
|
core/mpris2.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
optional_source(UNIX
|
||||||
|
SOURCES
|
||||||
|
device/connecteddevice.cpp
|
||||||
|
device/devicedatabasebackend.cpp
|
||||||
|
device/devicelister.cpp
|
||||||
|
device/devicemanager.cpp
|
||||||
|
device/devicestatefiltermodel.cpp
|
||||||
|
device/filesystemdevice.cpp
|
||||||
|
device/deviceviewcontainer.cpp
|
||||||
|
device/deviceview.cpp
|
||||||
|
device/deviceproperties.cpp
|
||||||
|
HEADERS
|
||||||
|
device/connecteddevice.h
|
||||||
|
device/devicedatabasebackend.h
|
||||||
|
device/devicelister.h
|
||||||
|
device/devicemanager.h
|
||||||
|
device/devicestatefiltermodel.h
|
||||||
|
device/filesystemdevice.h
|
||||||
|
device/deviceviewcontainer.h
|
||||||
|
device/deviceview.h
|
||||||
|
device/deviceproperties.h
|
||||||
|
UI
|
||||||
|
device/deviceproperties.ui
|
||||||
|
device/deviceviewcontainer.ui
|
||||||
|
)
|
||||||
|
|
||||||
if(HAVE_DBUS)
|
if(HAVE_DBUS)
|
||||||
optional_source(HAVE_DEVICEKIT
|
optional_source(HAVE_DEVICEKIT
|
||||||
SOURCES device/devicekitlister.cpp
|
SOURCES device/devicekitlister.cpp
|
||||||
|
|
|
@ -68,8 +68,10 @@
|
||||||
#include "collectionitem.h"
|
#include "collectionitem.h"
|
||||||
#include "collectionmodel.h"
|
#include "collectionmodel.h"
|
||||||
#include "collectionview.h"
|
#include "collectionview.h"
|
||||||
#include "device/devicemanager.h"
|
#ifndef Q_OS_WIN
|
||||||
#include "device/devicestatefiltermodel.h"
|
# include "device/devicemanager.h"
|
||||||
|
# include "device/devicestatefiltermodel.h"
|
||||||
|
#endif
|
||||||
#include "dialogs/edittagdialog.h"
|
#include "dialogs/edittagdialog.h"
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
#include "dialogs/organisedialog.h"
|
#include "dialogs/organisedialog.h"
|
||||||
|
@ -460,7 +462,9 @@ void CollectionView::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
organise_ = context_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organise files..."), this, SLOT(Organise()));
|
organise_ = context_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organise files..."), this, SLOT(Organise()));
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
copy_to_device_ = context_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, SLOT(CopyToDevice()));
|
copy_to_device_ = context_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, SLOT(CopyToDevice()));
|
||||||
|
#endif
|
||||||
//delete_ = context_menu_->addAction(IconLoader::Load("edit-delete"), tr("Delete from disk..."), this, SLOT(Delete()));
|
//delete_ = context_menu_->addAction(IconLoader::Load("edit-delete"), tr("Delete from disk..."), this, SLOT(Delete()));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -477,7 +481,7 @@ void CollectionView::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
|
|
||||||
context_menu_->addMenu(filter_->menu());
|
context_menu_->addMenu(filter_->menu());
|
||||||
|
|
||||||
#ifdef HAVE_GSTREAMER
|
#if defined(HAVE_GSTREAMER) && !defined(Q_OS_WIN)
|
||||||
copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
||||||
connect(app_->device_manager()->connected_devices_model(), SIGNAL(IsEmptyChanged(bool)), copy_to_device_, SLOT(setDisabled(bool)));
|
connect(app_->device_manager()->connected_devices_model(), SIGNAL(IsEmptyChanged(bool)), copy_to_device_, SLOT(setDisabled(bool)));
|
||||||
#endif
|
#endif
|
||||||
|
@ -518,7 +522,9 @@ void CollectionView::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
// only when no smart playlists selected
|
// only when no smart playlists selected
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
organise_->setVisible(regular_elements_only);
|
organise_->setVisible(regular_elements_only);
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
copy_to_device_->setVisible(regular_elements_only);
|
copy_to_device_->setVisible(regular_elements_only);
|
||||||
|
#endif
|
||||||
//delete_->setVisible(regular_elements_only);
|
//delete_->setVisible(regular_elements_only);
|
||||||
#endif
|
#endif
|
||||||
show_in_various_->setVisible(regular_elements_only);
|
show_in_various_->setVisible(regular_elements_only);
|
||||||
|
@ -527,7 +533,9 @@ void CollectionView::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
// only when all selected items are editable
|
// only when all selected items are editable
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
organise_->setEnabled(regular_elements == regular_editable);
|
organise_->setEnabled(regular_elements == regular_editable);
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
copy_to_device_->setEnabled(regular_elements == regular_editable);
|
copy_to_device_->setEnabled(regular_elements == regular_editable);
|
||||||
|
#endif
|
||||||
//delete_->setEnabled(regular_elements == regular_editable);
|
//delete_->setEnabled(regular_elements == regular_editable);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -670,7 +678,7 @@ void CollectionView::EditTracks() {
|
||||||
|
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
void CollectionView::CopyToDevice() {
|
void CollectionView::CopyToDevice() {
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
if (!organise_dialog_)
|
if (!organise_dialog_)
|
||||||
organise_dialog_.reset(new OrganiseDialog(app_->task_manager()));
|
organise_dialog_.reset(new OrganiseDialog(app_->task_manager()));
|
||||||
|
|
||||||
|
@ -678,7 +686,7 @@ void CollectionView::CopyToDevice() {
|
||||||
organise_dialog_->SetCopy(true);
|
organise_dialog_->SetCopy(true);
|
||||||
organise_dialog_->SetSongs(GetSelectedSongs());
|
organise_dialog_->SetSongs(GetSelectedSongs());
|
||||||
organise_dialog_->show();
|
organise_dialog_->show();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,9 @@ signals:
|
||||||
QAction *open_in_new_playlist_;
|
QAction *open_in_new_playlist_;
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
QAction *organise_;
|
QAction *organise_;
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
QAction *copy_to_device_;
|
QAction *copy_to_device_;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
QAction *delete_;
|
QAction *delete_;
|
||||||
QAction *edit_track_;
|
QAction *edit_track_;
|
||||||
|
|
|
@ -66,9 +66,12 @@
|
||||||
#include "core/utilities.h"
|
#include "core/utilities.h"
|
||||||
#include "collection/collectionbackend.h"
|
#include "collection/collectionbackend.h"
|
||||||
#include "collection/collectiondirectorymodel.h"
|
#include "collection/collectiondirectorymodel.h"
|
||||||
|
#include "collection/collectionmodel.h"
|
||||||
#include "collection/collectionitem.h"
|
#include "collection/collectionitem.h"
|
||||||
#include "device/devicemanager.h"
|
#ifndef Q_OS_WIN
|
||||||
#include "device/devicestatefiltermodel.h"
|
# include "device/devicemanager.h"
|
||||||
|
# include "device/devicestatefiltermodel.h"
|
||||||
|
#endif
|
||||||
#include "dialogs/edittagdialog.h"
|
#include "dialogs/edittagdialog.h"
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
#include "dialogs/organisedialog.h"
|
#include "dialogs/organisedialog.h"
|
||||||
|
@ -264,9 +267,6 @@ void ContextAlbumsView::SaveFocus() {
|
||||||
|
|
||||||
void ContextAlbumsView::SaveContainerPath(const QModelIndex &child) {
|
void ContextAlbumsView::SaveContainerPath(const QModelIndex &child) {
|
||||||
|
|
||||||
|
|
||||||
// return;
|
|
||||||
|
|
||||||
QModelIndex current = model()->parent(child);
|
QModelIndex current = model()->parent(child);
|
||||||
QVariant type = model()->data(current, ContextAlbumsModel::Role_Type);
|
QVariant type = model()->data(current, ContextAlbumsModel::Role_Type);
|
||||||
if (!type.isValid() || !(type.toInt() == CollectionItem::Type_Container || type.toInt() == CollectionItem::Type_Divider)) {
|
if (!type.isValid() || !(type.toInt() == CollectionItem::Type_Container || type.toInt() == CollectionItem::Type_Divider)) {
|
||||||
|
@ -359,7 +359,6 @@ void ContextAlbumsView::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
|
|
||||||
if (!context_menu_) {
|
if (!context_menu_) {
|
||||||
context_menu_ = new QMenu(this);
|
context_menu_ = new QMenu(this);
|
||||||
//context_menu_->setStyleSheet("background-color: #3DADE8;");
|
|
||||||
|
|
||||||
add_to_playlist_ = context_menu_->addAction(IconLoader::Load("media-play"), tr("Append to current playlist"), this, SLOT(AddToPlaylist()));
|
add_to_playlist_ = context_menu_->addAction(IconLoader::Load("media-play"), tr("Append to current playlist"), this, SLOT(AddToPlaylist()));
|
||||||
load_ = context_menu_->addAction(IconLoader::Load("media-play"), tr("Replace current playlist"), this, SLOT(Load()));
|
load_ = context_menu_->addAction(IconLoader::Load("media-play"), tr("Replace current playlist"), this, SLOT(Load()));
|
||||||
|
@ -371,7 +370,9 @@ void ContextAlbumsView::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
organise_ = context_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organise files..."), this, SLOT(Organise()));
|
organise_ = context_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organise files..."), this, SLOT(Organise()));
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
copy_to_device_ = context_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, SLOT(CopyToDevice()));
|
copy_to_device_ = context_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, SLOT(CopyToDevice()));
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
|
@ -381,7 +382,7 @@ void ContextAlbumsView::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
|
|
||||||
#ifdef HAVE_GSTREAMER
|
#if defined(HAVE_GSTREAMER) && !defined(Q_OS_WIN)
|
||||||
copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
||||||
connect(app_->device_manager()->connected_devices_model(), SIGNAL(IsEmptyChanged(bool)), copy_to_device_, SLOT(setDisabled(bool)));
|
connect(app_->device_manager()->connected_devices_model(), SIGNAL(IsEmptyChanged(bool)), copy_to_device_, SLOT(setDisabled(bool)));
|
||||||
#endif
|
#endif
|
||||||
|
@ -418,13 +419,17 @@ void ContextAlbumsView::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
|
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
organise_->setVisible(regular_elements_only);
|
organise_->setVisible(regular_elements_only);
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
copy_to_device_->setVisible(regular_elements_only);
|
copy_to_device_->setVisible(regular_elements_only);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// only when all selected items are editable
|
// only when all selected items are editable
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
organise_->setEnabled(regular_elements == regular_editable);
|
organise_->setEnabled(regular_elements == regular_editable);
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
copy_to_device_->setEnabled(regular_elements == regular_editable);
|
copy_to_device_->setEnabled(regular_elements == regular_editable);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
context_menu_->popup(e->globalPos());
|
context_menu_->popup(e->globalPos());
|
||||||
|
@ -509,7 +514,7 @@ void ContextAlbumsView::EditTracks() {
|
||||||
|
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
void ContextAlbumsView::CopyToDevice() {
|
void ContextAlbumsView::CopyToDevice() {
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
if (!organise_dialog_)
|
if (!organise_dialog_)
|
||||||
organise_dialog_.reset(new OrganiseDialog(app_->task_manager()));
|
organise_dialog_.reset(new OrganiseDialog(app_->task_manager()));
|
||||||
|
|
||||||
|
@ -517,7 +522,7 @@ void ContextAlbumsView::CopyToDevice() {
|
||||||
organise_dialog_->SetCopy(true);
|
organise_dialog_->SetCopy(true);
|
||||||
organise_dialog_->SetSongs(GetSelectedSongs());
|
organise_dialog_->SetSongs(GetSelectedSongs());
|
||||||
organise_dialog_->show();
|
organise_dialog_->show();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,9 @@ signals:
|
||||||
void OpenInNewPlaylist();
|
void OpenInNewPlaylist();
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
void Organise();
|
void Organise();
|
||||||
|
//#ifndef Q_OS_WIN
|
||||||
void CopyToDevice();
|
void CopyToDevice();
|
||||||
|
//#endif
|
||||||
#endif
|
#endif
|
||||||
void EditTracks();
|
void EditTracks();
|
||||||
void ShowInBrowser();
|
void ShowInBrowser();
|
||||||
|
@ -124,7 +126,9 @@ signals:
|
||||||
QAction *open_in_new_playlist_;
|
QAction *open_in_new_playlist_;
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
QAction *organise_;
|
QAction *organise_;
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
QAction *copy_to_device_;
|
QAction *copy_to_device_;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
QAction *delete_;
|
QAction *delete_;
|
||||||
QAction *edit_track_;
|
QAction *edit_track_;
|
||||||
|
|
|
@ -38,7 +38,9 @@
|
||||||
#include "appearance.h"
|
#include "appearance.h"
|
||||||
|
|
||||||
#include "engine/enginedevice.h"
|
#include "engine/enginedevice.h"
|
||||||
#include "device/devicemanager.h"
|
#ifndef Q_OS_WIN
|
||||||
|
# include "device/devicemanager.h"
|
||||||
|
#endif
|
||||||
#include "collection/collection.h"
|
#include "collection/collection.h"
|
||||||
#include "playlist/playlistbackend.h"
|
#include "playlist/playlistbackend.h"
|
||||||
#include "playlist/playlistmanager.h"
|
#include "playlist/playlistmanager.h"
|
||||||
|
@ -48,7 +50,6 @@
|
||||||
#ifdef HAVE_LIBLASTFM
|
#ifdef HAVE_LIBLASTFM
|
||||||
#include "covermanager/lastfmcoverprovider.h"
|
#include "covermanager/lastfmcoverprovider.h"
|
||||||
#endif
|
#endif
|
||||||
//#include "covermanager/amazoncoverprovider.h"
|
|
||||||
#include "covermanager/discogscoverprovider.h"
|
#include "covermanager/discogscoverprovider.h"
|
||||||
#include "covermanager/musicbrainzcoverprovider.h"
|
#include "covermanager/musicbrainzcoverprovider.h"
|
||||||
|
|
||||||
|
@ -81,7 +82,9 @@ class ApplicationImpl {
|
||||||
task_manager_([=]() { return new TaskManager(app); }),
|
task_manager_([=]() { return new TaskManager(app); }),
|
||||||
player_([=]() { return new Player(app, app); }),
|
player_([=]() { return new Player(app, app); }),
|
||||||
enginedevice_([=]() { return new EngineDevice(app); }),
|
enginedevice_([=]() { return new EngineDevice(app); }),
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
device_manager_([=]() { return new DeviceManager(app, app); }),
|
device_manager_([=]() { return new DeviceManager(app, app); }),
|
||||||
|
#endif
|
||||||
collection_([=]() { return new SCollection(app, app); }),
|
collection_([=]() { return new SCollection(app, app); }),
|
||||||
playlist_backend_([=]() {
|
playlist_backend_([=]() {
|
||||||
PlaylistBackend *backend = new PlaylistBackend(app, app);
|
PlaylistBackend *backend = new PlaylistBackend(app, app);
|
||||||
|
@ -95,7 +98,6 @@ class ApplicationImpl {
|
||||||
#ifdef HAVE_LIBLASTFM
|
#ifdef HAVE_LIBLASTFM
|
||||||
cover_providers->AddProvider(new LastFmCoverProvider(app));
|
cover_providers->AddProvider(new LastFmCoverProvider(app));
|
||||||
#endif
|
#endif
|
||||||
//cover_providers->AddProvider(new AmazonCoverProvider(app));
|
|
||||||
cover_providers->AddProvider(new DiscogsCoverProvider(app));
|
cover_providers->AddProvider(new DiscogsCoverProvider(app));
|
||||||
cover_providers->AddProvider(new MusicbrainzCoverProvider(app));
|
cover_providers->AddProvider(new MusicbrainzCoverProvider(app));
|
||||||
return cover_providers;
|
return cover_providers;
|
||||||
|
@ -122,7 +124,9 @@ class ApplicationImpl {
|
||||||
Lazy<TaskManager> task_manager_;
|
Lazy<TaskManager> task_manager_;
|
||||||
Lazy<Player> player_;
|
Lazy<Player> player_;
|
||||||
Lazy<EngineDevice> enginedevice_;
|
Lazy<EngineDevice> enginedevice_;
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
Lazy<DeviceManager> device_manager_;
|
Lazy<DeviceManager> device_manager_;
|
||||||
|
#endif
|
||||||
Lazy<SCollection> collection_;
|
Lazy<SCollection> collection_;
|
||||||
Lazy<PlaylistBackend> playlist_backend_;
|
Lazy<PlaylistBackend> playlist_backend_;
|
||||||
Lazy<PlaylistManager> playlist_manager_;
|
Lazy<PlaylistManager> playlist_manager_;
|
||||||
|
@ -148,7 +152,9 @@ Application::~Application() {
|
||||||
|
|
||||||
// It's important that the device manager is deleted before the database.
|
// It's important that the device manager is deleted before the database.
|
||||||
// Deleting the database deletes all objects that have been created in its thread, including some device collection backends.
|
// Deleting the database deletes all objects that have been created in its thread, including some device collection backends.
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
p_->device_manager_.reset();
|
p_->device_manager_.reset();
|
||||||
|
#endif
|
||||||
|
|
||||||
for (QThread *thread : threads_) {
|
for (QThread *thread : threads_) {
|
||||||
thread->quit();
|
thread->quit();
|
||||||
|
@ -198,9 +204,11 @@ CurrentArtLoader *Application::current_art_loader() const {
|
||||||
|
|
||||||
Database *Application::database() const { return p_->database_.get(); }
|
Database *Application::database() const { return p_->database_.get(); }
|
||||||
|
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
DeviceManager *Application::device_manager() const {
|
DeviceManager *Application::device_manager() const {
|
||||||
return p_->device_manager_.get();
|
return p_->device_manager_.get();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
SCollection *Application::collection() const { return p_->collection_.get(); }
|
SCollection *Application::collection() const { return p_->collection_.get(); }
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,9 @@ class CollectionBackend;
|
||||||
class CollectionModel;
|
class CollectionModel;
|
||||||
class PlaylistBackend;
|
class PlaylistBackend;
|
||||||
class PlaylistManager;
|
class PlaylistManager;
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
class DeviceManager;
|
class DeviceManager;
|
||||||
|
#endif
|
||||||
class CoverProviders;
|
class CoverProviders;
|
||||||
class AlbumCoverLoader;
|
class AlbumCoverLoader;
|
||||||
class CurrentArtLoader;
|
class CurrentArtLoader;
|
||||||
|
@ -68,7 +70,9 @@ class Application : public QObject {
|
||||||
TaskManager *task_manager() const;
|
TaskManager *task_manager() const;
|
||||||
Player *player() const;
|
Player *player() const;
|
||||||
EngineDevice *enginedevice() const;
|
EngineDevice *enginedevice() const;
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
DeviceManager *device_manager() const;
|
DeviceManager *device_manager() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
SCollection *collection() const;
|
SCollection *collection() const;
|
||||||
|
|
||||||
|
|
|
@ -121,10 +121,12 @@
|
||||||
#include "covermanager/albumcoverchoicecontroller.h"
|
#include "covermanager/albumcoverchoicecontroller.h"
|
||||||
#include "covermanager/albumcoverloader.h"
|
#include "covermanager/albumcoverloader.h"
|
||||||
#include "covermanager/currentartloader.h"
|
#include "covermanager/currentartloader.h"
|
||||||
#include "device/devicemanager.h"
|
#ifndef Q_OS_WIN
|
||||||
#include "device/devicestatefiltermodel.h"
|
# include "device/devicemanager.h"
|
||||||
#include "device/deviceview.h"
|
# include "device/devicestatefiltermodel.h"
|
||||||
#include "device/deviceviewcontainer.h"
|
# include "device/deviceview.h"
|
||||||
|
# include "device/deviceviewcontainer.h"
|
||||||
|
#endif
|
||||||
#include "transcoder/transcodedialog.h"
|
#include "transcoder/transcodedialog.h"
|
||||||
#include "settings/behavioursettingspage.h"
|
#include "settings/behavioursettingspage.h"
|
||||||
#include "settings/playbacksettingspage.h"
|
#include "settings/playbacksettingspage.h"
|
||||||
|
@ -167,8 +169,10 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
|
||||||
context_view_(new ContextView(this)),
|
context_view_(new ContextView(this)),
|
||||||
collection_view_(new CollectionViewContainer(this)),
|
collection_view_(new CollectionViewContainer(this)),
|
||||||
file_view_(new FileView(this)),
|
file_view_(new FileView(this)),
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
device_view_container_(new DeviceViewContainer(this)),
|
device_view_container_(new DeviceViewContainer(this)),
|
||||||
device_view_(device_view_container_->view()),
|
device_view_(device_view_container_->view()),
|
||||||
|
#endif
|
||||||
playlist_list_(new PlaylistListContainer(this)),
|
playlist_list_(new PlaylistListContainer(this)),
|
||||||
settings_dialog_(std::bind(&MainWindow::CreateSettingsDialog, this)),
|
settings_dialog_(std::bind(&MainWindow::CreateSettingsDialog, this)),
|
||||||
cover_manager_([=]() {
|
cover_manager_([=]() {
|
||||||
|
@ -246,7 +250,9 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
|
||||||
ui_->tabs->addTab(collection_view_, IconLoader::Load("vinyl"), tr("Collection"));
|
ui_->tabs->addTab(collection_view_, IconLoader::Load("vinyl"), tr("Collection"));
|
||||||
ui_->tabs->addTab(file_view_, IconLoader::Load("document-open"), tr("Files"));
|
ui_->tabs->addTab(file_view_, IconLoader::Load("document-open"), tr("Files"));
|
||||||
ui_->tabs->addTab(playlist_list_, IconLoader::Load("view-media-playlist"), tr("Playlists"));
|
ui_->tabs->addTab(playlist_list_, IconLoader::Load("view-media-playlist"), tr("Playlists"));
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
ui_->tabs->addTab(device_view_, IconLoader::Load("device"), tr("Devices"));
|
ui_->tabs->addTab(device_view_, IconLoader::Load("device"), tr("Devices"));
|
||||||
|
#endif
|
||||||
ui_->tabs->addTab(tidal_search_view_, IconLoader::Load("tidal"), tr("Tidal", "Tidal"));
|
ui_->tabs->addTab(tidal_search_view_, IconLoader::Load("tidal"), tr("Tidal", "Tidal"));
|
||||||
//ui_->tabs->AddSpacer();
|
//ui_->tabs->AddSpacer();
|
||||||
|
|
||||||
|
@ -284,7 +290,9 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
|
||||||
|
|
||||||
collection_view_->view()->setModel(collection_sort_model_);
|
collection_view_->view()->setModel(collection_sort_model_);
|
||||||
collection_view_->view()->SetApplication(app_);
|
collection_view_->view()->SetApplication(app_);
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
device_view_->SetApplication(app_);
|
device_view_->SetApplication(app_);
|
||||||
|
#endif
|
||||||
playlist_list_->SetApplication(app_);
|
playlist_list_->SetApplication(app_);
|
||||||
|
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
|
@ -344,7 +352,9 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
|
||||||
connect(file_view_, SIGNAL(CopyToCollection(QList<QUrl>)), SLOT(CopyFilesToCollection(QList<QUrl>)));
|
connect(file_view_, SIGNAL(CopyToCollection(QList<QUrl>)), SLOT(CopyFilesToCollection(QList<QUrl>)));
|
||||||
connect(file_view_, SIGNAL(MoveToCollection(QList<QUrl>)), SLOT(MoveFilesToCollection(QList<QUrl>)));
|
connect(file_view_, SIGNAL(MoveToCollection(QList<QUrl>)), SLOT(MoveFilesToCollection(QList<QUrl>)));
|
||||||
connect(file_view_, SIGNAL(EditTags(QList<QUrl>)), SLOT(EditFileTags(QList<QUrl>)));
|
connect(file_view_, SIGNAL(EditTags(QList<QUrl>)), SLOT(EditFileTags(QList<QUrl>)));
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
connect(file_view_, SIGNAL(CopyToDevice(QList<QUrl>)), SLOT(CopyFilesToDevice(QList<QUrl>)));
|
connect(file_view_, SIGNAL(CopyToDevice(QList<QUrl>)), SLOT(CopyFilesToDevice(QList<QUrl>)));
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
file_view_->SetTaskManager(app_->task_manager());
|
file_view_->SetTaskManager(app_->task_manager());
|
||||||
|
|
||||||
|
@ -469,8 +479,10 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
|
||||||
connect(app_->task_manager(), SIGNAL(PauseCollectionWatchers()), app_->collection(), SLOT(PauseWatcher()));
|
connect(app_->task_manager(), SIGNAL(PauseCollectionWatchers()), app_->collection(), SLOT(PauseWatcher()));
|
||||||
connect(app_->task_manager(), SIGNAL(ResumeCollectionWatchers()), app_->collection(), SLOT(ResumeWatcher()));
|
connect(app_->task_manager(), SIGNAL(ResumeCollectionWatchers()), app_->collection(), SLOT(ResumeWatcher()));
|
||||||
|
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
// Devices connections
|
// Devices connections
|
||||||
connect(device_view_, SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
connect(device_view_, SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
||||||
|
#endif
|
||||||
|
|
||||||
// Collection filter widget
|
// Collection filter widget
|
||||||
QActionGroup *collection_view_group = new QActionGroup(this);
|
QActionGroup *collection_view_group = new QActionGroup(this);
|
||||||
|
@ -529,7 +541,9 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
|
||||||
playlist_copy_to_collection_ = playlist_menu_->addAction(IconLoader::Load("edit-copy"), tr("Copy to collection..."), this, SLOT(PlaylistCopyToCollection()));
|
playlist_copy_to_collection_ = playlist_menu_->addAction(IconLoader::Load("edit-copy"), tr("Copy to collection..."), this, SLOT(PlaylistCopyToCollection()));
|
||||||
playlist_move_to_collection_ = playlist_menu_->addAction(IconLoader::Load("go-jump"), tr("Move to collection..."), this, SLOT(PlaylistMoveToCollection()));
|
playlist_move_to_collection_ = playlist_menu_->addAction(IconLoader::Load("go-jump"), tr("Move to collection..."), this, SLOT(PlaylistMoveToCollection()));
|
||||||
//playlist_organise_ = playlist_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organise files..."), this, SLOT(PlaylistMoveToCollection()));
|
//playlist_organise_ = playlist_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organise files..."), this, SLOT(PlaylistMoveToCollection()));
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
playlist_copy_to_device_ = playlist_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, SLOT(PlaylistCopyToDevice()));
|
playlist_copy_to_device_ = playlist_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, SLOT(PlaylistCopyToDevice()));
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
//playlist_delete_ = playlist_menu_->addAction(IconLoader::Load("edit-delete"), tr("Delete from disk..."), this, SLOT(PlaylistDelete()));
|
//playlist_delete_ = playlist_menu_->addAction(IconLoader::Load("edit-delete"), tr("Delete from disk..."), this, SLOT(PlaylistDelete()));
|
||||||
playlist_open_in_browser_ = playlist_menu_->addAction(IconLoader::Load("document-open-folder"), tr("Show in file browser..."), this, SLOT(PlaylistOpenInBrowser()));
|
playlist_open_in_browser_ = playlist_menu_->addAction(IconLoader::Load("document-open-folder"), tr("Show in file browser..."), this, SLOT(PlaylistOpenInBrowser()));
|
||||||
|
@ -551,7 +565,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
|
||||||
|
|
||||||
connect(ui_->playlist, SIGNAL(UndoRedoActionsChanged(QAction*, QAction*)), SLOT(PlaylistUndoRedoChanged(QAction*, QAction*)));
|
connect(ui_->playlist, SIGNAL(UndoRedoActionsChanged(QAction*, QAction*)), SLOT(PlaylistUndoRedoChanged(QAction*, QAction*)));
|
||||||
|
|
||||||
#ifdef HAVE_GSTREAMER
|
#if defined(HAVE_GSTREAMER) && !defined(Q_OS_WIN)
|
||||||
playlist_copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
playlist_copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
||||||
connect(app_->device_manager()->connected_devices_model(), SIGNAL(IsEmptyChanged(bool)), playlist_copy_to_device_, SLOT(setDisabled(bool)));
|
connect(app_->device_manager()->connected_devices_model(), SIGNAL(IsEmptyChanged(bool)), playlist_copy_to_device_, SLOT(setDisabled(bool)));
|
||||||
#endif
|
#endif
|
||||||
|
@ -1324,7 +1338,9 @@ void MainWindow::PlaylistRightClick(const QPoint &global_pos, const QModelIndex
|
||||||
playlist_copy_to_collection_->setVisible(false);
|
playlist_copy_to_collection_->setVisible(false);
|
||||||
playlist_move_to_collection_->setVisible(false);
|
playlist_move_to_collection_->setVisible(false);
|
||||||
//playlist_organise_->setVisible(false);
|
//playlist_organise_->setVisible(false);
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
playlist_copy_to_device_->setVisible(false);
|
playlist_copy_to_device_->setVisible(false);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
playlist_open_in_browser_->setVisible(false);
|
playlist_open_in_browser_->setVisible(false);
|
||||||
|
|
||||||
|
@ -1393,7 +1409,7 @@ void MainWindow::PlaylistRightClick(const QPoint &global_pos, const QModelIndex
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GSTREAMER
|
#if defined(HAVE_GSTREAMER) && !defined(Q_OS_WIN)
|
||||||
playlist_copy_to_device_->setVisible(editable);
|
playlist_copy_to_device_->setVisible(editable);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1830,6 +1846,7 @@ void MainWindow::MoveFilesToCollection(const QList<QUrl> &urls) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::CopyFilesToDevice(const QList<QUrl> &urls) {
|
void MainWindow::CopyFilesToDevice(const QList<QUrl> &urls) {
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
organise_dialog_->SetDestinationModel(app_->device_manager()->connected_devices_model(), true);
|
organise_dialog_->SetDestinationModel(app_->device_manager()->connected_devices_model(), true);
|
||||||
organise_dialog_->SetCopy(true);
|
organise_dialog_->SetCopy(true);
|
||||||
if (organise_dialog_->SetUrls(urls))
|
if (organise_dialog_->SetUrls(urls))
|
||||||
|
@ -1837,6 +1854,7 @@ void MainWindow::CopyFilesToDevice(const QList<QUrl> &urls) {
|
||||||
else {
|
else {
|
||||||
QMessageBox::warning(this, tr("Error"), tr("None of the selected songs were suitable for copying to a device"));
|
QMessageBox::warning(this, tr("Error"), tr("None of the selected songs were suitable for copying to a device"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1968,15 +1986,14 @@ void MainWindow::PlaylistSkip() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_GSTREAMER
|
#if defined(HAVE_GSTREAMER)
|
||||||
void MainWindow::PlaylistCopyToDevice() {
|
void MainWindow::PlaylistCopyToDevice() {
|
||||||
|
#if !defined(Q_OS_WIN)
|
||||||
QModelIndexList proxy_indexes = ui_->playlist->view()->selectionModel()->selectedRows();
|
QModelIndexList proxy_indexes = ui_->playlist->view()->selectionModel()->selectedRows();
|
||||||
SongList songs;
|
SongList songs;
|
||||||
|
|
||||||
for (const QModelIndex &proxy_index : proxy_indexes) {
|
for (const QModelIndex &proxy_index : proxy_indexes) {
|
||||||
QModelIndex index = app_->playlist_manager()->current()->proxy()->mapToSource(proxy_index);
|
QModelIndex index = app_->playlist_manager()->current()->proxy()->mapToSource(proxy_index);
|
||||||
|
|
||||||
songs << app_->playlist_manager()->current()->item_at(index.row())->Metadata();
|
songs << app_->playlist_manager()->current()->item_at(index.row())->Metadata();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1985,9 +2002,9 @@ void MainWindow::PlaylistCopyToDevice() {
|
||||||
if (organise_dialog_->SetSongs(songs))
|
if (organise_dialog_->SetSongs(songs))
|
||||||
organise_dialog_->show();
|
organise_dialog_->show();
|
||||||
else {
|
else {
|
||||||
QMessageBox::warning(this, tr("Error"),
|
QMessageBox::warning(this, tr("Error"), tr("None of the selected songs were suitable for copying to a device"));
|
||||||
tr("None of the selected songs were suitable for copying to a device"));
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,10 @@ class ContextView;
|
||||||
class CollectionViewContainer;
|
class CollectionViewContainer;
|
||||||
class AlbumCoverChoiceController;
|
class AlbumCoverChoiceController;
|
||||||
class CommandlineOptions;
|
class CommandlineOptions;
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
class DeviceView;
|
class DeviceView;
|
||||||
class DeviceViewContainer;
|
class DeviceViewContainer;
|
||||||
|
#endif
|
||||||
class EditTagDialog;
|
class EditTagDialog;
|
||||||
class Equalizer;
|
class Equalizer;
|
||||||
class ErrorDialog;
|
class ErrorDialog;
|
||||||
|
@ -134,7 +136,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
||||||
void resizeEvent(QResizeEvent *event);
|
void resizeEvent(QResizeEvent *event);
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN
|
||||||
bool winEvent(MSG *message, long *result);
|
bool winEvent(MSG *message, long *result);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -183,7 +185,9 @@ signals:
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
void PlaylistCopyToCollection();
|
void PlaylistCopyToCollection();
|
||||||
void PlaylistMoveToCollection();
|
void PlaylistMoveToCollection();
|
||||||
|
#ifndef Q_OS_WIN_
|
||||||
void PlaylistCopyToDevice();
|
void PlaylistCopyToDevice();
|
||||||
|
#endif
|
||||||
void PlaylistOrganiseSelected(bool copy);
|
void PlaylistOrganiseSelected(bool copy);
|
||||||
#endif
|
#endif
|
||||||
//void PlaylistDelete();
|
//void PlaylistDelete();
|
||||||
|
@ -202,7 +206,9 @@ signals:
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
void CopyFilesToCollection(const QList<QUrl>& urls);
|
void CopyFilesToCollection(const QList<QUrl>& urls);
|
||||||
void MoveFilesToCollection(const QList<QUrl>& urls);
|
void MoveFilesToCollection(const QList<QUrl>& urls);
|
||||||
|
//#ifndef Q_OS_WIN
|
||||||
void CopyFilesToDevice(const QList<QUrl>& urls);
|
void CopyFilesToDevice(const QList<QUrl>& urls);
|
||||||
|
//#endif
|
||||||
#endif
|
#endif
|
||||||
void EditFileTags(const QList<QUrl>& urls);
|
void EditFileTags(const QList<QUrl>& urls);
|
||||||
|
|
||||||
|
@ -308,8 +314,10 @@ signals:
|
||||||
ContextView *context_view_;
|
ContextView *context_view_;
|
||||||
CollectionViewContainer *collection_view_;
|
CollectionViewContainer *collection_view_;
|
||||||
FileView *file_view_;
|
FileView *file_view_;
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
DeviceViewContainer *device_view_container_;
|
DeviceViewContainer *device_view_container_;
|
||||||
DeviceView *device_view_;
|
DeviceView *device_view_;
|
||||||
|
#endif
|
||||||
PlaylistListContainer *playlist_list_;
|
PlaylistListContainer *playlist_list_;
|
||||||
|
|
||||||
Lazy<SettingsDialog> settings_dialog_;
|
Lazy<SettingsDialog> settings_dialog_;
|
||||||
|
@ -347,7 +355,9 @@ signals:
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
QAction *playlist_copy_to_collection_;
|
QAction *playlist_copy_to_collection_;
|
||||||
QAction *playlist_move_to_collection_;
|
QAction *playlist_move_to_collection_;
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
QAction *playlist_copy_to_device_;
|
QAction *playlist_copy_to_device_;
|
||||||
|
#endif
|
||||||
//QAction *playlist_delete_;
|
//QAction *playlist_delete_;
|
||||||
#endif
|
#endif
|
||||||
QAction *playlist_open_in_browser_;
|
QAction *playlist_open_in_browser_;
|
||||||
|
|
Loading…
Reference in New Issue