Improve FolderWizard

This commit is contained in:
Daniel Molkentin 2013-08-01 18:22:13 +02:00
parent 1399ea13cc
commit 19bbff708e

View file

@ -22,6 +22,7 @@
#include <QDir> #include <QDir>
#include <QFileDialog> #include <QFileDialog>
#include <QFileInfo> #include <QFileInfo>
#include <QFileIconProvider>
#include <QInputDialog> #include <QInputDialog>
#include <QUrl> #include <QUrl>
#include <QValidator> #include <QValidator>
@ -178,6 +179,8 @@ FolderWizardTargetPage::FolderWizardTargetPage()
void FolderWizardTargetPage::slotAddRemoteFolder() void FolderWizardTargetPage::slotAddRemoteFolder()
{ {
QInputDialog *dlg = new QInputDialog(this); QInputDialog *dlg = new QInputDialog(this);
dlg->setWindowTitle(tr("Add Remote Folder"));
dlg->setLabelText(tr("Enter the name of the new folder:"));
dlg->open(this, SLOT(slotCreateRemoteFolder(QString))); dlg->open(this, SLOT(slotCreateRemoteFolder(QString)));
dlg->setAttribute(Qt::WA_DeleteOnClose); dlg->setAttribute(Qt::WA_DeleteOnClose);
} }
@ -205,9 +208,11 @@ void FolderWizardTargetPage::slotCreateRemoteFolderFinished( QNetworkReply::Netw
void FolderWizardTargetPage::slotUpdateDirectories(QStringList list) void FolderWizardTargetPage::slotUpdateDirectories(QStringList list)
{ {
_ui.folderListWidget->clear(); _ui.folderListWidget->clear();
foreach (QString item, list) { QFileIconProvider prov;
item.remove(QLatin1String("/remote.php/webdav")); QIcon folderIcon = prov.icon(QFileIconProvider::Folder);
_ui.folderListWidget->addItem(item); foreach (QString path, list) {
path.remove(QLatin1String("/remote.php/webdav"));
new QListWidgetItem(folderIcon, path, _ui.folderListWidget);
} }
} }