-
Notifications
You must be signed in to change notification settings - Fork 1
/
cmainwindow.cpp
157 lines (137 loc) · 4.54 KB
/
cmainwindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/******************************
* Author : YangRongBao
* Date : 2021.4
******************************/
#include "cmainwindow.h"
#include "ui_cmainwindow.h"
CMainWindow::CMainWindow(const QString account, QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::CMainWindow)
, m_account(new const QString(account))
{
ui->setupUi(this); //默认代码
/** [NetworkSystem] */
/* [NetworkSystem] **/
/** [FilesSystem] */
/* [FilesSystem] **/
/** [Menu\Set] */
connect(ui->actionModifyPassword, &QAction::triggered, [&]()
{
m_modifyPasswordDialog = new CModifyPasswordDialog(*m_account ,this);
m_modifyPasswordDialog->exec();
connect(m_modifyPasswordDialog, &CModifyPasswordDialog::modified, [&]()
{
delete m_modifyPasswordDialog;
});
});
connect(ui->actionModifySecretiveQuestions, &QAction::triggered, [&]()
{
m_modifySecretiveQuestionsDialog = new CModifySecretiveQuestionsDialog(*m_account ,this);
m_modifySecretiveQuestionsDialog->exec();
connect(m_modifySecretiveQuestionsDialog, &CModifySecretiveQuestionsDialog::modified, [&]()
{
delete m_modifySecretiveQuestionsDialog;
});
});
connect(ui->actionStyle, &QAction::triggered, [&]()
{
qDebug() << "修改样式!";
});
connect(ui->actionComponents, &QAction::triggered, [&]()
{
qDebug() << "设置插件!";
});
/* [Menu\Set] **/
/** [Menu\Help] */
connect(ui->actionOPI, &QAction::triggered, []()
{
CProductInformationDialog productInformationDialog;
productInformationDialog.exec();
});
connect(ui->actionUpdate, &QAction::triggered, [&]()
{
qDebug() << "获取更新!";
});
connect(ui->actionRepair, &QAction::triggered, [&]()
{
qDebug() << "修复错误!";
});
connect(ui->actionFeedback, &QAction::triggered, [&]()
{
qDebug() << "提交反馈!";
});
/* [Menu\Help] **/
/** [SidedMenu] */
ui->stackedWidgetMain->setCurrentIndex(0);
connect(ui->toolButtonHome, &QToolButton::clicked, [&]()
{
ui->stackedWidgetMain->setCurrentIndex(0);
});
connect(ui->toolButtonStudy, &QToolButton::clicked, [&]()
{
ui->stackedWidgetMain->setCurrentIndex(1);
});
connect(ui->toolButtonRecreation, &QToolButton::clicked, [&]()
{
ui->stackedWidgetMain->setCurrentIndex(2);
});
connect(ui->toolButtonSociology, &QToolButton::clicked, [&]()
{
ui->stackedWidgetMain->setCurrentIndex(3);
});
connect(ui->toolButtonTools, &QToolButton::clicked, [&]()
{
ui->stackedWidgetMain->setCurrentIndex(4);
});
connect(ui->toolButtonLogout, &QToolButton::clicked, [&]()
{
emit logout();
});
/* [SidedMenu] **/
/** [SidedMenu\Recreation\Gobang] */
ui->tabWidgetRecreation->setCurrentIndex(0);
ui->stackedWidgetGobang->setCurrentIndex(0);
connect(ui->toolButtonGobangPVC, &QToolButton::clicked, [&]()
{
ui->stackedWidgetGobang->setCurrentIndex(0);
});
connect(ui->toolButtonGobangPVP, &QToolButton::clicked, [&]()
{
ui->stackedWidgetGobang->setCurrentIndex(1);
});
connect(ui->toolButtonGobangQualifying, &QToolButton::clicked, [&]()
{
ui->stackedWidgetGobang->setCurrentIndex(2);
});
connect(ui->toolButtonGobangRecord, &QToolButton::clicked, [&]()
{
ui->stackedWidgetGobang->setCurrentIndex(3);
});
connect(ui->toolButtonGobangSetting, &QToolButton::clicked, [&]()
{
ui->stackedWidgetGobang->setCurrentIndex(4);
});
connect(ui->pushButtonRestart, &QPushButton::clicked, [&]()
{
ui->labelGobangPVCChessboard->restart();
ui->labelGobangPVCMessageboard->setText("");
});
connect(ui->labelGobangPVCChessboard, &CGobangChessboard::blackWin, [&]()
{
ui->labelGobangPVCMessageboard->setText("黑棋胜利!");
});
connect(ui->labelGobangPVCChessboard, &CGobangChessboard::whiteWin, [&]()
{
ui->labelGobangPVCMessageboard->setText("白棋胜利!");
});
/* [SidedMenu\Recreation\Gobang] **/
/** [SidedMenu\Tools\EditPictures] */
ui->tabWidgetTools->setCurrentIndex(0);
/* [SidedMenu\Tools\CalculateFormula] **/
/** [StatusMenu] */
/* [StatusMenu] **/
}
CMainWindow::~CMainWindow()
{
delete ui;
}