diff options
Diffstat (limited to 'src/plugins/CommandLineOptions/SeekOption')
| -rw-r--r-- | src/plugins/CommandLineOptions/SeekOption/seekoption.cpp | 32 | ||||
| -rw-r--r-- | src/plugins/CommandLineOptions/SeekOption/seekoption.h | 5 |
2 files changed, 13 insertions, 24 deletions
diff --git a/src/plugins/CommandLineOptions/SeekOption/seekoption.cpp b/src/plugins/CommandLineOptions/SeekOption/seekoption.cpp index 29c70728f..ed367fd9f 100644 --- a/src/plugins/CommandLineOptions/SeekOption/seekoption.cpp +++ b/src/plugins/CommandLineOptions/SeekOption/seekoption.cpp @@ -24,6 +24,17 @@ #include <qmmp/soundcore.h> #include "seekoption.h" +const CommandLineProperties SeekOption::properties() const +{ + CommandLineProperties properties; + properties.shortName = "SeekOption"; + properties.translation = QLatin1String(":/seek_plugin_"); + properties.helpString << QString("--seek <time>") + "||" + tr("Seek to position in the current track") + << QString("--seek-fwd <time>") + "||" + tr("Seek forward") + << QString("--seek-bwd <time>") + "||" + tr("Seek backwards"); + return properties; +} + bool SeekOption::identify(const QString &str) const { QStringList opts; @@ -31,14 +42,6 @@ bool SeekOption::identify(const QString &str) const return opts.contains(str); } -const QStringList SeekOption::helpString() const -{ - return QStringList() - << QString("--seek <time>") + "||" + tr("Seek to position in the current track") - << QString("--seek-fwd <time>") + "||" + tr("Seek forward") - << QString("--seek-bwd <time>") + "||" + tr("Seek backwards"); -} - QString SeekOption::executeCommand(const QString &opt_str, const QStringList &args) { SoundCore *core = SoundCore::instance(); @@ -73,16 +76,3 @@ QString SeekOption::executeCommand(const QString &opt_str, const QStringList &ar return QString(); return QString(); } - -const QString SeekOption::name() const -{ - return "SeekOption"; -} - -/*QTranslator *SeekOption::createTranslator(QObject *parent) -{ - QTranslator *translator = new QTranslator(parent); - QString locale = Qmmp::systemLanguageID(); - translator->load(QString(":/seek_plugin_") + locale); - return translator; -}*/ diff --git a/src/plugins/CommandLineOptions/SeekOption/seekoption.h b/src/plugins/CommandLineOptions/SeekOption/seekoption.h index 80113cd38..24bc608e3 100644 --- a/src/plugins/CommandLineOptions/SeekOption/seekoption.h +++ b/src/plugins/CommandLineOptions/SeekOption/seekoption.h @@ -34,9 +34,8 @@ Q_OBJECT Q_PLUGIN_METADATA(IID "org.qmmp.qmmpui.CommandLineOptionInterface.1.0") Q_INTERFACES(CommandLineOption) public: - virtual bool identify(const QString& opt_str) const; - virtual const QString name() const; - virtual const QStringList helpString() const; + virtual const CommandLineProperties properties() const; + virtual bool identify(const QString &opt_str) const; virtual QString executeCommand(const QString& opt_str, const QStringList &args); }; |
