diff options
author | Arno <arno@disconnect.de> | 2018-10-13 04:56:32 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-10-13 04:56:32 +0200 |
commit | 6f87db1897e4be7bccd2684da571ed251c5b695e (patch) | |
tree | d1dbbeb6757456e5e9aaa36ab53a38662ed7f3b1 | |
parent | 2a866788cd2608b5f893f173a611785da44d3047 (diff) | |
download | BeetPlayer-6f87db1897e4be7bccd2684da571ed251c5b695e.tar.gz BeetPlayer-6f87db1897e4be7bccd2684da571ed251c5b695e.tar.bz2 BeetPlayer-6f87db1897e4be7bccd2684da571ed251c5b695e.zip |
Implement add sources to CopyDialog
-rw-r--r-- | collectiondatesview.cpp | 6 | ||||
-rw-r--r-- | copydialog.cpp | 5 | ||||
-rw-r--r-- | copydialog.h | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/collectiondatesview.cpp b/collectiondatesview.cpp index 5544f72..59fd5d2 100644 --- a/collectiondatesview.cpp +++ b/collectiondatesview.cpp @@ -100,5 +100,11 @@ void CollectionDatesView::copyTo(){ destDir = destDir.replace(" - ", "-"); destDir = destDir.replace(' ', '.'); cdlg->setDestFolder(destDir); + QStringList sources; + for(int i = 0; i < item->rowCount(); ++i){ + QStandardItem *childItem = item->child(i); + sources << childItem->data(FullPathRole).toString(); + } + cdlg->setSources(sources); cdlg->show(); } diff --git a/copydialog.cpp b/copydialog.cpp index 625ccac..38a5b9f 100644 --- a/copydialog.cpp +++ b/copydialog.cpp @@ -36,6 +36,7 @@ CopyDialog::CopyDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) dirGB->setLayout(dirGrid); QHBoxLayout *resultL = new QHBoxLayout; mResultL = new QLabel; + mResultL->setAlignment(Qt::AlignTop | Qt::AlignLeft); resultL->addWidget(mResultL); QGroupBox *resultGB = new QGroupBox(tr("Result")); resultGB->setLayout(resultL); @@ -78,6 +79,10 @@ void CopyDialog::setDestFolder(const QString &dst){ mFolderE->setText(dst); } +void CopyDialog::setSources(const QStringList &sources){ + mSources = sources; +} + void CopyDialog::closeEvent(QCloseEvent *e){ QSettings s; s.setValue("copydlgsize", size()); diff --git a/copydialog.h b/copydialog.h index 5a63515..8a32372 100644 --- a/copydialog.h +++ b/copydialog.h @@ -15,6 +15,7 @@ class CopyDialog : public QDialog { void getDestination(); void setSource(const QString &src); void setDestFolder(const QString &dst); + void setSources(const QStringList &sources); protected: virtual void closeEvent(QCloseEvent *e); @@ -24,6 +25,7 @@ class CopyDialog : public QDialog { QLineEdit *mDstE; QLineEdit *mFolderE; QLabel *mResultL; + QStringList mSources; }; #endif // COPYDIALOG_H |