diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-07-09 18:54:22 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-07-09 18:54:22 +0000 |
| commit | e85b77286f66edecdc3707065e39b31f2e220f5a (patch) | |
| tree | 8d92254944d3c9391c61231bc114758f9ac23370 /src/plugins/FileDialogs | |
| parent | c0a9e456b6a935b67f2d3357a9cef7170cfee418 (diff) | |
| download | qmmp-e85b77286f66edecdc3707065e39b31f2e220f5a.tar.gz qmmp-e85b77286f66edecdc3707065e39b31f2e220f5a.tar.bz2 qmmp-e85b77286f66edecdc3707065e39b31f2e220f5a.zip | |
completed file dialog support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@443 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/FileDialogs')
14 files changed, 1556 insertions, 190 deletions
diff --git a/src/plugins/FileDialogs/QmmpFileDialog/QmmpFileDialog.pro b/src/plugins/FileDialogs/QmmpFileDialog/QmmpFileDialog.pro index 5661a3de3..d89ba2d18 100644 --- a/src/plugins/FileDialogs/QmmpFileDialog/QmmpFileDialog.pro +++ b/src/plugins/FileDialogs/QmmpFileDialog/QmmpFileDialog.pro @@ -30,3 +30,12 @@ isEmpty(LIB_DIR){ } target.path = $$LIB_DIR/qmmp/FileDialogs INSTALLS += target + +TRANSLATIONS = translations/qmmp_file_dialog_plugin_ru.ts \ + translations/qmmp_file_dialog_plugin_tr.ts \ + translations/qmmp_file_dialog_plugin_zh_CN.ts \ + translations/qmmp_file_dialog_plugin_cs.ts \ + translations/qmmp_file_dialog_plugin_pt_BR.ts \ + translations/qmmp_file_dialog_plugin_uk_UA.ts \ + translations/qmmp_file_dialog_plugin_zh_TW.ts \ + translations/qmmp_file_dialog_plugin_de.ts diff --git a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.cpp b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.cpp index fce9f6e53..7209394e0 100644 --- a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.cpp +++ b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.cpp @@ -1,4 +1,26 @@ +/************************************************************************** +* Copyright (C) 2008 by Ilya Kotov * +* forkotov02@hotmail.ru * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ + #include <QtPlugin> +#include <QTranslator> +#include <QMessageBox> #include "qmmpfiledialogimpl.h" #include "qmmpfiledialog.h" @@ -25,20 +47,77 @@ QmmpFileDialog::~QmmpFileDialog() qWarning("QmmpFileDialog::~QmmpFileDialog()"); delete m_dialog; } -void QmmpFileDialog::raise(const QString& d,Mode m,const QStringList& f) +void QmmpFileDialog::raise(const QString &dir, Mode mode, const QString &caption, + const QStringList &mask) { - m_dialog->setModeAndMask(d,m,f); + m_dialog->setModeAndMask(dir, mode, mask); + m_dialog->setWindowTitle(caption); m_dialog->show(); m_dialog->raise(); } +QString QmmpFileDialog::openFileName(QWidget *parent, const QString &caption, + const QString &dir, const QString &filter, QString*) +{ + QmmpFileDialogImpl *dialog = new QmmpFileDialogImpl(parent); + dialog->setWindowTitle(caption); + dialog->setModeAndMask(dir, FileDialog::AddFile, filter.split(";;")); + QStringList l; + if (dialog->exec() == QDialog::Accepted) + l = dialog->selectedFiles(); + dialog->deleteLater(); + if (l.isEmpty()) + return QString(); + else + return l.at(0); +} + +QString QmmpFileDialog::saveFileName (QWidget *parent, const QString &caption, + const QString &dir, const QString &filter, QString*) +{ + QmmpFileDialogImpl *dialog = new QmmpFileDialogImpl(parent); + dialog->setWindowTitle(caption); + dialog->setModeAndMask(dir, FileDialog::SaveFile, filter.split(";;")); + QStringList l; + if (dialog->exec() == QDialog::Accepted) + l = dialog->selectedFiles(); + dialog->deleteLater(); + if (l.isEmpty()) + return QString(); + else + return l.at(0); +} + +FileDialog* QmmpFileDialogFactory::create() +{ + return new QmmpFileDialog(); +} -FileDialog* QmmpFileDialogFactory::create(){ return new QmmpFileDialog();} +const FileDialogProperties QmmpFileDialogFactory::properties() const +{ + FileDialogProperties properties; + properties.name = tr("Qmmp File Dialog"); + properties.hasAbout =TRUE; + return properties; +} -QString QmmpFileDialogFactory::name(){return QmmpFileDialogFactoryName;} +void QmmpFileDialogFactory::showAbout(QWidget *parent) +{ + QMessageBox::about (parent, tr("About Qmmp File Dialog"), + tr("Qmmp File Dialog")+"\n"+ + tr("Writen by:\n" + "Vladimir Kuznetsov <vovanec@gmail.com>\n" + "Ilya Kotov <forkotov02@hotmail.ru>")+"\n"+ + tr("Some code is copied from the Qt library")); -QString QmmpFileDialogFactory::QmmpFileDialogFactoryName = "Qmmp File Dialog"; +} +QTranslator *QmmpFileDialogFactory::createTranslator(QObject *parent) +{ + QTranslator *translator = new QTranslator(parent); + QString locale = QLocale::system().name(); + translator->load(QString(":/qmmp_file_dialog_plugin_") + locale); + return translator; +} Q_EXPORT_PLUGIN(QmmpFileDialogFactory) - diff --git a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.h b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.h index 2b69e06c3..e99e5ed2a 100644 --- a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.h +++ b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.h @@ -1,3 +1,24 @@ +/************************************************************************** +* Copyright (C) 2008 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 QMMPFILEDIALOG_H #define QMMPFILEDIALOG_H @@ -7,17 +28,34 @@ class QmmpFileDialogImpl; class QmmpFileDialog : public FileDialog { -Q_OBJECT - public: - QmmpFileDialog(); - virtual ~QmmpFileDialog(); - virtual bool modal()const; - virtual void raise(const QString&,Mode = AddFiles,const QStringList& = QStringList()); - public slots: - void handleSelected(); - - private: - QmmpFileDialogImpl * m_dialog; + Q_OBJECT +public: + QmmpFileDialog(); + virtual ~QmmpFileDialog(); + bool modal()const; + + void raise(const QString &dir = QString(), + Mode mode = AddFiles, + const QString &caption = QString(), + const QStringList &mask = QStringList()); + + QString openFileName(QWidget *parent = 0, + const QString &caption = QString(), + const QString &dir = QString(), + const QString &filter = QString(), + QString *selectedFilter = 0); + + QString saveFileName (QWidget *parent = 0, + const QString &caption = QString(), + const QString &dir = QString(), + const QString &filter = QString(), + QString *selectedFilter = 0); + +public slots: + void handleSelected(); + +private: + QmmpFileDialogImpl *m_dialog; }; @@ -27,11 +65,15 @@ class QmmpFileDialogFactory : public QObject, public FileDialogFactory { Q_OBJECT Q_INTERFACES(FileDialogFactory); - public: - virtual FileDialog* create(); - virtual QString name(); - virtual ~QmmpFileDialogFactory(){;} - static QString QmmpFileDialogFactoryName; +public: + virtual FileDialog* create(); + virtual const FileDialogProperties properties() const; + virtual void showAbout(QWidget*); + virtual QTranslator *createTranslator(QObject *parent); + virtual ~QmmpFileDialogFactory() + { + ; + } }; diff --git a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.ui b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.ui index f2b778a13..0cbf7001c 100644 --- a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.ui +++ b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialog.ui @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>517</width> - <height>312</height> + <width>574</width> + <height>374</height> </rect> </property> <property name="windowTitle" > @@ -15,46 +15,9 @@ <property name="sizeGripEnabled" > <bool>true</bool> </property> - <layout class="QVBoxLayout" > - <property name="spacing" > - <number>6</number> - </property> - <property name="leftMargin" > - <number>9</number> - </property> - <property name="topMargin" > - <number>9</number> - </property> - <property name="rightMargin" > - <number>9</number> - </property> - <property name="bottomMargin" > - <number>9</number> - </property> - <item> + <layout class="QGridLayout" > + <item row="0" column="0" colspan="3" > <layout class="QHBoxLayout" > - <property name="spacing" > - <number>6</number> - </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label_2" > - <property name="text" > - <string>Look in:</string> - </property> - </widget> - </item> <item> <widget class="QComboBox" name="lookInComboBox" > <property name="sizePolicy" > @@ -70,9 +33,12 @@ </item> <item> <widget class="QToolButton" name="upToolButton" > - <property name="text" > + <property name="toolTip" > <string>Up</string> </property> + <property name="text" > + <string>...</string> + </property> <property name="autoRaise" > <bool>true</bool> </property> @@ -84,23 +50,26 @@ <string>List view</string> </property> <property name="text" > - <string>lst</string> + <string>...</string> </property> <property name="checkable" > <bool>true</bool> </property> + <property name="autoExclusive" > + <bool>true</bool> + </property> <property name="autoRaise" > <bool>true</bool> </property> </widget> </item> <item> - <widget class="QToolButton" name="iconToolButton" > + <widget class="QToolButton" name="detailsToolButton" > <property name="toolTip" > - <string>Icon view</string> + <string>Detailed view</string> </property> <property name="text" > - <string>icn</string> + <string>...</string> </property> <property name="iconSize" > <size> @@ -111,6 +80,25 @@ <property name="checkable" > <bool>true</bool> </property> + <property name="autoExclusive" > + <bool>true</bool> + </property> + <property name="autoRaise" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QToolButton" name="closeOnAddToolButton" > + <property name="toolTip" > + <string>Close dialog on add</string> + </property> + <property name="text" > + <string>...</string> + </property> + <property name="checkable" > + <bool>true</bool> + </property> <property name="autoRaise" > <bool>true</bool> </property> @@ -118,105 +106,117 @@ </item> </layout> </item> - <item> - <widget class="QListView" name="fileListView" > - <property name="selectionMode" > - <enum>QAbstractItemView::ExtendedSelection</enum> - </property> - <property name="movement" > - <enum>QListView::Free</enum> - </property> - <property name="isWrapping" stdset="0" > - <bool>true</bool> - </property> - <property name="resizeMode" > - <enum>QListView::Adjust</enum> - </property> - <property name="layoutMode" > - <enum>QListView::SinglePass</enum> - </property> - <property name="uniformItemSizes" > - <bool>false</bool> - </property> - <property name="wordWrap" > - <bool>false</bool> - </property> + <item row="1" column="0" colspan="3" > + <widget class="QStackedWidget" name="stackedWidget" > + <property name="currentIndex" > + <number>1</number> + </property> + <widget class="QWidget" name="page" > + <layout class="QVBoxLayout" > + <item> + <widget class="QListView" name="fileListView" > + <property name="selectionMode" > + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + <property name="movement" > + <enum>QListView::Free</enum> + </property> + <property name="isWrapping" stdset="0" > + <bool>true</bool> + </property> + <property name="resizeMode" > + <enum>QListView::Adjust</enum> + </property> + <property name="layoutMode" > + <enum>QListView::SinglePass</enum> + </property> + <property name="uniformItemSizes" > + <bool>false</bool> + </property> + <property name="wordWrap" > + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="page_2" > + <layout class="QVBoxLayout" > + <item> + <widget class="QTreeView" name="treeView" > + <property name="selectionMode" > + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> + <property name="rootIsDecorated" > + <bool>false</bool> + </property> + <property name="itemsExpandable" > + <bool>false</bool> + </property> + <property name="allColumnsShowFocus" > + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> </widget> </item> - <item> - <layout class="QHBoxLayout" > - <property name="spacing" > - <number>6</number> - </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> + <item row="2" column="0" > + <widget class="QLabel" name="label" > + <property name="text" > + <string>File name:</string> </property> - <property name="rightMargin" > - <number>0</number> + </widget> + </item> + <item row="2" column="1" > + <widget class="QLineEdit" name="fileNameLineEdit" /> + </item> + <item row="2" column="2" > + <widget class="QPushButton" name="addPushButton" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="bottomMargin" > - <number>0</number> + <property name="text" > + <string>Add</string> </property> - <item> - <widget class="QLabel" name="label" > - <property name="text" > - <string>File name:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="fileNameLineEdit" /> - </item> - </layout> + </widget> </item> - <item> - <layout class="QHBoxLayout" > - <property name="spacing" > - <number>6</number> + <item row="3" column="0" > + <widget class="QLabel" name="label_3" > + <property name="text" > + <string>Files of type:</string> </property> - <property name="leftMargin" > - <number>0</number> + </widget> + </item> + <item row="3" column="1" > + <widget class="QComboBox" name="fileTypeComboBox" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="topMargin" > - <number>0</number> + <property name="sizeAdjustPolicy" > + <enum>QComboBox::AdjustToMinimumContentsLength</enum> </property> - <property name="rightMargin" > - <number>0</number> + </widget> + </item> + <item row="3" column="2" > + <widget class="QPushButton" name="closePushButton" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="bottomMargin" > - <number>0</number> + <property name="text" > + <string>Close</string> </property> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="addPushButton" > - <property name="text" > - <string>Add</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="closePushButton" > - <property name="text" > - <string>Close</string> - </property> - </widget> - </item> - </layout> + </widget> </item> </layout> </widget> diff --git a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.cpp b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.cpp index 3abec0222..4121b7d28 100644 --- a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.cpp +++ b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.cpp @@ -1,37 +1,149 @@ +/************************************************************************** +* Copyright (C) 2008 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 "qmmpfiledialogimpl.h" #include <QDirModel> #include <QApplication> #include <QFileInfo> #include <QStyle> +#include <QSettings> +#include <QMessageBox> + +#define HISTORY_SIZE 8 + + +/** + * This variable had been copied from Qt library + */ + +const char *qt_file_dialog_filter_reg_exp = + "([a-zA-Z0-9 -]*)\\(([a-zA-Z0-9_.*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$"; + +/** + * This function had been copied from Qt library + */ + +// Makes a list of filters from a normal filter string "Image Files (*.png *.jpg)" +static QStringList qt_clean_filter_list(const QString &filter) +{ + QRegExp regexp(QString::fromLatin1(qt_file_dialog_filter_reg_exp)); + QString f = filter; + int i = regexp.indexIn(f); + if (i >= 0) + f = regexp.cap(2); + return f.split(QLatin1Char(' '), QString::SkipEmptyParts); +} + + -QmmpFileDialogImpl::QmmpFileDialogImpl( QWidget * parent, Qt::WindowFlags f) : QDialog(parent,f) +QmmpFileDialogImpl::QmmpFileDialogImpl(QWidget * parent, Qt::WindowFlags f) : QDialog(parent,f) { setupUi(this); setAttribute(Qt::WA_QuitOnClose, FALSE); m_model = new QDirModel(this); m_model->setSorting(QDir::Type /*| QDir::Name*/); fileListView->setModel(m_model); - //fileListView->setViewMode(QListView::IconMode); + treeView->setModel(m_model); listToolButton->setChecked(true); upToolButton->setIcon(qApp->style()->standardIcon(QStyle::SP_ArrowUp)); listToolButton->setIcon(qApp->style()->standardIcon(QStyle::SP_FileDialogListView)); - iconToolButton->setIcon(qApp->style()->standardIcon(QStyle::SP_FileDialogDetailedView)); + closeOnAddToolButton->setIcon(qApp->style()->standardIcon(QStyle::SP_DialogOkButton)); + detailsToolButton->setIcon(qApp->style()->standardIcon(QStyle::SP_FileDialogDetailedView)); + connect(fileListView->selectionModel(), + SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)), + SLOT(updateSelection ())); + connect(treeView->selectionModel(), + SIGNAL(selectionChanged (const QItemSelection&, const QItemSelection&)), + SLOT(updateSelection ())); + PathCompleter* completer = new PathCompleter (m_model, fileListView, this); + fileNameLineEdit->setCompleter (completer); + QSettings settings(QDir::homePath()+"/.qmmp/qmmprc", QSettings::IniFormat); + closeOnAddToolButton->setChecked(settings.value("QMMPFileDialog/close_on_add", FALSE).toBool()); + restoreGeometry(settings.value("QMMPFileDialog/geometry").toByteArray()); + m_history = settings.value("QMMPFileDialog/history").toStringList(); + lookInComboBox->addItems(m_history); + lookInComboBox->setMaxCount(HISTORY_SIZE); + QCompleter* dir_completer = new QCompleter (m_model, this); + lookInComboBox->setCompleter (dir_completer); } QmmpFileDialogImpl::~QmmpFileDialogImpl() { } -void QmmpFileDialogImpl::on_lookInComboBox_activated(const QString&) +QStringList QmmpFileDialogImpl::selectedFiles () { - qWarning("TODO: %s %d",__FILE__,__LINE__); + QStringList l; + if (m_mode == FileDialog::SaveFile) + { + l << m_model->filePath(fileListView->rootIndex()) + "/" + fileNameLineEdit->text(); + qDebug(qPrintable(l[0])); + } + else + { + QModelIndexList ml = fileListView->selectionModel()->selectedIndexes(); + foreach(QModelIndex i,ml) + l << m_model->filePath(i); + } + return l; +} + +void QmmpFileDialogImpl::on_lookInComboBox_activated(const QString &path) +{ + if (QDir(path).exists ()) + { + fileListView->setRootIndex(m_model->index(path)); + treeView->setRootIndex(m_model->index(path)); + } } void QmmpFileDialogImpl::on_upToolButton_clicked() { fileListView->setRootIndex(m_model->parent(fileListView->rootIndex())); + treeView->setRootIndex(m_model->parent(fileListView->rootIndex())); lookInComboBox->setEditText(m_model->filePath(fileListView->rootIndex())); + fileListView->selectionModel()->clear (); +} + +void QmmpFileDialogImpl::on_treeView_doubleClicked(const QModelIndex& ind) +{ + if (ind.isValid()) + { + QFileInfo info = m_model->fileInfo(ind); + if (info.isDir()) + { + treeView->setRootIndex(ind); + lookInComboBox->setEditText(m_model->filePath(ind)); + treeView->selectionModel()->clear (); + fileListView->setRootIndex(ind); + fileListView->selectionModel()->clear (); + } + else + { + QStringList l; + l << m_model->filePath(ind); + addToHistory(l[0]); + addFiles(l); + } + } } void QmmpFileDialogImpl::on_fileListView_doubleClicked(const QModelIndex& ind) @@ -43,20 +155,41 @@ void QmmpFileDialogImpl::on_fileListView_doubleClicked(const QModelIndex& ind) { fileListView->setRootIndex(ind); lookInComboBox->setEditText(m_model->filePath(ind)); + fileListView->selectionModel()->clear (); + treeView->setRootIndex(ind); + treeView->selectionModel()->clear (); } else { QStringList l; l << m_model->filePath(ind); - emit filesAdded(l); + addToHistory(l[0]); + addFiles(l); } } - } void QmmpFileDialogImpl::on_fileNameLineEdit_returnPressed() { - on_addPushButton_clicked(); + qWarning("TODO: %s %d", __FILE__, __LINE__); +} + +void QmmpFileDialogImpl::on_fileNameLineEdit_textChanged (const QString &text) +{ + if (m_mode == FileDialog::SaveFile) + { + addPushButton->setEnabled(!text.isEmpty()); + return; + } + QModelIndex index; + if (text.startsWith("/")) + index = m_model->index(text); + else + index = m_model->index(m_model->filePath(fileListView->rootIndex()) + "/" + text); + if (!index.isValid() || !fileNameLineEdit->hasFocus()) + return; + fileListView->selectionModel()->clear(); + fileListView->selectionModel()->select(index, QItemSelectionModel::Select); } void QmmpFileDialogImpl::on_addPushButton_clicked() @@ -65,53 +198,199 @@ void QmmpFileDialogImpl::on_addPushButton_clicked() QStringList l; foreach(QModelIndex i,ml) l << m_model->filePath(i); - qWarning("!!!!!!!!!"); - emit filesAdded(l); + if (!l.isEmpty()) + { + addToHistory(l[0]); + addFiles(l); + } } void QmmpFileDialogImpl::setModeAndMask(const QString& d,FileDialog::Mode m, const QStringList& mask) { - if (m == FileDialog::AddFiles) + m_mode = m; + fileListView->clearSelection (); + treeView->clearSelection (); + fileTypeComboBox->clear(); + addPushButton->setEnabled(FALSE); + addPushButton->setText(tr("Add")); + + QString fileName; + QString path = d; + + if (m == FileDialog::SaveFile) { - setWindowTitle("Add Files"); - m_model->setFilter(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot); - m_model->setNameFilters(mask); + if (path.endsWith('/')) + path.remove(path.size()-1, 1); + path = path.left(path.lastIndexOf ('/')); + fileName = d.section('/', -1); + fileNameLineEdit->setText(fileName); + addPushButton->setEnabled(!fileName.isEmpty()); + addPushButton->setText(tr("Save")); + } + + if (m_model->filePath(fileListView->rootIndex()) != path) + { + fileListView->setRootIndex(m_model->index(path)); + treeView->setRootIndex(m_model->index(path)); } - else if (m == FileDialog::AddDirs) + + if (m == FileDialog::AddDirs || m == FileDialog::AddDir) { - setWindowTitle("Add Dirs"); - m_model->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot); + m_model->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot); //dirs only + fileTypeComboBox->addItem(tr("Directories")); + fileTypeComboBox->setEnabled(FALSE); } else { - setWindowTitle("Save File"); m_model->setFilter(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot); - qWarning("To be implemented..."); + fileTypeComboBox->setEnabled(TRUE); + fileTypeComboBox->addItems(mask); + on_fileTypeComboBox_activated(0); + } + + //set selection mode + if (m == FileDialog::AddDir || m == FileDialog::AddFile || m == FileDialog::SaveFile) + { + fileListView->setSelectionMode (QAbstractItemView::SingleSelection); + treeView->setSelectionMode (QAbstractItemView::SingleSelection); + } + else + { + fileListView->setSelectionMode (QAbstractItemView::ExtendedSelection); + treeView->setSelectionMode (QAbstractItemView::ExtendedSelection); } - m_model->setSorting(QDir::Type); - fileListView->setRootIndex(m_model->index(d)); - m_model->sort(0); - lookInComboBox->setEditText(QDir::cleanPath(d)); + lookInComboBox->setEditText(QDir::cleanPath(path)); } void QmmpFileDialogImpl::on_listToolButton_toggled(bool yes) { if (yes) { - iconToolButton->setChecked(false); - fileListView->setViewMode(QListView::ListMode); - fileListView->setGridSize(QSize(-1, -1)); + stackedWidget->setCurrentIndex(0); } } -void QmmpFileDialogImpl::on_iconToolButton_toggled(bool yes) +void QmmpFileDialogImpl::on_detailsToolButton_toggled(bool yes) { if (yes) { - listToolButton->setChecked(false); - fileListView->setViewMode(QListView::IconMode); - fileListView->setGridSize(QSize(82, 82)); + stackedWidget->setCurrentIndex(1); } } +void QmmpFileDialogImpl::on_fileTypeComboBox_activated(int index) +{ + m_model->setNameFilters(qt_clean_filter_list(fileTypeComboBox->itemText(index))); +} + +void QmmpFileDialogImpl::hideEvent (QHideEvent *event) +{ + QSettings settings(QDir::homePath()+"/.qmmp/qmmprc", QSettings::IniFormat); + settings.setValue("QMMPFileDialog/close_on_add", closeOnAddToolButton->isChecked()); + settings.setValue("QMMPFileDialog/geometry", saveGeometry()); + settings.setValue("QMMPFileDialog/history", m_history); + QWidget::hideEvent(event); +} + +void QmmpFileDialogImpl::updateSelection () +{ + QModelIndexList ml; + if (stackedWidget->currentIndex() == 0) + ml = fileListView->selectionModel()->selectedIndexes(); + else + ml = treeView->selectionModel()->selectedIndexes(); + QStringList l; + QStringList files; + foreach(QModelIndex i,ml) + { + if (!l.contains(m_model->filePath(i).section("/", -1))) + { + files << m_model->filePath(i); + l << m_model->filePath(i).section("/", -1); + } + } + + if (!l.isEmpty()) + { + QString str; + if (l.size() == 1) + str = l.at(0); + else + { + str = l.join ("\" \""); + str.append("\""); + str.prepend("\""); + } + if (!fileNameLineEdit->hasFocus()) + fileNameLineEdit->setText(str); + if (m_mode == FileDialog::AddFiles || m_mode == FileDialog::AddFile/* || FileDialog::SaveFile*/) + { + addPushButton->setEnabled(TRUE); + foreach(str, files) + { + if (QFileInfo(str).isDir()) + { + addPushButton->setEnabled(FALSE); + break; + } + } + } + else + addPushButton->setEnabled(TRUE); + } + else + { + fileNameLineEdit->clear(); + addPushButton->setEnabled(FALSE); + } +} + +void QmmpFileDialogImpl::addToHistory(const QString &path) +{ + QString path_copy = path; + if (path_copy.endsWith('/')) + path_copy.remove(path.size()-1, 1); + QString dir_path = path.left(path_copy.lastIndexOf ('/')); + + m_history.removeAll(dir_path); + m_history.prepend(dir_path); + + while ( m_history.size() > HISTORY_SIZE) + m_history.removeLast(); + + lookInComboBox->clear(); + lookInComboBox->addItems(m_history); +} + +void QmmpFileDialogImpl::addFiles(const QStringList &list) +{ + if (list.isEmpty()) + return; + if (!isModal()) + { + emit filesAdded(list); + if (closeOnAddToolButton->isChecked()) + reject(); + } + else if (m_mode == FileDialog::SaveFile) + { + //TODO check file extension + QFileInfo info(m_model->filePath(fileListView->rootIndex()) + "/" + fileNameLineEdit->text()); + + if (info.exists()) + { + if (QMessageBox::question (this, windowTitle (), fileNameLineEdit->text() + " " + + tr("already exists.") + "\n" + + tr("Do you want to replace it?"), + QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) + accept(); + else + return; + + } + accept(); + } + else + accept(); +} diff --git a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.h b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.h index 12cd63e21..647fe009b 100644 --- a/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.h +++ b/src/plugins/FileDialogs/QmmpFileDialog/qmmpfiledialogimpl.h @@ -1,33 +1,118 @@ +/************************************************************************** +* Copyright (C) 2008 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 QMMPFILEDIALOGIMPL_H #define QMMPFILEDIALOGIMPL_H #include "ui_qmmpfiledialog.h" #include <QDialog> +#include <QCompleter> +#include <QAbstractItemView> +#include <QDirModel> #include <qmmpui/filedialog.h> -class QDirModel; +//class QDirModel; class QmmpFileDialogImpl : public QDialog , private Ui::QmmpFileDialog { Q_OBJECT public: - QmmpFileDialogImpl( QWidget * parent = 0, Qt::WindowFlags f = 0 ); + QmmpFileDialogImpl(QWidget *parent = 0, Qt::WindowFlags f = 0); + ~QmmpFileDialogImpl(); - void setModeAndMask(const QString&,FileDialog::Mode m,const QStringList& mask); + + void setModeAndMask(const QString&,FileDialog::Mode m, const QStringList& mask); + QStringList selectedFiles (); + protected slots: void on_lookInComboBox_activated(const QString&); void on_upToolButton_clicked(); void on_fileListView_doubleClicked(const QModelIndex&); + void on_treeView_doubleClicked(const QModelIndex&); void on_fileNameLineEdit_returnPressed(); + void on_fileNameLineEdit_textChanged (const QString &text); void on_addPushButton_clicked(); void on_listToolButton_toggled(bool); - void on_iconToolButton_toggled(bool); + void on_detailsToolButton_toggled(bool); + void on_fileTypeComboBox_activated(int); + void on_fileListView_selectionChanged (const QItemSelection&, const QItemSelection&); signals: void filesAdded(const QStringList&); + protected: QDirModel* m_model; + virtual void hideEvent (QHideEvent *event); + +private slots: + void updateSelection (); + +private: + int m_mode; + void addToHistory(const QString &path); + void addFiles(const QStringList &list); + QStringList m_history; + +}; +class PathCompleter : public QCompleter +{ + Q_OBJECT +public: + PathCompleter(QAbstractItemModel *model, QAbstractItemView *itemView, QObject *parent = 0) : QCompleter(model, parent) + { + m_itemView = itemView; + }; + + + QString pathFromIndex(const QModelIndex &index) const + { + const QDirModel *dirModel = static_cast<const QDirModel *>(model()); + QString currentLocation = dirModel->filePath(m_itemView->rootIndex()); + QString path = dirModel->filePath(index); + if (path.startsWith(currentLocation)) + { + path = path.mid(currentLocation.length() + 1); + } + return path; + } + + + QStringList splitPath(const QString &path) const + { + if (path.isEmpty()) + return QStringList(completionPrefix()); + QStringList parts; + if (!path.startsWith(QDir::separator())) + { + const QDirModel *dirModel = static_cast<const QDirModel *>(model()); + QString currentLocation = QDir::toNativeSeparators(dirModel->filePath(m_itemView->rootIndex())); + parts = QCompleter::splitPath(currentLocation); + } + parts << QCompleter::splitPath(path); + return parts; + } +private: + QAbstractItemView *m_itemView; }; + + #endif //QMMPFILEDIALOGIMPL_H diff --git a/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_cs.ts b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_cs.ts new file mode 100644 index 000000000..b9b3600db --- /dev/null +++ b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_cs.ts @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS><TS version="1.1"> +<context> + <name>QmmpFileDialog</name> + <message> + <location filename="../qmmpfiledialog.ui" line="13"/> + <source>Add Files</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="37"/> + <source>Up</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="97"/> + <source>...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="50"/> + <source>List view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="69"/> + <source>Detailed view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="94"/> + <source>Close dialog on add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="168"/> + <source>File name:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="184"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="191"/> + <source>Files of type:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="217"/> + <source>Close</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogFactory</name> + <message> + <location filename="../qmmpfiledialog.cpp" line="107"/> + <source>Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="106"/> + <source>About Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="110"/> + <source>Writen by: +Vladimir Kuznetsov <vovanec@gmail.com> +Ilya Kotov <forkotov02@hotmail.ru></source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="111"/> + <source>Some code is copied from the Qt library</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogImpl</name> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="215"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="228"/> + <source>Save</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="240"/> + <source>Directories</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="384"/> + <source>already exists.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="385"/> + <source>Do you want to replace it?</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_de.ts b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_de.ts new file mode 100644 index 000000000..b9b3600db --- /dev/null +++ b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_de.ts @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS><TS version="1.1"> +<context> + <name>QmmpFileDialog</name> + <message> + <location filename="../qmmpfiledialog.ui" line="13"/> + <source>Add Files</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="37"/> + <source>Up</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="97"/> + <source>...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="50"/> + <source>List view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="69"/> + <source>Detailed view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="94"/> + <source>Close dialog on add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="168"/> + <source>File name:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="184"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="191"/> + <source>Files of type:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="217"/> + <source>Close</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogFactory</name> + <message> + <location filename="../qmmpfiledialog.cpp" line="107"/> + <source>Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="106"/> + <source>About Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="110"/> + <source>Writen by: +Vladimir Kuznetsov <vovanec@gmail.com> +Ilya Kotov <forkotov02@hotmail.ru></source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="111"/> + <source>Some code is copied from the Qt library</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogImpl</name> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="215"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="228"/> + <source>Save</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="240"/> + <source>Directories</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="384"/> + <source>already exists.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="385"/> + <source>Do you want to replace it?</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_pt_BR.ts b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_pt_BR.ts new file mode 100644 index 000000000..b9b3600db --- /dev/null +++ b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_pt_BR.ts @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS><TS version="1.1"> +<context> + <name>QmmpFileDialog</name> + <message> + <location filename="../qmmpfiledialog.ui" line="13"/> + <source>Add Files</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="37"/> + <source>Up</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="97"/> + <source>...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="50"/> + <source>List view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="69"/> + <source>Detailed view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="94"/> + <source>Close dialog on add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="168"/> + <source>File name:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="184"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="191"/> + <source>Files of type:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="217"/> + <source>Close</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogFactory</name> + <message> + <location filename="../qmmpfiledialog.cpp" line="107"/> + <source>Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="106"/> + <source>About Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="110"/> + <source>Writen by: +Vladimir Kuznetsov <vovanec@gmail.com> +Ilya Kotov <forkotov02@hotmail.ru></source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="111"/> + <source>Some code is copied from the Qt library</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogImpl</name> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="215"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="228"/> + <source>Save</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="240"/> + <source>Directories</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="384"/> + <source>already exists.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="385"/> + <source>Do you want to replace it?</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_ru.ts b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_ru.ts new file mode 100644 index 000000000..b9b3600db --- /dev/null +++ b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_ru.ts @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS><TS version="1.1"> +<context> + <name>QmmpFileDialog</name> + <message> + <location filename="../qmmpfiledialog.ui" line="13"/> + <source>Add Files</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="37"/> + <source>Up</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="97"/> + <source>...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="50"/> + <source>List view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="69"/> + <source>Detailed view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="94"/> + <source>Close dialog on add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="168"/> + <source>File name:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="184"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="191"/> + <source>Files of type:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="217"/> + <source>Close</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogFactory</name> + <message> + <location filename="../qmmpfiledialog.cpp" line="107"/> + <source>Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="106"/> + <source>About Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="110"/> + <source>Writen by: +Vladimir Kuznetsov <vovanec@gmail.com> +Ilya Kotov <forkotov02@hotmail.ru></source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="111"/> + <source>Some code is copied from the Qt library</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogImpl</name> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="215"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="228"/> + <source>Save</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="240"/> + <source>Directories</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="384"/> + <source>already exists.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="385"/> + <source>Do you want to replace it?</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_tr.ts b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_tr.ts new file mode 100644 index 000000000..b9b3600db --- /dev/null +++ b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_tr.ts @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS><TS version="1.1"> +<context> + <name>QmmpFileDialog</name> + <message> + <location filename="../qmmpfiledialog.ui" line="13"/> + <source>Add Files</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="37"/> + <source>Up</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="97"/> + <source>...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="50"/> + <source>List view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="69"/> + <source>Detailed view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="94"/> + <source>Close dialog on add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="168"/> + <source>File name:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="184"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="191"/> + <source>Files of type:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="217"/> + <source>Close</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogFactory</name> + <message> + <location filename="../qmmpfiledialog.cpp" line="107"/> + <source>Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="106"/> + <source>About Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="110"/> + <source>Writen by: +Vladimir Kuznetsov <vovanec@gmail.com> +Ilya Kotov <forkotov02@hotmail.ru></source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="111"/> + <source>Some code is copied from the Qt library</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogImpl</name> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="215"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="228"/> + <source>Save</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="240"/> + <source>Directories</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="384"/> + <source>already exists.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="385"/> + <source>Do you want to replace it?</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_uk_UA.ts b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_uk_UA.ts new file mode 100644 index 000000000..b9b3600db --- /dev/null +++ b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_uk_UA.ts @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS><TS version="1.1"> +<context> + <name>QmmpFileDialog</name> + <message> + <location filename="../qmmpfiledialog.ui" line="13"/> + <source>Add Files</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="37"/> + <source>Up</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="97"/> + <source>...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="50"/> + <source>List view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="69"/> + <source>Detailed view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="94"/> + <source>Close dialog on add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="168"/> + <source>File name:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="184"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="191"/> + <source>Files of type:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="217"/> + <source>Close</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogFactory</name> + <message> + <location filename="../qmmpfiledialog.cpp" line="107"/> + <source>Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="106"/> + <source>About Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="110"/> + <source>Writen by: +Vladimir Kuznetsov <vovanec@gmail.com> +Ilya Kotov <forkotov02@hotmail.ru></source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="111"/> + <source>Some code is copied from the Qt library</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogImpl</name> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="215"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="228"/> + <source>Save</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="240"/> + <source>Directories</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="384"/> + <source>already exists.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="385"/> + <source>Do you want to replace it?</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_zh_CN.ts b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_zh_CN.ts new file mode 100644 index 000000000..b9b3600db --- /dev/null +++ b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_zh_CN.ts @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS><TS version="1.1"> +<context> + <name>QmmpFileDialog</name> + <message> + <location filename="../qmmpfiledialog.ui" line="13"/> + <source>Add Files</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="37"/> + <source>Up</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="97"/> + <source>...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="50"/> + <source>List view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="69"/> + <source>Detailed view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="94"/> + <source>Close dialog on add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="168"/> + <source>File name:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="184"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="191"/> + <source>Files of type:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="217"/> + <source>Close</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogFactory</name> + <message> + <location filename="../qmmpfiledialog.cpp" line="107"/> + <source>Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="106"/> + <source>About Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="110"/> + <source>Writen by: +Vladimir Kuznetsov <vovanec@gmail.com> +Ilya Kotov <forkotov02@hotmail.ru></source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="111"/> + <source>Some code is copied from the Qt library</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogImpl</name> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="215"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="228"/> + <source>Save</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="240"/> + <source>Directories</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="384"/> + <source>already exists.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="385"/> + <source>Do you want to replace it?</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_zh_TW.ts b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_zh_TW.ts new file mode 100644 index 000000000..b9b3600db --- /dev/null +++ b/src/plugins/FileDialogs/QmmpFileDialog/translations/qmmp_file_dialog_plugin_zh_TW.ts @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS><TS version="1.1"> +<context> + <name>QmmpFileDialog</name> + <message> + <location filename="../qmmpfiledialog.ui" line="13"/> + <source>Add Files</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="37"/> + <source>Up</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="97"/> + <source>...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="50"/> + <source>List view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="69"/> + <source>Detailed view</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="94"/> + <source>Close dialog on add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="168"/> + <source>File name:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="184"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="191"/> + <source>Files of type:</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.ui" line="217"/> + <source>Close</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogFactory</name> + <message> + <location filename="../qmmpfiledialog.cpp" line="107"/> + <source>Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="106"/> + <source>About Qmmp File Dialog</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="110"/> + <source>Writen by: +Vladimir Kuznetsov <vovanec@gmail.com> +Ilya Kotov <forkotov02@hotmail.ru></source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialog.cpp" line="111"/> + <source>Some code is copied from the Qt library</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QmmpFileDialogImpl</name> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="215"/> + <source>Add</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="228"/> + <source>Save</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="240"/> + <source>Directories</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="384"/> + <source>already exists.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../qmmpfiledialogimpl.cpp" line="385"/> + <source>Do you want to replace it?</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> |
