From abaab158ba5c7e46ecfee3846ae9d596df871212 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 27 Jan 2010 22:25:47 +0000 Subject: added template editor, improved status icon plugin git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1530 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/statusicon/qmmptrayicon.cpp | 20 +- src/plugins/General/statusicon/qmmptrayicon.h | 9 +- src/plugins/General/statusicon/settingsdialog.cpp | 43 ++-- src/plugins/General/statusicon/settingsdialog.h | 6 +- src/plugins/General/statusicon/settingsdialog.ui | 272 ++++++++++++++------- src/plugins/General/statusicon/statusicon.cpp | 49 +--- .../General/statusicon/statusiconpopupwidget.cpp | 74 +++--- .../General/statusicon/statusiconpopupwidget.h | 12 +- .../translations/statusicon_plugin_cs.ts | 57 +++-- .../translations/statusicon_plugin_de.ts | 57 +++-- .../translations/statusicon_plugin_it.ts | 57 +++-- .../translations/statusicon_plugin_lt.ts | 57 +++-- .../translations/statusicon_plugin_pl.ts | 57 +++-- .../translations/statusicon_plugin_ru.ts | 57 +++-- .../translations/statusicon_plugin_tr.ts | 57 +++-- .../translations/statusicon_plugin_uk_UA.ts | 57 +++-- .../translations/statusicon_plugin_zh_CN.ts | 57 +++-- .../translations/statusicon_plugin_zh_TW.ts | 57 +++-- src/qmmpui/CMakeLists.txt | 4 + src/qmmpui/metadataformatter.cpp | 26 +- src/qmmpui/metadataformatter.h | 5 +- src/qmmpui/qmmpui.pro | 9 +- src/qmmpui/templateeditor.cpp | 100 ++++++++ src/qmmpui/templateeditor.h | 59 +++++ src/qmmpui/templateeditor.ui | 110 +++++++++ src/qmmpui/translations/libqmmpui_cs.ts | 88 +++++++ src/qmmpui/translations/libqmmpui_de.ts | 88 +++++++ src/qmmpui/translations/libqmmpui_it.ts | 88 +++++++ src/qmmpui/translations/libqmmpui_lt.ts | 88 +++++++ src/qmmpui/translations/libqmmpui_pl.ts | 88 +++++++ src/qmmpui/translations/libqmmpui_pt_BR.ts | 88 +++++++ src/qmmpui/translations/libqmmpui_ru.ts | 90 ++++++- src/qmmpui/translations/libqmmpui_tr.ts | 88 +++++++ src/qmmpui/translations/libqmmpui_uk_UA.ts | 88 +++++++ src/qmmpui/translations/libqmmpui_zh_CN.ts | 88 +++++++ src/qmmpui/translations/libqmmpui_zh_TW.ts | 88 +++++++ src/ui/popupwidget.cpp | 12 +- 37 files changed, 1956 insertions(+), 394 deletions(-) create mode 100644 src/qmmpui/templateeditor.cpp create mode 100644 src/qmmpui/templateeditor.h create mode 100644 src/qmmpui/templateeditor.ui (limited to 'src') diff --git a/src/plugins/General/statusicon/qmmptrayicon.cpp b/src/plugins/General/statusicon/qmmptrayicon.cpp index d7a7bf230..e335d3079 100644 --- a/src/plugins/General/statusicon/qmmptrayicon.cpp +++ b/src/plugins/General/statusicon/qmmptrayicon.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -43,21 +43,6 @@ void QmmpTrayIcon::showNiceToolTip(bool value) m_showNiceToolTip = value; } -void QmmpTrayIcon::setNiceToolTipDelay(int value) -{ - m_niceToolTipDelay = value; -} - -void QmmpTrayIcon::setNiceToolTipOpacity(qreal value) -{ - m_niceToolTipOpacity = value; -} - -void QmmpTrayIcon::setSplitFileName(bool value) -{ - m_splitFileName = value; -} - bool QmmpTrayIcon::event(QEvent *e) { if (e->type() == QEvent::Wheel ) @@ -96,7 +81,6 @@ void QmmpTrayIcon::showToolTip() { m_PopupWidget = new StatusIconPopupWidget(); } - m_PopupWidget->setWindowOpacity(m_niceToolTipOpacity); - m_PopupWidget->showInfo(geometry().x(),geometry().y(),m_niceToolTipDelay,m_splitFileName); + m_PopupWidget->showInfo(geometry().x(),geometry().y()); } } diff --git a/src/plugins/General/statusicon/qmmptrayicon.h b/src/plugins/General/statusicon/qmmptrayicon.h index 239fe918e..0e211bddb 100644 --- a/src/plugins/General/statusicon/qmmptrayicon.h +++ b/src/plugins/General/statusicon/qmmptrayicon.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -38,9 +38,6 @@ public: ~QmmpTrayIcon(); void showNiceToolTip(bool value); - void setNiceToolTipDelay(int value); - void setNiceToolTipOpacity(qreal value); - void setSplitFileName(bool value); protected: bool event(QEvent *e); @@ -48,11 +45,7 @@ protected: private: void wheelEvent(QWheelEvent *e); void showToolTip(); - bool m_showNiceToolTip; - bool m_splitFileName; - qint32 m_niceToolTipDelay; - qreal m_niceToolTipOpacity; QPointer m_PopupWidget; }; diff --git a/src/plugins/General/statusicon/settingsdialog.cpp b/src/plugins/General/statusicon/settingsdialog.cpp index 1735054c7..391277c6f 100644 --- a/src/plugins/General/statusicon/settingsdialog.cpp +++ b/src/plugins/General/statusicon/settingsdialog.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009 by Ilya Kotov * + * Copyright (C) 2009-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -19,9 +19,9 @@ ***************************************************************************/ #include - +#include #include - +#include "statusiconpopupwidget.h" #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) @@ -32,15 +32,14 @@ SettingsDialog::SettingsDialog(QWidget *parent) settings.beginGroup("Tray"); ui.messageGroupBox->setChecked(settings.value("show_message",TRUE).toBool()); ui.messageDelaySpinBox->setValue(settings.value("message_delay", 2000).toInt()); - ui.niceTooltipGroupBox->setChecked(settings.value("show_nicetooltip", TRUE).toBool()); - ui.niceTooltipDelaySpinBox->setValue(settings.value("nicetooltip_delay",2000).toInt()); - ui.transparencySlider->setValue(settings.value("nicetooltip_transparency",0).toInt()); + ui.niceTooltipGroupBox->setChecked(settings.value("show_tooltip", TRUE).toBool()); + ui.niceTooltipDelaySpinBox->setValue(settings.value("tooltip_delay",2000).toInt()); + ui.transparencySlider->setValue(settings.value("tooltip_transparency",0).toInt()); + ui.coverSizeSlider->setValue(settings.value("tooltip_cover_size", 100).toInt()); ui.niceTooltipSplitCheckBox->setChecked(settings.value("split_file_name",TRUE).toBool()); -#if QT_VERSION >= 0x040400 ui.standardIconsCheckBox->setChecked(settings.value("use_standard_icons",FALSE).toBool()); -#else - ui.standardIconsCheckBox->setEnabled(FALSE); -#endif + ui.progressCheckBox->setChecked(settings.value("tooltip_progress",TRUE).toBool()); + m_template = settings.value("tooltip_template", DEFAULT_TEMPLATE).toString(); settings.endGroup(); } @@ -52,15 +51,23 @@ void SettingsDialog::accept() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Tray"); - settings.setValue ("show_message", ui.messageGroupBox->isChecked()); - settings.setValue ("message_delay", ui.messageDelaySpinBox->value()); - settings.setValue ("show_nicetooltip", ui.niceTooltipGroupBox->isChecked()); - settings.setValue ("nicetooltip_delay", ui.niceTooltipDelaySpinBox->value()); - settings.setValue ("nicetooltip_transparency", ui.transparencySlider->value()); + settings.setValue("show_message", ui.messageGroupBox->isChecked()); + settings.setValue("message_delay", ui.messageDelaySpinBox->value()); settings.setValue("split_file_name", ui.niceTooltipSplitCheckBox->isChecked()); -#if QT_VERSION >= 0x040400 - settings.setValue ("use_standard_icons",ui.standardIconsCheckBox->isChecked()); -#endif + settings.setValue("use_standard_icons", ui.standardIconsCheckBox->isChecked()); + settings.setValue("show_tooltip", ui.niceTooltipGroupBox->isChecked()); + settings.setValue("tooltip_delay", ui.niceTooltipDelaySpinBox->value()); + settings.setValue("tooltip_transparency", ui.transparencySlider->value()); + settings.setValue("tooltip_cover_size", ui.coverSizeSlider->value()); + settings.setValue("tooltip_progress", ui.progressCheckBox->isChecked()); + settings.setValue("tooltip_template", m_template); settings.endGroup(); QDialog::accept(); } + +void SettingsDialog::on_templateButton_clicked() +{ + QString t = TemplateEditor::getTemplate(this, tr("Tooltip Template"), m_template, DEFAULT_TEMPLATE); + if(!t.isEmpty()) + m_template = t; +} diff --git a/src/plugins/General/statusicon/settingsdialog.h b/src/plugins/General/statusicon/settingsdialog.h index 2983bcde9..fe48a9867 100644 --- a/src/plugins/General/statusicon/settingsdialog.h +++ b/src/plugins/General/statusicon/settingsdialog.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -39,8 +39,12 @@ public: public slots: virtual void accept(); +private slots: + void on_templateButton_clicked(); + private: Ui::SettingsDialog ui; + QString m_template; }; diff --git a/src/plugins/General/statusicon/settingsdialog.ui b/src/plugins/General/statusicon/settingsdialog.ui index c6d37b4f5..1425b218e 100644 --- a/src/plugins/General/statusicon/settingsdialog.ui +++ b/src/plugins/General/statusicon/settingsdialog.ui @@ -6,8 +6,8 @@ 0 0 - 340 - 237 + 302 + 322 @@ -23,34 +23,58 @@ 6 - - - - Qt::Horizontal + + + + Balloone message - - - 150 - 18 - + + true - + + + + + Delay, ms: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + 100 + + + 10000 + + + 100 + + + 1000 + + + + + - - + + - + 0 0 - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - Tooltip @@ -61,15 +85,35 @@ true - + + + + Try to split file name when no tag + + + + + + + Show progress bar + + + + Delay, ms: - + + + + 0 + 0 + + 10000 @@ -81,15 +125,15 @@ - + Transparency: - - + + @@ -113,7 +157,7 @@ - 20 + 26 0 @@ -124,67 +168,115 @@ - - + + - Try to split file name when no tag + Cover size: - - - - - - - Balloone message - - - true - - - - - - Delay, ms: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - + + + + + + 32 + + + 160 + + + 16 + + + Qt::Horizontal + + + QSlider::NoTicks + + + + + + + + 3 + 0 + + + + + 26 + 0 + + + + 32 + + + + - - - - - 0 - 0 - - - - 100 - - - 10000 - - - 100 - - - 1000 - - + + + + + + Change template + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - + Use standard icons + + + + Qt::Horizontal + + + + 279 + 23 + + + + + + + + + 0 + 0 + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + @@ -196,8 +288,8 @@ accept() - 333 - 230 + 295 + 315 112 @@ -212,8 +304,8 @@ reject() - 333 - 230 + 295 + 315 27 @@ -228,12 +320,28 @@ setNum(int) - 166 - 127 + 252 + 187 + + + 284 + 188 + + + + + coverSizeSlider + valueChanged(int) + niceTooltipOpacityValueLabel_2 + setNum(int) + + + 184 + 203 - 309 - 129 + 261 + 205 diff --git a/src/plugins/General/statusicon/statusicon.cpp b/src/plugins/General/statusicon/statusicon.cpp index 491e7a1af..e54ef0ded 100644 --- a/src/plugins/General/statusicon/statusicon.cpp +++ b/src/plugins/General/statusicon/statusicon.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -49,43 +49,19 @@ StatusIcon::StatusIcon(QObject *parent) m_hideToTray = settings.value("hide_on_close", FALSE).toBool(); m_useStandardIcons = settings.value("use_standard_icons",FALSE).toBool(); m_tray->showNiceToolTip(settings.value("show_nicetooltip",TRUE).toBool()); - m_tray->setNiceToolTipDelay(settings.value("nicetooltip_delay",2000).toInt()); - m_tray->setNiceToolTipOpacity(1 - (settings.value("nicetooltip_transparency",0).toDouble()/100)); - m_tray->setSplitFileName(settings.value("split_file_name",TRUE).toBool()); -#if QT_VERSION >= 0x040400 if(m_useStandardIcons) m_tray->setIcon(QApplication::style ()->standardIcon(QStyle::SP_MediaStop)); else -#endif m_tray->setIcon ( QIcon(":/tray_stop.png")); m_tray->show(); settings.endGroup(); //actions QMenu *menu = new QMenu(qobject_cast(parent)); - QIcon playIcon; - QIcon pauseIcon; - QIcon stopIcon; - QIcon nextIcon; - QIcon previousIcon; -#if QT_VERSION >= 0x040400 - if(m_useStandardIcons) - { - playIcon = QApplication::style()->standardIcon(QStyle::SP_MediaPlay); - pauseIcon = QApplication::style()->standardIcon(QStyle::SP_MediaPause); - stopIcon = QApplication::style()->standardIcon(QStyle::SP_MediaStop); - nextIcon = QApplication::style()->standardIcon(QStyle::SP_MediaSkipForward); - previousIcon = QApplication::style()->standardIcon(QStyle::SP_MediaSkipBackward); - } - else - { -#endif - playIcon = QIcon(":/tray_play.png"); - pauseIcon = QIcon(":/tray_pause.png"); - stopIcon = QIcon(":/tray_stop.png"); - //TODO add more icons -#if QT_VERSION >= 0x040400 - } -#endif + QIcon playIcon = QApplication::style()->standardIcon(QStyle::SP_MediaPlay); + QIcon pauseIcon = QApplication::style()->standardIcon(QStyle::SP_MediaPause); + QIcon stopIcon = QApplication::style()->standardIcon(QStyle::SP_MediaStop); + QIcon nextIcon = QApplication::style()->standardIcon(QStyle::SP_MediaSkipForward); + QIcon previousIcon = QApplication::style()->standardIcon(QStyle::SP_MediaSkipBackward); menu->addAction(playIcon,tr("Play"), m_player, SLOT(play())); menu->addAction(pauseIcon,tr("Pause"), m_core, SLOT(pause())); menu->addAction(stopIcon,tr("Stop"), m_core, SLOT(stop())); @@ -95,7 +71,6 @@ StatusIcon::StatusIcon(QObject *parent) menu->addSeparator(); menu->addAction(tr("Exit"), this, SLOT(exit())); m_tray->setContextMenu(menu); - connect (m_core, SIGNAL(metaDataChanged ()), SLOT(showMetaData())); connect (m_core, SIGNAL(stateChanged (Qmmp::State)), SLOT(setState(Qmmp::State))); setState(m_core->state()); //update state @@ -113,32 +88,26 @@ void StatusIcon::setState(Qmmp::State state) { case Qmmp::Playing: { -#if QT_VERSION >= 0x040400 if(m_useStandardIcons) m_tray->setIcon(QApplication::style ()->standardIcon(QStyle::SP_MediaPlay)); else -#endif - m_tray->setIcon ( QIcon(":/tray_play.png")); + m_tray->setIcon (QIcon(":/tray_play.png")); break; } case Qmmp::Paused: { -#if QT_VERSION >= 0x040400 if(m_useStandardIcons) m_tray->setIcon(QApplication::style ()->standardIcon(QStyle::SP_MediaPause)); else -#endif - m_tray->setIcon ( QIcon(":/tray_pause.png")); + m_tray->setIcon (QIcon(":/tray_pause.png")); break; } case Qmmp::Stopped: { -#if QT_VERSION >= 0x040400 if(m_useStandardIcons) m_tray->setIcon(QApplication::style ()->standardIcon(QStyle::SP_MediaStop)); else -#endif - m_tray->setIcon ( QIcon(":/tray_stop.png")); + m_tray->setIcon (QIcon(":/tray_stop.png")); break; } } diff --git a/src/plugins/General/statusicon/statusiconpopupwidget.cpp b/src/plugins/General/statusicon/statusiconpopupwidget.cpp index dd5b25334..0d1fe5e8f 100644 --- a/src/plugins/General/statusicon/statusiconpopupwidget.cpp +++ b/src/plugins/General/statusicon/statusiconpopupwidget.cpp @@ -1,8 +1,8 @@ /*************************************************************************** * Copyright (C) 2009 by Artur Guzik * - * a.guzik88@gmail.com - * - * Copyright (C) 2009 by Ilya Kotov * + * a.guzik88@gmail.com * + * * + * Copyright (C) 2009-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -31,8 +31,10 @@ #include #include #include +#include #include #include +#include #include "coverwidget.h" #include "statusiconpopupwidget.h" @@ -48,7 +50,6 @@ StatusIconPopupWidget::StatusIconPopupWidget(QWidget * parent) m_vLayout = new QVBoxLayout(); m_cover = new CoverWidget(this); - m_cover->setFixedSize(100,100); m_hLayout->addWidget(m_cover); m_textLabel = new QLabel(this); @@ -73,7 +74,16 @@ StatusIconPopupWidget::StatusIconPopupWidget(QWidget * parent) connect(SoundCore::instance(),SIGNAL(elapsedChanged(qint64)),this,SLOT(updateTime(qint64))); connect(SoundCore::instance(),SIGNAL(stateChanged(Qmmp::State)),this,SLOT(updateMetaData())); - setVisible(FALSE); + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("Tray"); + m_timer->setInterval(settings.value("tooltip_delay",2000).toInt()); + setWindowOpacity(1.0 - settings.value("tooltip_transparency",0).toInt()/100.0); + int size = settings.value("tooltip_cover_size",100).toInt(); + m_cover->setFixedSize(size,size); + m_splitFileName = settings.value("split_file_name",TRUE).toBool(); + m_showProgress = settings.value("tooltip_progress",TRUE).toBool(); + m_template = settings.value("tooltip_template", DEFAULT_TEMPLATE).toString(); + settings.endGroup(); } StatusIconPopupWidget::~StatusIconPopupWidget() @@ -91,48 +101,23 @@ void StatusIconPopupWidget::updateMetaData() SoundCore *core = SoundCore::instance(); if(core->state() == Qmmp::Playing || core->state() == Qmmp::Paused) { - QString text; - QString title = core->metaData(Qmmp::TITLE); - QString artist = core->metaData(Qmmp::ARTIST); - QString album = core->metaData(Qmmp::ALBUM); - int year = core->metaData(Qmmp::YEAR).toInt(); - if(title.isEmpty()) + QString title = m_template; + SoundCore *core = SoundCore::instance(); + QMap meta; + if(m_splitFileName && meta[Qmmp::TITLE].isEmpty() && !meta[Qmmp::URL].contains("://")) { - title = QFileInfo(core->metaData(Qmmp::URL)).completeBaseName(); - if(m_splitFileName && title.contains("-")) + QString name = QFileInfo(meta[Qmmp::URL]).completeBaseName(); + if(name.contains("-")) { - artist = title.section('-',0,0).trimmed(); - title = title.section('-',1,1).trimmed(); + meta[Qmmp::TITLE] = name.section('-',1,1).trimmed(); + if(meta[Qmmp::ARTIST].isEmpty()) + meta[Qmmp::ARTIST] = name.section('-',0,0).trimmed(); } } - text.append("" + title + ""); - if(core->totalTime() > 0) - { - text.append(" "); - QString time; - int l = core->totalTime()/1000; - if(l > 3600) - time += QString("(%1:%2:%3)").arg(l/3600,2,10,QChar('0')).arg(l%3600/60,2,10,QChar('0')) - .arg(l%60,2,10,QChar('0')); - - else - time = QString("(%1:%2)").arg(l/60,2,10,QChar('0')).arg(l%60,2,10,QChar('0')); - text.append(time); - } - if(!artist.isEmpty()) - { - text.append("
"); - text.append(artist); - } - if(!album.isEmpty()) - { - text.append("
"); - text.append(album); - } - if(year > 0) - text.append(QString("
%1").arg(year)); - m_textLabel->setText(text); + MetaDataFormatter f(title); + title = f.parse(core->metaData(), core->totalTime()/1000); + m_textLabel->setText(title); QPixmap cover = MetaDataManager::instance()->getCover(core->metaData(Qmmp::URL)); m_cover->show(); m_bar->show(); @@ -141,6 +126,7 @@ void StatusIconPopupWidget::updateMetaData() else m_cover->setPixmap(cover); updateTime(core->elapsed()); + m_bar->setVisible(m_showProgress); } else { @@ -186,13 +172,11 @@ void StatusIconPopupWidget::updatePosition(int trayx, int trayy) return; } -void StatusIconPopupWidget::showInfo(int x, int y, int delay, bool splitFileName) +void StatusIconPopupWidget::showInfo(int x, int y) { m_timer->stop(); - m_timer->setInterval(delay); m_lastTrayX = x; m_lastTrayY = y; - m_splitFileName = splitFileName; updateMetaData(); qApp->processEvents(); updatePosition(x,y); diff --git a/src/plugins/General/statusicon/statusiconpopupwidget.h b/src/plugins/General/statusicon/statusiconpopupwidget.h index bcef0cc87..97ab8835f 100644 --- a/src/plugins/General/statusicon/statusiconpopupwidget.h +++ b/src/plugins/General/statusicon/statusiconpopupwidget.h @@ -1,8 +1,8 @@ /*************************************************************************** * Copyright (C) 2009 by Artur Guzik * - * a.guzik88@gmail.com - * - * Copyright (C) 2009 by Ilya Kotov * + * a.guzik88@gmail.com * + * * + * Copyright (C) 2009-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -24,6 +24,8 @@ #ifndef STATUSICONPOPUPWIDGET_H #define STATUSICONPOPUPWIDGET_H +#define DEFAULT_TEMPLATE "%if(%t,%t,%f)\n%if(%p,
%p,)\n%if(%a,
%a,)\n%if(%l,
%l,)" + #include #include #include @@ -44,7 +46,7 @@ public: StatusIconPopupWidget(QWidget * parent = 0); ~StatusIconPopupWidget(); - void showInfo(int x, int y, int delay, bool splitFileName); //x,y are tray icon position + void showInfo(int x, int y); //x,y are tray icon position protected: virtual void mousePressEvent(QMouseEvent *); @@ -66,6 +68,8 @@ private: int m_lastTrayX; int m_lastTrayY; int m_splitFileName; + QString m_template; + bool m_showProgress; }; class TimeBar : public QProgressBar diff --git a/src/plugins/General/statusicon/translations/statusicon_plugin_cs.ts b/src/plugins/General/statusicon/translations/statusicon_plugin_cs.ts index 1a8c12392..fac3f43da 100644 --- a/src/plugins/General/statusicon/translations/statusicon_plugin_cs.ts +++ b/src/plugins/General/statusicon/translations/statusicon_plugin_cs.ts @@ -9,76 +9,101 @@ Nastavení modulu stavové ikony - + Tooltip Popisek - - + + Delay, ms: Prodleva, ms: - + + Show progress bar + + + + Transparency: Průhlednost: - + 0 0 - + Try to split file name when no tag Pokusit se rozdělit název souboru, není-li tag - + Balloone message Zobrazovat zprávu - + + Cover size: + + + + + 32 + + + + + Change template + + + + Use standard icons Použít standardní ikony + + + Tooltip Template + + StatusIcon - + Play Přehrát - + Pause Pauza - + Stop Stop - + Next Další - + Previous Předchozí - + Exit Ukončit - + Now Playing Nyní hraje @@ -119,7 +144,7 @@ StatusIconPopupWidget - + Stopped Zastaveno diff --git a/src/plugins/General/statusicon/translations/statusicon_plugin_de.ts b/src/plugins/General/statusicon/translations/statusicon_plugin_de.ts index e5f27458a..0c1b1bf63 100644 --- a/src/plugins/General/statusicon/translations/statusicon_plugin_de.ts +++ b/src/plugins/General/statusicon/translations/statusicon_plugin_de.ts @@ -9,76 +9,101 @@ Einstellungen Statussymbol-Modul - + Tooltip Kurzinfo - - + + Delay, ms: Anzeigedauer (ms): - + + Show progress bar + + + + Transparency: Transparenz: - + 0 0 - + Try to split file name when no tag - + Balloone message - + + Cover size: + + + + + 32 + + + + + Change template + + + + Use standard icons System-Symbole benutzen + + + Tooltip Template + + StatusIcon - + Play Wiedergabe - + Pause Pause - + Stop Stopp - + Next Nächster - + Previous Vorheriger - + Exit Beenden - + Now Playing Aktueller Titel @@ -119,7 +144,7 @@ StatusIconPopupWidget - + Stopped Angehalten diff --git a/src/plugins/General/statusicon/translations/statusicon_plugin_it.ts b/src/plugins/General/statusicon/translations/statusicon_plugin_it.ts index 2362a343e..85c3696e7 100644 --- a/src/plugins/General/statusicon/translations/statusicon_plugin_it.ts +++ b/src/plugins/General/statusicon/translations/statusicon_plugin_it.ts @@ -9,76 +9,101 @@ Impostazione del modulo icona di stato - + Tooltip Strumento suggerimenti - - + + Delay, ms: Ritardo, ms: - + + Show progress bar + + + + Transparency: Trasparenza: - + 0 0 - + Try to split file name when no tag Dividi nome file se senza tag - + Balloone message Fumetto messaggio - + + Cover size: + + + + + 32 + + + + + Change template + + + + Use standard icons Usa icone standard + + + Tooltip Template + + StatusIcon - + Play Esegui - + Pause Pausa - + Stop Ferma - + Next Successivo - + Previous Precedente - + Exit Esci - + Now Playing Brano in esecuzione: @@ -119,7 +144,7 @@ StatusIconPopupWidget - + Stopped Fermato diff --git a/src/plugins/General/statusicon/translations/statusicon_plugin_lt.ts b/src/plugins/General/statusicon/translations/statusicon_plugin_lt.ts index 5bdc913dc..a445969a3 100644 --- a/src/plugins/General/statusicon/translations/statusicon_plugin_lt.ts +++ b/src/plugins/General/statusicon/translations/statusicon_plugin_lt.ts @@ -9,76 +9,101 @@ Status Icon įskiepio nustatymai - + Tooltip - - + + Delay, ms: Užlaikymas ms: - + + Show progress bar + + + + Transparency: Permatomumas: - + 0 - + Try to split file name when no tag Bandyti išskirti bylos pavadinimą, kai nėra meta duomenų - + Balloone message Iššokantis pranešimas - + + Cover size: + + + + + 32 + + + + + Change template + + + + Use standard icons Naudoti standartines ikonas + + + Tooltip Template + + StatusIcon - + Play Groti - + Pause Pauzė - + Stop Stop - + Next Sekantis takelis - + Previous Ankstesnis takelis - + Exit Uždaryti - + Now Playing Dabar groju @@ -119,7 +144,7 @@ StatusIconPopupWidget - + Stopped Sustojo diff --git a/src/plugins/General/statusicon/translations/statusicon_plugin_pl.ts b/src/plugins/General/statusicon/translations/statusicon_plugin_pl.ts index 22a0f3d24..cd08356c9 100644 --- a/src/plugins/General/statusicon/translations/statusicon_plugin_pl.ts +++ b/src/plugins/General/statusicon/translations/statusicon_plugin_pl.ts @@ -9,76 +9,101 @@ Ustawienia wtyczki Ikona Statusu - + Tooltip Powiadomienie - - + + Delay, ms: Opóźnienie, ms: - + + Show progress bar + + + + Transparency: Przezroczystość: - + 0 - + Try to split file name when no tag Próbuj rozdzielić nazwę pliku jeśli brakuje tagu - + Balloone message Powiadomienie w chmurce - + + Cover size: + + + + + 32 + + + + + Change template + + + + Use standard icons Użyj standardowych ikon + + + Tooltip Template + + StatusIcon - + Play Odtwarzaj - + Pause Pauza - + Stop Zatrzymaj - + Next Następny - + Previous Poprzedni - + Exit Wyjdź - + Now Playing Teraz odtwarza @@ -119,7 +144,7 @@ StatusIconPopupWidget - + Stopped Zatrzymane diff --git a/src/plugins/General/statusicon/translations/statusicon_plugin_ru.ts b/src/plugins/General/statusicon/translations/statusicon_plugin_ru.ts index 66316418e..6a684424c 100644 --- a/src/plugins/General/statusicon/translations/statusicon_plugin_ru.ts +++ b/src/plugins/General/statusicon/translations/statusicon_plugin_ru.ts @@ -9,76 +9,101 @@ Настройки модуля Status Icon - + Tooltip Всплывающая подсказка - - + + Delay, ms: Задержка, мс: - + + Show progress bar + Показывать полосу завершения + + + Transparency: Прозрачность: - + 0 0 - + Try to split file name when no tag Разделить имя файла, если нет тегов - + Balloone message Сообщение - + + Cover size: + Размер обложки: + + + + 32 + + + + + Change template + Изменить шаблон + + + Use standard icons Использовать стандартные иконки + + + Tooltip Template + Шаблон всплывающей подсказки + StatusIcon - + Play Воспроизвести - + Pause Пауза - + Stop Стоп - + Next Следующий фрагмент - + Previous Предыдущий фрагмент - + Exit Выход - + Now Playing Сейчас играет @@ -119,7 +144,7 @@ StatusIconPopupWidget - + Stopped Остановлено diff --git a/src/plugins/General/statusicon/translations/statusicon_plugin_tr.ts b/src/plugins/General/statusicon/translations/statusicon_plugin_tr.ts index e32e41f37..99886d73b 100644 --- a/src/plugins/General/statusicon/translations/statusicon_plugin_tr.ts +++ b/src/plugins/General/statusicon/translations/statusicon_plugin_tr.ts @@ -9,76 +9,101 @@ Durum Simgesi Eklenti Ayarları - + Tooltip - - + + Delay, ms: - + + Show progress bar + + + + Transparency: - + 0 - + Try to split file name when no tag - + Balloone message - + + Cover size: + + + + + 32 + + + + + Change template + + + + Use standard icons Standart simgeleri kullan + + + Tooltip Template + + StatusIcon - + Play Oynat - + Pause Duraklat - + Stop Durdur - + Next Sonraki - + Previous Önceki - + Exit Çık - + Now Playing Şimdi Oynatılıyor @@ -119,7 +144,7 @@ StatusIconPopupWidget - + Stopped diff --git a/src/plugins/General/statusicon/translations/statusicon_plugin_uk_UA.ts b/src/plugins/General/statusicon/translations/statusicon_plugin_uk_UA.ts index a3e21b7ca..45b05c655 100644 --- a/src/plugins/General/statusicon/translations/statusicon_plugin_uk_UA.ts +++ b/src/plugins/General/statusicon/translations/statusicon_plugin_uk_UA.ts @@ -9,76 +9,101 @@ Налаштування модуля Status Icon - + Tooltip Підказка - - + + Delay, ms: Затримка, мс: - + + Show progress bar + + + + Transparency: Прозорість: - + 0 - + Try to split file name when no tag Розділити ім'я файла, якщо немає тегів - + Balloone message Повідомлення - + + Cover size: + + + + + 32 + + + + + Change template + + + + Use standard icons Використовувати стандартні іконки + + + Tooltip Template + + StatusIcon - + Play Грати - + Pause Пауза - + Stop Стоп - + Next Вперед - + Previous Назад - + Exit Вихід - + Now Playing Зараз грає @@ -119,7 +144,7 @@ StatusIconPopupWidget - + Stopped Зупинено diff --git a/src/plugins/General/statusicon/translations/statusicon_plugin_zh_CN.ts b/src/plugins/General/statusicon/translations/statusicon_plugin_zh_CN.ts index e06e6466f..fc85c957d 100644 --- a/src/plugins/General/statusicon/translations/statusicon_plugin_zh_CN.ts +++ b/src/plugins/General/statusicon/translations/statusicon_plugin_zh_CN.ts @@ -9,76 +9,101 @@ 状态图标插件设置 - + Tooltip - - + + Delay, ms: - + + Show progress bar + + + + Transparency: - + 0 - + Try to split file name when no tag - + Balloone message - + + Cover size: + + + + + 32 + + + + + Change template + + + + Use standard icons 使用标准图标 + + + Tooltip Template + + StatusIcon - + Play 播放 - + Pause 暂停 - + Stop 停止 - + Next 下一曲 - + Previous 上一曲 - + Exit 退出 - + Now Playing 正在播放 @@ -119,7 +144,7 @@ StatusIconPopupWidget - + Stopped diff --git a/src/plugins/General/statusicon/translations/statusicon_plugin_zh_TW.ts b/src/plugins/General/statusicon/translations/statusicon_plugin_zh_TW.ts index ce7d11c17..1e0975469 100644 --- a/src/plugins/General/statusicon/translations/statusicon_plugin_zh_TW.ts +++ b/src/plugins/General/statusicon/translations/statusicon_plugin_zh_TW.ts @@ -9,76 +9,101 @@ 狀態圖像插件設定 - + Tooltip - - + + Delay, ms: - + + Show progress bar + + + + Transparency: - + 0 - + Try to split file name when no tag - + Balloone message - + + Cover size: + + + + + 32 + + + + + Change template + + + + Use standard icons 使用標准圖標 + + + Tooltip Template + + StatusIcon - + Play 播放 - + Pause 暫停 - + Stop 停止 - + Next 下一曲 - + Previous 上一曲 - + Exit 結束 - + Now Playing 正在播放 @@ -119,7 +144,7 @@ StatusIconPopupWidget - + Stopped diff --git a/src/qmmpui/CMakeLists.txt b/src/qmmpui/CMakeLists.txt index 595cf4f0c..cf72e83da 100644 --- a/src/qmmpui/CMakeLists.txt +++ b/src/qmmpui/CMakeLists.txt @@ -40,6 +40,7 @@ SET(libqmmpui_SRCS tageditor.cpp playlistmanager.cpp metadataformatter.cpp + templateeditor.cpp ) SET(libqmmpui_MOC_HDRS @@ -64,6 +65,7 @@ SET(libqmmpui_MOC_HDRS tageditor.h playlistmanager.h metadataformatter.h + templateeditor.h ) SET(libqmmpui_DEVEL_HDRS @@ -84,12 +86,14 @@ SET(libqmmpui_DEVEL_HDRS tageditor.h playlistmanager.h metadataformatter.h + templateeditor.h ) SET(libqmmpui_UIS detailsdialog.ui tageditor.ui + templateeditor.ui ) QT4_WRAP_UI(libqmmpui_UIS_H ${libqmmpui_UIS}) diff --git a/src/qmmpui/metadataformatter.cpp b/src/qmmpui/metadataformatter.cpp index dba32abd2..073c6ef88 100644 --- a/src/qmmpui/metadataformatter.cpp +++ b/src/qmmpui/metadataformatter.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009 by Ilya Kotov * + * Copyright (C) 2009-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -33,6 +33,7 @@ Syntax: %f - file name %F - full path %y - year +%l - duration %if(A,B,C) %if(A&B&C,D,E) */ @@ -46,7 +47,12 @@ MetaDataFormatter::MetaDataFormatter(const QString &format) m_format = format; } -QString MetaDataFormatter::parse(const QMap metaData) +QString MetaDataFormatter::parse(AbstractPlaylistItem *item) +{ + return parse(item->metaData(), item->length()); +} + +QString MetaDataFormatter::parse(const QMap metaData, qint64 length) { QString title = m_format; title.replace("\\(", "%28"); @@ -66,6 +72,22 @@ QString MetaDataFormatter::parse(const QMap metaData) title.replace("%f", metaData[Qmmp::URL].section('/',-1)); title.replace("%F", metaData[Qmmp::URL]); title.replace("%y", metaData[Qmmp::YEAR]); + if(title.contains("l")) + { + if (length) + { + QString time; + int l = length; + if(l > 3600) + time == QString("%1:%2:%3").arg(l/3600,2,10,QChar('0')) + .arg(l%3600/60,2,10,QChar('0')).arg(l%60,2,10,QChar('0')); + else + time = QString("%1:%2").arg(l/60,2,10,QChar('0')).arg(l%60,2,10,QChar('0')); + title.replace("%l",time); + } + else + title.replace("%l",""); + } if(title.contains("%if")) title = processIfKeyWord(title); diff --git a/src/qmmpui/metadataformatter.h b/src/qmmpui/metadataformatter.h index c826cb499..b338e2085 100644 --- a/src/qmmpui/metadataformatter.h +++ b/src/qmmpui/metadataformatter.h @@ -23,6 +23,7 @@ #include #include +#include #include /*! @@ -32,12 +33,12 @@ class MetaDataFormatter { public: MetaDataFormatter(const QString &format); - QString parse(const QMap metaData); + QString parse(AbstractPlaylistItem *item); + QString parse(const QMap metaData, qint64 length = 0); private: QString m_format; QString processIfKeyWord(QString title); - }; #endif // METADATAFORMATTER_H diff --git a/src/qmmpui/qmmpui.pro b/src/qmmpui/qmmpui.pro index f7fa82662..51f2cef04 100644 --- a/src/qmmpui/qmmpui.pro +++ b/src/qmmpui/qmmpui.pro @@ -38,7 +38,8 @@ HEADERS += general.h \ detailsdialog.h \ tageditor.h \ playlistmanager.h \ - metadataformatter.h + metadataformatter.h \ + templateeditor.h SOURCES += general.cpp \ generalhandler.cpp \ playlistparser.cpp \ @@ -55,9 +56,11 @@ SOURCES += general.cpp \ detailsdialog.cpp \ tageditor.cpp \ playlistmanager.cpp \ - metadataformatter.cpp + metadataformatter.cpp \ + templateeditor.cpp FORMS += detailsdialog.ui \ - tageditor.ui + tageditor.ui \ + templateeditor.ui unix:DESTDIR = . RESOURCES += translations/libqmmpui_locales.qrc TRANSLATIONS = translations/libqmmpui_ru.ts \ diff --git a/src/qmmpui/templateeditor.cpp b/src/qmmpui/templateeditor.cpp new file mode 100644 index 000000000..203f91e6a --- /dev/null +++ b/src/qmmpui/templateeditor.cpp @@ -0,0 +1,100 @@ +/*************************************************************************** + * Copyright (C) 2010 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 +#include +#include "ui_templateeditor.h" +#include "templateeditor.h" + +TemplateEditor::TemplateEditor(QWidget *parent) : QDialog(parent), m_ui(new Ui::TemplateEditor) +{ + m_ui->setupUi(this); + createMenu(); +} + +QString TemplateEditor::currentTemplate() const +{ + return m_ui->textEdit->toPlainText (); +} + +void TemplateEditor::setTemplate(const QString &text) +{ + m_ui->textEdit->setPlainText(text); +} + +void TemplateEditor::setDefaultTemplate(const QString &text) +{ + m_defaultTemplate = text; +} + +void TemplateEditor::createMenu() +{ + QMenu *menu = new QMenu(this); + menu->addAction(tr("Artist"))->setData("%p"); + menu->addAction(tr("Album"))->setData("%a"); + menu->addAction(tr("Title"))->setData("%t"); + menu->addAction(tr("Track number"))->setData("%n"); + menu->addAction(tr("Two-digit track number"))->setData("%NN"); + menu->addAction(tr("Genre"))->setData("%g"); + menu->addAction(tr("Comment"))->setData("%c"); + menu->addAction(tr("Composer"))->setData("%C"); + menu->addAction(tr("Duration"))->setData("%l"); + menu->addAction(tr("Disc number"))->setData("%D"); + menu->addAction(tr("File name"))->setData("%f"); + menu->addAction(tr("File path"))->setData("%F"); + menu->addAction(tr("Year"))->setData("%y"); + menu->addAction(tr("Condition"))->setData("%if(%p&%t,%p - %t,%f)"); + m_ui->insertButton->setMenu(menu); + connect(menu, SIGNAL(triggered (QAction *)), SLOT(insertExpression(QAction *))); +} + +void TemplateEditor::insertExpression(QAction *a) +{ + m_ui->textEdit->insertPlainText(a->data().toString()); +} + +void TemplateEditor::on_resetButton_clicked() +{ + m_ui->textEdit->setPlainText(m_defaultTemplate); +} + +QString TemplateEditor::getTemplate (QWidget *parent, const QString &title, const QString &text, + const QString &default_template, bool *ok) +{ + TemplateEditor *editor = new TemplateEditor(parent); + editor->setWindowTitle(title); + editor->setTemplate(text); + editor->setDefaultTemplate(default_template); + if(editor->exec() == QDialog::Accepted) + { + if(ok) + *ok = TRUE; + QString t = editor->currentTemplate(); + editor->deleteLater(); + return t; + } + else + { + if(ok) + *ok = FALSE; + editor->deleteLater(); + return QString(); + } +} diff --git a/src/qmmpui/templateeditor.h b/src/qmmpui/templateeditor.h new file mode 100644 index 000000000..c53949ae4 --- /dev/null +++ b/src/qmmpui/templateeditor.h @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (C) 2010 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 TEMPLATEEDITOR_H +#define TEMPLATEEDITOR_H + +#include + + +namespace Ui { + class TemplateEditor; +} +class QAction; + + +/*! + * @author Ilya Kotov + */ +class TemplateEditor : public QDialog +{ +Q_OBJECT +public: + explicit TemplateEditor(QWidget *parent = 0); + + QString currentTemplate() const; + void setTemplate(const QString &text = QString()); + void setDefaultTemplate(const QString &text); + static QString getTemplate (QWidget *parent, const QString &title, const QString &text = QString(), + const QString &default_template = QString(), bool *ok = 0); + +private slots: + void insertExpression(QAction *a); + void on_resetButton_clicked(); + +private: + void createMenu(); + Ui::TemplateEditor *m_ui; + QString m_defaultTemplate; + +}; + +#endif // TEMPLATEEDITOR_H diff --git a/src/qmmpui/templateeditor.ui b/src/qmmpui/templateeditor.ui new file mode 100644 index 000000000..b1f0d9853 --- /dev/null +++ b/src/qmmpui/templateeditor.ui @@ -0,0 +1,110 @@ + + + TemplateEditor + + + + 0 + 0 + 372 + 249 + + + + Template Editor + + + + 6 + + + 6 + + + 6 + + + + + + 0 + 0 + + + + + + + + Reset + + + + + + + Insert + + + + + + + Qt::Horizontal + + + + 124 + 17 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + TemplateEditor + accept() + + + 365 + 242 + + + 157 + 274 + + + + + buttonBox + rejected() + TemplateEditor + reject() + + + 365 + 242 + + + 286 + 274 + + + + + diff --git a/src/qmmpui/translations/libqmmpui_cs.ts b/src/qmmpui/translations/libqmmpui_cs.ts index c91b1b8ae..8ec11fde8 100644 --- a/src/qmmpui/translations/libqmmpui_cs.ts +++ b/src/qmmpui/translations/libqmmpui_cs.ts @@ -167,4 +167,92 @@ p, li { white-space: pre-wrap; } Vložit vybraný tag do souboru + + TemplateEditor + + + Reset + + + + + Insert + + + + + Template Editor + + + + + Artist + Umělec + + + + Album + Album + + + + Title + Název + + + + Track number + + + + + Two-digit track number + + + + + Genre + Žánr + + + + Comment + Poznámka + + + + Composer + Skladatel + + + + Duration + + + + + Disc number + Číslo disku + + + + File name + + + + + File path + + + + + Year + Rok + + + + Condition + + + diff --git a/src/qmmpui/translations/libqmmpui_de.ts b/src/qmmpui/translations/libqmmpui_de.ts index 00b1596b7..a0813fb57 100644 --- a/src/qmmpui/translations/libqmmpui_de.ts +++ b/src/qmmpui/translations/libqmmpui_de.ts @@ -167,4 +167,92 @@ p, li { white-space: pre-wrap; } Ausgewählten Tag in Datei einbeziehen + + TemplateEditor + + + Reset + + + + + Insert + + + + + Template Editor + + + + + Artist + Interpret + + + + Album + Album + + + + Title + Titel + + + + Track number + + + + + Two-digit track number + + + + + Genre + Genre + + + + Comment + Kommentar + + + + Composer + Komponent + + + + Duration + + + + + Disc number + CD-Nummer + + + + File name + + + + + File path + + + + + Year + Jahr + + + + Condition + + + diff --git a/src/qmmpui/translations/libqmmpui_it.ts b/src/qmmpui/translations/libqmmpui_it.ts index ed807048b..9fa3e8c91 100644 --- a/src/qmmpui/translations/libqmmpui_it.ts +++ b/src/qmmpui/translations/libqmmpui_it.ts @@ -167,4 +167,92 @@ p, li { white-space: pre-wrap; } Includi le etichette selezionate nel file + + TemplateEditor + + + Reset + + + + + Insert + + + + + Template Editor + + + + + Artist + Interprete + + + + Album + Album + + + + Title + Titolo + + + + Track number + + + + + Two-digit track number + + + + + Genre + Genere + + + + Comment + Commento + + + + Composer + Compositore + + + + Duration + + + + + Disc number + Disco n° + + + + File name + + + + + File path + + + + + Year + Anno + + + + Condition + + + diff --git a/src/qmmpui/translations/libqmmpui_lt.ts b/src/qmmpui/translations/libqmmpui_lt.ts index ff5282be5..05090f4c4 100644 --- a/src/qmmpui/translations/libqmmpui_lt.ts +++ b/src/qmmpui/translations/libqmmpui_lt.ts @@ -159,4 +159,92 @@ p, li { white-space: pre-wrap; } Įtraukti meta informaciją į bylą + + TemplateEditor + + + Reset + + + + + Insert + + + + + Template Editor + + + + + Artist + Atlikėjas + + + + Album + Albumas + + + + Title + Pavadinimas + + + + Track number + + + + + Two-digit track number + + + + + Genre + Žanras + + + + Comment + Komentaras + + + + Composer + + + + + Duration + + + + + Disc number + Disko numeris + + + + File name + + + + + File path + + + + + Year + Metai + + + + Condition + + + diff --git a/src/qmmpui/translations/libqmmpui_pl.ts b/src/qmmpui/translations/libqmmpui_pl.ts index b225489f9..6b98dffa6 100644 --- a/src/qmmpui/translations/libqmmpui_pl.ts +++ b/src/qmmpui/translations/libqmmpui_pl.ts @@ -159,4 +159,92 @@ p, li { white-space: pre-wrap; } Dołącz wybrany tag do pliku + + TemplateEditor + + + Reset + + + + + Insert + + + + + Template Editor + + + + + Artist + Artysta + + + + Album + Album + + + + Title + Tytuł + + + + Track number + + + + + Two-digit track number + + + + + Genre + Gatunek + + + + Comment + Komentarz + + + + Composer + Kompozytor + + + + Duration + + + + + Disc number + Numer płyty + + + + File name + + + + + File path + + + + + Year + Rok + + + + Condition + + + diff --git a/src/qmmpui/translations/libqmmpui_pt_BR.ts b/src/qmmpui/translations/libqmmpui_pt_BR.ts index d418a02b2..e872b0444 100644 --- a/src/qmmpui/translations/libqmmpui_pt_BR.ts +++ b/src/qmmpui/translations/libqmmpui_pt_BR.ts @@ -159,4 +159,92 @@ p, li { white-space: pre-wrap; } + + TemplateEditor + + + Reset + + + + + Insert + + + + + Template Editor + + + + + Artist + + + + + Album + + + + + Title + + + + + Track number + + + + + Two-digit track number + + + + + Genre + + + + + Comment + + + + + Composer + + + + + Duration + + + + + Disc number + + + + + File name + + + + + File path + + + + + Year + + + + + Condition + + + diff --git a/src/qmmpui/translations/libqmmpui_ru.ts b/src/qmmpui/translations/libqmmpui_ru.ts index 2ff3e89cc..4bb884068 100644 --- a/src/qmmpui/translations/libqmmpui_ru.ts +++ b/src/qmmpui/translations/libqmmpui_ru.ts @@ -31,7 +31,7 @@ Composer - Композитр + Композитор @@ -159,4 +159,92 @@ p, li { white-space: pre-wrap; } Включить выбранный тег в файл + + TemplateEditor + + + Reset + Сброс + + + + Insert + Вставить + + + + Template Editor + Редактор шаблонов + + + + Artist + Исполнитель + + + + Album + Альбом + + + + Title + Название + + + + Track number + Номер трека + + + + Two-digit track number + 2-х разрядный номер трека + + + + Genre + Жанр + + + + Comment + Комментарий + + + + Composer + Композитор + + + + Duration + Длительность + + + + Disc number + Номер диска + + + + File name + Имя файла + + + + File path + Путь к файлу + + + + Year + Год + + + + Condition + Условие + + diff --git a/src/qmmpui/translations/libqmmpui_tr.ts b/src/qmmpui/translations/libqmmpui_tr.ts index 329a73a95..864ed2255 100644 --- a/src/qmmpui/translations/libqmmpui_tr.ts +++ b/src/qmmpui/translations/libqmmpui_tr.ts @@ -159,4 +159,92 @@ p, li { white-space: pre-wrap; } + + TemplateEditor + + + Reset + + + + + Insert + + + + + Template Editor + + + + + Artist + + + + + Album + + + + + Title + + + + + Track number + + + + + Two-digit track number + + + + + Genre + + + + + Comment + + + + + Composer + + + + + Duration + + + + + Disc number + + + + + File name + + + + + File path + + + + + Year + + + + + Condition + + + diff --git a/src/qmmpui/translations/libqmmpui_uk_UA.ts b/src/qmmpui/translations/libqmmpui_uk_UA.ts index 4d6d0e16a..7f2fbf338 100644 --- a/src/qmmpui/translations/libqmmpui_uk_UA.ts +++ b/src/qmmpui/translations/libqmmpui_uk_UA.ts @@ -159,4 +159,92 @@ p, li { white-space: pre-wrap; } Включити вибраний тег у файл + + TemplateEditor + + + Reset + + + + + Insert + + + + + Template Editor + + + + + Artist + Виконавець + + + + Album + Альбом + + + + Title + Заголовок + + + + Track number + + + + + Two-digit track number + + + + + Genre + Жанр + + + + Comment + Коментар + + + + Composer + Композитор + + + + Duration + + + + + Disc number + Номер диску + + + + File name + + + + + File path + + + + + Year + Рік + + + + Condition + + + diff --git a/src/qmmpui/translations/libqmmpui_zh_CN.ts b/src/qmmpui/translations/libqmmpui_zh_CN.ts index 10eda0e5d..c8db7d1ed 100644 --- a/src/qmmpui/translations/libqmmpui_zh_CN.ts +++ b/src/qmmpui/translations/libqmmpui_zh_CN.ts @@ -159,4 +159,92 @@ p, li { white-space: pre-wrap; } + + TemplateEditor + + + Reset + + + + + Insert + + + + + Template Editor + + + + + Artist + + + + + Album + + + + + Title + + + + + Track number + + + + + Two-digit track number + + + + + Genre + + + + + Comment + + + + + Composer + + + + + Duration + + + + + Disc number + + + + + File name + + + + + File path + + + + + Year + + + + + Condition + + + diff --git a/src/qmmpui/translations/libqmmpui_zh_TW.ts b/src/qmmpui/translations/libqmmpui_zh_TW.ts index 08941d523..6bad57b06 100644 --- a/src/qmmpui/translations/libqmmpui_zh_TW.ts +++ b/src/qmmpui/translations/libqmmpui_zh_TW.ts @@ -159,4 +159,92 @@ p, li { white-space: pre-wrap; } + + TemplateEditor + + + Reset + + + + + Insert + + + + + Template Editor + + + + + Artist + + + + + Album + + + + + Title + + + + + Track number + + + + + Two-digit track number + + + + + Genre + + + + + Comment + + + + + Composer + + + + + Duration + + + + + Disc number + + + + + File name + + + + + File path + + + + + Year + + + + + Condition + + + diff --git a/src/ui/popupwidget.cpp b/src/ui/popupwidget.cpp index 0494f6bb0..6d44e0b84 100644 --- a/src/ui/popupwidget.cpp +++ b/src/ui/popupwidget.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -84,16 +84,8 @@ void PopupWidget::popup(PlayListItem *item, QPoint pos) m_lastItem = item; move(pos); QString title = m_template; - - if (item->length() > 0) - { - int l = item->length(); - title.replace("%l",QString("%1:%2").arg(l/60).arg(l%60, 2, 10, QChar('0'))); - } - else - title.replace("%l",""); MetaDataFormatter f(title); - title = f.parse(item->metaData()); + title = f.parse(item); m_label1->setText(title); -- cgit v1.2.3-13-gbd6f