]> vaikene.ee Git - evaf/blobdiff - src/apps/FileFinder/GUI/gui.h
Warning fixes and copyright update.
[evaf] / src / apps / FileFinder / GUI / gui.h
index 809dab1f39449499fa7d1f727add7f9c5a0fad53..3b584c3cb08a5a1ea6800a770a61cd66634be545 100644 (file)
@@ -3,7 +3,7 @@
  * @brief GUI for the FileFinder application
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
 #ifndef __FILEFINDER_GUI_GUI_H
 #  define __FILEFINDER_GUI_GUI_H
 
+#include "version.h"
+
 #include <Plugins/iPlugin>
+#include <Gui/Panel>
 
 #include <QObject>
 #include <QString>
@@ -33,13 +36,14 @@ class QComboBox;
 class QPushButton;
 class QListWidget;
 class QAction;
+class QFileSystemModel;
 
 namespace eVaf {
 namespace SdiWindow {
     struct iSdiWindow;    
 } // namespace eVaf::SdiWindow
 namespace FileFinder {
-    struct iFileFinder;
+    class iFileFinder;
 namespace GUI {
 
 namespace Internal {
@@ -47,14 +51,14 @@ namespace Internal {
 /**
  * Main widget for the FileFinder window
  */
-class MainWidget : public QWidget
+class MainWidget : public Gui::Panel
 {
     Q_OBJECT
 
 public:
 
-    MainWidget(QWidget * parent = 0)
-        : QWidget(parent)
+    MainWidget(QWidget * parent = nullptr)
+        : Gui::Panel(parent)
     {}
 
     virtual void keyPressEvent(QKeyEvent * e);
@@ -80,6 +84,7 @@ class Module : public Plugins::iPlugin
 {
     Q_OBJECT
     Q_INTERFACES(eVaf::Plugins::iPlugin)
+    Q_PLUGIN_METADATA(IID VER_MODULE_NAME_STR)
 
 public:
 
@@ -110,9 +115,16 @@ private slots:
 
     void openDirectory();
 
+    void copyName();
+
+    void copyAllNames();
+
 
 private: // Members
 
+    /// Max number of items in each field that we save
+    static int const MaxHistoryItems;
+
     /// Flag indicating that the module is ready
     bool mReady;
 
@@ -122,10 +134,13 @@ private: // Members
     /// Actions
     QAction * mOpenFileAction;
     QAction * mOpenDirectoryAction;
+    QAction * mCopyNameAction;
+    QAction * mCopyAllNamesAction;
 
     /// Widgets on the screen
     Internal::MainWidget * wMain;
     QComboBox * wDirectory;
+    QPushButton * wBrowse;
     QCheckBox * wRecursive;
     QComboBox * wIncludeNames;
     QComboBox * wExcludeNames;
@@ -134,6 +149,9 @@ private: // Members
     QListWidget * wResults;
     QPushButton * wFind;
 
+    /// File system auto-completion model for the directory field
+    QFileSystemModel * mDirModel;
+
 
 private: // Methods