summaryrefslogtreecommitdiffstats
path: root/fswidget.h
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-04-02 21:36:19 +0200
committerArno <arno@disconnect.de>2018-04-02 21:37:47 +0200
commit3afe6efd51edaa02a989418c825182f41b7c8ab6 (patch)
treebf0eaa5456d759609c5ce2ef57b77bb84d467bbb /fswidget.h
parent096cf7474907cbdd7ab2c67ea57f19ebdab805d4 (diff)
downloadSheMov-3afe6efd51edaa02a989418c825182f41b7c8ab6.tar.gz
SheMov-3afe6efd51edaa02a989418c825182f41b7c8ab6.tar.bz2
SheMov-3afe6efd51edaa02a989418c825182f41b7c8ab6.zip
FSWidget: Implement select and deselect files
Select files by CTRL+k, deselect everything with CTRL+k (for kill). Select all with the global shortcut CTRL+a. Learned some interesting things: First, QAction shortcuts won't work if you don't add them to any actions(), even if it has a parent. So subclass QTreeView for the context menu and add an InvisibleAction enum. Don't show the QAction if it has that flag in data(). This has a nice side effect: the context menu isn't shown any more when you right-click outside the FSView. Second: The debugger was quite confused with equal SLOT names in different classes when using the new connect syntax. It dropped me off in totally wrong classes, confusing me at first, too :(
Diffstat (limited to 'fswidget.h')
-rw-r--r--fswidget.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/fswidget.h b/fswidget.h
index e6760fe..252c487 100644
--- a/fswidget.h
+++ b/fswidget.h
@@ -13,6 +13,7 @@ class NewMovieWizard;
class NewPicsDialog;
class Viewer;
class FSProxy;
+class FSView;
class FSWidget : public QWidget {
Q_OBJECT
@@ -21,9 +22,6 @@ class FSWidget : public QWidget {
explicit FSWidget(QWidget *parent = nullptr);
~FSWidget();
- protected:
- virtual void contextMenuEvent(QContextMenuEvent *e);
-
public slots:
void readSettings();
void writeSettings();
@@ -43,6 +41,7 @@ class FSWidget : public QWidget {
void doubleClicked(const QModelIndex &idx);
void preview();
void playSelected(int count = 1);
+ void selectFilter();
signals:
void message(QString msg);
@@ -51,7 +50,7 @@ class FSWidget : public QWidget {
void setupWidget();
QComboBox *mDirCB;
QComboBox *mFilterCB;
- QTreeView *mFileView;
+ FSView *mFileView;
QStandardItemModel *mModel;
FSProxy *mProxy;
NewMovieWizard *mMovieWizard;