3#ifndef SRC_MAINWINDOW_H_
4#define SRC_MAINWINDOW_H_
8#include <QFileSystemModel>
9#include <QItemSelectionModel>
15class SingleApplication;
17#define SingleApplication QApplication
22void qt_set_sequence_auto_mnemonic(
bool b);
54 explicit MainWindow(
const QString &searchText = QString(),
55 QWidget *parent =
nullptr);
94 void flashText(
const QString &text,
const bool isError,
95 const bool isHtml =
false);
171 void critical(
const QString &title,
const QString &msg);
225 void on_grepButton_toggled(
bool checked);
226 void on_grepResultsList_itemClicked(QTreeWidgetItem *item,
int column);
232 void onUpdate(
bool block =
false);
235 void on_treeView_doubleClicked(
const QModelIndex &index);
236 void clearPanel(
bool notify =
true);
237 void on_lineEdit_textChanged(
const QString &arg1);
238 void on_lineEdit_returnPressed();
239#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
240 void on_profileBox_currentIndexChanged(QString);
242 void on_profileBox_currentTextChanged(
const QString &);
244 void showContextMenu(
const QPoint &pos);
245 void showBrowserContextMenu(
const QPoint &pos);
248 void editPassword(
const QString &);
249 void renamePassword();
251 void copyPasswordFromTreeview();
252 void passwordFromFileToClipboard(
const QString &text);
253 void onTimeoutSearch();
257 QScopedPointer<Ui::MainWindow> ui;
258 bool m_grepMode =
false;
259 bool m_grepBusy =
false;
260 bool m_grepCancelled =
false;
261 QFileSystemModel model;
263 QScopedPointer<QItemSelectionModel> selectionModel;
264 QTimer clearPanelTimer, searchTimer;
269 void initToolBarButtons();
270 void initStatusBar();
273 void selectFirstFile();
274 auto firstFile(QModelIndex parentIndex) -> QModelIndex;
275 auto getFile(
const QModelIndex &,
bool) -> QString;
276 void setPassword(
const QString &,
bool isNew =
true);
278 void updateProfileBox();
280 void destroyTrayIcon();
281 void clearTemplateWidgets();
282 void reencryptPath(
const QString &dir);
283 void addToGridLayout(
int position,
const QString &field,
284 const QString &value);
286 void applyTextBrowserSettings();
287 void applyWindowFlagsSettings();
289 void updateGitButtonVisibility();
290 void updateOtpButtonVisibility();
291 void updateGrepButtonVisibility();
292 void enableGitButtons(
const bool &);
void startReencryptPath()
Begin a re-encryption pass on the current path.
void userDialog(const QString &dir="")
Open the user/recipient management dialog.
void closeEvent(QCloseEvent *event) override
Save window state and geometry on close.
void endReencryptPath()
Finish a re-encryption pass on the current path.
void onGrepFinished(const QList< QPair< QString, QStringList > > &results)
Handle results from a completed grep search.
void executeWrapperStarted()
Slot called when an external process wrapper has started.
void passShowHandler(const QString &output)
Handle output from the pass show command.
void passGitInitNeeded()
Emitted when a Git init is required for the current store.
void changeEvent(QEvent *event) override
React to language or window state changes.
void messageAvailable(const QString &message)
Handle an incoming inter-process message (single-instance mode).
MainWindow(const QString &searchText=QString(), QWidget *parent=nullptr)
Construct the main window.
void keyPressEvent(QKeyEvent *event) override
Handle keyboard shortcuts.
void onPush()
Trigger a git push operation.
void showStatusMessage(const QString &msg, int timeout=2000)
Show a message in the status bar for the given duration.
void passShowHandlerFinished(const QString &output)
Emitted when the pass show handler has finished decrypting.
void generateGPGKeyPair(const QString &batch)
Emitted to trigger GPG key pair generation.
void critical(const QString &title, const QString &msg)
Display a critical error dialog.
void generateKeyPair(const QString &batch, QDialog *dialog)
Open the GPG key generation dialog.
void restoreWindow()
Restore window geometry and state from saved settings.
auto eventFilter(QObject *obj, QEvent *event) -> bool override
Filter events from watched objects.
void flashText(const QString &text, const bool isError, const bool isHtml=false)
Display a transient message in the text panel.
void setUiElementsEnabled(bool state)
Enable or disable the main UI elements.
auto getCurrentTreeViewIndex() -> QModelIndex
Return the currently selected index in the tree view.
void passOtpHandler(const QString &output)
Handle output from the pass OTP command.
void cleanKeygenDialog()
Destroy and clear the key generation dialog.
void deselect()
Clear the current tree view selection.
void on_treeView_clicked(const QModelIndex &index)
Handle a click on an item in the tree view.
auto getKeygenDialog() -> QDialog *
Return the active key generation dialog, if any.
void config()
Open the configuration dialog.
Orchestrates clipboard management, pass signal handling, and application-level operations for the QtP...
QSortFilterProxyModel for filtering and displaying password store.
Handles the system tray icon and menu.