QtPass 1.6.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
MainWindow Class Reference

The MainWindow class does way too much, not only is it a switchboard, configuration handler and more, it's also the process-manager. More...

#include <mainwindow.h>

Inheritance diagram for MainWindow:
Collaboration diagram for MainWindow:

Public Slots

void deselect ()
 MainWindow::deselect clear the selection, password and copy buffer.
void messageAvailable (const QString &message)
 MainWindow::messageAvailable we have some text/message/search to do.
void critical (const QString &, const QString &)
 MainWindow::critical critical message popup wrapper.
void executeWrapperStarted ()
void showStatusMessage (const QString &msg, int timeout=2000)
 Displays message in status bar.
void passShowHandler (const QString &)
void passOtpHandler (const QString &)
void onPush ()
 MainWindow::onPush do a git push.
void on_treeView_clicked (const QModelIndex &index)
 MainWindow::on_treeView_clicked read the selected password file.
void startReencryptPath ()
 MainWindow::startReencryptPath disable ui elements and treeview.
void endReencryptPath ()
 MainWindow::endReencryptPath re-enable ui elements.

Signals

void passShowHandlerFinished (const QString &output)
void passGitInitNeeded ()
void generateGPGKeyPair (const QString &batch)

Public Member Functions

 MainWindow (const QString &searchText=QString(), QWidget *parent=nullptr)
 MainWindow::MainWindow handles all of the main functionality and also the main window.
 ~MainWindow () override
void restoreWindow ()
void generateKeyPair (const QString &, QDialog *)
 MainWindow::generateKeyPair internal gpg keypair generator . .
void userDialog (const QString &="")
 MainWindow::userDialog see MainWindow::onUsers().
void config ()
void setUiElementsEnabled (bool state)
 MainWindow::setUiElementsEnabled enable or disable the relevant UI elements.
void flashText (const QString &text, const bool isError, const bool isHtml=false)
auto getCurrentTreeViewIndex () -> QModelIndex
auto getKeygenDialog () -> QDialog *
void cleanKeygenDialog ()

Protected Member Functions

void closeEvent (QCloseEvent *event) override
 MainWindow::closeEvent hide or quit.
void keyPressEvent (QKeyEvent *event) override
 MainWindow::keyPressEvent did anyone press return, enter or escape?
void changeEvent (QEvent *event) override
 MainWindow::changeEvent sets focus to the search box.
auto eventFilter (QObject *obj, QEvent *event) -> bool override
 MainWindow::eventFilter filter out some events and focus the treeview.

Detailed Description

The MainWindow class does way too much, not only is it a switchboard, configuration handler and more, it's also the process-manager.

Main application window that orchestrates 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). Exposes methods to restore and configure window state, control grouped UI element enablement, display transient messages, and access or reset the key-generation dialog.

This class could really do with an overhaul.

Examples
/home/annejan/Projects/QtPass/src/configdialog.cpp, and /home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 51 of file mainwindow.h.

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow::MainWindow ( const QString & searchText = QString(),
QWidget * parent = nullptr )
explicit

MainWindow::MainWindow handles all of the main functionality and also the main window.

Parameters
searchTextfor searching from cli
parentpointer
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 40 of file mainwindow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~MainWindow()

MainWindow::~MainWindow ( )
override

Member Function Documentation

◆ changeEvent()

void MainWindow::changeEvent ( QEvent * event)
overrideprotected

MainWindow::changeEvent sets focus to the search box.

Parameters
event
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 152 of file mainwindow.cpp.

◆ cleanKeygenDialog()

void MainWindow::cleanKeygenDialog ( )

◆ closeEvent()

void MainWindow::closeEvent ( QCloseEvent * event)
overrideprotected

MainWindow::closeEvent hide or quit.

Parameters
event
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 948 of file mainwindow.cpp.

Here is the call graph for this function:

◆ config()

void MainWindow::config ( )
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 286 of file mainwindow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ critical

void MainWindow::critical ( const QString & title,
const QString & msg )
slot

MainWindow::critical critical message popup wrapper.

Parameters
title
msg
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 1360 of file mainwindow.cpp.

