3#ifndef SRC_MAINWINDOW_H_
4#define SRC_MAINWINDOW_H_
8#include <QFileSystemModel>
9#include <QItemSelectionModel>
17#define SingleApplication QApplication
22void qt_set_sequence_auto_mnemonic(
bool b);
43 explicit MainWindow(
const QString &searchText = QString(),
44 QWidget *parent =
nullptr);
53 void flashText(
const QString &text,
const bool isError,
54 const bool isHtml =
false);
65 auto eventFilter(QObject *obj, QEvent *event) -> bool;
76 void critical(
const QString &,
const QString &);
95 void onUpdate(
bool block =
false);
98 void on_treeView_doubleClicked(
const QModelIndex &index);
99 void clearPanel(
bool notify =
true);
100 void on_lineEdit_textChanged(
const QString &arg1);
101 void on_lineEdit_returnPressed();
102#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
103 void on_profileBox_currentIndexChanged(QString);
105 void on_profileBox_currentTextChanged(
const QString &);
107 void showContextMenu(
const QPoint &pos);
108 void showBrowserContextMenu(
const QPoint &pos);
111 void editPassword(
const QString &);
112 void renamePassword();
114 void copyPasswordFromTreeview();
115 void passwordFromFileToClipboard(
const QString &text);
116 void onTimeoutSearch();
120 QScopedPointer<Ui::MainWindow> ui;
121 QFileSystemModel model;
123 QScopedPointer<QItemSelectionModel> selectionModel;
124 QTimer clearPanelTimer, searchTimer;
129 void initToolBarButtons();
130 void initStatusBar();
133 void selectFirstFile();
134 auto firstFile(QModelIndex parentIndex) -> QModelIndex;
135 auto getFile(
const QModelIndex &,
bool) -> QString;
136 void setPassword(
const QString &,
bool isNew =
true);
138 void updateProfileBox();
140 void destroyTrayIcon();
141 void clearTemplateWidgets();
142 void reencryptPath(QString dir);
143 void addToGridLayout(
int position,
const QString &field,
144 const QString &value);
146 void updateGitButtonVisibility();
147 void updateOtpButtonVisibility();
148 void enableGitButtons(
const bool &);
The MainWindow class does way too much, not only is it a switchboard, configuration handler and more,...
void startReencryptPath()
MainWindow::startReencryptPath disable ui elements and treeview.
void passShowHandler(const QString &)
void endReencryptPath()
MainWindow::endReencryptPath re-enable ui elements.
void executeWrapperStarted()
void generateKeyPair(const QString &, QDialog *)
MainWindow::generateKeyPair internal gpg keypair generator . .
void closeEvent(QCloseEvent *event)
MainWindow::closeEvent hide or quit.
void critical(const QString &, const QString &)
MainWindow::critical critical message popup wrapper.
void messageAvailable(const QString &message)
MainWindow::messageAvailable we have some text/message/search to do.
void onPush()
MainWindow::onPush do a git push.
void showStatusMessage(const QString &msg, int timeout=2000)
Displays message in status bar.
void passOtpHandler(const QString &)
void passShowHandlerFinished(const QString &output)
void generateGPGKeyPair(const QString &batch)
void keyPressEvent(QKeyEvent *event)
MainWindow::keyPressEvent did anyone press return, enter or escape?
void flashText(const QString &text, const bool isError, const bool isHtml=false)
void userDialog(const QString &="")
MainWindow::userDialog see MainWindow::onUsers()
void setUiElementsEnabled(bool state)
MainWindow::setUiElementsEnabled enable or disable the relevant UI elements.
auto eventFilter(QObject *obj, QEvent *event) -> bool
MainWindow::eventFilter filter out some events and focus the treeview.
void changeEvent(QEvent *event)
MainWindow::changeEvent sets focus to the search box.
auto getCurrentTreeViewIndex() -> QModelIndex
void deselect()
MainWindow::deselect clear the selection, password and copy buffer.
void on_treeView_clicked(const QModelIndex &index)
MainWindow::on_treeView_clicked read the selected password file.
auto getKeygenDialog() -> QDialog *
void config()
MainWindow::config pops up the configuration screen and handles all inter-window communication.
The SingleApplication class is used for commandline intergration.
The QSortFilterProxyModel for handling filesystem searches.
Handles the systemtray icon and menu.