Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a button to show hidden files if desired.

  • Loading branch information...
commit be06ac1c176c73ab64e969ddf1ede9416b627597 1 parent bc83a30
@beanpole135 beanpole135 authored
Showing with 18 additions and 0 deletions.
  1. +10 −0 lp-gui/LPMain.cpp
  2. +1 −0  lp-gui/LPMain.h
  3. +7 −0 lp-gui/LPMain.ui
View
10 lp-gui/LPMain.cpp
@@ -16,6 +16,7 @@ LPMain::LPMain(QWidget *parent) : QMainWindow(parent), ui(new Ui::LPMain){
//Create the filesystem model and tie it to the treewidget
fsModel = new QFileSystemModel(this);
fsModel->setReadOnly(true);
+ //fsModel->setFilter(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot );
ui->treeView->setModel(fsModel);
//Connect the UI to all the functions
connect(ui->combo_pools, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTabs()) );
@@ -23,6 +24,7 @@ LPMain::LPMain(QWidget *parent) : QMainWindow(parent), ui(new Ui::LPMain){
connect(ui->slider_snapshots, SIGNAL(valueChanged(int)), this, SLOT(updateSnapshot()) );
connect(ui->push_prevsnap, SIGNAL(clicked()), this, SLOT(prevSnapshot()) );
connect(ui->push_nextsnap, SIGNAL(clicked()), this, SLOT(nextSnapshot()) );
+ connect(ui->check_hidden, SIGNAL(stateChanged(int)), this, SLOT(setFileVisibility()) );
connect(ui->push_restore, SIGNAL(clicked()), this, SLOT(restoreFiles()) );
connect(ui->push_configure, SIGNAL(clicked()), this, SLOT(openConfigGUI()) );
connect(ui->push_configBackups, SIGNAL(clicked()), this, SLOT(openBackupGUI()) );
@@ -219,6 +221,14 @@ void LPMain::prevSnapshot(){
ui->slider_snapshots->setValue( ui->slider_snapshots->value()-1 );
}
+void LPMain::setFileVisibility(){
+ if(ui->check_hidden->isChecked()){
+ fsModel->setFilter(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden );
+ }else{
+ fsModel->setFilter(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot );
+ }
+}
+
void LPMain::restoreFiles(){
QString filePath = fsModel->filePath( ui->treeView->currentIndex() );
qDebug() << " Restore file(s):" << filePath;
View
1  lp-gui/LPMain.h
@@ -45,6 +45,7 @@ private slots:
void updateSnapshot(); //selected snapshot changed
void nextSnapshot();
void prevSnapshot();
+ void setFileVisibility();
void restoreFiles();
void openConfigGUI();
void openBackupGUI();
View
7 lp-gui/LPMain.ui
@@ -319,6 +319,13 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
+ <widget class="QCheckBox" name="check_hidden">
+ <property name="text">
+ <string>Show Hidden Files</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
Please sign in to comment.
Something went wrong with that request. Please try again.