mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 21:46:03 +03:00
Improve FolderWizard
This commit is contained in:
parent
1399ea13cc
commit
19bbff708e
1 changed files with 8 additions and 3 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue