aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-07-01 10:14:13 +0000
committerSaturneric <[email protected]>2021-07-01 10:14:13 +0000
commita56e7df840b7156d6992d03b9b9b6f3e2328e39d (patch)
treec91274ee49e4a7539140477d2fff1cfd032ec11f
parentMerge remote-tracking branch 'origin/develop' into develop (diff)
downloadGpgFrontend-a56e7df840b7156d6992d03b9b9b6f3e2328e39d.tar.gz
GpgFrontend-a56e7df840b7156d6992d03b9b9b6f3e2328e39d.zip
Continue to write new function.
-rw-r--r--include/ui/widgets/FilePage.h1
-rw-r--r--src/ui/widgets/FilePage.cpp10
2 files changed, 9 insertions, 2 deletions
diff --git a/include/ui/widgets/FilePage.h b/include/ui/widgets/FilePage.h
index 5a4331be..3d2c8e72 100644
--- a/include/ui/widgets/FilePage.h
+++ b/include/ui/widgets/FilePage.h
@@ -67,6 +67,7 @@ private:
QPushButton *upLevelButton;
QPushButton *goPathButton;
+ QPushButton *refreshButton;
QMenu *popUpMenu{};
QAction *encryptItemAct{};
diff --git a/src/ui/widgets/FilePage.cpp b/src/ui/widgets/FilePage.cpp
index 16724f40..9f6970db 100644
--- a/src/ui/widgets/FilePage.cpp
+++ b/src/ui/widgets/FilePage.cpp
@@ -49,17 +49,22 @@ FilePage::FilePage(QWidget *parent) : QWidget(parent) {
upLevelButton = new QPushButton("UP Level");
connect(upLevelButton, SIGNAL(clicked(bool)), this, SLOT(slotUpLevel()));
+ refreshButton = new QPushButton("Refresh");
+ connect(refreshButton, SIGNAL(clicked(bool)), this, SLOT(slotGoPath()));
+
goPathButton = new QPushButton("Go Path");
connect(goPathButton, SIGNAL(clicked(bool)), this, SLOT(slotGoPath()));
pathEdit = new QLineEdit();
- pathEdit->setFixedWidth(500);
+ pathEdit->setFixedWidth(480);
pathEdit->setText(dirModel->rootPath());
auto *menuLayout = new QHBoxLayout();
menuLayout->addWidget(upLevelButton);
menuLayout->addWidget(pathEdit);
menuLayout->addWidget(goPathButton);
+ menuLayout->addWidget(goPathButton);
+ menuLayout->addWidget(refreshButton);
menuLayout->addStretch(0);
auto *layout = new QVBoxLayout();
@@ -112,7 +117,8 @@ void FilePage::slotGoPath() {
qDebug() << "getSelected" << pathEdit->text();
auto fileInfo = QFileInfo(pathEdit->text());
if(fileInfo.isDir() && fileInfo.isReadable() && fileInfo.isExecutable()) {
- qDebug() << "Set Path" << fileInfo.filePath();
+ mPath = fileInfo.filePath();
+ qDebug() << "Set Path" << mPath;
dirTreeView->setRootIndex(dirModel->index(fileInfo.filePath()));
} else {
QMessageBox::critical(this, "Error", "The path is unprivileged or unreachable.");