* @brief Sets up the main window and connects signal handlers. */
| 128 | * @brief Sets up the main window and connects signal handlers. |
| 129 | */ |
| 130 | void QtPass::setMainWindow() { |
| 131 | m_mainWindow->restoreWindow(); |
| 132 | |
| 133 | fusedav.setParent(m_mainWindow); |
| 134 | |
| 135 | // Signal handlers are connected for both pass implementations |
| 136 | // Note: When pass binary changes, QtPass restart is required to reconnect |
| 137 | // This is acceptable as pass binary change is infrequent |
| 138 | connectPassSignalHandlers(QtPassSettings::getRealPass()); |
| 139 | connectPassSignalHandlers(QtPassSettings::getImitatePass()); |
| 140 | |
| 141 | connect(m_mainWindow, &MainWindow::passShowHandlerFinished, this, |
| 142 | &QtPass::passShowHandlerFinished); |
| 143 | |
| 144 | // only for ipass |
| 145 | connect(QtPassSettings::getImitatePass(), &ImitatePass::startReencryptPath, |
| 146 | m_mainWindow, &MainWindow::startReencryptPath); |
| 147 | connect(QtPassSettings::getImitatePass(), &ImitatePass::endReencryptPath, |
| 148 | m_mainWindow, &MainWindow::endReencryptPath); |
| 149 | |
| 150 | connect(m_mainWindow, &MainWindow::passGitInitNeeded, []() { |
| 151 | #ifdef QT_DEBUG |
| 152 | dbg() << "Pass git init called"; |
| 153 | #endif |
| 154 | QtPassSettings::getPass()->GitInit(); |
| 155 | }); |
| 156 | |
| 157 | connect(m_mainWindow, &MainWindow::generateGPGKeyPair, m_mainWindow, |
| 158 | [this](const QString &batch) { |
| 159 | QtPassSettings::getPass()->GenerateGPGKeys(batch); |
| 160 | m_mainWindow->showStatusMessage(tr("Generating GPG key pair"), |
| 161 | 60000); |
| 162 | }); |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * @brief Connects pass signal handlers to QtPass slots. |
nothing calls this directly
no test coverage detected