diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-10-20 18:31:52 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-10-20 18:31:52 +0000 |
| commit | bcdb3b5623afff2bddd3f5de9f9e6be37dbfc3f7 (patch) | |
| tree | b94b7e80b021f6b9b5fc650fafc0aad38f0bca08 | |
| parent | 5d057136dcfb9a7dca90783510d905d6aa097ca6 (diff) | |
| download | qmmp-bcdb3b5623afff2bddd3f5de9f9e6be37dbfc3f7.tar.gz qmmp-bcdb3b5623afff2bddd3f5de9f9e6be37dbfc3f7.tar.bz2 qmmp-bcdb3b5623afff2bddd3f5de9f9e6be37dbfc3f7.zip | |
added playlits access from command line
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2414 90c681e8-e032-0410-971d-27865f9a5e38
23 files changed, 633 insertions, 4 deletions
@@ -35,4 +35,4 @@ CONFIG += PROJECTM_PLUGIN CONFIG += WITH_ENCA CONFIG += WITH_PROJECTM20 -CONFIG += WITH_SKINNED
\ No newline at end of file +CONFIG += WITH_SKINNED diff --git a/src/plugins/CommandLineOptions/CMakeLists.txt b/src/plugins/CommandLineOptions/CMakeLists.txt index da214e334..51aae5fdb 100644 --- a/src/plugins/CommandLineOptions/CMakeLists.txt +++ b/src/plugins/CommandLineOptions/CMakeLists.txt @@ -1,3 +1,4 @@ add_subdirectory(IncDecVolumeOption) add_subdirectory(SeekOption) add_subdirectory(StatusOption) +add_subdirectory(PlayListOption) diff --git a/src/plugins/CommandLineOptions/CommandLineOptions.pro b/src/plugins/CommandLineOptions/CommandLineOptions.pro index 5476ca429..ea15469d5 100644 --- a/src/plugins/CommandLineOptions/CommandLineOptions.pro +++ b/src/plugins/CommandLineOptions/CommandLineOptions.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs SUBDIRS = IncDecVolumeOption \ SeekOption \ - StatusOption + StatusOption \ + PlayListOption diff --git a/src/plugins/CommandLineOptions/PlayListOption/CMakeLists.txt b/src/plugins/CommandLineOptions/PlayListOption/CMakeLists.txt new file mode 100644 index 000000000..2b9e5c4cc --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/CMakeLists.txt @@ -0,0 +1,53 @@ +project(libplaylistoption) + +cmake_minimum_required(VERSION 2.4.7) + +if(COMMAND cmake_policy) +cmake_policy(SET CMP0003 NEW) +endif(COMMAND cmake_policy) + + +# qt plugin +ADD_DEFINITIONS( -Wall ) +ADD_DEFINITIONS(${QT_DEFINITIONS}) +ADD_DEFINITIONS(-DQT_PLUGIN) +ADD_DEFINITIONS(-DQT_NO_DEBUG) +ADD_DEFINITIONS(-DQT_SHARED) +ADD_DEFINITIONS(-DQT_THREAD) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +SET(QT_INCLUDES + ${QT_INCLUDES} + ${CMAKE_CURRENT_SOURCE_DIR}/../../../ +) + +# libqmmpui +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) +link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmpui) +link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) + +SET(libplaylistoption_SRCS + playlistoption.cpp +) + +SET(libplaylistoption_MOC_HDRS + playlistoption.h +) + +SET(libplaylistoption_RCCS translations/translations.qrc) + +QT4_ADD_RESOURCES(libplaylistoption_RCC_SRCS ${libplaylistoption_RCCS}) + +QT4_WRAP_CPP(libplaylistoption_MOC_SRCS ${libplaylistoption_MOC_HDRS}) + + +# Don't forget to include output directory, otherwise +# the UI file won't be wrapped! +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +ADD_LIBRARY(playlistoption MODULE ${libplaylistoption_SRCS} ${libplaylistoption_MOC_SRCS} + ${libplaylistoption_RCC_SRCS}) +add_dependencies(playlistoption qmmpui) +target_link_libraries(playlistoption ${QT_LIBRARIES} -lqmmpui -lqmmp) +install(TARGETS playlistoption DESTINATION ${LIB_DIR}/qmmp/CommandLineOptions) diff --git a/src/plugins/CommandLineOptions/PlayListOption/PlayListOption.pro b/src/plugins/CommandLineOptions/PlayListOption/PlayListOption.pro new file mode 100644 index 000000000..43652f4f7 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/PlayListOption.pro @@ -0,0 +1,42 @@ +include(../../plugins.pri) + +CONFIG += release \ +warn_on \ +plugin \ + lib + +TARGET =$$PLUGINS_PREFIX/CommandLineOptions/playlistoption +QMAKE_CLEAN =$$PLUGINS_PREFIX/CommandLineOptions/libplaylistoption.so + +TEMPLATE = lib +QMAKE_LIBDIR += ../../../../lib + +TRANSLATIONS = translations/playlist_plugin_cs.ts \ + translations/playlist_plugin_de.ts \ + translations/playlist_plugin_pl.ts \ + translations/playlist_plugin_ru.ts \ + translations/playlist_plugin_uk_UA.ts \ + translations/playlist_plugin_zh_TW.ts \ + translations/playlist_plugin_zh_CN.ts \ + translations/playlist_plugin_it.ts \ + translations/playlist_plugin_tr.ts \ + translations/playlist_plugin_lt.ts \ + translations/playlist_plugin_nl.ts \ + translations/playlist_plugin_ja.ts \ + translations/playlist_plugin_es.ts + +RESOURCES = translations/translations.qrc + +isEmpty(LIB_DIR){ + LIB_DIR = /lib +} +target.path = $$LIB_DIR/qmmp/CommandLineOptions +INSTALLS += target + +INCLUDEPATH += ../../../../src + +LIBS += -lqmmpui -lqmmp + +HEADERS += playlistoption.h + +SOURCES += playlistoption.cpp diff --git a/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp b/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp new file mode 100644 index 000000000..49324b98a --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp @@ -0,0 +1,101 @@ +/*************************************************************************** + * Copyright (C) 2011 by Ilya Kotov * + * forkotov02@hotmail.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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <QtPlugin> +#include <QTranslator> +#include <QLocale> +#include <qmmp/soundcore.h> +#include <qmmpui/playlistmanager.h> +#include <qmmpui/metadataformatter.h> +#include "playlistoption.h" + +bool PlayListOption::identify(const QString & str) const +{ + return str == QString("--pl-list") || + str == QString("--pl-dump") || + str == QString("--pl-clear"); +} + +const QString PlayListOption::helpString() const +{ + return QString( + "--pl-list " + tr("List all available playlists")+"\n"+ + "--pl-dump <id> " + tr("Show playlist content")+"\n" + + "--pl-clear <id> " + tr("Clear playlist")+"\n" + ); +} + +QString PlayListOption::executeCommand(const QString& opt_str, const QStringList &args) +{ + Q_UNUSED(args); + QString out; + PlayListManager *pl_manager = PlayListManager::instance(); + + if(opt_str == "--pl-list") + { + QStringList names = pl_manager->playListNames(); + for(int i = 0; i < names.count(); ++i) + { + if(i == pl_manager->currentPlayListIndex()) + out += QString("%1. %2 [*]\n").arg(i+1).arg(names.at(i)); + else + out += QString("%1. %2\n").arg(i+1).arg(names.at(i)); + } + } + else if(opt_str == "--pl-dump") + { + MetaDataFormatter formatter("%p%if(%p&%t, - ,)%t%if(%p,,%if(%t,,%f))%if(%l, - %l,)"); + int id = args.isEmpty() ? pl_manager->currentPlayListIndex() : args.at(0).toInt() - 1; + PlayListModel *model = pl_manager->playListAt(id); + if(!model) + return tr("Invalid playlist ID") + "\n"; + for(int i = 0; i < model->count(); ++i) + { + out += QString("%1. %2").arg(i+1).arg(formatter.parse(model->item(i))); + if(i == model->currentRow()) + out += " [*]"; + out += "\n"; + } + } + else if(opt_str == "--pl-clear") + { + int id = args.isEmpty() ? pl_manager->currentPlayListIndex() : args.at(0).toInt() - 1; + PlayListModel *model = pl_manager->playListAt(id); + if(!model) + out = tr("Invalid playlist ID") + "\n"; + model->clear(); + } + return out; +} + +const QString PlayListOption::name() const +{ + return "PlayListOption"; +} + +QTranslator *PlayListOption::createTranslator(QObject *parent) +{ + QTranslator *translator = new QTranslator(parent); + QString locale = Qmmp::systemLanguageID(); + translator->load(QString(":/playlist_plugin_") + locale); + return translator; +} + +Q_EXPORT_PLUGIN2(playlistoption, PlayListOption) diff --git a/src/plugins/CommandLineOptions/PlayListOption/playlistoption.h b/src/plugins/CommandLineOptions/PlayListOption/playlistoption.h new file mode 100644 index 000000000..b9a6c09fa --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/playlistoption.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (C) 2011 by Ilya Kotov * + * forkotov02@hotmail.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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef PLAYLISTOPTION_H +#define PLAYLISTOPTION_H + +#include <QString> +#include <QObject> +#include <QStringList> +#include <qmmpui/commandlineoption.h> +#include <qmmpui/commandlinemanager.h> + +/** + @author Ilya Kotov <forkotov02@hotmail.ru> +*/ +class PlayListOption : public QObject, public CommandLineOption +{ +Q_OBJECT +Q_INTERFACES(CommandLineOption) +public: + virtual bool identify(const QString& opt_str)const; + virtual const QString name()const; + virtual const QString helpString()const; + virtual QString executeCommand(const QString& opt_str, const QStringList &args); + virtual QTranslator *createTranslator(QObject *parent); +}; + +#endif + diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_cs.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_cs.ts new file mode 100644 index 000000000..f7c45ee14 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_cs.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="cs"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_de.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_de.ts new file mode 100644 index 000000000..3e5c8fe29 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_de.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="de_DE"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_es.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_es.ts new file mode 100644 index 000000000..fb1e425d1 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_es.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="es"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_it.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_it.ts new file mode 100644 index 000000000..1e00772e9 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_it.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="it"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_ja.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_ja.ts new file mode 100644 index 000000000..6088c4ef5 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_ja.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="ja_JP"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_lt.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_lt.ts new file mode 100644 index 000000000..2726a423a --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_lt.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="lt"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_nl.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_nl.ts new file mode 100644 index 000000000..6c29a5bb8 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_nl.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="nl"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_pl.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_pl.ts new file mode 100644 index 000000000..761ddac63 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_pl.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="pl"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_ru.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_ru.ts new file mode 100644 index 000000000..6f60f9969 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_ru.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="ru"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_tr.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_tr.ts new file mode 100644 index 000000000..d944c2ac9 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_tr.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="tr_TR"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_uk_UA.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_uk_UA.ts new file mode 100644 index 000000000..a20ecf940 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_uk_UA.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="uk"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_zh_CN.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_zh_CN.ts new file mode 100644 index 000000000..f6d93f54e --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_zh_CN.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="zh_CN"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_zh_TW.ts b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_zh_TW.ts new file mode 100644 index 000000000..eb9d49e45 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_zh_TW.ts @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="zh_TW"> +<context> + <name>PlayListOption</name> + <message> + <location filename="../playlistoption.cpp" line="39"/> + <source>List all available playlists</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="40"/> + <source>Show playlist content</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="41"/> + <source>Clear playlist</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../playlistoption.cpp" line="68"/> + <location filename="../playlistoption.cpp" line="82"/> + <source>Invalid playlist ID</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/CommandLineOptions/PlayListOption/translations/translations.qrc b/src/plugins/CommandLineOptions/PlayListOption/translations/translations.qrc new file mode 100644 index 000000000..8033da631 --- /dev/null +++ b/src/plugins/CommandLineOptions/PlayListOption/translations/translations.qrc @@ -0,0 +1,18 @@ +<!DOCTYPE RCC> +<RCC version="1.0"> + <qresource> + <file>playlist_plugin_it.qm</file> + <file>playlist_plugin_pl.qm</file> + <file>playlist_plugin_ru.qm</file> + <file>playlist_plugin_de.qm</file> + <file>playlist_plugin_cs.qm</file> + <file>playlist_plugin_uk_UA.qm</file> + <file>playlist_plugin_zh_TW.qm</file> + <file>playlist_plugin_zh_CN.qm</file> + <file>playlist_plugin_tr.qm</file> + <file>playlist_plugin_lt.qm</file> + <file>playlist_plugin_nl.qm</file> + <file>playlist_plugin_ja.qm</file> + <file>playlist_plugin_es.qm</file> + </qresource> +</RCC> diff --git a/src/plugins/CommandLineOptions/StatusOption/statusoption.h b/src/plugins/CommandLineOptions/StatusOption/statusoption.h index fa1737ead..1744af3c7 100644 --- a/src/plugins/CommandLineOptions/StatusOption/statusoption.h +++ b/src/plugins/CommandLineOptions/StatusOption/statusoption.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010 by Ilya Kotov * + * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -28,6 +28,9 @@ #include <qmmpui/commandlinemanager.h> +/** + @author Ilya Kotov <forkotov02@hotmail.ru> +*/ class StatusOption : public QObject, public CommandLineOption { Q_OBJECT diff --git a/src/qmmpui/playlistmanager.cpp b/src/qmmpui/playlistmanager.cpp index 2c56ecd58..852224e03 100644 --- a/src/qmmpui/playlistmanager.cpp +++ b/src/qmmpui/playlistmanager.cpp @@ -239,7 +239,7 @@ int PlayListManager::indexOf(PlayListModel *model) const PlayListModel *PlayListManager::playListAt(int i) const { - if(i >= 0 || i < m_models.count()) + if(i >= 0 && i < m_models.count()) return m_models.at(i); return 0; } |
