LCOV - code coverage report
Current view: top level - src - mainwindow.h (source / functions) Hit Total Coverage
Test: .lcov.total Lines: 0 2 0.0 %
Date: 2017-03-14 11:46:08 Functions: 0 3 0.0 %

          Line data    Source code
       1             : #ifndef MAINWINDOW_H_
       2             : #define MAINWINDOW_H_
       3             : 
       4             : #include "datahelpers.h"
       5             : #include "enums.h"
       6             : #include "imitatepass.h"
       7             : #include "pass.h"
       8             : #include "realpass.h"
       9             : #include "storemodel.h"
      10             : #include "trayicon.h"
      11             : #include <QFileSystemModel>
      12             : #include <QMainWindow>
      13             : #include <QProcess>
      14             : #include <QQueue>
      15             : #include <QTimer>
      16             : #include <QTreeView>
      17             : 
      18             : #if SINGLE_APP
      19             : #include "singleapplication.h"
      20             : #else
      21             : #define SingleApplication QApplication
      22             : #endif
      23             : 
      24             : #ifdef __APPLE__
      25             : #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
      26             : // http://doc.qt.io/qt-5/qkeysequence.html#qt_set_sequence_auto_mnemonic
      27             : void qt_set_sequence_auto_mnemonic(bool b);
      28             : #endif
      29             : #endif
      30             : 
      31             : namespace Ui {
      32             : class MainWindow;
      33             : }
      34             : 
      35             : /*!
      36             :     \class MainWindow
      37             :     \brief The MainWindow class does way too much, not only is it a switchboard,
      38             :     configuration handler and more, it's also the process-manager.
      39             : 
      40             :     This class could really do with an overhaul.
      41             :  */
      42             : class MainWindow : public QMainWindow {
      43           0 :   Q_OBJECT
      44             : 
      45             : public:
      46             :   explicit MainWindow(QWidget *parent = 0);
      47           0 :   ~MainWindow();
      48             :   bool checkConfig();
      49             :   void setApp(SingleApplication *app);
      50             :   void setText(QString);
      51             :   QStringList getSecretKeys();
      52             :   void generateKeyPair(QString, QDialog *);
      53             :   void userDialog(QString = "");
      54             :   void config();
      55             :   void executePassGitInit();
      56             : 
      57             :   /**
      58             :    * @brief MainWindow::pwdConfig instance of passwordConfiguration.
      59             :    * @sa MainWindow::passwordConfiguration
      60             :    */
      61             :   passwordConfiguration pwdConfig;
      62             : 
      63             : protected:
      64             :   void closeEvent(QCloseEvent *event);
      65             :   void keyPressEvent(QKeyEvent *event);
      66             :   void changeEvent(QEvent *event);
      67             :   bool eventFilter(QObject *obj, QEvent *event);
      68             : 
      69             : public slots:
      70             :   void deselect();
      71             : 
      72             : private slots:
      73             :   void on_updateButton_clicked(bool block = false);
      74             :   void on_pushButton_clicked();
      75             :   void on_treeView_clicked(const QModelIndex &index);
      76             :   void on_treeView_doubleClicked(const QModelIndex &index);
      77             :   void on_configButton_clicked();
      78             :   void processFinished(const QString &, const QString &);
      79             :   void processError(QProcess::ProcessError);
      80             :   void clearClipboard();
      81             :   void clearPanel(bool notify = true);
      82             :   void on_lineEdit_textChanged(const QString &arg1);
      83             :   void on_lineEdit_returnPressed();
      84             :   void on_addButton_clicked();
      85             :   void on_deleteButton_clicked();
      86             :   void on_editButton_clicked();
      87             :   void on_usersButton_clicked();
      88             :   void messageAvailable(QString message);
      89             :   void on_profileBox_currentIndexChanged(QString);
      90             :   void showContextMenu(const QPoint &pos);
      91             :   void showBrowserContextMenu(const QPoint &pos);
      92             :   void addFolder();
      93             :   void editPassword(const QString &);
      94             :   void focusInput();
      95             :   void copyTextToClipboard(const QString &text);
      96             : 
      97             :   void executeWrapperStarted();
      98             :   void showStatusMessage(QString msg, int timeout);
      99             :   void startReencryptPath();
     100             :   void endReencryptPath();
     101             :   void critical(QString, QString);
     102             :   void passShowHandler(const QString &);
     103             :   void passStoreChanged(const QString &, const QString &);
     104             :   void doGitPush();
     105             : 
     106             :   void processErrorExit(int exitCode, const QString &);
     107             : 
     108             :   void finishedInsert(const QString &, const QString &);
     109             :   void keyGenerationComplete(const QString &p_output, const QString &p_errout);
     110             : 
     111             : private:
     112             :   QAction *actionAddPassword;
     113             :   QAction *actionAddFolder;
     114             : 
     115             :   QApplication *QtPass;
     116             :   QScopedPointer<Ui::MainWindow> ui;
     117             :   QFileSystemModel model;
     118             :   StoreModel proxyModel;
     119             :   QScopedPointer<QItemSelectionModel> selectionModel;
     120             :   QTreeView *treeView;
     121             :   QProcess fusedav;
     122             :   QString clippedText;
     123             :   QTimer clearPanelTimer;
     124             :   QTimer clearClipboardTimer;
     125             :   bool freshStart;
     126             :   QDialog *keygen;
     127             :   QString currentDir;
     128             :   bool startupPhase;
     129             :   TrayIcon *tray;
     130             : 
     131             :   void updateText();
     132             :   void enableUiElements(bool state);
     133             :   void selectFirstFile();
     134             :   QModelIndex firstFile(QModelIndex parentIndex);
     135             :   QString getFile(const QModelIndex &, bool);
     136             :   void setPassword(QString, bool isNew = true);
     137             : 
     138             :   void mountWebDav();
     139             :   void updateProfileBox();
     140             :   void initTrayIcon();
     141             :   void destroyTrayIcon();
     142             :   void clearTemplateWidgets();
     143             :   void reencryptPath(QString dir);
     144             :   void addToGridLayout(int position, const QString &field,
     145             :                        const QString &value);
     146             :   void DisplayInTextBrowser(QString toShow, QString prefix = QString(),
     147             :                             QString postfix = QString());
     148             :   void connectPassSignalHandlers(Pass *pass);
     149             : };
     150             : 
     151             : #endif // MAINWINDOW_H_

Generated by: LCOV version 1.13