Add import destination indicator

This commit is contained in:
zhupengfei
2020-04-18 23:58:03 +08:00
parent 376012e95e
commit fa7aecaf37
2 changed files with 38 additions and 1 deletions
+9
View File
@@ -5,6 +5,7 @@
#include <regex>
#include <string>
#include <QApplication>
#include <QDesktopServices>
#include <QFileDialog>
#include <QMessageBox>
#include <QStorageInfo>
@@ -56,6 +57,14 @@ MainDialog::MainDialog(QWidget* parent) : QDialog(parent), ui(std::make_unique<U
}
});
ui->importDestination->setText(
QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::UserDir)));
connect(ui->importDestinationButton, &QPushButton::clicked, [this] {
QDesktopServices::openUrl(QUrl(
QStringLiteral("file:///%1")
.arg(QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::UserDir)))));
});
connect(ui->main, &QTreeWidget::itemSelectionChanged, [this] {
ui->buttonBox->button(QDialogButtonBox::StandardButton::Ok)
->setEnabled(!ui->main->selectedItems().empty());