mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 12:52:04 +08:00
新增了配置的保存,以及第一次打开程序时安装默认配置
This commit is contained in:
@@ -34,6 +34,9 @@ namespace SpkUi
|
||||
ui->lblSettingsTitle->setObjectName("styConfTitle");
|
||||
ui->lblCleanup->setObjectName("styConfTitle");
|
||||
ui->lblAdvanced->setObjectName("styConfTitle");
|
||||
|
||||
connect(ui->btnSave, &QPushButton::clicked,
|
||||
this, &SpkPageSettings::SaveConfiguration);
|
||||
}
|
||||
|
||||
void SpkPageSettings::ReadConfiguration()
|
||||
@@ -51,12 +54,20 @@ namespace SpkUi
|
||||
|
||||
void SpkPageSettings::SaveConfiguration()
|
||||
{
|
||||
auto ui = mSettingsUi;
|
||||
auto settings = CFG;
|
||||
|
||||
CFG->SetSettings("resource/concurrent", ui->spnConcurrentResDownloads->value());
|
||||
assert(CFG->SetField("url/api", ui->edtApiUrl->text()));
|
||||
assert(CFG->SetField("url/res", ui->edtResourceUrl->text()));
|
||||
CFG->SetSettings("dirs/cache", ui->edtResourceCachePath->text());
|
||||
assert(CFG->SetField("dirs/download", ui->edtDownloadPath->text()));
|
||||
assert(CFG->SetField("download/servers", ui->edtDownloadServers->toPlainText()));
|
||||
CFG->SetSettings("internal/qss_path", ui->edtQssPath->text());
|
||||
}
|
||||
|
||||
void SpkPageSettings::Activated()
|
||||
{
|
||||
ReadConfiguration();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,11 +15,35 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblSettingsTitle">
|
||||
<property name="text">
|
||||
<string>Spark Store Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="layTitle">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblSettingsTitle">
|
||||
<property name="text">
|
||||
<string>Spark Store Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnSave">
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="lineTitle">
|
||||
|
||||
Reference in New Issue
Block a user