From 3fac72595be7f86a65933cdf9928857353040c2b Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 31 Mar 2018 10:13:12 +0200 Subject: Add refresh to FSWidget --- fswidget.cpp | 8 ++++++++ fswidget.h | 1 + 2 files changed, 9 insertions(+) diff --git a/fswidget.cpp b/fswidget.cpp index ffc001a..1932c10 100644 --- a/fswidget.cpp +++ b/fswidget.cpp @@ -38,6 +38,10 @@ void FSWidget::setupWidget(){ QAction *forwardA = new QAction(buttplugRight, tr("Next dir"), this); connect(forwardA, &QAction::triggered, [=] { advanceDir(1); }); toolbar->addAction(forwardA); + QAction *refreshA = new QAction(QIcon(":/refresh.png"), tr("Refresh"), this); + connect(refreshA, &QAction::triggered, this, &FSWidget::refresh); + toolbar->addSeparator(); + toolbar->addAction(refreshA); QIcon plusIcon = Helper::icon(QColor(255,85,255), '+'); QIcon minusIcon = Helper::icon(QColor(255,85,255), '-'); @@ -159,6 +163,10 @@ void FSWidget::insertItem(QComboBox *cb, const QString &text){ cb->insertItem(idx, text); } +void FSWidget::refresh(){ + gatherData(mDirCB->currentText()); +} + void FSWidget::removeItem(QComboBox *cb){ int toRemove = cb->findText(cb->currentText()); if(toRemove != -1){ diff --git a/fswidget.h b/fswidget.h index 0b977ff..7a6104d 100644 --- a/fswidget.h +++ b/fswidget.h @@ -18,6 +18,7 @@ class FSWidget : public QWidget { public slots: void readSettings(); void writeSettings(); + void refresh(); private slots: void insertItem(QComboBox *cb, const QString &text); -- cgit v1.2.3-70-g09d2