◆ deselect

void MainWindow::deselect ( )
slot

MainWindow::deselect clear the selection, password and copy buffer.

Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 408 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ endReencryptPath

void MainWindow::endReencryptPath ( )
slot

MainWindow::endReencryptPath re-enable ui elements.

Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 1326 of file mainwindow.cpp.

Here is the call graph for this function:

◆ eventFilter()

auto MainWindow::eventFilter ( QObject * obj,
QEvent * event ) -> bool
overrideprotected

MainWindow::eventFilter filter out some events and focus the treeview.

Parameters
obj
event
Returns
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 973 of file mainwindow.cpp.

◆ executeWrapperStarted

void MainWindow::executeWrapperStarted ( )
slot
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 418 of file mainwindow.cpp.

Here is the call graph for this function:

◆ flashText()

void MainWindow::flashText ( const QString & text,
const bool isError,
const bool isHtml = false )
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 231 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ generateGPGKeyPair

void MainWindow::generateGPGKeyPair ( const QString & batch)
signal
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.
Here is the caller graph for this function:

◆ generateKeyPair()

void MainWindow::generateKeyPair ( const QString & batch,
QDialog * keygenWindow )

MainWindow::generateKeyPair internal gpg keypair generator . .

Parameters
batch
keygenWindow
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 837 of file mainwindow.cpp.

Here is the call graph for this function:

◆ getCurrentTreeViewIndex()

auto MainWindow::getCurrentTreeViewIndex ( ) -> QModelIndex

◆ getKeygenDialog()

auto MainWindow::getKeygenDialog ( ) -> QDialog *
inline

Definition at line 70 of file mainwindow.h.

◆ keyPressEvent()

void MainWindow::keyPressEvent ( QKeyEvent * event)
overrideprotected

MainWindow::keyPressEvent did anyone press return, enter or escape?

Parameters
event
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 987 of file mainwindow.cpp.

Here is the call graph for this function:

◆ messageAvailable

void MainWindow::messageAvailable ( const QString & message)
slot

MainWindow::messageAvailable we have some text/message/search to do.

Parameters
message
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 820 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ on_treeView_clicked

void MainWindow::on_treeView_clicked ( const QModelIndex & index)
slot

MainWindow::on_treeView_clicked read the selected password file.

Parameters
index
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 374 of file mainwindow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onPush

void MainWindow::onPush ( )
slot

MainWindow::onPush do a git push.

Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 343 of file mainwindow.cpp.

Here is the call graph for this function:

◆ passGitInitNeeded

void MainWindow::passGitInitNeeded ( )
signal

◆ passOtpHandler

void MainWindow::passOtpHandler ( const QString & p_output)
slot
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 492 of file mainwindow.cpp.

Here is the call graph for this function:

◆ passShowHandler

void MainWindow::passShowHandler ( const QString & p_output)
slot
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 435 of file mainwindow.cpp.

Here is the call graph for this function:

◆ passShowHandlerFinished

void MainWindow::passShowHandlerFinished ( const QString & output)
signal
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.
Here is the caller graph for this function:

◆ restoreWindow()

void MainWindow::restoreWindow ( )
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 553 of file mainwindow.cpp.

Here is the call graph for this function:

◆ setUiElementsEnabled()

void MainWindow::setUiElementsEnabled ( bool state)

MainWindow::setUiElementsEnabled enable or disable the relevant UI elements.

Parameters
state
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 528 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ showStatusMessage

void MainWindow::showStatusMessage ( const QString & msg,
int timeout = 2000 )
slot

Displays message in status bar.

Parameters
msgtext to be displayed
timeouttime for which msg shall be visible
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 1311 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ startReencryptPath

void MainWindow::startReencryptPath ( )
slot

MainWindow::startReencryptPath disable ui elements and treeview.

Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 1318 of file mainwindow.cpp.

Here is the call graph for this function:

◆ userDialog()

void MainWindow::userDialog ( const QString & dir = "")

MainWindow::userDialog see MainWindow::onUsers().

Parameters
dirfolder to edit users for.
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 792 of file mainwindow.cpp.


The documentation for this class was generated from the following files: