MailJD nbsp;·nbsp; Test Dashboard nbsp;·nbsp; Coverage
LCOV - code coverage report
Current view: top level - ui - SetupWizard.h (source / functions) Coverage Total Hit
Test: MailJD Coverage (Unit + E2E) Lines: 100.0 % 6 6
Test Date: 2026-07-27 17:53:44 Functions: 100.0 % 6 6
Legend: Lines:     hit not hit

            Line data    Source code
       1              : #pragma once
       2              : 
       3              : #include <QWizard>
       4              : 
       5              : class AccountFormWidget;
       6              : class QLabel;
       7              : class QProgressBar;
       8              : class QPushButton;
       9              : 
      10              : class ImapService;
      11              : struct AccountConfig;
      12              : 
      13              : // First-run wizard for setting up the initial email account.
      14              : // Uses AccountFormWidget (shared with SettingsDialog) for the account form.
      15              : class SetupWizard : public QWizard {
      16           11 :   Q_OBJECT
      17              : 
      18              : public:
      19              :   explicit SetupWizard(QWidget *parent = nullptr);
      20              : 
      21              :   // Override config dir for testing
      22              :   void setConfigDir(const QString &dir);
      23            1 :   QString configDir() const { return m_configDir; }
      24              : 
      25              :   // Returns the configured account after wizard completes
      26              :   AccountConfig configuredAccount() const;
      27              : 
      28              :   void accept() override;
      29              : 
      30              : private:
      31              :   QString m_configDir;
      32              : 
      33              :   // T-304: Runtime language switching
      34              :   void retranslateUi();
      35              : 
      36              : protected:
      37              :   void changeEvent(QEvent *event) override;
      38              : };
      39              : 
      40              : // Page 1: Welcome message
      41              : class WelcomePage : public QWizardPage {
      42           20 :   Q_OBJECT
      43              : 
      44              : public:
      45              :   explicit WelcomePage(QWidget *parent = nullptr);
      46              : };
      47              : 
      48              : // Page 2: Account form (embeds AccountFormWidget)
      49              : class AccountPage : public QWizardPage {
      50           21 :   Q_OBJECT
      51              : 
      52              : public:
      53              :   explicit AccountPage(QWidget *parent = nullptr);
      54              : 
      55              :   bool validatePage() override;
      56              : 
      57           10 :   AccountFormWidget *form() const { return m_form; }
      58              : 
      59              : private:
      60              :   AccountFormWidget *m_form = nullptr;
      61              : };
      62              : 
      63              : // Page 3: Connection test + summary
      64              : class TestPage : public QWizardPage {
      65           30 :   Q_OBJECT
      66              : 
      67              : public:
      68              :   explicit TestPage(QWidget *parent = nullptr);
      69              : 
      70              :   void initializePage() override;
      71              :   bool isComplete() const override;
      72              : 
      73              : private:
      74              :   void runTest();
      75              :   void onTestSuccess();
      76              :   void onTestFailed(const QString &error);
      77              : 
      78              :   QLabel *m_summaryLabel = nullptr;
      79              :   QLabel *m_statusLabel = nullptr;
      80              :   QProgressBar *m_progressBar = nullptr;
      81              :   QPushButton *m_retryButton = nullptr;
      82              : 
      83              :   ImapService *m_testService = nullptr;
      84              :   bool m_testComplete = false;
      85              : };
        

Generated by: LCOV version 2.0-1