|
QtPass 2.0.0
Developer documentation
|
Main application window orchestrating UI, user interactions, and external process handlers. More...
#include <mainwindow.h>
Public Slots | |
| void | deselect () |
| Clear the current tree view selection. | |
| void | messageAvailable (const QString &message) |
| Handle an incoming inter-process message (single-instance mode). | |
| void | onProcessOutput (const QString &output, bool isError, Enums::PROCESS pid=Enums::INVALID) |
| Handle generic process output for display in output panel. | |
| void | critical (const QString &title, const QString &msg) |
| Display a critical error dialog. | |
| void | executeWrapperStarted () |
| Slot called when an external process wrapper has started. | |
| void | showStatusMessage (const QString &msg, int timeout=2000) |
| Show a message in the status bar for the given duration. | |
| void | passShowHandler (const QString &output, const QString &file=QString()) |
| Render a decrypted entry: fields into the display panel, the rest into the text browser, and the password onto the clipboard when "Always copy" is set. Decrypts of any entry but the one the panel last asked to show (m_shownFile) are dropped. | |
| void | otpFromFileToClipboard (const QString &output, const QString &file) |
| Generate a one-time password from decrypted content and copy it. Ignores decrypts of anything but the entry onOtp() asked for. | |
| void | passwordFromFileToClipboard (const QString &text, const QString &file) |
| Copy the first line of a decrypted entry (Ctrl+C). Ignores decrypts of anything but the entry copyPasswordFromTreeview() asked for; an otpauth:// first line is refused. | |
| void | cancelOtpRequest () |
| Forget the pending OTP and copy requests. | |
| void | onOperationError () |
| An operation ended in an error before or instead of a result: forget the pending requests and what the panel was about to show. | |
| void | dropStaleToolsAreaPalettes () |
| Drop a style-imposed menu bar or toolbar palette that belongs to the other theme (Breeze header palette after a light/dark switch). | |
| void | onGrepFinished (const QList< QPair< QString, QStringList > > &results) |
| Handle results from a completed grep search. | |
| void | onPush () |
| Trigger a git push operation. | |
| void | on_treeView_clicked (const QModelIndex &index) |
| Handle a click on an item in the tree view. | |
| void | startReencryptPath () |
| Begin a re-encryption pass on the current path. | |
| void | reencryptProgress (int current, int total) |
| Update the re-encryption progress dialog. | |
| void | endReencryptPath () |
| Finish a re-encryption pass on the current path. | |
Public Member Functions | |
| MainWindow (const QString &searchText=QString(), QWidget *parent=nullptr) | |
| Construct the main window. | |
| ~MainWindow () override | |
| Save the window state (a quit from the tray menu or a SIGTERM never delivers closeEvent()) and delete the QtPass glue. | |
| void | restoreWindow () |
| Restore window geometry and state from saved settings. | |
| auto | config () -> bool |
| Open the configuration dialog. | |
| void | setUiElementsEnabled (bool state) |
| Enable or disable the main UI elements. | |
| void | flashText (const QString &text, const bool isError, const bool isHtml=false) |
| Display a transient message in the text panel. | |
| auto | getCurrentTreeViewIndex () -> QModelIndex |
| Return the currently selected index in the tree view. | |
| auto | initSucceeded () const -> bool |
| Return whether startup configuration succeeded. | |
Protected Member Functions | |
| void | closeEvent (QCloseEvent *event) override |
| Save window state and geometry on close. | |
| void | keyPressEvent (QKeyEvent *event) override |
| Handle keyboard shortcuts. | |
| void | changeEvent (QEvent *event) override |
| React to language or window state changes. | |
| auto | event (QEvent *event) -> bool override |
| Notice an application palette change, the theme switch that makes a style-imposed bar palette suspect; see dropStaleToolsAreaPalettes(). | |
| void | showEvent (QShowEvent *event) override |
| First-show hook used to focus the search input once the window is actually mapped (avoids races with timers fired before show). | |
| auto | eventFilter (QObject *obj, QEvent *event) -> bool override |
| Filter events from watched objects. | |
Private Slots | |
| void | updateProfileBox () |
| Fill the profile box from the settings, the active profile selected, without switching profiles while doing so. | |
| void | updateProfileBoxEnabled () |
| Enable the profile box only when there is more than one profile, the interface is enabled and the backend is idle. | |
| void | on_grepButton_toggled (bool checked) |
| The content-search toggle changed: switch the search box between name filtering and regex content search, clearing the query, the tree filter and any results; leaving while a search runs cancels it. | |
| void | on_grepResultsList_itemClicked (QTreeWidgetItem *item, int column) |
| A content-search result was clicked: select the entry in the tree, show it, and go back to the tree (clearing the results when content is hidden or the panel autoclears). | |
| void | addPassword () |
| Toolbar/context-menu "Add password": open PasswordDialog for a new entry in the current folder. | |
| void | addFolder () |
| Toolbar/context-menu "Add folder": ask for a name, create the folder under the current one (refusing paths that escape the store) and seed its .gpg-id from the parent when configured. | |
| void | onEdit () |
| Toolbar "Edit" or a double-click: editPassword() on the current entry. | |
| void | onDelete () |
| Toolbar "Delete" or the Delete key: confirm, then remove the current entry or folder. Nothing selected is a no-op (#556); a linked folder only loses its link, a folder behind a link is refused. | |
| void | onOtp () |
| Toolbar "OTP": copy the current entry's one-time code. Uses the code the panel already shows for this entry; otherwise decrypts once and lets otpFromFileToClipboard() finish. | |
| void | onUpdate (bool block=false) |
| Toolbar "Update": git pull. | |
| void | onUsers () |
| Toolbar/context-menu "Users": open UsersDialog for the current folder, unless it lies behind a link. | |
| void | onConfig () |
| Toolbar "Config": config(), ignoring its result. | |
| void | showAbout () |
| Show the About box: version, project link, licence. | |
| void | on_treeView_doubleClicked (const QModelIndex &index) |
| A double-click on a tree entry opens it for editing; folders are left to the view. | |
| void | clearPanel (bool notify=true) |
| Empty the display panel and the text browser, and leave content search if its results were showing. Runs on the autoclear timer. | |
| void | on_lineEdit_textChanged (const QString &arg1) |
| The search box changed (name filtering only): drop the pending decrypt and the panel, expand the tree and restart searchTimer. | |
| void | on_lineEdit_returnPressed () |
| Enter in the search box: in content-search mode start (or, for an empty query, cancel) the grep; otherwise select and show the first matching entry. | |
| void | on_profileBox_currentTextChanged (const QString &name) |
| The user picked another profile: save its store, key and Git flags as the active settings, re-root the tree and clear the selection. Ignored during the fresh start and reverted while an operation runs. | |
| void | showContextMenu (const QPoint &pos) |
| Build and show the tree's context menu for the item under the cursor: folder actions (open, add, users, rename, Share) or entry actions (edit, rename), plus Delete. | |
| void | addShareMenu (QMenu &contextMenu, const AppSettings &s) |
| Add the Share submenu for the folder under the cursor: the entries are enabled only where a recipient list and a usable gpg or pass make them work. | |
| auto | confirmDeletion (const QString &file, bool isDir) -> bool |
| Ask before deleting an entry or a folder, naming what goes and warning when the folder holds anything but entries. | |
| auto | confirmLinkRemoval (const QString &file) -> bool |
| Ask before removing a folder that is a link, which takes the link and leaves what it points to. | |
| void | showBrowserContextMenu (const QPoint &pos) |
| Show the text browser's standard context menu, reparented to the window so the browser's stylesheet does not bleed into it. | |
| void | openFolder () |
| Context menu "Open folder with file manager" on the current folder. | |
| void | renameFolder () |
| Context menu "Rename folder": ask for a new name and Move the current folder, refusing a target outside the store. | |
| void | editPassword (const QString &file) |
| Open PasswordDialog on an existing entry, after a blocking pull when auto-pull is on. Releases the panel's claim on the next decrypt so the dialog's own Show does not repaint or copy. | |
| void | renamePassword () |
| Context menu "Rename password": ask for a new name and Move the current entry within its folder, refusing a target outside the store. | |
| void | focusInput () |
| Select-all and focus the search box once the window is visible; sets m_firstShowCompleted only on success so showEvent() retries. Looks the widget up by name because setWindowFlags() can rebuild it under ui->lineEdit (Qt 6.11). | |
| void | copyPasswordFromTreeview () |
| Ctrl+C on the tree: decrypt the current entry and let passwordFromFileToClipboard() copy its first line. The newest request wins (m_copyRequestFile). | |
| void | onTimeoutSearch () |
| searchTimer fired: filter the tree on the typed words (matched literally, in order, case-insensitively) and select the first match; an empty query collapses the tree and deselects. | |
Private Member Functions | |
| void | initToolBarButtons () |
| void | initStatusBar () |
| Welcome message and the permanent logo in the status bar. | |
| void | connectBackends () |
| void | initTextBrowser () |
| Font, wrapping and link handling of the text browser, per the settings. | |
| void | initDisplayPanel () |
| The grid of decrypted fields and what its buttons ask for. | |
| void | initTimers () |
| void | initProcessOutput () |
| void | connectPassSignals (Pass *pass) |
| Connect the signals of one backend that the window answers itself: errors, critical messages, wrapper start, idle, status, finishedShow (panel, OTP and Ctrl+C handlers) and finishedGrep. | |
| void | selectFirstFile () |
| Make the first entry (depth first) under the store root current. | |
| auto | firstFile (QModelIndex parentIndex) -> QModelIndex |
| Depth-first search for the first entry under a folder. | |
| auto | getFile (const QModelIndex &index, bool forPass) -> QString |
| StoreTree::fileFor() on the tree. | |
| void | setPassword (const QString &file, bool isNew=true) |
| Run PasswordDialog for a new or existing entry. For a new one the dialog gets the store's real folders (current one preselected) and the .templates, if any. | |
| auto | confirmPathInStore (const QString &candidate) -> bool |
| Guard the input dialogs (create, move, rename) against names like ../../etc/passwd or absolute paths escaping the store root; warns the user when refusing. | |
| void | initTrayIcon () |
| Create m_tray and add the menu bar toggle to its menu; gives up (m_tray stays null) when no system tray is available. | |
| void | destroyTrayIcon () |
| Delete m_tray and reset it to null. | |
| void | reencryptPath (const QString &dir) |
Share menu "Re-encrypt all passwords": confirm, lock the UI via startReencryptPath() and have ImitatePass rewrite every entry under dir for the recipients in its .gpg-id. | |
| void | exportPublicKey () |
| Share menu "Export my public key": run gpg --armor --export for the configured signing key and show the result in ExportPublicKeyDialog; explains what to do when no key is set. | |
| void | addRecipient (const QString &dir) |
Share menu "Add recipient": open UsersDialog for dir (keys already in the keyring only). | |
| auto | refuseLinkedFolder (const QString &dir) -> bool |
| Refuse, with a message, a tree-picked folder that is or lies behind a symlink or junction: what it points to is not part of the store. The store root itself may be a link. | |
| void | showShareHelp () |
| Share menu "What is this?": the explanation of sharing with GPG. | |
| void | applyTextBrowserSettings () |
| void | applyWindowFlagsSettings () |
| void | saveWindowState () |
| void | updateGitButtonVisibility (bool uiEnabled=true) |
| Show Push and Pull only when Git is in use; enable them only while the interface is. | |
| void | updateOtpButtonVisibility (bool uiEnabled=true) |
| Refresh the OTP toolbar action from settings. | |
| void | updateGrepButtonVisibility () |
| void | enableGitButtons (const bool &state) |
| Enable or disable the Push and Pull actions together. | |
| void | updateProcessOutputVisibility () |
Private Attributes | |
| QtPass * | m_qtPass |
| The UI-neutral glue to the backends (output, status, clipboard, QR codes); created in the constructor, deleted in the destructor. | |
| QScopedPointer< Ui::MainWindow > | ui |
| The widgets generated from mainwindow.ui. | |
| GrepSearchController | m_grep |
| Mode/busy/cancelled state of the content search. | |
| PasswordDisplayPanel * | m_displayPanel = nullptr |
| Renders decrypted fields into the grid; created in initDisplayPanel(), parented to this window. | |
| bool | m_firstShowCompleted = false |
| Set once focusInput() has actually focused the search box, so later show events leave the focus alone. | |
| bool | m_themeSwitched = false |
| QString | m_shownFile |
| QString | m_otpRequestFile |
| QString | m_copyRequestFile |
| ProcessOutputPanel * | m_processOutput = nullptr |
| StoreTree * | m_tree = nullptr |
| The store as shown in the tree: models, view setup, path mapping. | |
| QTimer | clearPanelTimer |
| QTimer | searchTimer |
| QTimer | m_uiWatchdog |
| QPointer< QProgressDialog > | m_reencryptProgress |
| bool | m_reencryptRunning = false |
| bool | m_uiEnabled = true |
| TrayIcon * | m_tray {} |
| bool | m_initSucceeded = false |
| bool | m_freshStart = true |
Static Private Attributes | |
| static constexpr int | UiWatchdogMs = 30000 |
| Interval of m_uiWatchdog in milliseconds. | |
Main application window orchestrating UI, user interactions, and external process handlers.
Provides the central interface for managing items, folders, passwords, and OTPs; coordinates UI components (toolbars, panels, dialogs, status/tray), selection and navigation in the underlying file/store models, and lifecycle interactions with external handlers (e.g., pass, Git, GPG key generation, OTP).
Definition at line 59 of file mainwindow.h.
|
explicit |
Construct the main window.
| searchText | Initial search text to populate the search field. |
| parent | Optional parent widget. |
Definition at line 64 of file mainwindow.cpp.
|
override |
Save the window state (a quit from the tray menu or a SIGTERM never delivers closeEvent()) and delete the QtPass glue.
Definition at line 260 of file mainwindow.cpp.
|
privateslot |
Toolbar/context-menu "Add folder": ask for a name, create the folder under the current one (refusing paths that escape the store) and seed its .gpg-id from the parent when configured.
Definition at line 1516 of file mainwindow.cpp.
|
privateslot |
Toolbar/context-menu "Add password": open PasswordDialog for a new entry in the current folder.
Definition at line 1087 of file mainwindow.cpp.
|
private |
Share menu "Add recipient": open UsersDialog for dir (keys already in the keyring only).
| dir | Absolute folder; refused when behind a link. |
Definition at line 1768 of file mainwindow.cpp.
|
privateslot |
Add the Share submenu for the folder under the cursor: the entries are enabled only where a recipient list and a usable gpg or pass make them work.
| contextMenu | The menu being built, which owns the submenu. |
| s | The settings the executables and the store come from. |
Definition at line 1421 of file mainwindow.cpp.
|
private |
Re-apply the monospace and line-wrapping settings to the text browser after the configuration dialog.
Definition at line 449 of file mainwindow.cpp.
|
private |
Toggle Qt::WindowStaysOnTopHint to match the "always on top" setting, skipping the native-window rebuild when nothing changes.
Definition at line 466 of file mainwindow.cpp.
|
slot |
Forget the pending OTP and copy requests.
A failed decrypt never emits Pass::finishedShow; without this a later decrypt of the same entry (the user retrying) would be taken as the answer to a request the user has long given up on.
Definition at line 1156 of file mainwindow.cpp.
|
overrideprotected |
React to language or window state changes.
| event | The change event. |
Definition at line 323 of file mainwindow.cpp.
|
privateslot |
Empty the display panel and the text browser, and leave content search if its results were showing. Runs on the autoclear timer.
| notify | true to show "Password and content hidden" in the browser, false to leave it blank. |
Definition at line 716 of file mainwindow.cpp.
|
overrideprotected |
Save window state and geometry on close.
| event | The close event. |
Definition at line 1335 of file mainwindow.cpp.
| auto MainWindow::config | ( | ) | -> bool |
Open the configuration dialog.
On a fresh start the first-run wizard runs before the dialog is shown. Accepting the dialog does not guarantee a usable configuration: the OK button is not gated on Util::configIsValid(), so QtPass::init() uses the return value to decide whether to ask again or to give up.
Definition at line 485 of file mainwindow.cpp.
|
privateslot |
Ask before deleting an entry or a folder, naming what goes and warning when the folder holds anything but entries.
| file | Store-relative path being deleted. |
| isDir | Whether it is a folder. |
Definition at line 1089 of file mainwindow.cpp.
|
privateslot |
Ask before removing a folder that is a link, which takes the link and leaves what it points to.
| file | Store-relative path of the link. |
Definition at line 1120 of file mainwindow.cpp.
|
private |
Guard the input dialogs (create, move, rename) against names like ../../etc/passwd or absolute paths escaping the store root; warns the user when refusing.
| candidate | Path the user asked for. |
Definition at line 1037 of file mainwindow.cpp.
|
private |
Connect QtPass's and both backends' signals (the active backend can change through the configuration dialog without a restart).
Definition at line 135 of file mainwindow.cpp.
|
private |
Connect the signals of one backend that the window answers itself: errors, critical messages, wrapper start, idle, status, finishedShow (panel, OTP and Ctrl+C handlers) and finishedGrep.
| pass | The backend; both are connected, see connectBackends(). |
Definition at line 268 of file mainwindow.cpp.
|
privateslot |
Ctrl+C on the tree: decrypt the current entry and let passwordFromFileToClipboard() copy its first line. The newest request wins (m_copyRequestFile).
Definition at line 1615 of file mainwindow.cpp.
|
slot |
Display a critical error dialog.
| title | Dialog title. |
| msg | Error message body. |
Definition at line 1848 of file mainwindow.cpp.
|
slot |
Clear the current tree view selection.
Definition at line 584 of file mainwindow.cpp.
|
private |
Delete m_tray and reset it to null.
Definition at line 1330 of file mainwindow.cpp.
|
slot |
Drop a style-imposed menu bar or toolbar palette that belongs to the other theme (Breeze header palette after a light/dark switch).
Definition at line 1372 of file mainwindow.cpp.
|
privateslot |
Open PasswordDialog on an existing entry, after a blocking pull when auto-pull is on. Releases the panel's claim on the next decrypt so the dialog's own Show does not repaint or copy.
| file | Store-relative entry name; empty is a no-op. |
Definition at line 1577 of file mainwindow.cpp.
|
private |
Enable or disable the Push and Pull actions together.
| state | true to enable. |
Definition at line 1843 of file mainwindow.cpp.
|
slot |
Finish a re-encryption pass on the current path.
Definition at line 1721 of file mainwindow.cpp.
|
overrideprotected |
Notice an application palette change, the theme switch that makes a style-imposed bar palette suspect; see dropStaleToolsAreaPalettes().
| event | The event. |
Definition at line 313 of file mainwindow.cpp.
|
overrideprotected |
Filter events from watched objects.
| obj | The object that received the event. |
| event | The event to filter. |
Definition at line 1351 of file mainwindow.cpp.
|
slot |
Slot called when an external process wrapper has started.
Definition at line 595 of file mainwindow.cpp.
|
private |
Share menu "Export my public key": run gpg --armor --export for the configured signing key and show the result in ExportPublicKeyDialog; explains what to do when no key is set.
Definition at line 1731 of file mainwindow.cpp.
|
private |
Depth-first search for the first entry under a folder.
| parentIndex | Proxy index of the folder to search. |
Definition at line 1018 of file mainwindow.cpp.
| void MainWindow::flashText | ( | const QString & | text, |
| const bool | isError, | ||
| const bool | isHtml = false ) |
Display a transient message in the text panel.
| text | Message text to display. |
| isError | true to style the message as an error. |
| isHtml | true if text contains HTML markup. |
Definition at line 425 of file mainwindow.cpp.
|
privateslot |
Select-all and focus the search box once the window is visible; sets m_firstShowCompleted only on success so showEvent() retries. Looks the widget up by name because setWindowFlags() can rebuild it under ui->lineEdit (Qt 6.11).
Definition at line 294 of file mainwindow.cpp.
| auto MainWindow::getCurrentTreeViewIndex | ( | ) | -> QModelIndex |
Return the currently selected index in the tree view.
Definition at line 421 of file mainwindow.cpp.
|
private |
StoreTree::fileFor() on the tree.
| index | Proxy index. |
| forPass | true for the store-relative entry name, false for the absolute .gpg path. |
Definition at line 555 of file mainwindow.cpp.
|
private |
The grid of decrypted fields and what its buttons ask for.
Definition at line 179 of file mainwindow.cpp.
|
private |
The Process Output dock, its Settings-menu toggle, and the feed of non-secret process output into it.
Definition at line 220 of file mainwindow.cpp.
|
private |
Welcome message and the permanent logo in the status bar.
Definition at line 411 of file mainwindow.cpp.
|
inline |
Return whether startup configuration succeeded.
Reflects the result of the initial configuration check performed in the constructor (QtPass::init()). When it is false the application cannot be used (e.g. the user cancelled the first-run wizard), and main() should exit before ever showing the window.
Definition at line 122 of file mainwindow.h.
|
private |
Font, wrapping and link handling of the text browser, per the settings.
Definition at line 160 of file mainwindow.cpp.
|
private |
The panel-clear and search timers, and the watchdog that re-enables the UI when an operation never signals its end.
Definition at line 198 of file mainwindow.cpp.
|
private |
Wire the toolbar and menu actions to their slots, set their icons, and set up the "Show menu bar" toggle with its MenuBarPeek (not on macOS).
Definition at line 352 of file mainwindow.cpp.
|
private |
Create m_tray and add the menu bar toggle to its menu; gives up (m_tray stays null) when no system tray is available.
Definition at line 1319 of file mainwindow.cpp.
|
overrideprotected |
Handle keyboard shortcuts.
| event | The key press event. |
Definition at line 1402 of file mainwindow.cpp.
|
slot |
Handle an incoming inter-process message (single-instance mode).
| message | Message string received from another instance. |
Definition at line 1222 of file mainwindow.cpp.
|
privateslot |
The content-search toggle changed: switch the search box between name filtering and regex content search, clearing the query, the tree filter and any results; leaving while a search runs cancels it.
| checked | true when content search was switched on. |
Definition at line 892 of file mainwindow.cpp.
|
privateslot |
A content-search result was clicked: select the entry in the tree, show it, and go back to the tree (clearing the results when content is hidden or the panel autoclears).
| item | The clicked entry or match line; its UserRole holds the entry name. |
| column | Unused. |
Definition at line 992 of file mainwindow.cpp.
|
privateslot |
Enter in the search box: in content-search mode start (or, for an empty query, cancel) the grep; otherwise select and show the first matching entry.
Definition at line 862 of file mainwindow.cpp.
|
privateslot |
The search box changed (name filtering only): drop the pending decrypt and the panel, expand the tree and restart searchTimer.
| arg1 | The new text. |
Definition at line 817 of file mainwindow.cpp.
|
privateslot |
The user picked another profile: save its store, key and Git flags as the active settings, re-root the tree and clear the selection. Ignored during the fresh start and reverted while an operation runs.
| name | The chosen profile name. |
Definition at line 1281 of file mainwindow.cpp.
|
slot |
Handle a click on an item in the tree view.
| index | The model index that was clicked. |
Definition at line 559 of file mainwindow.cpp.
|
privateslot |
A double-click on a tree entry opens it for editing; folders are left to the view.
| index | The double-clicked proxy index. |
Definition at line 576 of file mainwindow.cpp.
|
privateslot |
Toolbar "Config": config(), ignoring its result.
Definition at line 798 of file mainwindow.cpp.
|
privateslot |
Toolbar "Delete" or the Delete key: confirm, then remove the current entry or folder. Nothing selected is a no-op (#556); a linked folder only loses its link, a folder behind a link is refused.
Definition at line 1130 of file mainwindow.cpp.
|
privateslot |
Toolbar "Edit" or a double-click: editPassword() on the current entry.
Definition at line 1205 of file mainwindow.cpp.
|
slot |
Handle results from a completed grep search.
| results | List of file/match pairs from the grep operation. |
Definition at line 923 of file mainwindow.cpp.
|
slot |
An operation ended in an error before or instead of a result: forget the pending requests and what the panel was about to show.
Connected to Pass::processErrorExit. A Show that never ran (a linked entry refused at the store boundary) leaves the previous entry's fields on the panel under the new name otherwise, and onOtp()'s fast path would take that entry's code for the refused one.
Definition at line 1161 of file mainwindow.cpp.
|
privateslot |
Toolbar "OTP": copy the current entry's one-time code. Uses the code the panel already shows for this entry; otherwise decrypts once and lets otpFromFileToClipboard() finish.
Definition at line 1171 of file mainwindow.cpp.
|
slot |
Handle generic process output for display in output panel.
| output | Process output text. |
| isError | true if output should be styled as error (red). |
| pid | Identifier of the originating subprocess (for the label prefix); defaults to Enums::INVALID for unlabelled output. |
Definition at line 1853 of file mainwindow.cpp.
|
slot |
Trigger a git push operation.
Definition at line 548 of file mainwindow.cpp.
|
privateslot |
searchTimer fired: filter the tree on the typed words (matched literally, in order, case-insensitively) and select the first match; an empty query collapses the tree and deselects.
Definition at line 834 of file mainwindow.cpp.
|
privateslot |
Toolbar "Update": git pull.
| block | true to pull synchronously (before opening an edit dialog with auto-pull on). |
Definition at line 539 of file mainwindow.cpp.
|
privateslot |
Toolbar/context-menu "Users": open UsersDialog for the current folder, unless it lies behind a link.
Definition at line 1210 of file mainwindow.cpp.
|
privateslot |
Context menu "Open folder with file manager" on the current folder.
Definition at line 1509 of file mainwindow.cpp.
|
slot |
Generate a one-time password from decrypted content and copy it. Ignores decrypts of anything but the entry onOtp() asked for.
| output | Decrypted entry content. |
| file | Entry the content belongs to. |
Definition at line 669 of file mainwindow.cpp.
|
slot |
Render a decrypted entry: fields into the display panel, the rest into the text browser, and the password onto the clipboard when "Always copy" is set. Decrypts of any entry but the one the panel last asked to show (m_shownFile) are dropped.
| output | Decrypted password file content. |
| file | Entry the content belongs to; empty for legacy callers that do not name it, which always repaints. |
Definition at line 605 of file mainwindow.cpp.
|
slot |
Copy the first line of a decrypted entry (Ctrl+C). Ignores decrypts of anything but the entry copyPasswordFromTreeview() asked for; an otpauth:// first line is refused.
| text | Decrypted entry content. |
| file | Entry the content belongs to. |
Definition at line 1629 of file mainwindow.cpp.
|
private |
Share menu "Re-encrypt all passwords": confirm, lock the UI via startReencryptPath() and have ImitatePass rewrite every entry under dir for the recipients in its .gpg-id.
| dir | Absolute folder; refused when missing or behind a link. |
Definition at line 1652 of file mainwindow.cpp.
|
slot |
Update the re-encryption progress dialog.
| current | Files checked so far. |
| total | Files found under the re-encrypted folder. |
Definition at line 1710 of file mainwindow.cpp.
|
private |
Refuse, with a message, a tree-picked folder that is or lies behind a symlink or junction: what it points to is not part of the store. The store root itself may be a link.
| dir | Absolute folder path. |
Definition at line 1779 of file mainwindow.cpp.
|
privateslot |
Context menu "Rename folder": ask for a new name and Move the current folder, refusing a target outside the store.
Definition at line 1559 of file mainwindow.cpp.
|
privateslot |
Context menu "Rename password": ask for a new name and Move the current entry within its folder, refusing a target outside the store.
Definition at line 1593 of file mainwindow.cpp.
| void MainWindow::restoreWindow | ( | ) |
Restore window geometry and state from saved settings.
Definition at line 775 of file mainwindow.cpp.
|
private |
Store geometry and dock/toolbar state in the settings; idempotent, called from closeEvent() and the destructor.
Definition at line 289 of file mainwindow.cpp.
|
private |
Make the first entry (depth first) under the store root current.
Definition at line 1013 of file mainwindow.cpp.
|
private |
Run PasswordDialog for a new or existing entry. For a new one the dialog gets the store's real folders (current one preselected) and the .templates, if any.
| file | Store-relative entry name; empty when creating. |
| isNew | true to create, false to edit file. |
Definition at line 1047 of file mainwindow.cpp.
| void MainWindow::setUiElementsEnabled | ( | bool | state | ) |
Enable or disable the main UI elements.
| state | true to enable, false to disable. |
Definition at line 742 of file mainwindow.cpp.
|
privateslot |
Show the About box: version, project link, licence.
Definition at line 800 of file mainwindow.cpp.
|
privateslot |
Show the text browser's standard context menu, reparented to the window so the browser's stylesheet does not bleed into it.
| pos | Viewport position of the right-click. |
Definition at line 1498 of file mainwindow.cpp.
|
privateslot |
Build and show the tree's context menu for the item under the cursor: folder actions (open, add, users, rename, Share) or entry actions (edit, rename), plus Delete.
| pos | Viewport position of the right-click. |
Definition at line 1451 of file mainwindow.cpp.
|
overrideprotected |
First-show hook used to focus the search input once the window is actually mapped (avoids races with timers fired before show).
| event | The show event. |
Definition at line 340 of file mainwindow.cpp.
|
private |
Share menu "What is this?": the explanation of sharing with GPG.
Definition at line 1791 of file mainwindow.cpp.
|
slot |
Show a message in the status bar for the given duration.
| msg | Message to display. |
| timeout | Duration in milliseconds (default 2000). |
Definition at line 1648 of file mainwindow.cpp.
|
slot |
Begin a re-encryption pass on the current path.
Disables the UI, shows a cancellable progress dialog and keeps both in place until endReencryptPath(): while the worker runs, unrelated completions must not re-enable the interface (see setUiElementsEnabled).
Definition at line 1686 of file mainwindow.cpp.
|
private |
Show Push and Pull only when Git is in use; enable them only while the interface is.
| uiEnabled | false while an operation runs |
Definition at line 1808 of file mainwindow.cpp.
|
private |
Show the content-search buttons only when the setting is on; turning it off while in content-search mode leaves that mode.
Definition at line 1834 of file mainwindow.cpp.
|
private |
Refresh the OTP toolbar action from settings.
| uiEnabled | false while a backend operation is in flight, so the action is disabled along with the rest of the UI. |
Definition at line 1825 of file mainwindow.cpp.
|
private |
Sync the Process Output dock and its menu toggle with the setting after the configuration dialog.
Definition at line 1862 of file mainwindow.cpp.
|
privateslot |
Fill the profile box from the settings, the active profile selected, without switching profiles while doing so.
Definition at line 1234 of file mainwindow.cpp.
|
privateslot |
Enable the profile box only when there is more than one profile, the interface is enabled and the backend is idle.
Definition at line 1269 of file mainwindow.cpp.
|
private |
Single-shot timer that runs clearPanel() "Autoclear panel" seconds after an entry was shown.
Definition at line 523 of file mainwindow.h.
|
private |
Entry the in-flight Ctrl+C request asked for; empty when none. Each finishedShow is matched to it by file, so a second Ctrl+C on another entry just replaces the request instead of racing it.
Definition at line 511 of file mainwindow.h.
|
private |
Renders decrypted fields into the grid; created in initDisplayPanel(), parented to this window.
Definition at line 488 of file mainwindow.h.
|
private |
Set once focusInput() has actually focused the search box, so later show events leave the focus alone.
Definition at line 493 of file mainwindow.h.
|
private |
No usable configuration has been accepted yet: config() runs the first-run wizard and defaults to pass when it is installed.
Definition at line 553 of file mainwindow.h.
|
private |
Mode/busy/cancelled state of the content search.
Definition at line 483 of file mainwindow.h.
|
private |
Whether the constructor ended with a usable configuration; main() consults it via initSucceeded() to decide whether the application should start at all.
Definition at line 550 of file mainwindow.h.
|
private |
Entry the in-flight OTP request asked for; empty when none. finishedShow names its file, so otpFromFileToClipboard() simply ignores everything else and passShowHandler() skips the password copy for this one.
Definition at line 507 of file mainwindow.h.
|
private |
The process output console, a QDockWidget at the bottom dock area created in initProcessOutput(). It isn't part of the .ui because uic places its QMainWindow children in centralWidget / statusBar / menuBar / toolBars / dock-widget slots only — a sibling widget at the QMainWindow level isn't laid out and ends up obscuring the centralWidget. See #1192 for the symptom.
Definition at line 518 of file mainwindow.h.
|
private |
The UI-neutral glue to the backends (output, status, clipboard, QR codes); created in the constructor, deleted in the destructor.
Definition at line 479 of file mainwindow.h.
|
private |
Progress/cancel dialog shown between startReencryptPath() and endReencryptPath(); QPointer so a closed dialog reads back as null.
Definition at line 534 of file mainwindow.h.
|
private |
True between startReencryptPath() and endReencryptPath(). While set, setUiElementsEnabled(true) is ignored so the git completions queued by Init/Move/Copy (or the UI watchdog) cannot re-enable the interface while the re-encryption worker is still rewriting files.
Definition at line 539 of file mainwindow.h.
|
private |
Entry the display panel is currently rendering. The tree's currentIndex can move without a repaint (arrow keys and right-click do not emit QTreeView::clicked), so onOtp() must not assume the visible code belongs to the selected entry.
Definition at line 503 of file mainwindow.h.
|
private |
Whether the application palette changed in this window's lifetime. A header palette a style stamps on the bars is only suspect after that: at startup the style's colours are fresh, however far from the window colour a scheme puts its header.
Definition at line 498 of file mainwindow.h.
|
private |
The system tray icon; null until initTrayIcon() creates it when the setting is on, deleted again by destroyTrayIcon() when it is turned off or no tray is available.
Definition at line 546 of file mainwindow.h.
|
private |
The store as shown in the tree: models, view setup, path mapping.
Definition at line 520 of file mainwindow.h.
|
private |
What setUiElementsEnabled() last set: updateProfileBox() keeps the profile box disabled while an operation runs.
Definition at line 542 of file mainwindow.h.
|
private |
Re-enables the UI if a backend operation disables it but never reports completion (see setUiElementsEnabled); armed whenever the UI is disabled, stopped when it is enabled again.
Definition at line 529 of file mainwindow.h.
|
private |
searchTimer: single-shot 350 ms debounce between typing in the search box and onTimeoutSearch().
Definition at line 523 of file mainwindow.h.
|
private |
The widgets generated from mainwindow.ui.
Definition at line 481 of file mainwindow.h.
|
staticconstexprprivate |
Interval of m_uiWatchdog in milliseconds.
Definition at line 531 of file mainwindow.h.