From b6e3db4ce3a777841c1da68fb110682f99eac23d Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 14 Aug 2021 19:05:46 +0000 Subject: renamed udisks2 plugin to udisks git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@10199 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/udisks/CMakeLists.txt | 36 +++ src/plugins/General/udisks/settingsdialog.cpp | 55 +++++ src/plugins/General/udisks/settingsdialog.h | 45 ++++ src/plugins/General/udisks/settingsdialog.ui | 122 ++++++++++ .../General/udisks/translations/translations.qrc | 33 +++ .../udisks/translations/udisks_plugin_bg.ts | 83 +++++++ .../udisks/translations/udisks_plugin_cs.ts | 83 +++++++ .../udisks/translations/udisks_plugin_de.ts | 83 +++++++ .../udisks/translations/udisks_plugin_el.ts | 83 +++++++ .../udisks/translations/udisks_plugin_en.ts | 83 +++++++ .../udisks/translations/udisks_plugin_es.ts | 83 +++++++ .../udisks/translations/udisks_plugin_fi.ts | 83 +++++++ .../udisks/translations/udisks_plugin_fr.ts | 83 +++++++ .../udisks/translations/udisks_plugin_gl_ES.ts | 83 +++++++ .../udisks/translations/udisks_plugin_he.ts | 83 +++++++ .../udisks/translations/udisks_plugin_hu.ts | 83 +++++++ .../udisks/translations/udisks_plugin_id.ts | 83 +++++++ .../udisks/translations/udisks_plugin_it.ts | 83 +++++++ .../udisks/translations/udisks_plugin_ja.ts | 83 +++++++ .../udisks/translations/udisks_plugin_kk.ts | 83 +++++++ .../udisks/translations/udisks_plugin_ko.ts | 83 +++++++ .../udisks/translations/udisks_plugin_lt.ts | 83 +++++++ .../udisks/translations/udisks_plugin_nl.ts | 83 +++++++ .../udisks/translations/udisks_plugin_pl_PL.ts | 83 +++++++ .../udisks/translations/udisks_plugin_pt.ts | 83 +++++++ .../udisks/translations/udisks_plugin_pt_BR.ts | 83 +++++++ .../udisks/translations/udisks_plugin_ru.ts | 83 +++++++ .../udisks/translations/udisks_plugin_sk.ts | 83 +++++++ .../udisks/translations/udisks_plugin_sr_BA.ts | 83 +++++++ .../udisks/translations/udisks_plugin_sr_RS.ts | 83 +++++++ .../udisks/translations/udisks_plugin_tr.ts | 83 +++++++ .../udisks/translations/udisks_plugin_uk_UA.ts | 83 +++++++ .../udisks/translations/udisks_plugin_zh_CN.ts | 83 +++++++ .../udisks/translations/udisks_plugin_zh_TW.ts | 83 +++++++ src/plugins/General/udisks/udisks.pro | 26 +++ src/plugins/General/udisks/udisksdevice.cpp | 118 ++++++++++ src/plugins/General/udisks/udisksdevice.h | 91 ++++++++ src/plugins/General/udisks/udisksfactory.cpp | 59 +++++ src/plugins/General/udisks/udisksfactory.h | 44 ++++ src/plugins/General/udisks/udisksmanager.cpp | 91 ++++++++ src/plugins/General/udisks/udisksmanager.h | 59 +++++ src/plugins/General/udisks/udisksplugin.cpp | 253 +++++++++++++++++++++ src/plugins/General/udisks/udisksplugin.h | 65 ++++++ 43 files changed, 3504 insertions(+) create mode 100644 src/plugins/General/udisks/CMakeLists.txt create mode 100644 src/plugins/General/udisks/settingsdialog.cpp create mode 100644 src/plugins/General/udisks/settingsdialog.h create mode 100644 src/plugins/General/udisks/settingsdialog.ui create mode 100644 src/plugins/General/udisks/translations/translations.qrc create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_bg.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_cs.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_de.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_el.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_en.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_es.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_fi.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_fr.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_gl_ES.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_he.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_hu.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_id.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_it.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_ja.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_kk.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_ko.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_lt.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_nl.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_pl_PL.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_pt.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_pt_BR.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_ru.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_sk.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_sr_BA.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_sr_RS.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_tr.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_uk_UA.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_zh_CN.ts create mode 100644 src/plugins/General/udisks/translations/udisks_plugin_zh_TW.ts create mode 100644 src/plugins/General/udisks/udisks.pro create mode 100644 src/plugins/General/udisks/udisksdevice.cpp create mode 100644 src/plugins/General/udisks/udisksdevice.h create mode 100644 src/plugins/General/udisks/udisksfactory.cpp create mode 100644 src/plugins/General/udisks/udisksfactory.h create mode 100644 src/plugins/General/udisks/udisksmanager.cpp create mode 100644 src/plugins/General/udisks/udisksmanager.h create mode 100644 src/plugins/General/udisks/udisksplugin.cpp create mode 100644 src/plugins/General/udisks/udisksplugin.h (limited to 'src/plugins/General/udisks') diff --git a/src/plugins/General/udisks/CMakeLists.txt b/src/plugins/General/udisks/CMakeLists.txt new file mode 100644 index 000000000..95209cca3 --- /dev/null +++ b/src/plugins/General/udisks/CMakeLists.txt @@ -0,0 +1,36 @@ +project(libudisks) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +# libqmmpui & libqmmp +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) +link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmpui) +link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) + +SET(libudisks_SRCS + udisksfactory.cpp + udisksmanager.cpp + udisksplugin.cpp + udisksdevice.cpp + settingsdialog.cpp +) + +SET(libudisks_RCCS translations/translations.qrc) + +QT5_ADD_RESOURCES(libudisks_RCC_SRCS ${libudisks_RCCS}) + +# user interface + +SET(libudisks_UIS + settingsdialog.ui +) + +QT5_WRAP_UI(libudisks_UIS_H ${libudisks_UIS}) +# Don't forget to include output directory, otherwise +# the UI file won't be wrapped! +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +ADD_LIBRARY(udisks MODULE ${libudisks_SRCS} ${libudisks_UIS_H} ${libudisks_RCC_SRCS}) +add_dependencies(udisks libqmmpui) +target_link_libraries(udisks Qt5::Widgets Qt5::DBus libqmmpui libqmmp) +install(TARGETS udisks DESTINATION ${PLUGIN_DIR}/General) diff --git a/src/plugins/General/udisks/settingsdialog.cpp b/src/plugins/General/udisks/settingsdialog.cpp new file mode 100644 index 000000000..b051cec0b --- /dev/null +++ b/src/plugins/General/udisks/settingsdialog.cpp @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (C) 2013-2021 by Ilya Kotov * + * forkotov02@ya.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#include +#include +#include "settingsdialog.h" + +SettingsDialog::SettingsDialog(QWidget *parent) + : QDialog(parent) +{ + m_ui.setupUi(this); + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("UDisks"); + m_ui.cdGroupBox->setChecked(settings.value("cda", true).toBool()); + m_ui.addTracksCheckBox->setChecked(settings.value("add_tracks", false).toBool()); + m_ui.removeTracksCheckBox->setChecked(settings.value("remove_tracks", false).toBool()); + m_ui.removableGroupBox->setChecked(settings.value("removable", true).toBool()); + m_ui.addFilesCheckBox->setChecked(settings.value("add_files", false).toBool()); + m_ui.removeFilesCheckBox->setChecked(settings.value("remove_files", false).toBool()); + settings.endGroup(); +} + + +SettingsDialog::~SettingsDialog() +{} + +void SettingsDialog::accept() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("UDisks"); + settings.setValue("cda", m_ui.cdGroupBox->isChecked()); + settings.setValue("add_tracks", m_ui.addTracksCheckBox->isChecked()); + settings.setValue("remove_tracks", m_ui.removeTracksCheckBox->isChecked()); + settings.setValue("removable", m_ui.removableGroupBox->isChecked()); + settings.setValue("add_files", m_ui.addFilesCheckBox->isChecked()); + settings.setValue("remove_files", m_ui.removeFilesCheckBox->isChecked()); + settings.endGroup(); + QDialog::accept(); +} diff --git a/src/plugins/General/udisks/settingsdialog.h b/src/plugins/General/udisks/settingsdialog.h new file mode 100644 index 000000000..10fb8814f --- /dev/null +++ b/src/plugins/General/udisks/settingsdialog.h @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2013-2021 by Ilya Kotov * + * forkotov02@ya.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef SETTINGSDIALOG_H +#define SETTINGSDIALOG_H + +#include +#include "ui_settingsdialog.h" + +/** + @author Ilya Kotov +*/ +class SettingsDialog : public QDialog +{ +Q_OBJECT +public: + SettingsDialog(QWidget *parent = nullptr); + + ~SettingsDialog(); + + +public slots: + virtual void accept() override; + +private: + Ui::SettingsDialog m_ui; +}; + +#endif diff --git a/src/plugins/General/udisks/settingsdialog.ui b/src/plugins/General/udisks/settingsdialog.ui new file mode 100644 index 000000000..5b039a88c --- /dev/null +++ b/src/plugins/General/udisks/settingsdialog.ui @@ -0,0 +1,122 @@ + + + SettingsDialog + + + + 0 + 0 + 348 + 247 + + + + UDisks Plugin Settings + + + + 6 + + + 6 + + + 6 + + + + + CD Audio Detection + + + true + + + + + + Add tracks to playlist automatically + + + + + + + Remove tracks from playlist automatically + + + + + + + + + + Removable Device Detection + + + true + + + + + + Add files to playlist automatically + + + + + + + Remove files from playlist automatically + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + SettingsDialog + accept() + + + 199 + 221 + + + 22 + 242 + + + + + buttonBox + rejected() + SettingsDialog + reject() + + + 247 + 225 + + + 273 + 229 + + + + + diff --git a/src/plugins/General/udisks/translations/translations.qrc b/src/plugins/General/udisks/translations/translations.qrc new file mode 100644 index 000000000..8c398ef67 --- /dev/null +++ b/src/plugins/General/udisks/translations/translations.qrc @@ -0,0 +1,33 @@ + + + + udisks_plugin_ru.qm + udisks_plugin_uk_UA.qm + udisks_plugin_zh_CN.qm + udisks_plugin_zh_TW.qm + udisks_plugin_tr.qm + udisks_plugin_cs.qm + udisks_plugin_pt_BR.qm + udisks_plugin_pt.qm + udisks_plugin_de.qm + udisks_plugin_pl_PL.qm + udisks_plugin_fr.qm + udisks_plugin_it.qm + udisks_plugin_kk.qm + udisks_plugin_ko.qm + udisks_plugin_lt.qm + udisks_plugin_hu.qm + udisks_plugin_nl.qm + udisks_plugin_ja.qm + udisks_plugin_sk.qm + udisks_plugin_es.qm + udisks_plugin_he.qm + udisks_plugin_gl_ES.qm + udisks_plugin_sr_BA.qm + udisks_plugin_sr_RS.qm + udisks_plugin_bg.qm + udisks_plugin_el.qm + udisks_plugin_id.qm + udisks_plugin_fi.qm + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_bg.ts b/src/plugins/General/udisks/translations/udisks_plugin_bg.ts new file mode 100644 index 000000000..f6c63b44a --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_bg.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + + + + + CD Audio Detection + + + + + Add tracks to playlist automatically + + + + + Remove tracks from playlist automatically + + + + + Removable Device Detection + + + + + Add files to playlist automatically + + + + + Remove files from playlist automatically + + + + + UDisks2Factory + + + UDisks2 Plugin + + + + + About UDisks2 Plugin + + + + + Qmmp UDisks2 Plugin + + + + + This plugin provides removable devices detection using UDisks2 + + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + + + + + UDisks2Plugin + + + Add CD "%1" + + + + + Add Volume "%1" + + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_cs.ts b/src/plugins/General/udisks/translations/udisks_plugin_cs.ts new file mode 100644 index 000000000..655ea9c84 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_cs.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Nastavení modulu UDisks + + + + CD Audio Detection + Detekce zvukových CD + + + + Add tracks to playlist automatically + Automaticky přidat stopy do seznamu skladeb + + + + Remove tracks from playlist automatically + Automaticky odebrat stopy ze seznamu skladeb + + + + Removable Device Detection + Detekce odpojitelných zařízení + + + + Add files to playlist automatically + Automaticky přidat soubory do seznamu skladeb + + + + Remove files from playlist automatically + Automaticky odebrat stopy ze seznamu skladeb + + + + UDisks2Factory + + + UDisks2 Plugin + Modul UDisks2 + + + + About UDisks2 Plugin + O modulu UDisks2 + + + + Qmmp UDisks2 Plugin + Modul Qmmp UDisks2 + + + + This plugin provides removable devices detection using UDisks2 + Tento modul poskytuje detekci výměnných médií pomocí UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + + + + + UDisks2Plugin + + + Add CD "%1" + Přidat CD „%1“ + + + + Add Volume "%1" + Přidat svazek „%1“ + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_de.ts b/src/plugins/General/udisks/translations/udisks_plugin_de.ts new file mode 100644 index 000000000..42dd34174 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_de.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Einstellungen UDisks-Modul + + + + CD Audio Detection + CD-Audio-Erkennung + + + + Add tracks to playlist automatically + Titel automatisch zur Wiedergabeliste hinzufügen + + + + Remove tracks from playlist automatically + Titel automatisch von der Wiedergabeliste entfernen + + + + Removable Device Detection + Wechsellaufwerkerkennung + + + + Add files to playlist automatically + Dateien automatisch zur Wiedergabeliste hinzufügen + + + + Remove files from playlist automatically + Dateien automatisch von der Wiedergabeliste entfernen + + + + UDisks2Factory + + + UDisks2 Plugin + UDisks2-Modul + + + + About UDisks2 Plugin + Über UDisks2-Modul + + + + Qmmp UDisks2 Plugin + Qmmp UDisks2-Modul + + + + This plugin provides removable devices detection using UDisks2 + Dieses Modul bietet Wechsellaufwerkerkennung unter Verwendung von UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Geschrieben von: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + CD „%1“ hinzufügen + + + + Add Volume "%1" + Datenträger „%1“ hinzufügen + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_el.ts b/src/plugins/General/udisks/translations/udisks_plugin_el.ts new file mode 100644 index 000000000..eb41b22fb --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_el.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Ρυθμίσεις πρόσθετου UDisks + + + + CD Audio Detection + Ανίχνευση CD ήχου + + + + Add tracks to playlist automatically + Προσθήκη των κομματιών αυτόματα στη λίστα αναπαραγωγής + + + + Remove tracks from playlist automatically + Αφαίρεση των κομματιών αυτόματα από τη λίστα αναπαραγωγής + + + + Removable Device Detection + Ανίχνευση αφαιρούμενης συσκευής + + + + Add files to playlist automatically + Προσθήκη αρχείων αυτόματα στη λίστα αναπαραγωγής + + + + Remove files from playlist automatically + Αφαίρεση των αρχείων από τη λίστα αναπαραγωγής αυτόματα + + + + UDisks2Factory + + + UDisks2 Plugin + Πρόσθετο UDisks2 + + + + About UDisks2 Plugin + Σχετικά με το πρόσθετο UDisks2 + + + + Qmmp UDisks2 Plugin + Qmmp πρόσθετο UDisks2 + + + + This plugin provides removable devices detection using UDisks2 + Αυτό το πρόσθετο παρέχει την ανίχνευση αφαιρούμενων συσκευών μέσω UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Γράφτηκε από τον: Ilya Kotov <forkotov02@hotmail.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Προσθήκη CD «%1» + + + + Add Volume "%1" + Προσθήκη Έντασης «%1» + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_en.ts b/src/plugins/General/udisks/translations/udisks_plugin_en.ts new file mode 100644 index 000000000..5e44b7b87 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_en.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + + + + + CD Audio Detection + + + + + Add tracks to playlist automatically + + + + + Remove tracks from playlist automatically + + + + + Removable Device Detection + + + + + Add files to playlist automatically + + + + + Remove files from playlist automatically + + + + + UDisks2Factory + + + UDisks2 Plugin + + + + + About UDisks2 Plugin + + + + + Qmmp UDisks2 Plugin + + + + + This plugin provides removable devices detection using UDisks2 + + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + + + + + UDisks2Plugin + + + Add CD "%1" + + + + + Add Volume "%1" + + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_es.ts b/src/plugins/General/udisks/translations/udisks_plugin_es.ts new file mode 100644 index 000000000..907d8805d --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_es.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Configuración del módulo UDisks + + + + CD Audio Detection + Detección de audio CD + + + + Add tracks to playlist automatically + Añadir pistas a la lista de reproducción automáticamente + + + + Remove tracks from playlist automatically + Eliminar pistas de la lista de reproducción automáticamente + + + + Removable Device Detection + Detectar dispositivos extraibles + + + + Add files to playlist automatically + Añadir archivos a la lista de reproducción automáticamente + + + + Remove files from playlist automatically + Eliminar archivos de la lista de reproducción automáticamente + + + + UDisks2Factory + + + UDisks2 Plugin + Módulo UDisks2 + + + + About UDisks2 Plugin + Acerca del Módulo UDisks2 + + + + Qmmp UDisks2 Plugin + Módulo UDisks2 de Qmmp + + + + This plugin provides removable devices detection using UDisks2 + Este módulo proporciona detección de dispositivos extraíbles mediante UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Escrito por: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Añadir CD "%1" + + + + Add Volume "%1" + Añadir volumen "%1" + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_fi.ts b/src/plugins/General/udisks/translations/udisks_plugin_fi.ts new file mode 100644 index 000000000..cf41107dd --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_fi.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + UDisks-liitännäisen asetukset + + + + CD Audio Detection + + + + + Add tracks to playlist automatically + Lisää kappaleet soittolistaan automaattisesti + + + + Remove tracks from playlist automatically + Poista kappaleet soittolistalta automaattisesti + + + + Removable Device Detection + Irrotettavan laitteen havaitseminen + + + + Add files to playlist automatically + Lisää tiedostot soittolistaan automaattisesti + + + + Remove files from playlist automatically + Poista tiedostot soittolistasta automaattisesti + + + + UDisks2Factory + + + UDisks2 Plugin + UDisks2-liitännäinen + + + + About UDisks2 Plugin + + + + + Qmmp UDisks2 Plugin + Qmmp:n UDisks2-liitännäinen + + + + This plugin provides removable devices detection using UDisks2 + + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Toteuttanut: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Lisää CD "%1" + + + + Add Volume "%1" + + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_fr.ts b/src/plugins/General/udisks/translations/udisks_plugin_fr.ts new file mode 100644 index 000000000..5efce0a69 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_fr.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Configuration du greffon UDisks + + + + CD Audio Detection + Détection de CD audio + + + + Add tracks to playlist automatically + Ajouter automatiquement les pistes à la liste + + + + Remove tracks from playlist automatically + Enlever automatiquement les pistes de la liste + + + + Removable Device Detection + Détection de périphérique amovible + + + + Add files to playlist automatically + Ajouter automatiquement les fichiers à la liste + + + + Remove files from playlist automatically + Enlever automatiquement les fichiers à la liste + + + + UDisks2Factory + + + UDisks2 Plugin + Greffon UDisks2 + + + + About UDisks2 Plugin + À propos du greffon UDisks2 + + + + Qmmp UDisks2 Plugin + Greffon UDisks2 pour Qmmp + + + + This plugin provides removable devices detection using UDisks2 + Ce greffon fournit une détection de périphériques amovibles en utilisant UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Écrit par : Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Ajouter CD « %1 » + + + + Add Volume "%1" + Ajouter volume « %1 » + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_gl_ES.ts b/src/plugins/General/udisks/translations/udisks_plugin_gl_ES.ts new file mode 100644 index 000000000..f95311746 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_gl_ES.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Preferencias do engadido UDisks + + + + CD Audio Detection + Detección de CD de audio + + + + Add tracks to playlist automatically + Engadir pistas á lista de reprodución automaticamente + + + + Remove tracks from playlist automatically + Eliminar pistas da lista de reprodución automaticamente + + + + Removable Device Detection + Detección de dispositivos extraíbles + + + + Add files to playlist automatically + Engadir ficheiros á lista de reprodución automaticamente + + + + Remove files from playlist automatically + Eliminar ficheiros da lista de reprodución automaticamente + + + + UDisks2Factory + + + UDisks2 Plugin + Engadido UDisks2 + + + + About UDisks2 Plugin + Sobre o engadido UDisks2 + + + + Qmmp UDisks2 Plugin + Engadido UDisks2 de Qmmp + + + + This plugin provides removable devices detection using UDisks2 + Este engadido provén detección de dispositivos extraíbles usando UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Escrito por: LLya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Engadir CD "%1" + + + + Add Volume "%1" + Engadir volume "%1" + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_he.ts b/src/plugins/General/udisks/translations/udisks_plugin_he.ts new file mode 100644 index 000000000..755a13f49 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_he.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + הגדרות תוסף UDisks + + + + CD Audio Detection + איתור אוטומטי של תקליטור שמע + + + + Add tracks to playlist automatically + הוסף רצועות אוטומטית לתוך רשימת נגינה + + + + Remove tracks from playlist automatically + הסר רצועות אוטומטית מתוך רשימת נגינה + + + + Removable Device Detection + איתור התקנים נשלפים + + + + Add files to playlist automatically + הוסף קבצים אוטומטית לתוך רשימת נגינה + + + + Remove files from playlist automatically + הסר קבצים אוטומטית מתוך רשימת נגינה + + + + UDisks2Factory + + + UDisks2 Plugin + תוסף UDisks2 + + + + About UDisks2 Plugin + אודות תוסף UDisks2 + + + + Qmmp UDisks2 Plugin + תוסף UDisks2 של Qmmp + + + + This plugin provides removable devices detection using UDisks2 + תוסף זה מספק איתור התקנים ברי הזזה באמצעות UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + + + + + UDisks2Plugin + + + Add CD "%1" + הוסף תקליטור "%1" + + + + Add Volume "%1" + הוסף כרך "%1" + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_hu.ts b/src/plugins/General/udisks/translations/udisks_plugin_hu.ts new file mode 100644 index 000000000..94f6b2dfd --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_hu.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + + + + + CD Audio Detection + + + + + Add tracks to playlist automatically + + + + + Remove tracks from playlist automatically + + + + + Removable Device Detection + + + + + Add files to playlist automatically + + + + + Remove files from playlist automatically + + + + + UDisks2Factory + + + UDisks2 Plugin + + + + + About UDisks2 Plugin + + + + + Qmmp UDisks2 Plugin + + + + + This plugin provides removable devices detection using UDisks2 + + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + + + + + UDisks2Plugin + + + Add CD "%1" + + + + + Add Volume "%1" + + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_id.ts b/src/plugins/General/udisks/translations/udisks_plugin_id.ts new file mode 100644 index 000000000..ce56e2aa6 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_id.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Setelan Plugin UDisks + + + + CD Audio Detection + Deteksi Audio CD + + + + Add tracks to playlist automatically + Tambah track ke daftarmain secara otomatis + + + + Remove tracks from playlist automatically + Buang track dari daftarmain secara otomatis + + + + Removable Device Detection + Deteksi Perangkat Dapat-dilepas + + + + Add files to playlist automatically + Tambah file ke daftarmain secara otomatis + + + + Remove files from playlist automatically + Buang file dari daftarmain secara otomatis + + + + UDisks2Factory + + + UDisks2 Plugin + Plugin UDisks + + + + About UDisks2 Plugin + Tentang Plugin UDisks + + + + Qmmp UDisks2 Plugin + Plugin UDisks Qmmp + + + + This plugin provides removable devices detection using UDisks2 + Plugin ini menyediakan deteksi perangkat dapat-dilepas menggunakan UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Ditulis oleh: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Tambah CD "%1" + + + + Add Volume "%1" + Tambah Volume "%1" + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_it.ts b/src/plugins/General/udisks/translations/udisks_plugin_it.ts new file mode 100644 index 000000000..56b6f4140 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_it.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Impostazioni dell'estensione UDisks + + + + CD Audio Detection + Rilevamento CD Audio + + + + Add tracks to playlist automatically + Aggiungi automaticamente le tracce alla scaletta + + + + Remove tracks from playlist automatically + Rimuovi automaticamente i titoli dalla scaletta + + + + Removable Device Detection + Rilevamento dispositivi rimovibili + + + + Add files to playlist automatically + Aggiungi automaticamente i file alla scaletta + + + + Remove files from playlist automatically + Rimuovi automaticamente i file dalla scaletta + + + + UDisks2Factory + + + UDisks2 Plugin + Estensione UDisks2 + + + + About UDisks2 Plugin + Informazioni sull'estensione UDisks2 + + + + Qmmp UDisks2 Plugin + Estensione UDisks2 per Qmmp + + + + This plugin provides removable devices detection using UDisks2 + Estensione che permette il rilevamento di dispositivi rimovibili utilizzando UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Autori: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Aggiungi CD «%1» + + + + Add Volume "%1" + Aggiungi volume «%1» + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_ja.ts b/src/plugins/General/udisks/translations/udisks_plugin_ja.ts new file mode 100644 index 000000000..6b226722d --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_ja.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + UDisks プラグイン設定 + + + + CD Audio Detection + 音楽 CD 検知 + + + + Add tracks to playlist automatically + プレイリストにトラックを自動追加 + + + + Remove tracks from playlist automatically + プレイリストからトラックを自動除去 + + + + Removable Device Detection + 着脱可能なデバイスの検知 + + + + Add files to playlist automatically + プレイリストにファイルを自動追加 + + + + Remove files from playlist automatically + プレイリストからファイルを自動除去 + + + + UDisks2Factory + + + UDisks2 Plugin + UDisks2 プラグイン + + + + About UDisks2 Plugin + UDisks2 プラグインについて + + + + Qmmp UDisks2 Plugin + QMMP UDisks2 プラグイン + + + + This plugin provides removable devices detection using UDisks2 + このプラグインは着脱可能なデバイスの検知を UDisks2 により行ないます + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + 制作: Илья Котов (Ilya Kotov) <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + CD "%1" を追加 + + + + Add Volume "%1" + 量目 "%1" を追加 + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_kk.ts b/src/plugins/General/udisks/translations/udisks_plugin_kk.ts new file mode 100644 index 000000000..336c9269d --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_kk.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + + + + + CD Audio Detection + + + + + Add tracks to playlist automatically + + + + + Remove tracks from playlist automatically + + + + + Removable Device Detection + + + + + Add files to playlist automatically + + + + + Remove files from playlist automatically + + + + + UDisks2Factory + + + UDisks2 Plugin + + + + + About UDisks2 Plugin + + + + + Qmmp UDisks2 Plugin + + + + + This plugin provides removable devices detection using UDisks2 + + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + + + + + UDisks2Plugin + + + Add CD "%1" + + + + + Add Volume "%1" + + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_ko.ts b/src/plugins/General/udisks/translations/udisks_plugin_ko.ts new file mode 100644 index 000000000..3ffaba282 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_ko.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + UDisks 플러그인 설정 + + + + CD Audio Detection + CD 오디오 감지 + + + + Add tracks to playlist automatically + 자동으로 재생목록에 트랙 추가 + + + + Remove tracks from playlist automatically + 자동으로 재생목록에 트랙 제거 + + + + Removable Device Detection + 이동식 장치 감지 + + + + Add files to playlist automatically + 자동으로 재생목록에 파일 추가 + + + + Remove files from playlist automatically + 자동으로 재생목록에서 파일 제거 + + + + UDisks2Factory + + + UDisks2 Plugin + UDisks2 플러그인 + + + + About UDisks2 Plugin + UDisks2 플러그인 정보 + + + + Qmmp UDisks2 Plugin + Qmmp UDisks2 플러그인 + + + + This plugin provides removable devices detection using UDisks2 + 이 플러그인은 UDisks2를 사용하여 이동식 디바이스 감지 기능을 제공합니다 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + 작성자: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + CD "%1" 추가 + + + + Add Volume "%1" + 볼륨 "%1" 추가 + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_lt.ts b/src/plugins/General/udisks/translations/udisks_plugin_lt.ts new file mode 100644 index 000000000..e1b6c1ca8 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_lt.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Udisks įskiepio nustatymai + + + + CD Audio Detection + Audio CD aptikimas + + + + Add tracks to playlist automatically + Įdėti takelius į grojaraštį automatiškai + + + + Remove tracks from playlist automatically + Pašalinti takelius iš grojaraščio automatiškai + + + + Removable Device Detection + Išorinių įrenginių aptikimas + + + + Add files to playlist automatically + Įdėti takelius į grojaratį automatiškai + + + + Remove files from playlist automatically + Pašalinti takelius iš grojaraščio automatiškai + + + + UDisks2Factory + + + UDisks2 Plugin + UDisks2 Įskiepis + + + + About UDisks2 Plugin + Apie UDisks2 Įskiepį + + + + Qmmp UDisks2 Plugin + Qmmp UDisks2 Įskiepis + + + + This plugin provides removable devices detection using UDisks2 + Šis įskiepis aptinka prijungiamus įrenginius naudodamas UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Sukūrė: Ilya Kotov + + + + UDisks2Plugin + + + Add CD "%1" + Pridėti CD "%1" + + + + Add Volume "%1" + Pridėti tomą "%1" + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_nl.ts b/src/plugins/General/udisks/translations/udisks_plugin_nl.ts new file mode 100644 index 000000000..95fe9937b --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_nl.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Instellingen + + + + CD Audio Detection + CD-audiodetectie + + + + Add tracks to playlist automatically + Nummers automatisch toevoegen aan afspeellijst + + + + Remove tracks from playlist automatically + Nummers automatisch verwijderen van afspeellijst + + + + Removable Device Detection + Detectie van verwisselbare apparaten + + + + Add files to playlist automatically + Bestanden automatisch toevoegen aan afspeellijst + + + + Remove files from playlist automatically + Bestanden automatisch verwijderen van afspeellijst + + + + UDisks2Factory + + + UDisks2 Plugin + UDisks2-plug-in + + + + About UDisks2 Plugin + Over de UDisks2-plug-in + + + + Qmmp UDisks2 Plugin + UDisks2-plug-in voor Qmmp + + + + This plugin provides removable devices detection using UDisks2 + Deze plug-in faciliteert detectie van verwisselbare apparaten via UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Auteur: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + CD "%1" toevoegen + + + + Add Volume "%1" + Apparaat "%1" toevoegen + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_pl_PL.ts b/src/plugins/General/udisks/translations/udisks_plugin_pl_PL.ts new file mode 100644 index 000000000..d37d92e72 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_pl_PL.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Ustawienia wtyczki UDisks + + + + CD Audio Detection + Detekcja płyt CD Audio + + + + Add tracks to playlist automatically + Automatycznie dodaj utwory do listy + + + + Remove tracks from playlist automatically + Automatycznie usuń utwory z listy + + + + Removable Device Detection + Detekcja urządzeń przenośnych + + + + Add files to playlist automatically + Automatycznie dodaj pliki do listy + + + + Remove files from playlist automatically + Automatycznie usuń pliki z listy + + + + UDisks2Factory + + + UDisks2 Plugin + Wtyczka UDisks2 + + + + About UDisks2 Plugin + O wtyczce UDisks2 + + + + Qmmp UDisks2 Plugin + Wtyczka UDisks2 dla Qmmp + + + + This plugin provides removable devices detection using UDisks2 + Ta wtyczka pozwala na wykrywanie urządzeń przy użyciu UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Napisana przez: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Dodaj CD "%1" + + + + Add Volume "%1" + Dodaj głośność "%1" + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_pt.ts b/src/plugins/General/udisks/translations/udisks_plugin_pt.ts new file mode 100644 index 000000000..de7b41eb2 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_pt.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Definições + + + + CD Audio Detection + Deteção de CD áudio + + + + Add tracks to playlist automatically + Adicionar faixas à lista de reprodução + + + + Remove tracks from playlist automatically + Remover faixas da lista de reprodução + + + + Removable Device Detection + Deteção de discos amovíveis + + + + Add files to playlist automatically + Adicionar ficheiros à lista de reprodução + + + + Remove files from playlist automatically + Remover ficheiros da lista de reprodução + + + + UDisks2Factory + + + UDisks2 Plugin + Suplemento UDisks2 + + + + About UDisks2 Plugin + Acerca de suplemento UDisks2 + + + + Qmmp UDisks2 Plugin + Suplemento Qmmp UDisks2 + + + + This plugin provides removable devices detection using UDisks2 + Este suplemento permite a deteção de discos amovíveis através do serviço UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Desenvolvido por: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Adicionar CD %1 + + + + Add Volume "%1" + Adicionar volume %1 + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_pt_BR.ts b/src/plugins/General/udisks/translations/udisks_plugin_pt_BR.ts new file mode 100644 index 000000000..a62d4d5c5 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_pt_BR.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Preferências do plugin UDisks + + + + CD Audio Detection + Detecção de áudio de CD + + + + Add tracks to playlist automatically + Adicionar faixas à lista de reprodução + + + + Remove tracks from playlist automatically + Remover faixas da lista de reprodução + + + + Removable Device Detection + Detecção de dispositivos removíveis + + + + Add files to playlist automatically + Adicionar arquivos à lista de reprodução + + + + Remove files from playlist automatically + Remover arquivos da lista de reprodução + + + + UDisks2Factory + + + UDisks2 Plugin + Plugin UDisks2 + + + + About UDisks2 Plugin + Sobre o plugin UDisks2 + + + + Qmmp UDisks2 Plugin + Plugin Qmmp UDisks2 + + + + This plugin provides removable devices detection using UDisks2 + Este plugin permite a detecção de dispositivos removíveis através do serviço UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + + + + + UDisks2Plugin + + + Add CD "%1" + Adicionar CD %1 + + + + Add Volume "%1" + Adicionar volume %1 + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_ru.ts b/src/plugins/General/udisks/translations/udisks_plugin_ru.ts new file mode 100644 index 000000000..c04130e85 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_ru.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Настройки модуля UDisks + + + + CD Audio Detection + Автоопределение аудио-CD + + + + Add tracks to playlist automatically + Автоматически добавлять треки в список + + + + Remove tracks from playlist automatically + Автоматически удалять треки из списка + + + + Removable Device Detection + Автоопределение съёмных устройств + + + + Add files to playlist automatically + Автоматически добавлять треки в список + + + + Remove files from playlist automatically + Автоматически удалять треки из списка + + + + UDisks2Factory + + + UDisks2 Plugin + Модуль UDisks2 + + + + About UDisks2 Plugin + О модуле UDisks2 + + + + Qmmp UDisks2 Plugin + Модуль UDisks2 для Qmmp + + + + This plugin provides removable devices detection using UDisks2 + Это модуль отслеживает съёмные устройства с помощью UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Разработчик: Илья Котов <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Добавить CD "%1" + + + + Add Volume "%1" + Добавить том "%1" + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_sk.ts b/src/plugins/General/udisks/translations/udisks_plugin_sk.ts new file mode 100644 index 000000000..a8fcd692b --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_sk.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + + + + + CD Audio Detection + + + + + Add tracks to playlist automatically + + + + + Remove tracks from playlist automatically + + + + + Removable Device Detection + + + + + Add files to playlist automatically + + + + + Remove files from playlist automatically + + + + + UDisks2Factory + + + UDisks2 Plugin + + + + + About UDisks2 Plugin + + + + + Qmmp UDisks2 Plugin + + + + + This plugin provides removable devices detection using UDisks2 + + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + + + + + UDisks2Plugin + + + Add CD "%1" + + + + + Add Volume "%1" + + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_sr_BA.ts b/src/plugins/General/udisks/translations/udisks_plugin_sr_BA.ts new file mode 100644 index 000000000..bf430d5e8 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_sr_BA.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Поставке за Удискс2 + + + + CD Audio Detection + Откривање музичког диска + + + + Add tracks to playlist automatically + Аутоматски додај нумере на листу + + + + Remove tracks from playlist automatically + Аутоматски уклони нумере са листе + + + + Removable Device Detection + Откривање уклоњивих уређаја + + + + Add files to playlist automatically + Аутоматски додај фајлове на листу + + + + Remove files from playlist automatically + Аутоматски уклони фајлове са листе + + + + UDisks2Factory + + + UDisks2 Plugin + Удискс2 + + + + About UDisks2 Plugin + О прикључку за UDisks2 + + + + Qmmp UDisks2 Plugin + Кумп прикључак за UDisks2 + + + + This plugin provides removable devices detection using UDisks2 + Омогућује откривање уклоњивих уређаја користећи UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Аутор: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Додај диск „%1“ + + + + Add Volume "%1" + Додај складишни простор „%1“ + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_sr_RS.ts b/src/plugins/General/udisks/translations/udisks_plugin_sr_RS.ts new file mode 100644 index 000000000..ff03960bc --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_sr_RS.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Поставке за Удискс2 + + + + CD Audio Detection + Откривање музичког диска + + + + Add tracks to playlist automatically + Аутоматски додај нумере на листу + + + + Remove tracks from playlist automatically + Аутоматски уклони нумере са листе + + + + Removable Device Detection + Откривање уклоњивих уређаја + + + + Add files to playlist automatically + Аутоматски додај фајлове на листу + + + + Remove files from playlist automatically + Аутоматски уклони фајлове са листе + + + + UDisks2Factory + + + UDisks2 Plugin + Удискс2 + + + + About UDisks2 Plugin + О прикључку за UDisks2 + + + + Qmmp UDisks2 Plugin + Кумп прикључак за UDisks2 + + + + This plugin provides removable devices detection using UDisks2 + Омогућује откривање уклоњивих уређаја користећи UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Аутор: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Додај диск „%1“ + + + + Add Volume "%1" + Додај складишни простор „%1“ + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_tr.ts b/src/plugins/General/udisks/translations/udisks_plugin_tr.ts new file mode 100644 index 000000000..2031a0af3 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_tr.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + + + + + CD Audio Detection + CD Ses Algılama + + + + Add tracks to playlist automatically + Parçaları listeye otomatik olarka ekle + + + + Remove tracks from playlist automatically + Parçaları listeden otomatik olarak kaldır + + + + Removable Device Detection + Çıkarılabilir Aygıt Algılama + + + + Add files to playlist automatically + Dosyaları listeye otomatik olarak ekle + + + + Remove files from playlist automatically + Dosyaları listeden otomatik olarak kaldır + + + + UDisks2Factory + + + UDisks2 Plugin + + + + + About UDisks2 Plugin + + + + + Qmmp UDisks2 Plugin + + + + + This plugin provides removable devices detection using UDisks2 + + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Yazan: Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + CD "%1" Ekle + + + + Add Volume "%1" + "%1" Aygıtını Ekle + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_uk_UA.ts b/src/plugins/General/udisks/translations/udisks_plugin_uk_UA.ts new file mode 100644 index 000000000..d43c066cc --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_uk_UA.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + Налаштування модуля UDisks + + + + CD Audio Detection + Автовизначення аудіо-CD + + + + Add tracks to playlist automatically + Автоматично додавати треки до списку + + + + Remove tracks from playlist automatically + Автоматично видаляти треки зі списку + + + + Removable Device Detection + Виявлення змінних пристроїв + + + + Add files to playlist automatically + Автоматично додавати файли до списку + + + + Remove files from playlist automatically + Автоматично видаляти файли зі списку + + + + UDisks2Factory + + + UDisks2 Plugin + Модуль UDisks2 + + + + About UDisks2 Plugin + Про модуль UDisks2 + + + + Qmmp UDisks2 Plugin + Модуль UDisks2 для Qmmp + + + + This plugin provides removable devices detection using UDisks2 + Цей модуль відстежує з'ємні пристрої за допомогою UDisks2 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + Розробник: Ілля Котов <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + Додати CD "%1" + + + + Add Volume "%1" + Додати том "%1" + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_zh_CN.ts b/src/plugins/General/udisks/translations/udisks_plugin_zh_CN.ts new file mode 100644 index 000000000..c281c0f79 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_zh_CN.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + UDisks 插件设置 + + + + CD Audio Detection + CD 音频检测 + + + + Add tracks to playlist automatically + 自动添加音轨到播放列表 + + + + Remove tracks from playlist automatically + 自动从播放列表删除音轨 + + + + Removable Device Detection + 可移动设备检测 + + + + Add files to playlist automatically + 自动添加文件到播放列表 + + + + Remove files from playlist automatically + 自动从播放列表删除文件 + + + + UDisks2Factory + + + UDisks2 Plugin + UDisk2插件 + + + + About UDisks2 Plugin + 关于UDisk2插件 + + + + Qmmp UDisks2 Plugin + Qmmp播放器UDisk2插件 + + + + This plugin provides removable devices detection using UDisks2 + 本插件使用UDisk2提供对移动设备的探测功能 + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + + + + + UDisks2Plugin + + + Add CD "%1" + 增加CD"%1" + + + + Add Volume "%1" + 增加音量"%1" + + + diff --git a/src/plugins/General/udisks/translations/udisks_plugin_zh_TW.ts b/src/plugins/General/udisks/translations/udisks_plugin_zh_TW.ts new file mode 100644 index 000000000..adc7ed488 --- /dev/null +++ b/src/plugins/General/udisks/translations/udisks_plugin_zh_TW.ts @@ -0,0 +1,83 @@ + + + + + SettingsDialog + + + UDisks Plugin Settings + UDisks 插件設定 + + + + CD Audio Detection + CD 音頻檢測 + + + + Add tracks to playlist automatically + 自動添加音軌到播放清單 + + + + Remove tracks from playlist automatically + 自動從播放清單刪除音軌 + + + + Removable Device Detection + 可移動設備檢測 + + + + Add files to playlist automatically + 自動添加檔案到播放清單 + + + + Remove files from playlist automatically + 自動從播放清單刪除檔案 + + + + UDisks2Factory + + + UDisks2 Plugin + + + + + About UDisks2 Plugin + + + + + Qmmp UDisks2 Plugin + + + + + This plugin provides removable devices detection using UDisks2 + + + + + Written by: Ilya Kotov <forkotov02@ya.ru> + 撰寫:Ilya Kotov <forkotov02@ya.ru> + + + + UDisks2Plugin + + + Add CD "%1" + 添加 CD "%1" + + + + Add Volume "%1" + 添加卷 "%1" + + + diff --git a/src/plugins/General/udisks/udisks.pro b/src/plugins/General/udisks/udisks.pro new file mode 100644 index 000000000..ca99c7a5e --- /dev/null +++ b/src/plugins/General/udisks/udisks.pro @@ -0,0 +1,26 @@ +include(../../plugins.pri) + +TARGET = $$PLUGINS_PREFIX/General/udisks + +QT += dbus + +HEADERS += udisksfactory.h \ + udisksplugin.h \ + udisksmanager.h \ + udisksdevice.h \ + settingsdialog.h + +SOURCES += udisksfactory.cpp \ + udisksplugin.cpp \ + udisksmanager.cpp \ + udisksdevice.cpp \ + settingsdialog.cpp + +FORMS += settingsdialog.ui + +RESOURCES = translations/translations.qrc + +LIBS += $$QMMPUI_LIB + +target.path = $$PLUGIN_DIR/General +INSTALLS += target diff --git a/src/plugins/General/udisks/udisksdevice.cpp b/src/plugins/General/udisks/udisksdevice.cpp new file mode 100644 index 000000000..544d5a8a0 --- /dev/null +++ b/src/plugins/General/udisks/udisksdevice.cpp @@ -0,0 +1,118 @@ +/*************************************************************************** + * Copyright (C) 2013-2021 by Ilya Kotov * + * forkotov02@ya.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#if (QT_VERSION < QT_VERSION_CHECK(5, 7, 0)) //qAsConst template +#include +#endif +#include "udisksdevice.h" + +UDisksDevice::UDisksDevice(QDBusObjectPath o, QObject *parent) : QObject(parent) +{ + m_block_interface = new QDBusInterface("org.freedesktop.UDisks2", o.path(), + "org.freedesktop.UDisks2.Block", QDBusConnection::systemBus(), + this); + + QDBusObjectPath drive_object = property("Drive").value(); + + QDBusConnection::systemBus().connect("org.freedesktop.UDisks2", o.path(), + "org.freedesktop.DBus.Properties","PropertiesChanged", + this, SIGNAL(changed())); + + m_drive_interface = new QDBusInterface("org.freedesktop.UDisks2", drive_object.path(), + "org.freedesktop.UDisks2.Drive", QDBusConnection::systemBus(), + this); + m_path = o; +} + +UDisksDevice::~UDisksDevice() +{ +} + +QVariant UDisksDevice::property(const QString &key) const +{ + return m_block_interface->property(key.toLatin1().data()); +} + +bool UDisksDevice::isRemovable() const +{ + return m_drive_interface->property("Removable").toBool(); +} + +bool UDisksDevice::isMediaRemovable() const +{ + return m_drive_interface->property("MediaRemovable").toBool(); +} + +bool UDisksDevice::isAudio() const +{ + return m_drive_interface->property("OpticalNumAudioTracks").toInt() > 0; +} + +bool UDisksDevice::isMounted() const +{ + return !mountPoints().isEmpty(); +} + +bool UDisksDevice::isOptical() const +{ + return m_drive_interface->property("Optical").toBool(); +} + +QStringList UDisksDevice::mountPoints() const +{ + QStringList points; + QDBusMessage message = QDBusMessage::createMethodCall("org.freedesktop.UDisks2", m_path.path(), + "org.freedesktop.DBus.Properties", "Get"); + + QList arguments; + arguments << "org.freedesktop.UDisks2.Filesystem" << "MountPoints"; + message.setArguments(arguments); + + QDBusMessage reply = QDBusConnection::systemBus().call(message); + + const QList args = reply.arguments(); + + for(const QVariant &arg : qAsConst(args)) + { + QByteArrayList list; + QDBusArgument a = arg.value().variant().value(); + if(a.currentType() != QDBusArgument::ArrayType) + continue; + a >> list; + + for(const QByteArray &p : qAsConst(list)) + points.append(p); + } + return points; +} + +QString UDisksDevice::deviceFile() const +{ + return QString::fromLatin1(m_block_interface->property("Device").toByteArray()); +} + +QDBusObjectPath UDisksDevice::objectPath() const +{ + return m_path; +} diff --git a/src/plugins/General/udisks/udisksdevice.h b/src/plugins/General/udisks/udisksdevice.h new file mode 100644 index 000000000..e027cd2be --- /dev/null +++ b/src/plugins/General/udisks/udisksdevice.h @@ -0,0 +1,91 @@ +/*************************************************************************** + * Copyright (C) 2013-2021 by Ilya Kotov * + * forkotov02@ya.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef UDISKS2DEVICE_H +#define UDISKS2DEVICE_H + +#include +#include +#include +#include +#include +#include +#include + +class QDBusInterface; + +typedef QList QByteArrayList; +Q_DECLARE_METATYPE(QByteArrayList) + +inline const QDBusArgument &operator>>(const QDBusArgument &arg, QByteArrayList &list) +{ + arg.beginArray(); + list.clear(); + + while (!arg.atEnd()) + { + QByteArray element; + arg >> element; + list.append( element ); + } + arg.endArray(); + return arg; +} + +inline QDBusArgument &operator<<(QDBusArgument &arg, const QByteArrayList &list) +{ + arg.beginArray(qMetaTypeId()); + for (int i = 0; i < list.count(); ++i) + arg << list[i]; + arg.endArray(); + return arg; +} + + +/** + @author Ilya Kotov +*/ +class UDisksDevice : public QObject +{ + Q_OBJECT +public: + UDisksDevice(QDBusObjectPath o, QObject *parent = nullptr); + + ~UDisksDevice(); + + QVariant property(const QString &key) const; + bool isRemovable() const; + bool isMediaRemovable() const; + bool isAudio() const; + bool isMounted() const; + bool isOptical() const; + QStringList mountPoints() const; + QString deviceFile() const; + QDBusObjectPath objectPath() const; + +signals: + void changed(); + +private: + QDBusInterface *m_block_interface; + QDBusInterface *m_drive_interface; + QDBusObjectPath m_path; +}; + +#endif diff --git a/src/plugins/General/udisks/udisksfactory.cpp b/src/plugins/General/udisks/udisksfactory.cpp new file mode 100644 index 000000000..c9237f65a --- /dev/null +++ b/src/plugins/General/udisks/udisksfactory.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (C) 2013-2021 by Ilya Kotov * + * forkotov02@ya.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include +#include +#include "settingsdialog.h" +#include "udisksplugin.h" +#include "udisksfactory.h" + +GeneralProperties UDisksFactory::properties() const +{ + GeneralProperties properties; + properties.name = tr("UDisks Plugin"); + properties.shortName = "udisks"; + properties.hasAbout = true; + properties.hasSettings = true; + properties.visibilityControl = false; + return properties; +} + +QObject *UDisksFactory::create(QObject *parent) +{ + return new UDisksPlugin(parent); +} + +QDialog *UDisksFactory::createConfigDialog(QWidget *parent) +{ + return new SettingsDialog(parent); +} + +void UDisksFactory::showAbout(QWidget *parent) +{ + QMessageBox::about (parent, tr("About UDisks Plugin"), + tr("Qmmp UDisks Plugin") + "\n" + + tr("This plugin provides removable devices detection using UDisks") + "\n" + + tr("Written by: Ilya Kotov ")); +} + +QString UDisksFactory::translation() const +{ + return QLatin1String(":/udisks_plugin_"); +} diff --git a/src/plugins/General/udisks/udisksfactory.h b/src/plugins/General/udisks/udisksfactory.h new file mode 100644 index 000000000..ceba73de5 --- /dev/null +++ b/src/plugins/General/udisks/udisksfactory.h @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (C) 2013-2021 by Ilya Kotov * + * forkotov02@ya.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef UDISKS2FACTORY_H +#define UDISKS2FACTORY_H + +/** + @author Ilya Kotov +*/ +#include + +#include +#include + +class UDisksFactory : public QObject, public GeneralFactory +{ +Q_OBJECT +Q_PLUGIN_METADATA(IID "org.qmmp.qmmpui.GeneralFactoryInterface.1.0") +Q_INTERFACES(GeneralFactory) +public: + GeneralProperties properties() const override; + QObject *create(QObject *parent) override; + QDialog *createConfigDialog(QWidget *parent) override; + void showAbout(QWidget *parent) override; + QString translation() const override; +}; + +#endif diff --git a/src/plugins/General/udisks/udisksmanager.cpp b/src/plugins/General/udisks/udisksmanager.cpp new file mode 100644 index 000000000..749f36ab1 --- /dev/null +++ b/src/plugins/General/udisks/udisksmanager.cpp @@ -0,0 +1,91 @@ +/*************************************************************************** + * Copyright (C) 2013-2021 by Ilya Kotov * + * forkotov02@ya.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include "udisksmanager.h" + +UDisksManager::UDisksManager(QObject *parent) + : QObject(parent) +{ + m_interface = new QDBusInterface("org.freedesktop.UDisks2", "/org/freedesktop/UDisks2", + "org.freedesktop.DBus.ObjectManager", + QDBusConnection::systemBus(), this); + + m_interface->connection().connect("org.freedesktop.UDisks2", "/org/freedesktop/UDisks2", + "org.freedesktop.DBus.ObjectManager", "InterfacesAdded", + this, SLOT(onInterfacesAdded(QDBusObjectPath,QVariantMapMap))); + + m_interface->connection().connect("org.freedesktop.UDisks2", "/org/freedesktop/UDisks2", + "org.freedesktop.DBus.ObjectManager", "InterfacesRemoved", + this, SIGNAL(onInterfacesRemoved(QDBusObjectPath, QStringList))); +} + + +UDisksManager::~UDisksManager() +{ +} + +QList UDisksManager::findAllDevices() +{ + QList paths; + QDBusMessage call = QDBusMessage::createMethodCall("org.freedesktop.UDisks2", + "/org/freedesktop/UDisks2/block_devices", + "org.freedesktop.DBus.Introspectable", + "Introspect"); + QDBusPendingReply reply = QDBusConnection::systemBus().call(call); + + + if (!reply.isValid()) + { + qWarning("UDisks2Manager: error: %s", qPrintable(reply.error().name())); + return paths; + } + QXmlStreamReader xml(reply.value()); + while (!xml.atEnd()) + { + xml.readNext(); + if (xml.tokenType() == QXmlStreamReader::StartElement && xml.name().toString() == "node" ) + { + QString name = xml.attributes().value("name").toString(); + if(!name.isEmpty()) + paths << QDBusObjectPath("/org/freedesktop/UDisks2/block_devices/" + name); + } + } + return paths; +} + +void UDisksManager::onInterfacesAdded(const QDBusObjectPath &object_path, const QVariantMapMap &) +{ + if(object_path.path().startsWith("/org/freedesktop/UDisks2/jobs")) + return; + emit deviceAdded(object_path); +} + +void UDisksManager::onInterfacesRemoved(const QDBusObjectPath &object_path, const QStringList &) +{ + if(object_path.path().startsWith("/org/freedesktop/UDisks2/jobs")) + return; + emit deviceRemoved(object_path); +} diff --git a/src/plugins/General/udisks/udisksmanager.h b/src/plugins/General/udisks/udisksmanager.h new file mode 100644 index 000000000..9e8fc14d2 --- /dev/null +++ b/src/plugins/General/udisks/udisksmanager.h @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (C) 2013-2021 by Ilya Kotov * + * forkotov02@ya.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef UDISKS2MANAGER_H +#define UDISKS2MANAGER_H + +#include +#include +#include +#include + +class QDBusInterface; + +typedef QMap QVariantMapMap; +Q_DECLARE_METATYPE(QVariantMapMap) + +/** + @author Ilya Kotov +*/ +class UDisksManager : public QObject +{ +Q_OBJECT +public: + UDisksManager(QObject *parent = nullptr); + + ~UDisksManager(); + + QList findAllDevices(); + +signals: + void deviceAdded(QDBusObjectPath); + void deviceRemoved(QDBusObjectPath); + +private slots: + void onInterfacesAdded(const QDBusObjectPath &object_path, const QVariantMapMap &); + void onInterfacesRemoved(const QDBusObjectPath &object_path, const QStringList &); + +private: + QDBusInterface *m_interface; + +}; + +#endif diff --git a/src/plugins/General/udisks/udisksplugin.cpp b/src/plugins/General/udisks/udisksplugin.cpp new file mode 100644 index 000000000..ac1559270 --- /dev/null +++ b/src/plugins/General/udisks/udisksplugin.cpp @@ -0,0 +1,253 @@ +/*************************************************************************** + * Copyright (C) 2013-2021 by Ilya Kotov * + * forkotov02@ya.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "udisksdevice.h" +#include "udisksmanager.h" +#include "udisksplugin.h" + +UDisksPlugin::UDisksPlugin(QObject *parent) : QObject(parent) +{ + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + + m_manager = new UDisksManager(this); + m_actions = new QActionGroup(this); + connect(m_manager,SIGNAL(deviceAdded(QDBusObjectPath)), SLOT(addDevice(QDBusObjectPath))); + connect(m_manager,SIGNAL(deviceRemoved(QDBusObjectPath)), SLOT(removeDevice(QDBusObjectPath))); + connect(m_actions,SIGNAL(triggered (QAction *)), SLOT(processAction(QAction *))); + //load settings + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("UDisks2"); + m_detectCDA = settings.value("cda", true).toBool(); + m_detectRemovable = settings.value("removable", true).toBool(); + m_addTracks = false; //do not load tracks on startup + m_addFiles = false; + //find existing devices + const QList devs = m_manager->findAllDevices(); + for(const QDBusObjectPath &o : qAsConst(devs)) + addDevice(o); + //load remaining settings + m_addTracks = settings.value("add_tracks", false).toBool(); + m_removeTracks = settings.value("remove_tracks", false).toBool(); + m_addFiles = settings.value("add_files", false).toBool(); + m_removeFiles = settings.value("remove_files", false).toBool(); + settings.endGroup(); +} + +UDisksPlugin::~UDisksPlugin() +{ +} + +void UDisksPlugin::removeDevice(QDBusObjectPath o) +{ + QList::iterator it = m_devices.begin(); + while(it != m_devices.end()) + { + if((*it)->objectPath() == o) + { + delete (*it); + it = m_devices.erase(it); + qDebug("UDisksPlugin: removed device: \"%s\"", qPrintable(o.path())); + updateActions(); + break; + } + else + { + ++it; + } + } +} + +void UDisksPlugin::addDevice(QDBusObjectPath o) +{ + for(const UDisksDevice *device : qAsConst(m_devices)) //is it already exists? + { + if (device->objectPath() == o) + return; + } + UDisksDevice *device = new UDisksDevice(o, this); + + if(device->isRemovable()) //detect removable devices only + { + qDebug("UDisksPlugin: added device: \"%s\"", qPrintable(o.path())); + m_devices << device; + updateActions(); + connect(device, SIGNAL(changed()), SLOT(updateActions())); + } + else + delete device; +} + +void UDisksPlugin::updateActions() +{ + // add action for cd audio or mounted volume + for(const UDisksDevice *device : qAsConst(m_devices)) + { + QString dev_path; + if (m_detectCDA && device->isAudio()) //cd audio + { + dev_path = "cdda://" + device->deviceFile(); + } + else if (m_detectRemovable && device->isMounted() && + device->property("Size").toLongLong() < 40000000000LL && + (device->property("IdType").toString() == "vfat" || + device->property("IdType").toString() == "iso9660" || + device->property("IdType").toString() == "udf" || + device->property("IdType").toString() == "ext2")) //mounted volume + { + dev_path = device->mountPoints().first(); + } + else + continue; + + if (!findAction(dev_path)) + { + QAction *action = new QAction(this); + QString actionText; + if (device->isAudio()) + { + actionText = QString(tr("Add CD \"%1\"")).arg(device->deviceFile()); + } + else + { + QString name = device->property("IdLabel").toString(); + if (name.isEmpty()) + name = dev_path; + + actionText = QString(tr("Add Volume \"%1\"")).arg(name); + } + + if (device->isOptical()) + { + if(device->property("IdType").toString() == "iso9660") + action->setIcon(qApp->style()->standardIcon(QStyle::SP_DriveDVDIcon)); + else + action->setIcon(qApp->style()->standardIcon(QStyle::SP_DriveCDIcon)); + } + else + action->setIcon(qApp->style()->standardIcon(QStyle::SP_DriveHDIcon)); + + qDebug("UDisksPlugin: added menu item: \"%s\"", qPrintable(dev_path)); + + action->setText(actionText); + action->setData(dev_path); + m_actions->addAction(action); + UiHelper::instance()->addAction(action, UiHelper::ADD_MENU); + addPath(dev_path); + } + } + // remove action if device is unmounted/removed + for(QAction *action : m_actions->actions()) + { + if (!findDevice(action)) + { + qDebug("UDisksPlugin: removed menu item: \"%s\"", qPrintable(action->data().toString())); + m_actions->removeAction(action); + UiHelper::instance()->removeAction(action); + removePath(action->data().toString()); + action->deleteLater(); + } + } +} + +void UDisksPlugin::processAction(QAction *action) +{ + qDebug("UDisksPlugin: action triggered: %s", qPrintable(action->data().toString())); + QString path = action->data().toString(); + PlayListManager::instance()->selectedPlayList()->add(path); +} + +QAction *UDisksPlugin::findAction(const QString &dev_path) +{ + for(QAction *action : m_actions->actions()) + { + if (action->data().toString() == dev_path) + return action; + } + return nullptr; +} + +UDisksDevice *UDisksPlugin::findDevice(QAction *action) +{ + for(UDisksDevice *device : qAsConst(m_devices)) + { + QString dev_path; + if (device->isAudio()) + { + dev_path = "cdda://" + device->deviceFile(); + if (dev_path == action->data().toString()) + return device; + } + if (device->isMounted()) + { + dev_path = device->mountPoints().first(); + if (dev_path == action->data().toString()) + return device; + } + } + return nullptr; +} + +void UDisksPlugin::addPath(const QString &path) +{ + PlayListModel *model = PlayListManager::instance()->selectedPlayList(); + + for(PlayListItem *item : model->items()) // Is it already exist? + { + if(item->isGroup()) + continue; + if (dynamic_cast(item)->path().startsWith(path)) + return; + } + + if (path.startsWith("cdda://") && m_addTracks) + { + PlayListManager::instance()->selectedPlayList()->add(path); + return; + } + else if (!path.startsWith("cdda://") && m_addFiles) + PlayListManager::instance()->selectedPlayList()->add(path); +} + +void UDisksPlugin::removePath(const QString &path) +{ + if ((path.startsWith("cdda://") && !m_removeTracks) || + (!path.startsWith("cdda://") && !m_removeFiles)) //process settings + return; + + PlayListModel *model = PlayListManager::instance()->selectedPlayList(); + + int i = 0; + while (model->count() > 0 && i < model->count()) + { + if (model->isTrack(i) && model->track(i)->path().startsWith(path)) + model->removeTrack(i); + else + ++i; + } +} diff --git a/src/plugins/General/udisks/udisksplugin.h b/src/plugins/General/udisks/udisksplugin.h new file mode 100644 index 000000000..66727d941 --- /dev/null +++ b/src/plugins/General/udisks/udisksplugin.h @@ -0,0 +1,65 @@ +/*************************************************************************** + * Copyright (C) 2013-2021 by Ilya Kotov * + * forkotov02@ya.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef UDISKS2PLUGIN_H +#define UDISKS2PLUGIN_H + +#include +#include + +class UDisksManager; +class UDisksDevice; +class QActionGroup; +class QAction; + +/** + @author Ilya Kotov +*/ + +class UDisksPlugin : public QObject +{ +Q_OBJECT +public: + UDisksPlugin(QObject *parent = nullptr); + + ~UDisksPlugin(); + +private slots: + void removeDevice(QDBusObjectPath); + void addDevice(QDBusObjectPath); + void processAction(QAction *action); + void updateActions(); + +private: + QAction *findAction(const QString &dev_path); + UDisksDevice *findDevice(QAction *action); + void addPath(const QString &path); + void removePath(const QString &path); + UDisksManager *m_manager; + QList m_devices; + QActionGroup *m_actions; + bool m_detectCDA; + bool m_addTracks; + bool m_removeTracks; + bool m_detectRemovable; + bool m_addFiles; + bool m_removeFiles; +}; + +#endif //UDISKS2PLUGIN_H -- cgit v1.2.3-13-gbd6f