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);
55 explicit MainWindow(
const QString &searchText = QString(),
56 QWidget *parent =
nullptr);
65 void flashText(
const QString &text,
const bool isError,
66 const bool isHtml =
false);
77 auto eventFilter(QObject *obj, QEvent *event) ->
bool override;
88 void critical(
const QString &,
const QString &);
107 void onUpdate(
bool block =
false);
110 void on_treeView_doubleClicked(
const QModelIndex &index);
111 void clearPanel(
bool notify =
true);
112 void on_lineEdit_textChanged(
const QString &arg1);
113 void on_lineEdit_returnPressed();
114#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
115 void on_profileBox_currentIndexChanged(QString);
117 void on_profileBox_currentTextChanged(
const QString &);
119 void showContextMenu(
const QPoint &pos);
120 void showBrowserContextMenu(
const QPoint &pos);
123 void editPassword(
const QString &);
124 void renamePassword();
126 void copyPasswordFromTreeview();
127 void passwordFromFileToClipboard(
const QString &text);
128 void onTimeoutSearch();
132 QScopedPointer<Ui::MainWindow> ui;
133 QFileSystemModel model;
135 QScopedPointer<QItemSelectionModel> selectionModel;
136 QTimer clearPanelTimer, searchTimer;
141 void initToolBarButtons();
142 void initStatusBar();
145 void selectFirstFile();
146 auto firstFile(QModelIndex parentIndex) -> QModelIndex;
147 auto getFile(
const QModelIndex &,
bool) -> QString;
148 void setPassword(
const QString &,
bool isNew =
true);
150 void updateProfileBox();
152 void destroyTrayIcon();
153 void clearTemplateWidgets();
154 void reencryptPath(QString dir);
155 void addToGridLayout(
int position,
const QString &field,
156 const QString &value);
158 void applyTextBrowserSettings();
159 void applyWindowFlagsSettings();
161 void updateGitButtonVisibility();
162 void updateOtpButtonVisibility();
163 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 closeEvent(QCloseEvent *event) override
MainWindow::closeEvent hide or quit.
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 changeEvent(QEvent *event) override
MainWindow::changeEvent sets focus to the search box.
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.
MainWindow(const QString &searchText=QString(), QWidget *parent=nullptr)
MainWindow::MainWindow handles all of the main functionality and also the main window.
void keyPressEvent(QKeyEvent *event) override
MainWindow::keyPressEvent did anyone press return, enter or escape?
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)
auto eventFilter(QObject *obj, QEvent *event) -> bool override
MainWindow::eventFilter filter out some events and focus the treeview.
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 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 *
QSortFilterProxyModel for filtering and displaying password store.
Handles the systemtray icon and menu.
#define SingleApplication