From dc0e3abbbbed90461906493e3fad84b76eb520c5 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 4 Jul 2011 17:53:55 +0000 Subject: added jump-to-track api function git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2268 90c681e8-e032-0410-971d-27865f9a5e38 --- src/app/builtincommandlineoption.cpp | 2 +- src/plugins/Ui/skinned/forms/jumptotrackdialog.ui | 152 --------------------- src/plugins/Ui/skinned/jumptotrackdialog.cpp | 138 ------------------- src/plugins/Ui/skinned/jumptotrackdialog.h | 62 --------- src/plugins/Ui/skinned/mainwindow.cpp | 12 +- src/plugins/Ui/skinned/mainwindow.h | 2 - src/plugins/Ui/skinned/skinned.pro | 3 - .../Ui/skinned/translations/skinned_plugin_cs.ts | 61 +-------- .../Ui/skinned/translations/skinned_plugin_de.ts | 61 +-------- .../Ui/skinned/translations/skinned_plugin_es.ts | 61 +-------- .../Ui/skinned/translations/skinned_plugin_hu.ts | 61 +-------- .../Ui/skinned/translations/skinned_plugin_it.ts | 61 +-------- .../Ui/skinned/translations/skinned_plugin_ja.ts | 61 +-------- .../Ui/skinned/translations/skinned_plugin_lt.ts | 61 +-------- .../Ui/skinned/translations/skinned_plugin_nl.ts | 61 +-------- .../skinned/translations/skinned_plugin_pl_PL.ts | 61 +-------- .../skinned/translations/skinned_plugin_pt_BR.ts | 61 +-------- .../Ui/skinned/translations/skinned_plugin_ru.ts | 61 +-------- .../Ui/skinned/translations/skinned_plugin_sk.ts | 61 +-------- .../Ui/skinned/translations/skinned_plugin_tr.ts | 61 +-------- .../skinned/translations/skinned_plugin_uk_UA.ts | 61 +-------- .../skinned/translations/skinned_plugin_zh_CN.ts | 61 +-------- .../skinned/translations/skinned_plugin_zh_TW.ts | 61 +-------- src/qmmpui/CMakeLists.txt | 3 + src/qmmpui/forms/jumptotrackdialog.ui | 152 +++++++++++++++++++++ src/qmmpui/jumptotrackdialog.cpp | 146 ++++++++++++++++++++ src/qmmpui/jumptotrackdialog_p.h | 61 +++++++++ src/qmmpui/qmmpui.pro | 9 +- src/qmmpui/translations/libqmmpui_cs.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_de.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_es.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_it.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_ja.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_lt.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_nl.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_pl.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_pt_BR.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_ru.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_tr.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_uk_UA.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_zh_CN.ts | 65 ++++++++- src/qmmpui/translations/libqmmpui_zh_TW.ts | 65 ++++++++- src/qmmpui/uihelper.cpp | 16 +++ src/qmmpui/uihelper.h | 6 + 44 files changed, 1284 insertions(+), 1366 deletions(-) delete mode 100644 src/plugins/Ui/skinned/forms/jumptotrackdialog.ui delete mode 100644 src/plugins/Ui/skinned/jumptotrackdialog.cpp delete mode 100644 src/plugins/Ui/skinned/jumptotrackdialog.h create mode 100644 src/qmmpui/forms/jumptotrackdialog.ui create mode 100644 src/qmmpui/jumptotrackdialog.cpp create mode 100644 src/qmmpui/jumptotrackdialog_p.h (limited to 'src') diff --git a/src/app/builtincommandlineoption.cpp b/src/app/builtincommandlineoption.cpp index 3370c882e..cf5ac623b 100644 --- a/src/app/builtincommandlineoption.cpp +++ b/src/app/builtincommandlineoption.cpp @@ -147,7 +147,7 @@ void BuiltinCommandLineOption::executeCommand(const QString &option_string, } else if (option_string == "--jump-to-file" || option_string == "-j") { - //mw->jumpToFile(); + UiHelper::instance()->jumpToTrack(); } else if (option_string == "--quit" || option_string == "-q") { diff --git a/src/plugins/Ui/skinned/forms/jumptotrackdialog.ui b/src/plugins/Ui/skinned/forms/jumptotrackdialog.ui deleted file mode 100644 index 7f94a2845..000000000 --- a/src/plugins/Ui/skinned/forms/jumptotrackdialog.ui +++ /dev/null @@ -1,152 +0,0 @@ - - - JumpToTrackDialog - - - - 0 - 0 - 487 - 315 - - - - Jump To Track - - - - 6 - - - 6 - - - 6 - - - - - 6 - - - 0 - - - - - Filter - - - - - - - - - - - - QAbstractItemView::NoEditTriggers - - - true - - - QAbstractItemView::SelectRows - - - - - - - - - - 0 - 0 - - - - Queue - - - - - - - - 0 - 0 - - - - Refresh - - - - - - - - 0 - 0 - - - - Jump To - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - QDialogButtonBox::Close - - - - - - - - - - - buttonBox - rejected() - JumpToTrackDialog - hide() - - - 457 - 294 - - - 481 - 279 - - - - - diff --git a/src/plugins/Ui/skinned/jumptotrackdialog.cpp b/src/plugins/Ui/skinned/jumptotrackdialog.cpp deleted file mode 100644 index d9df0bb75..000000000 --- a/src/plugins/Ui/skinned/jumptotrackdialog.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-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 "jumptotrackdialog.h" -#include -#include -#include -#include -#include -#include - -JumpToTrackDialog::JumpToTrackDialog(PlayListManager *manager, QWidget* parent) - : QDialog (parent) -{ - setupUi(this); - setAttribute(Qt::WA_QuitOnClose, false); - m_pl_manager = manager; - m_listModel = new QStringListModel(this); - - m_proxyModel = new QSortFilterProxyModel; - m_proxyModel->setDynamicSortFilter(true); - m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); - m_proxyModel->setSourceModel(m_listModel); - songsListView->setModel(m_proxyModel); - - connect(songsListView,SIGNAL(doubleClicked(const QModelIndex &)), - this,SLOT(jumpTo(const QModelIndex&))); - connect(songsListView,SIGNAL(activated(const QModelIndex &)), - this,SLOT(jumpTo(const QModelIndex&))); - connect(songsListView,SIGNAL(activated(const QModelIndex &)), - this,SLOT(accept())); - connect(songsListView->selectionModel(), - SIGNAL(currentRowChanged(const QModelIndex&,const QModelIndex&)), - this,SLOT(queueUnqueue(const QModelIndex&,const QModelIndex&))); - - new QShortcut(tr("Q"),this,SLOT(on_queuePushButton_clicked())); - new QShortcut(tr("J"),this,SLOT(on_jumpToPushButton_clicked())); - new QShortcut(tr("F5"),this,SLOT(on_refreshPushButton_clicked())); - - QAction *selectSongViewAction = new QAction(filterLineEdit); - selectSongViewAction->setShortcut(Qt::Key_Down); - selectSongViewAction->setShortcutContext(Qt::WidgetShortcut); - filterLineEdit->addAction(selectSongViewAction); - connect(selectSongViewAction, SIGNAL(triggered()),songsListView, SLOT(setFocus())); - //setup icons - refreshPushButton->setIcon(QIcon::fromTheme("view-refresh")); - jumpToPushButton->setIcon(QIcon::fromTheme("go-top")); -} - -JumpToTrackDialog::~JumpToTrackDialog() -{ -} - -void JumpToTrackDialog::on_refreshPushButton_clicked() -{ - refresh(); -} - -void JumpToTrackDialog::on_queuePushButton_clicked() -{ - QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); - if (!mi_list.isEmpty()) - { - int selected = (m_proxyModel->mapToSource(mi_list.at(0))).row(); - m_pl_manager->selectedPlayList()->setQueued(m_pl_manager->selectedPlayList()->item(selected)); - if (m_pl_manager->selectedPlayList()->isQueued(m_pl_manager->selectedPlayList()->item(selected))) - queuePushButton->setText(tr("Unqueue")); - else - queuePushButton->setText(tr("Queue")); - } -} - -void JumpToTrackDialog::on_jumpToPushButton_clicked() -{ - QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); - if (!mi_list.isEmpty()) - { - jumpTo(mi_list.at(0)); - } -} - -void JumpToTrackDialog::refresh() -{ - filterLineEdit->clear(); - QStringList titles = m_pl_manager->selectedPlayList()->getTitles(0, m_pl_manager->selectedPlayList()->count()); - m_listModel->setStringList(titles); - filterLineEdit->setFocus(); -} - -void JumpToTrackDialog::on_filterLineEdit_textChanged(const QString &str) -{ - m_proxyModel->setFilterFixedString(str); - if (m_proxyModel->hasIndex(0,0)) - songsListView->setCurrentIndex (m_proxyModel->index (0,0)); -} - -void JumpToTrackDialog::on_filterLineEdit_returnPressed () -{ - QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); - if (!mi_list.isEmpty()) - { - jumpTo(mi_list.at(0)); - accept(); - } -} - -void JumpToTrackDialog::jumpTo(const QModelIndex & index) -{ - int selected = (m_proxyModel->mapToSource(index)).row(); - m_pl_manager->selectedPlayList()->setCurrent(selected); - emit playRequest(); -} - -void JumpToTrackDialog::queueUnqueue(const QModelIndex& curr,const QModelIndex&) -{ - int row = m_proxyModel->mapToSource(curr).row(); - if (m_pl_manager->selectedPlayList()->isQueued(m_pl_manager->selectedPlayList()->item(row))) - queuePushButton->setText(tr("Unqueue")); - else - queuePushButton->setText(tr("Queue")); -} diff --git a/src/plugins/Ui/skinned/jumptotrackdialog.h b/src/plugins/Ui/skinned/jumptotrackdialog.h deleted file mode 100644 index 36186d72c..000000000 --- a/src/plugins/Ui/skinned/jumptotrackdialog.h +++ /dev/null @@ -1,62 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-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 JUMPTOTRACKDIALOG_H -#define JUMPTOTRACKDIALOG_H - -#include -#include "ui_jumptotrackdialog.h" - -class QStringListModel; -class QSortFilterProxyModel; -class PlayListManager; - -/** - @author Vladimir Kuznetsov - */ -class JumpToTrackDialog : public QDialog, private Ui::JumpToTrackDialog -{ - Q_OBJECT - -public: - JumpToTrackDialog(PlayListManager *manager, QWidget* parent = 0); - ~JumpToTrackDialog(); - void refresh(); - -protected slots: - void on_refreshPushButton_clicked(); - void on_queuePushButton_clicked(); - void on_jumpToPushButton_clicked(); - void on_filterLineEdit_textChanged(const QString&); - void on_filterLineEdit_returnPressed (); - void jumpTo(const QModelIndex&); - void queueUnqueue(const QModelIndex&,const QModelIndex&); - -signals: - void playRequest(); - -private: - QStringListModel* m_listModel; - QSortFilterProxyModel* m_proxyModel; - PlayListManager *m_pl_manager; -}; - -#endif - diff --git a/src/plugins/Ui/skinned/mainwindow.cpp b/src/plugins/Ui/skinned/mainwindow.cpp index f991b281a..d30c874e9 100644 --- a/src/plugins/Ui/skinned/mainwindow.cpp +++ b/src/plugins/Ui/skinned/mainwindow.cpp @@ -42,7 +42,6 @@ #include "dock.h" #include "eqwidget.h" #include "mainvisual.h" -#include "jumptotrackdialog.h" #include "aboutdialog.h" #include "addurldialog.h" #include "listwidget.h" @@ -86,9 +85,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) m_equalizer = new EqWidget(this); dock->addWidget(m_equalizer); - m_jumpDialog = new JumpToTrackDialog(m_pl_manager, this); - m_jumpDialog->hide(); - createActions(); //prepare visualization Visual::initialize(this, m_visMenu, SLOT(updateActions())); @@ -107,8 +103,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) connect(m_display,SIGNAL(shuffleToggled(bool)),m_pl_manager,SLOT(setShuffle(bool))); connect(m_display,SIGNAL(repeatableToggled(bool)),m_pl_manager,SLOT(setRepeatableList(bool))); - connect(m_jumpDialog,SIGNAL(playRequest()), SLOT(replay())); - connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(showState(Qmmp::State))); connect(m_core, SIGNAL(elapsedChanged(qint64)),m_playlist, SLOT(setTime(qint64))); connect(m_core, SIGNAL(metaDataChanged()),SLOT(showMetaData())); @@ -467,11 +461,7 @@ void MainWindow::playPause() void MainWindow::jumpToFile() { - if (m_jumpDialog->isHidden()) - { - m_jumpDialog->show(); - m_jumpDialog->refresh(); - } + m_uiHelper->jumpToTrack(this); } void MainWindow::handleCloseRequest() diff --git a/src/plugins/Ui/skinned/mainwindow.h b/src/plugins/Ui/skinned/mainwindow.h index a228b2be9..6b72780ee 100644 --- a/src/plugins/Ui/skinned/mainwindow.h +++ b/src/plugins/Ui/skinned/mainwindow.h @@ -35,7 +35,6 @@ class EqWidget; class MainVisual; class Skin; class SoundCore; -class JumpToTrackDialog; class VisualMenu; class UiHelper; class MediaPlayer; @@ -108,7 +107,6 @@ private: MainVisual *m_vis; bool m_update; Skin *m_skin; - JumpToTrackDialog* m_jumpDialog; bool m_hideOnClose, m_startHidden; VisualMenu *m_visMenu; UiHelper *m_uiHelper; diff --git a/src/plugins/Ui/skinned/skinned.pro b/src/plugins/Ui/skinned/skinned.pro index fffe9071f..1364167d3 100644 --- a/src/plugins/Ui/skinned/skinned.pro +++ b/src/plugins/Ui/skinned/skinned.pro @@ -1,7 +1,6 @@ include(../../plugins.pri) FORMS += forms/configdialog.ui \ forms/preseteditor.ui \ - forms/jumptotrackdialog.ui \ forms/aboutdialog.ui \ forms/addurldialog.ui \ forms/playlistbrowser.ui \ @@ -39,7 +38,6 @@ HEADERS += mainwindow.h \ playlistcontrol.h \ eqpreset.h \ preseteditor.h \ - jumptotrackdialog.h \ aboutdialog.h \ timeindicator.h \ keyboardmanager.h \ @@ -91,7 +89,6 @@ SOURCES += mainwindow.cpp \ playlistcontrol.cpp \ eqpreset.cpp \ preseteditor.cpp \ - jumptotrackdialog.cpp \ aboutdialog.cpp \ timeindicator.cpp \ keyboardmanager.cpp \ diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_cs.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_cs.ts index de253f678..7622fee29 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_cs.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_cs.ts @@ -1052,57 +1052,6 @@ Importovat předvolbu - - JumpToTrackDialog - - - Q - Q - - - - J - J - - - - F5 - F5 - - - - - Unqueue - Vyřadit - - - - - - Queue - Zařadit - - - - Jump To Track - Přeskočit na skladbu - - - - Filter - Filtr - - - - Refresh - Načíst znovu - - - - Jump To - Přeskočit na - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File Přeskočit na soubo&r - + J J - + View Zobrazení - + Playlist Seznam skladeb - + Tools Nástroje diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_de.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_de.ts index c7af52ee5..4756766c8 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_de.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_de.ts @@ -1052,57 +1052,6 @@ Voreinstellung importieren - - JumpToTrackDialog - - - Q - Q - - - - J - J - - - - F5 - F5 - - - - - Unqueue - Aus Warteschlange entfernen - - - - - - Queue - In Warteschlange - - - - Jump To Track - Zu Titel springen - - - - Filter - Filter - - - - Refresh - Aktualisieren - - - - Jump To - Springen zu - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File Springe zu &Titel - + J J - + View Ansicht - + Playlist Wiedergabeliste - + Tools Werkzeuge diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_es.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_es.ts index 495dce779..922ae4a27 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_es.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_es.ts @@ -1052,57 +1052,6 @@ Importar preprogramado - - JumpToTrackDialog - - - Q - Q - - - - J - J - - - - F5 - F5 - - - - - Unqueue - Desencolar - - - - - - Queue - Encolar - - - - Jump To Track - Saltar hasta pista - - - - Filter - Filtrar - - - - Refresh - Actualizar - - - - Jump To - Saltar a - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File &Saltar a archivo - + J J - + View Ver - + Playlist Lista de reproducción - + Tools Herramientas diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_hu.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_hu.ts index cccf502f4..cc6b22197 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_hu.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_hu.ts @@ -1052,57 +1052,6 @@ Beállítás importálása - - JumpToTrackDialog - - - Jump To Track - Ugrás számra - - - - Filter - Szűrő - - - - - - Queue - Sorba betesz - - - - Refresh - Frissít - - - - Jump To - Ugrás - - - - Q - Q - - - - J - J - - - - F5 - F5 - - - - - Unqueue - Sorból kivesz - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + Playlist Lejátszási lista - + &Jump To File &Ugrás fájlra - + J J - + View Megnéz - + Tools Eszközök diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_it.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_it.ts index b93c4f811..31d872ca1 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_it.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_it.ts @@ -1052,57 +1052,6 @@ Importa preimpostazione - - JumpToTrackDialog - - - Q - Q - - - - J - J - - - - F5 - F5 - - - - - Unqueue - Elimna dalla coda - - - - - - Queue - Metti in coda - - - - Jump To Track - Vai alla traccia - - - - Filter - Filtra - - - - Refresh - Aggiorna - - - - Jump To - Vai a - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File &Vai al brano - + J J - + View - + Playlist - + Tools Strumenti diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_ja.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_ja.ts index 82ee5cd2e..c16b56cb9 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_ja.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_ja.ts @@ -1052,57 +1052,6 @@ プリセットを移入 - - JumpToTrackDialog - - - Jump To Track - トラックを指定して即刻再生 - - - - Filter - フィルタ - - - - - - Queue - キューに入れる - - - - Refresh - 再実行 - - - - Jump To - この曲に跳ぶ - - - - Q - Q - - - - J - J - - - - F5 - F5 - - - - - Unqueue - キューから除く - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + Playlist プレイリスト - + &Jump To File ファイルを指定して即刻再生(&J) - + J J - + View 観容 - + Tools ツール diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_lt.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_lt.ts index 403afd03f..77b27eb9a 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_lt.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_lt.ts @@ -1054,57 +1054,6 @@ Importuoti nustatymus - - JumpToTrackDialog - - - Q - - - - - J - - - - - F5 - - - - - - Unqueue - Pašalinti iš eilės - - - - - - Queue - Į eilę - - - - Jump To Track - Pereiti prie takelio - - - - Filter - Filtras - - - - Refresh - Atnaujinti - - - - Jump To - Prereiti prie - - MainDisplay @@ -1329,27 +1278,27 @@ MainWindow - + &Jump To File &Pereiti prie bylos - + J - + View Rodyti - + Playlist Grojaraštis - + Tools Įrankiai diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_nl.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_nl.ts index 0aa4447f6..1e7a32e78 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_nl.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_nl.ts @@ -1052,57 +1052,6 @@ Importer Instelling - - JumpToTrackDialog - - - Q - Q - - - - J - J - - - - F5 - F5 - - - - - Unqueue - Verwijder uit lijst - - - - - - Queue - Rij - - - - Jump To Track - Ga Naar Nummer - - - - Filter - Filter - - - - Refresh - Herlaad - - - - Jump To - Ga Naar - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File &Spring Naar Bestand - + J J - + View Weergave - + Playlist Afspeellijst - + Tools Gereedschappen diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_pl_PL.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_pl_PL.ts index 704837f6b..b6d7e94e1 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_pl_PL.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_pl_PL.ts @@ -1052,57 +1052,6 @@ Importuj Profil - - JumpToTrackDialog - - - Q - Q - - - - J - J - - - - F5 - - - - - - Unqueue - Wykolejkuj - - - - - - Queue - Kolejkuj - - - - Jump To Track - Skocz do utworu - - - - Filter - Filtr - - - - Refresh - Odśwież - - - - Jump To - Skocz do - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File &Skocz do pliku - + J J - + View Wygląd - + Playlist Lista odtwarzania - + Tools Narzędzia diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_pt_BR.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_pt_BR.ts index 1ed9302f4..26e709dd1 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_pt_BR.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_pt_BR.ts @@ -1052,57 +1052,6 @@ Importar Preset - - JumpToTrackDialog - - - Q - - - - - J - - - - - F5 - - - - - - Unqueue - Sem Faixa na Fila - - - - - - Queue - Faixa na Fila - - - - Jump To Track - Pular de faixa - - - - Filter - Filtro - - - - Refresh - Recarregar - - - - Jump To - Pular para - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File Pular para arquivo - + J - + View - + Playlist Lista de músicas - + Tools diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_ru.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_ru.ts index 3ca711197..e4a25ebea 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_ru.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_ru.ts @@ -1052,57 +1052,6 @@ Импорт предустановки - - JumpToTrackDialog - - - Q - - - - - J - - - - - F5 - - - - - - Unqueue - Снять с очереди - - - - - - Queue - В очередь - - - - Jump To Track - Перейти к треку - - - - Filter - Фильтр - - - - Refresh - Обновить - - - - Jump To - Перейти к - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File &Перейти к файлу - + J - + View Вид - + Playlist Список - + Tools Сервис diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_sk.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_sk.ts index d7d3d9eb2..651bfd2dc 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_sk.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_sk.ts @@ -1052,57 +1052,6 @@ Importovat předvolbu - - JumpToTrackDialog - - - Q - Q - - - - J - J - - - - F5 - F5 - - - - - Unqueue - Vyradiť - - - - - - Queue - Zaradiť - - - - Jump To Track - Preskočiť na skladbu - - - - Filter - Filter - - - - Refresh - Obnoviť - - - - Jump To - Preskočiť na - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File &Preskočiť na súbor - + J J - + View Zobraziť - + Playlist Playlist - + Tools Nástroje diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_tr.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_tr.ts index 834583923..18ae4cc3e 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_tr.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_tr.ts @@ -1052,57 +1052,6 @@ Tanımlanmış Ayarları Al - - JumpToTrackDialog - - - Q - Q - - - - J - J - - - - F5 - - - - - - Unqueue - Kuyrukta Değil - - - - - - Queue - Kuyruk - - - - Jump To Track - Parçaya Git - - - - Filter - Filtre - - - - Refresh - Yenile - - - - Jump To - Git - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File &Parçaya Git - + J J - + View - + Playlist Çalma Listesi - + Tools Araçlar diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_uk_UA.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_uk_UA.ts index a0dc30876..0e913383f 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_uk_UA.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_uk_UA.ts @@ -1052,57 +1052,6 @@ Імпорт предвстановлення - - JumpToTrackDialog - - - Q - - - - - J - - - - - F5 - - - - - - Unqueue - Зняти з черги - - - - - - Queue - В чергу - - - - Jump To Track - Перейти до треку - - - - Filter - Фильтр - - - - Refresh - Поновити - - - - Jump To - Перейти до - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File &Перейти до файлу - + J - + View Вигляд - + Playlist Список - + Tools Утиліти diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_zh_CN.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_zh_CN.ts index 395d0447d..3103215e0 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_zh_CN.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_zh_CN.ts @@ -1052,57 +1052,6 @@ 导入预设 - - JumpToTrackDialog - - - Q - Q - - - - J - J - - - - F5 - - - - - - Unqueue - 移出队列 - - - - - - Queue - 加入队列 - - - - Jump To Track - 跳到音轨 - - - - Filter - 过滤 - - - - Refresh - 刷新 - - - - Jump To - 跳到 - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File 跳到文件(&J) - + J J - + View 视图 - + Playlist 播放列表 - + Tools 工具 diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_zh_TW.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_zh_TW.ts index 73eea588d..0bd4936d7 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_zh_TW.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_zh_TW.ts @@ -1052,57 +1052,6 @@ 導入預設 - - JumpToTrackDialog - - - Q - Q - - - - J - J - - - - F5 - - - - - - Unqueue - 移出佇列 - - - - - - Queue - 加入佇列 - - - - Jump To Track - 跳到音軌 - - - - Filter - 過濾 - - - - Refresh - 刷新 - - - - Jump To - 跳到 - - MainDisplay @@ -1327,27 +1276,27 @@ MainWindow - + &Jump To File 跳到文件(&J) - + J J - + View 視圖 - + Playlist 播放清單 - + Tools 工具 diff --git a/src/qmmpui/CMakeLists.txt b/src/qmmpui/CMakeLists.txt index 0f7884c23..d88850e63 100644 --- a/src/qmmpui/CMakeLists.txt +++ b/src/qmmpui/CMakeLists.txt @@ -41,6 +41,7 @@ SET(libqmmpui_SRCS metadataformatter.cpp templateeditor.cpp uiloader.cpp + jumptotrackdialog.cpp ) SET(libqmmpui_MOC_HDRS @@ -67,6 +68,7 @@ SET(libqmmpui_MOC_HDRS templateeditor.h uiloader.h uifactory.h + jumptotrackdialog_p.h ) SET(libqmmpui_DEVEL_HDRS @@ -95,6 +97,7 @@ SET(libqmmpui_UIS forms/detailsdialog.ui forms/tageditor.ui forms/templateeditor.ui + forms/jumptotrackdialog.ui ) QT4_WRAP_UI(libqmmpui_UIS_H ${libqmmpui_UIS}) diff --git a/src/qmmpui/forms/jumptotrackdialog.ui b/src/qmmpui/forms/jumptotrackdialog.ui new file mode 100644 index 000000000..7f94a2845 --- /dev/null +++ b/src/qmmpui/forms/jumptotrackdialog.ui @@ -0,0 +1,152 @@ + + + JumpToTrackDialog + + + + 0 + 0 + 487 + 315 + + + + Jump To Track + + + + 6 + + + 6 + + + 6 + + + + + 6 + + + 0 + + + + + Filter + + + + + + + + + + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::SelectRows + + + + + + + + + + 0 + 0 + + + + Queue + + + + + + + + 0 + 0 + + + + Refresh + + + + + + + + 0 + 0 + + + + Jump To + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + QDialogButtonBox::Close + + + + + + + + + + + buttonBox + rejected() + JumpToTrackDialog + hide() + + + 457 + 294 + + + 481 + 279 + + + + + diff --git a/src/qmmpui/jumptotrackdialog.cpp b/src/qmmpui/jumptotrackdialog.cpp new file mode 100644 index 000000000..a84b3ce25 --- /dev/null +++ b/src/qmmpui/jumptotrackdialog.cpp @@ -0,0 +1,146 @@ +/*************************************************************************** + * Copyright (C) 2007-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 "jumptotrackdialog_p.h" +#include "playlistmanager.h" +#include "mediaplayer.h" +#include +#include +#include +#include +#include +#include + +JumpToTrackDialog::JumpToTrackDialog(PlayListModel *model, QWidget* parent) + : QDialog (parent) +{ + setupUi(this); + setAttribute(Qt::WA_QuitOnClose, false); + setAttribute(Qt::WA_DeleteOnClose, true); + m_model = model; + m_pl_manager = PlayListManager::instance(); + m_listModel = new QStringListModel(this); + + m_proxyModel = new QSortFilterProxyModel; + m_proxyModel->setDynamicSortFilter(true); + m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); + m_proxyModel->setSourceModel(m_listModel); + songsListView->setModel(m_proxyModel); + + connect(songsListView,SIGNAL(doubleClicked(const QModelIndex &)), + this,SLOT(jumpTo(const QModelIndex&))); + connect(songsListView,SIGNAL(activated(const QModelIndex &)), + this,SLOT(jumpTo(const QModelIndex&))); + connect(songsListView,SIGNAL(activated(const QModelIndex &)), + this,SLOT(accept())); + connect(songsListView->selectionModel(), + SIGNAL(currentRowChanged(const QModelIndex&,const QModelIndex&)), + this,SLOT(queueUnqueue(const QModelIndex&,const QModelIndex&))); + + connect(m_model, SIGNAL(destroyed()), SLOT(close())); + + new QShortcut(tr("Q"),this,SLOT(on_queuePushButton_clicked())); + new QShortcut(tr("J"),this,SLOT(on_jumpToPushButton_clicked())); + new QShortcut(tr("F5"),this,SLOT(on_refreshPushButton_clicked())); + + QAction *selectSongViewAction = new QAction(filterLineEdit); + selectSongViewAction->setShortcut(Qt::Key_Down); + selectSongViewAction->setShortcutContext(Qt::WidgetShortcut); + filterLineEdit->addAction(selectSongViewAction); + connect(selectSongViewAction, SIGNAL(triggered()),songsListView, SLOT(setFocus())); + //setup icons + refreshPushButton->setIcon(QIcon::fromTheme("view-refresh")); + jumpToPushButton->setIcon(QIcon::fromTheme("go-top")); +} + +JumpToTrackDialog::~JumpToTrackDialog() +{ +} + +void JumpToTrackDialog::on_refreshPushButton_clicked() +{ + refresh(); +} + +void JumpToTrackDialog::on_queuePushButton_clicked() +{ + QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); + if (!mi_list.isEmpty()) + { + int selected = (m_proxyModel->mapToSource(mi_list.at(0))).row(); + m_model->setQueued(m_model->item(selected)); + if (m_model->isQueued(m_model->item(selected))) + queuePushButton->setText(tr("Unqueue")); + else + queuePushButton->setText(tr("Queue")); + } +} + +void JumpToTrackDialog::on_jumpToPushButton_clicked() +{ + QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); + if (!mi_list.isEmpty()) + { + jumpTo(mi_list.at(0)); + } +} + +void JumpToTrackDialog::refresh() +{ + filterLineEdit->clear(); + QStringList titles = m_model->getTitles(0, m_model->count()); + m_listModel->setStringList(titles); + filterLineEdit->setFocus(); +} + +void JumpToTrackDialog::on_filterLineEdit_textChanged(const QString &str) +{ + m_proxyModel->setFilterFixedString(str); + if (m_proxyModel->hasIndex(0,0)) + songsListView->setCurrentIndex (m_proxyModel->index (0,0)); +} + +void JumpToTrackDialog::on_filterLineEdit_returnPressed () +{ + QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); + if (!mi_list.isEmpty()) + { + jumpTo(mi_list.at(0)); + accept(); + } +} + +void JumpToTrackDialog::jumpTo(const QModelIndex & index) +{ + int selected = (m_proxyModel->mapToSource(index)).row(); + m_model->setCurrent(selected); + SoundCore::instance()->stop(); + m_pl_manager->activatePlayList(m_model); + MediaPlayer::instance()->play(); +} + +void JumpToTrackDialog::queueUnqueue(const QModelIndex& curr,const QModelIndex&) +{ + int row = m_proxyModel->mapToSource(curr).row(); + if (m_model->isQueued(m_model->item(row))) + queuePushButton->setText(tr("Unqueue")); + else + queuePushButton->setText(tr("Queue")); +} diff --git a/src/qmmpui/jumptotrackdialog_p.h b/src/qmmpui/jumptotrackdialog_p.h new file mode 100644 index 000000000..04c521801 --- /dev/null +++ b/src/qmmpui/jumptotrackdialog_p.h @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright (C) 2007-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 JUMPTOTRACKDIALOG_P_H +#define JUMPTOTRACKDIALOG_P_H + +#include +#include "ui_jumptotrackdialog.h" + +class QStringListModel; +class QSortFilterProxyModel; +class PlayListManager; +class PlayListModel; + +/** + @author Vladimir Kuznetsov + */ +class JumpToTrackDialog : public QDialog, private Ui::JumpToTrackDialog +{ + Q_OBJECT + +public: + JumpToTrackDialog(PlayListModel *model, QWidget* parent = 0); + ~JumpToTrackDialog(); + void refresh(); + +private slots: + void on_refreshPushButton_clicked(); + void on_queuePushButton_clicked(); + void on_jumpToPushButton_clicked(); + void on_filterLineEdit_textChanged(const QString&); + void on_filterLineEdit_returnPressed (); + void jumpTo(const QModelIndex&); + void queueUnqueue(const QModelIndex&,const QModelIndex&); + +private: + QStringListModel* m_listModel; + QSortFilterProxyModel* m_proxyModel; + PlayListManager *m_pl_manager; + PlayListModel *m_model; +}; + +#endif //JUMPTOTRACKDIALOG_P_H + diff --git a/src/qmmpui/qmmpui.pro b/src/qmmpui/qmmpui.pro index 01bda0ae2..d466c634d 100644 --- a/src/qmmpui/qmmpui.pro +++ b/src/qmmpui/qmmpui.pro @@ -40,7 +40,8 @@ HEADERS += general.h \ templateeditor.h \ uifactory.h \ uiloader.h \ - uihelper.h + uihelper.h \ + jumptotrackdialog_p.h SOURCES += general.cpp \ playlistparser.cpp \ commandlinemanager.cpp \ @@ -58,10 +59,12 @@ SOURCES += general.cpp \ metadataformatter.cpp \ templateeditor.cpp \ uiloader.cpp \ - uihelper.cpp + uihelper.cpp \ + jumptotrackdialog.cpp FORMS += forms/detailsdialog.ui \ forms/tageditor.ui \ - forms/templateeditor.ui + forms/templateeditor.ui \ + forms/jumptotrackdialog.ui unix:DESTDIR = . RESOURCES += translations/libqmmpui_locales.qrc TRANSLATIONS = translations/libqmmpui_ru.ts \ diff --git a/src/qmmpui/translations/libqmmpui_cs.ts b/src/qmmpui/translations/libqmmpui_cs.ts index 2e4649d0c..78581cc94 100644 --- a/src/qmmpui/translations/libqmmpui_cs.ts +++ b/src/qmmpui/translations/libqmmpui_cs.ts @@ -82,6 +82,57 @@ p, li { white-space: pre-wrap; } <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -268,33 +319,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_de.ts b/src/qmmpui/translations/libqmmpui_de.ts index cebf792b8..8012828b5 100644 --- a/src/qmmpui/translations/libqmmpui_de.ts +++ b/src/qmmpui/translations/libqmmpui_de.ts @@ -82,6 +82,57 @@ p, li { white-space: pre-wrap; } <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -268,33 +319,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_es.ts b/src/qmmpui/translations/libqmmpui_es.ts index ea7b61934..b3cab774a 100644 --- a/src/qmmpui/translations/libqmmpui_es.ts +++ b/src/qmmpui/translations/libqmmpui_es.ts @@ -82,6 +82,57 @@ p, li { white-space: pre-wrap; } <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -268,33 +319,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_it.ts b/src/qmmpui/translations/libqmmpui_it.ts index 3b07f7476..cb2426183 100644 --- a/src/qmmpui/translations/libqmmpui_it.ts +++ b/src/qmmpui/translations/libqmmpui_it.ts @@ -82,6 +82,57 @@ p, li { white-space: pre-wrap; } <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -268,33 +319,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_ja.ts b/src/qmmpui/translations/libqmmpui_ja.ts index 22afdf459..1d3017ba1 100644 --- a/src/qmmpui/translations/libqmmpui_ja.ts +++ b/src/qmmpui/translations/libqmmpui_ja.ts @@ -82,6 +82,57 @@ p, li { white-space: pre-wrap; } ディスク番号 + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -268,33 +319,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_lt.ts b/src/qmmpui/translations/libqmmpui_lt.ts index 2f1c2d50e..3f25c20b2 100644 --- a/src/qmmpui/translations/libqmmpui_lt.ts +++ b/src/qmmpui/translations/libqmmpui_lt.ts @@ -82,6 +82,57 @@ p, li { white-space: pre-wrap; } <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -268,33 +319,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_nl.ts b/src/qmmpui/translations/libqmmpui_nl.ts index 8388b4deb..4804df9fa 100644 --- a/src/qmmpui/translations/libqmmpui_nl.ts +++ b/src/qmmpui/translations/libqmmpui_nl.ts @@ -82,6 +82,57 @@ p, li { white-space: pre-wrap; } <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -268,33 +319,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_pl.ts b/src/qmmpui/translations/libqmmpui_pl.ts index 72ab69cd3..ebac46576 100644 --- a/src/qmmpui/translations/libqmmpui_pl.ts +++ b/src/qmmpui/translations/libqmmpui_pl.ts @@ -78,6 +78,57 @@ p, li { white-space: pre-wrap; } + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -260,33 +311,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_pt_BR.ts b/src/qmmpui/translations/libqmmpui_pt_BR.ts index af378ee8f..509e13aa1 100644 --- a/src/qmmpui/translations/libqmmpui_pt_BR.ts +++ b/src/qmmpui/translations/libqmmpui_pt_BR.ts @@ -78,6 +78,57 @@ p, li { white-space: pre-wrap; } + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -260,33 +311,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_ru.ts b/src/qmmpui/translations/libqmmpui_ru.ts index 995fdbcd4..d94ce66a5 100644 --- a/src/qmmpui/translations/libqmmpui_ru.ts +++ b/src/qmmpui/translations/libqmmpui_ru.ts @@ -78,6 +78,57 @@ p, li { white-space: pre-wrap; } + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -260,33 +311,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_tr.ts b/src/qmmpui/translations/libqmmpui_tr.ts index 1235d847b..fd04a4668 100644 --- a/src/qmmpui/translations/libqmmpui_tr.ts +++ b/src/qmmpui/translations/libqmmpui_tr.ts @@ -78,6 +78,57 @@ p, li { white-space: pre-wrap; } + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -260,33 +311,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_uk_UA.ts b/src/qmmpui/translations/libqmmpui_uk_UA.ts index 8d93934e4..3629711a6 100644 --- a/src/qmmpui/translations/libqmmpui_uk_UA.ts +++ b/src/qmmpui/translations/libqmmpui_uk_UA.ts @@ -78,6 +78,57 @@ p, li { white-space: pre-wrap; } + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -260,33 +311,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_zh_CN.ts b/src/qmmpui/translations/libqmmpui_zh_CN.ts index e4a80bfd1..e32f22ad4 100644 --- a/src/qmmpui/translations/libqmmpui_zh_CN.ts +++ b/src/qmmpui/translations/libqmmpui_zh_CN.ts @@ -78,6 +78,57 @@ p, li { white-space: pre-wrap; } + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -260,33 +311,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/translations/libqmmpui_zh_TW.ts b/src/qmmpui/translations/libqmmpui_zh_TW.ts index f6d02b7cc..5127b06c2 100644 --- a/src/qmmpui/translations/libqmmpui_zh_TW.ts +++ b/src/qmmpui/translations/libqmmpui_zh_TW.ts @@ -78,6 +78,57 @@ p, li { white-space: pre-wrap; } + + JumpToTrackDialog + + + Jump To Track + + + + + Filter + + + + + + + Queue + + + + + Refresh + + + + + Jump To + + + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + + + PlayListManager @@ -260,33 +311,33 @@ p, li { white-space: pre-wrap; } UiHelper - + All Supported Bitstreams - + Select one or more files to open - + Choose a directory - - + + Playlist Files - + Open Playlist - + Save Playlist diff --git a/src/qmmpui/uihelper.cpp b/src/qmmpui/uihelper.cpp index dd2e13148..a975b15b6 100644 --- a/src/qmmpui/uihelper.cpp +++ b/src/qmmpui/uihelper.cpp @@ -29,6 +29,7 @@ #include #include "general.h" #include "generalfactory.h" +#include "jumptotrackdialog_p.h" #include "uihelper.h" UiHelper *UiHelper::m_instance = 0; @@ -39,6 +40,7 @@ UiHelper::UiHelper(QObject *parent) m_instance = this; m_toolsMenu = 0; m_playlistMenu = 0; + m_jumpDialog = 0; General::create(parent); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_lastDir = settings.value("General/last_dir", QDir::homePath()).toString(); //last directory @@ -193,6 +195,20 @@ void UiHelper::savePlayList(QWidget *parent, PlayListModel *model) qWarning("Error: There is no registered playlist parsers"); } +void UiHelper::jumpToTrack(QWidget *parent, PlayListModel *model) +{ + if(!m_jumpDialog) + { + m_jumpDialog = new JumpToTrackDialog(model, parent); + } + if(m_jumpDialog->isHidden()) + { + m_jumpDialog->show(); + m_jumpDialog->refresh(); + } + m_jumpDialog->raise(); +} + void UiHelper::toggleVisibility() { emit toggleVisibilityCalled(); diff --git a/src/qmmpui/uihelper.h b/src/qmmpui/uihelper.h index e6987c618..3fc7732e5 100644 --- a/src/qmmpui/uihelper.h +++ b/src/qmmpui/uihelper.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -34,6 +35,7 @@ class QMenu; class QWidget; class General; class GeneralFactory; +class JumpToTrackDialog; /*! @brief The UiHelper class provides simple api to access general plugins and some gui features. * @author Ilya Kotov @@ -94,6 +96,8 @@ public: PlayListModel *model = PlayListManager::instance()->selectedPlayList()); void savePlayList(QWidget *parent = qApp->activeWindow(), PlayListModel *model = PlayListManager::instance()->selectedPlayList()); + void jumpToTrack(QWidget *parent = qApp->activeWindow(), + PlayListModel *model = PlayListManager::instance()->selectedPlayList()); /*! * Returns a pointer to the object's instance. */ @@ -131,6 +135,8 @@ private: QPointer m_toolsMenu; QPointer m_playlistMenu; QString m_lastDir; + //JumpToTrackDialog *m_jumpDialog; + QPointer m_jumpDialog; static UiHelper* m_instance; }; -- cgit v1.2.3-13-gbd6f