@@ -12,6 +12,7 @@ SettingsView::SettingsView(QWidget *parent)
12
12
ui->widget ->setStyleSheet (KiwixApp::instance ()->parseStyleFromFile (" :/css/_settingsManager.css" ));
13
13
connect (ui->zoomPercentSpinBox , QOverload<int >::of (&QSpinBox::valueChanged), this , &SettingsView::setZoom);
14
14
connect (ui->moveToTrashToggle , &QCheckBox::clicked, this , &SettingsView::setMoveToTrash);
15
+ connect (ui->reopenTabToggle , &QCheckBox::clicked, this , &SettingsView::setReopenTab);
15
16
connect (ui->browseButton , &QPushButton::clicked, this , &SettingsView::browseDownloadDir);
16
17
connect (ui->resetButton , &QPushButton::clicked, this , &SettingsView::resetDownloadDir);
17
18
connect (ui->monitorBrowse , &QPushButton::clicked, this , &SettingsView::browseMonitorDir);
@@ -20,6 +21,7 @@ SettingsView::SettingsView(QWidget *parent)
20
21
connect (KiwixApp::instance ()->getSettingsManager (), &SettingsManager::monitorDirChanged, this , &SettingsView::onMonitorDirChanged);
21
22
connect (KiwixApp::instance ()->getSettingsManager (), &SettingsManager::zoomChanged, this , &SettingsView::onZoomChanged);
22
23
connect (KiwixApp::instance ()->getSettingsManager (), &SettingsManager::moveToTrashChanged, this , &SettingsView::onMoveToTrashChanged);
24
+ connect (KiwixApp::instance ()->getSettingsManager (), &SettingsManager::reopenTabChanged, this , &SettingsView::onReopenTabChanged);
23
25
ui->settingsLabel ->setText (gt (" settings" ));
24
26
ui->zoomPercentLabel ->setText (gt (" zoom-level-setting" ));
25
27
ui->downloadDirLabel ->setText (gt (" download-directory-setting" ));
@@ -31,14 +33,18 @@ SettingsView::SettingsView(QWidget *parent)
31
33
ui->monitorHelp ->setText (" <b>?</b>" );
32
34
ui->monitorHelp ->setToolTip (gt (" monitor-directory-tooltip" ));
33
35
ui->moveToTrashLabel ->setText (gt (" move-files-to-trash" ));
36
+ ui->reopenTabLabel ->setText (gt (" open-previous-tabs-at-startup" ));
34
37
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
38
+ ui->line_5 ->hide ();
35
39
ui->moveToTrashLabel ->hide ();
36
40
ui->moveToTrashToggle ->hide ();
37
41
#endif
38
42
39
43
}
40
44
41
- void SettingsView::init (int zoomPercent, const QString &downloadDir, const QString &monitorDir, const bool moveToTrash)
45
+ void SettingsView::init (int zoomPercent, const QString &downloadDir,
46
+ const QString &monitorDir, const bool moveToTrash,
47
+ bool reopentab)
42
48
{
43
49
ui->zoomPercentSpinBox ->setValue (zoomPercent);
44
50
ui->downloadDirPath ->setText (downloadDir);
@@ -47,6 +53,7 @@ void SettingsView::init(int zoomPercent, const QString &downloadDir, const QStri
47
53
}
48
54
ui->monitorDirPath ->setText (monitorDir);
49
55
ui->moveToTrashToggle ->setChecked (moveToTrash);
56
+ ui->reopenTabToggle ->setChecked (reopentab);
50
57
}
51
58
bool SettingsView::confirmDialog ( QString messageText, QString messageTitle)
52
59
{
@@ -142,6 +149,11 @@ void SettingsView::setMoveToTrash(bool moveToTrash)
142
149
KiwixApp::instance ()->getSettingsManager ()->setMoveToTrash (moveToTrash);
143
150
}
144
151
152
+ void SettingsView::setReopenTab (bool reopen)
153
+ {
154
+ KiwixApp::instance ()->getSettingsManager ()->setReopenTab (reopen);
155
+ }
156
+
145
157
void SettingsView::onDownloadDirChanged (const QString &dir)
146
158
{
147
159
ui->downloadDirPath ->setText (dir);
@@ -167,3 +179,8 @@ void SettingsView::onMoveToTrashChanged(bool moveToTrash)
167
179
{
168
180
ui->moveToTrashToggle ->setChecked (moveToTrash);
169
181
}
182
+
183
+ void SettingsView::onReopenTabChanged (bool reopen)
184
+ {
185
+ ui->reopenTabToggle ->setChecked (reopen);
186
+ }
0 commit comments