anpstudio 0.4.0
ANP Studio — Analytic Network Process desktop application
Loading...
Searching...
No Matches
mainwindow.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <QList>
9#include <QMainWindow>
10
11class Document;
12class NetworkCanvas;
13class PairwisePanel;
14class AnalysisPanel;
15class ResearcherPanel;
16class InspectorPanel;
18class RatingsPanel;
20class SessionPanel;
21class GoogleOAuth;
22class QStackedWidget;
23class QButtonGroup;
24class QWidget;
25class QHBoxLayout;
26class QAction;
27class QMenu;
28class QComboBox;
29class QActionGroup;
30
34class MainWindow : public QMainWindow {
35 Q_OBJECT
36public:
37 enum class Stage { Structure = 0, Judgments = 1, Analysis = 2, Researcher = 3 };
38
39 explicit MainWindow(QWidget* parent = nullptr);
40
45 [[nodiscard]] bool openDocument(const QString& path);
46
47public slots:
48 void setStage(Stage stage);
49
50protected:
51 void closeEvent(QCloseEvent* event) override;
52
53private slots:
54 void newFile();
55 void openFile();
56 bool saveFile();
57 bool saveFileAs();
58 void updateTitle();
59 void updateBreadcrumb();
60 void onNetworkPathChosen(int index);
61 void onScopeChosen(int index);
62 void onManageParticipants();
63 void onCollectJudgments();
64 void onSettings();
65 void onCreateGoogleForm();
66 void onImportGoogleFormResults();
67 void onOpenLinkedGoogleForm();
68 void refreshLinkedFormUi();
69 void onExportJudgmentTemplates(const QString& participantId = QString());
70 void onImportJudgmentTemplates(bool preferCsv = false);
71 void onDocumentSelectionChanged(const QString& cluster, const QString& node);
72 void onJudgmentNodeSelected(const QString& parent,
73 const QString& destCluster,
74 bool ratings);
75 void onJudgmentClusterSelected(const QString& parent);
76 void onNodeActivated(const QString& name);
77 void openRecentFile();
78 void clearRecentFiles();
79 void rebuildRecentMenu();
80 void rebuildSampleMenu();
81 void openSampleFile();
82 void openUserGuide();
83 void openGlossary();
84 void showAbout();
85
86private:
87 [[nodiscard]] bool maybeSave();
88 [[nodiscard]] bool openPath(const QString& path);
89 [[nodiscard]] bool openSamplePath(const QString& path);
90 void rememberRecentFile(const QString& path);
91 void syncRecentShortcutActions();
92 [[nodiscard]] QStringList loadExistingRecentFiles();
93 void buildStagePages();
94 [[nodiscard]] static QString samplesDirectory();
95 [[nodiscard]] static QString sampleDisplayName(const QString& fileName);
96
97 static constexpr int kMaxRecentFiles = 10;
98 static constexpr int kRecentShortcutCount = 9;
99
100 Document* doc_ = nullptr;
101 Stage stage_ = Stage::Structure;
102
103 QStackedWidget* stages_ = nullptr;
104 QButtonGroup* stageButtons_ = nullptr;
105 QWidget* breadcrumbBar_ = nullptr;
106 QHBoxLayout* breadcrumbLay_ = nullptr;
107 QComboBox* networkPathCombo_ = nullptr;
108 QComboBox* scopeCombo_ = nullptr;
109 QAction* connectModeAction_ = nullptr;
110 QButtonGroup* structureModeButtons_ = nullptr;
111 QMenu* recentMenu_ = nullptr;
112 QMenu* sampleMenu_ = nullptr;
113 QList<QAction*> recentShortcutActions_;
114 QActionGroup* stageActionGroup_ = nullptr;
115 QAction* stageStructureAction_ = nullptr;
116 QAction* stageJudgmentsAction_ = nullptr;
117 QAction* stageAnalysisAction_ = nullptr;
118 QAction* stageResearcherAction_ = nullptr;
119
120 NetworkCanvas* canvas_ = nullptr;
121 InspectorPanel* inspector_ = nullptr;
122
123 JudgmentNavPanel* judgmentNav_ = nullptr;
124 PairwisePanel* pairwise_ = nullptr;
125 RatingsPanel* ratings_ = nullptr;
126 JudgmentPrioritiesPanel* judgmentPriorities_ = nullptr;
127 SessionPanel* sessionPanel_ = nullptr;
128 GoogleOAuth* googleOAuth_ = nullptr;
129 QAction* openLinkedFormAction_ = nullptr;
130 QAction* importGoogleFormAction_ = nullptr;
131 QStackedWidget* judgmentCenter_ = nullptr;
132
133 AnalysisPanel* analysis_ = nullptr;
134 ResearcherPanel* researcher_ = nullptr;
135};
Full Analysis stage: hierarchical left nav and stacked calculation panes.
Definition analysis_panel.hpp:29
Owns the root anpcpp::AnpNetwork, undo stack, file path, and dirty flag.
Definition document.hpp:71
Property inspector for the selected network, cluster, or node.
Definition inspector_panel.hpp:27
Vertical judgment config dock: Compare, Wrt, Other, Method, Status.
Definition judgment_nav_panel.hpp:22
Right-side Judgments chart of pairwise or ratings priorities.
Definition judgment_priorities_panel.hpp:21
Primary window: stages Structure / Judgments / Analysis / Researcher.
Definition mainwindow.hpp:34
bool openDocument(const QString &path)
Loads a model from path (same as File → Open for a known path).
Visual editor for clusters, nodes, and connections.
Definition network_canvas.hpp:31
Pairwise judgment editor with Matrix and Questionnaire views.
Definition pairwise_panel.hpp:26
RatingsPrioritizer editor with preset-first Scale + Advanced popout.
Definition ratings_panel.hpp:29