added context menu to download folders
This commit is contained in:
+13
-2
@@ -19,6 +19,9 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
QCoreApplication::setOrganizationName("RsyncUI");
|
||||
QCoreApplication::setApplicationName("RsyncUI");
|
||||
|
||||
ui->treeWidget->addAction(ui->actionDownload);
|
||||
|
||||
|
||||
// init shortcut
|
||||
loadSettings();
|
||||
config.setupUi(&Configuration);
|
||||
@@ -432,7 +435,7 @@ void MainWindow::on_listWidget_clicked()
|
||||
}
|
||||
|
||||
//Slot activated when a file is clicked in the treeview
|
||||
void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item)
|
||||
void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadDir)
|
||||
{
|
||||
QFuture<void> future;
|
||||
QFileDialog dialog;
|
||||
@@ -450,7 +453,7 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item)
|
||||
path = itemR->text(0).toStdString() + "/" + path;
|
||||
};
|
||||
|
||||
if (item->text(1) == tr("File"))
|
||||
if (item->text(1) == tr("File") or downloadDir == true)
|
||||
{
|
||||
// Item is a file
|
||||
this->downloading.path = path;
|
||||
@@ -761,3 +764,11 @@ void Downloading::clear()
|
||||
this->savePath.clear();
|
||||
this->service.clear();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionDownload_triggered()
|
||||
{
|
||||
// action made in qt-designer and added in init function.
|
||||
QTreeWidgetItem *item;
|
||||
item = ui->treeWidget->currentItem();
|
||||
on_treeWidget_itemClicked(item, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user