This commit is contained in:
DavidXanatos 2023-07-02 10:22:38 +02:00
parent 4841a1e993
commit 67c8bb82a1
3 changed files with 182 additions and 159 deletions

View File

@ -85,7 +85,6 @@
<widget class="QLabel" name="lblGeneral">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -128,7 +127,6 @@
<widget class="QLabel" name="lblRecovery">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -259,7 +257,6 @@
<widget class="QLabel" name="lblMessages">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -292,7 +289,6 @@
<widget class="QLabel" name="lblNotify">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -426,7 +422,6 @@
<widget class="QLabel" name="lblStartMenu">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -483,7 +478,6 @@
<widget class="QLabel" name="lblSysTray">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -504,7 +498,6 @@
<widget class="QLabel" name="lblRunBoxed">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -568,7 +561,6 @@
<widget class="QLabel" name="lblStartUp">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -842,7 +834,6 @@
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -1057,7 +1048,6 @@
<widget class="QLabel" name="lblDisplay">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -1096,7 +1086,7 @@
<item row="0" column="0">
<widget class="QTabWidget" name="tabsAddons">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tabAddonList">
<attribute name="title">
@ -1236,7 +1226,6 @@
<widget class="QLabel" name="lblCertExp">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -1331,129 +1320,14 @@
<property name="leftMargin">
<number>0</number>
</property>
<item row="7" column="2">
<widget class="QLabel" name="label_25">
<property name="toolTip">
<string>New full versions from the selected release channel.</string>
</property>
<property name="text">
<string>New Versions</string>
</property>
</widget>
</item>
<item row="9" column="1" colspan="6">
<widget class="QCheckBox" name="chkUpdateAddons">
<property name="text">
<string>Keep addon list up to date</string>
</property>
</widget>
</item>
<item row="10" column="4" colspan="2">
<spacer name="horizontalSpacer_21">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="2" colspan="2">
<widget class="QRadioButton" name="radPreview">
<property name="toolTip">
<string>The preview channel contains the latest GitHub pre-releases.</string>
</property>
<property name="text">
<string>Search in the Preview channel</string>
</property>
</widget>
</item>
<item row="10" column="1">
<spacer name="verticalSpacer_12">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="lblUpdates">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Support Settings</string>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QLabel" name="lblInsider">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="2" colspan="2">
<widget class="QRadioButton" name="radStable">
<property name="toolTip">
<string>The stable channel contains the latest stable GitHub releases.</string>
</property>
<property name="text">
<string>Search in the Stable channel</string>
</property>
</widget>
</item>
<item row="6" column="4" colspan="2">
<widget class="QLabel" name="lblRevision">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QLabel" name="lblPreview">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QLabel" name="lblStable">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="2" colspan="2">
<widget class="QRadioButton" name="radInsider">
<property name="toolTip">
<string>The Insider channel offers early access to new features and bugfixes that will eventually be released to the public, as well as all relevant improvements from the stable channel.
Unlike the preview channel, it does not include untested, potentially breaking, or experimental changes that may not be ready for wider use.</string>
</property>
<property name="text">
<string>Search in the Insider channel</string>
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QComboBox" name="cmbRelease"/>
</item>
<item row="6" column="3">
<widget class="QComboBox" name="cmbUpdate"/>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="QLabel" name="label_39">
<property name="maximumSize">
<size>
@ -1466,10 +1340,30 @@ Unlike the preview channel, it does not include untested, potentially breaking,
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QCheckBox" name="chkAutoUpdate">
<item row="10" column="1" colspan="6">
<widget class="QCheckBox" name="chkUpdateAddons">
<property name="text">
<string>Check periodically for new Sandboxie-Plus versions</string>
<string>Keep addon list up to date</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="lblUpdates">
<property name="font">
<font>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="text">
<string>Update Settings</string>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QLabel" name="lblPreview">
<property name="text">
<string/>
</property>
</widget>
</item>
@ -1480,7 +1374,7 @@ Unlike the preview channel, it does not include untested, potentially breaking,
</property>
</widget>
</item>
<item row="6" column="2">
<item row="7" column="2">
<widget class="QLabel" name="label_27">
<property name="toolTip">
<string>Hotpatches for the installed version, updates to the Templates.ini and translations.</string>
@ -1490,7 +1384,85 @@ Unlike the preview channel, it does not include untested, potentially breaking,
</property>
</widget>
</item>
<item row="10" column="6">
<item row="5" column="2" colspan="2">
<widget class="QRadioButton" name="radPreview">
<property name="toolTip">
<string>The preview channel contains the latest GitHub pre-releases.</string>
</property>
<property name="text">
<string>Search in the Preview channel</string>
</property>
</widget>
</item>
<item row="6" column="2" colspan="2">
<widget class="QRadioButton" name="radInsider">
<property name="toolTip">
<string>The Insider channel offers early access to new features and bugfixes that will eventually be released to the public, as well as all relevant improvements from the stable channel.
Unlike the preview channel, it does not include untested, potentially breaking, or experimental changes that may not be ready for wider use.</string>
</property>
<property name="text">
<string>Search in the Insider channel</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QLabel" name="lblInsider">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="4" colspan="2">
<widget class="QLabel" name="lblRevision">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QComboBox" name="cmbUpdate"/>
</item>
<item row="11" column="4" colspan="2">
<spacer name="horizontalSpacer_21">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="2">
<widget class="QLabel" name="label_25">
<property name="toolTip">
<string>New full versions from the selected release channel.</string>
</property>
<property name="text">
<string>New Versions</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QCheckBox" name="chkAutoUpdate">
<property name="text">
<string>Check periodically for new Sandboxie-Plus versions</string>
</property>
</widget>
</item>
<item row="6" column="5" colspan="2">
<widget class="QLabel" name="lblInsiderInfo">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>More about the &lt;a href=&quot;https://sandboxie-plus.com/go.php?to=sbie-insider&quot;&gt;Insider Channel&lt;/a&gt;</string>
</property>
</widget>
</item>
<item row="11" column="6">
<spacer name="horizontalSpacer_22">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -1503,23 +1475,49 @@ Unlike the preview channel, it does not include untested, potentially breaking,
</property>
</spacer>
</item>
<item row="5" column="5" colspan="2">
<widget class="QLabel" name="lblInsiderInfo">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>More about the &lt;a href=&quot;https://sandboxie-plus.com/go.php?to=sbie-insider&quot;&gt;Insider Channel&lt;/a&gt;</string>
</property>
</widget>
</item>
<item row="8" column="1" colspan="6">
<item row="9" column="1" colspan="6">
<widget class="QCheckBox" name="chkUpdateIssues">
<property name="text">
<string>Keep Troubleshooting scripts up to date</string>
</property>
</widget>
</item>
<item row="4" column="2" colspan="2">
<widget class="QRadioButton" name="radStable">
<property name="toolTip">
<string>The stable channel contains the latest stable GitHub releases.</string>
</property>
<property name="text">
<string>Search in the Stable channel</string>
</property>
</widget>
</item>
<item row="8" column="3">
<widget class="QComboBox" name="cmbRelease"/>
</item>
<item row="11" column="1">
<spacer name="verticalSpacer_12">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="3">
<widget class="QComboBox" name="cmbInterval"/>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Update Check Interval</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@ -1584,7 +1582,6 @@ Unlike the preview channel, it does not include untested, potentially breaking,
<widget class="QLabel" name="lblBoxRoot">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -1697,7 +1694,6 @@ Unlike the preview channel, it does not include untested, potentially breaking,
<widget class="QLabel" name="lblBoxFeatures">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
@ -1789,7 +1785,6 @@ Unlike the preview channel, it does not include untested, potentially breaking,
<widget class="QLabel" name="lblProtection">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>

View File

@ -15,6 +15,8 @@
#include <windows.h>
#include <QRandomGenerator>
#define UPDATE_INTERVAL (7 * 24 * 60 * 60)
#ifdef _DEBUG
// mess with a dummy installation when debugging
@ -90,8 +92,8 @@ void COnlineUpdater::Process()
if (iCheckUpdates != 0)
{
time_t NextUpdateCheck = theConf->GetUInt64("Options/NextCheckForUpdates", 0);
if (NextUpdateCheck == 0)
theConf->SetValue("Options/NextCheckForUpdates", QDateTime::currentDateTime().addDays(3).toSecsSinceEpoch());
if (NextUpdateCheck == 0) // no check made yet
theConf->SetValue("Options/NextCheckForUpdates", QDateTime::currentDateTime().addDays(7).toSecsSinceEpoch());
else if(QDateTime::currentDateTime().toSecsSinceEpoch() >= NextUpdateCheck)
{
if (iCheckUpdates == 2)
@ -104,11 +106,12 @@ void COnlineUpdater::Process()
theConf->SetValue("Options/CheckForUpdates", iCheckUpdates);
}
if (iCheckUpdates == 0)
if (iCheckUpdates == 0) // no clicked on prompt
theConf->SetValue("Options/NextCheckForUpdates", QDateTime::currentDateTime().addDays(7).toSecsSinceEpoch());
else
{
theConf->SetValue("Options/NextCheckForUpdates", QDateTime::currentDateTime().addDays(1).toSecsSinceEpoch());
// schedule next check in 12 h in case this one fails
theConf->SetValue("Options/NextCheckForUpdates", QDateTime::currentDateTime().addSecs(12 * 60 * 60).toSecsSinceEpoch());
CheckForUpdates(false);
}
@ -199,6 +202,11 @@ void COnlineUpdater::GetUpdates(QObject* receiver, const char* member, const QVa
Query.addQueryItem("auto", Params["manual"].toBool() ? "0" : "1");
if (!Params["manual"].toBool()) {
int UpdateInterval = theConf->GetInt("Options/UpdateInterval", UPDATE_INTERVAL); // in seconds
Query.addQueryItem("interval", QString::number(UpdateInterval));
}
#ifdef _DEBUG
QString Test = Query.toString();
#endif
@ -291,14 +299,13 @@ void COnlineUpdater::OnUpdateData(const QVariantMap& Data, const QVariantMap& Pa
bNothing = false;
}
if (bNothing) {
//theConf->SetValue("Options/NextCheckForUpdates", QDateTime::currentDateTime().addDays(7).toSecsSinceEpoch());
if (m_CheckMode == eManual) {
QMessageBox::information(theGUI, "Sandboxie-Plus", tr("No new updates found, your Sandboxie-Plus is up-to-date.\n"
"\nNote: The update check is often behind the latest GitHub release to ensure that only tested updates are offered."));
}
if (m_CheckMode != eManual) {
int UpdateInterval = theConf->GetInt("Options/UpdateInterval", UPDATE_INTERVAL); // in seconds
theConf->SetValue("Options/NextCheckForUpdates", QDateTime::currentDateTime().addSecs(UpdateInterval).toSecsSinceEpoch());
}
else if (bNothing) {
QMessageBox::information(theGUI, "Sandboxie-Plus", tr("No new updates found, your Sandboxie-Plus is up-to-date.\n"
"\nNote: The update check is often behind the latest GitHub release to ensure that only tested updates are offered."));
}
}

View File

@ -261,6 +261,11 @@ CSettingsWindow::CSettingsWindow(QWidget* parent)
ui.cmbDPI->addItem(tr("Native"), 1);
ui.cmbDPI->addItem(tr("Qt"), 2);
ui.cmbInterval->addItem(tr("Every Day"), 1 * 24 * 60 * 60);
ui.cmbInterval->addItem(tr("Every Week"), 7 * 24 * 60 * 60);
ui.cmbInterval->addItem(tr("Every 2 Weeks"), 14 * 24 * 60 * 60);
ui.cmbInterval->addItem(tr("Every 30 days"), 30 * 24 * 60 * 60);
ui.cmbUpdate->addItem(tr("Ignore"), "ignore");
ui.cmbUpdate->addItem(tr("Notify"), "notify");
ui.cmbUpdate->addItem(tr("Download & Notify"), "download");
@ -471,6 +476,8 @@ CSettingsWindow::CSettingsWindow(QWidget* parent)
connect(ui.chkAutoUpdate, SIGNAL(toggled(bool)), this, SLOT(UpdateUpdater()));
connect(ui.cmbInterval, SIGNAL(currentIndexChanged(int)), this, SLOT(OnOptChanged()));
connect(ui.radStable, SIGNAL(toggled(bool)), this, SLOT(UpdateUpdater()));
connect(ui.radPreview, SIGNAL(toggled(bool)), this, SLOT(UpdateUpdater()));
connect(ui.radInsider, SIGNAL(toggled(bool)), this, SLOT(UpdateUpdater()));
@ -971,6 +978,13 @@ void CSettingsWindow::LoadSettings()
ui.chkAutoUpdate->setCheckState(CSettingsWindow__Int2Chk(theConf->GetInt("Options/CheckForUpdates", 2)));
int UpdateInterval = theConf->GetInt("Options/UpdateInterval", UPDATE_INTERVAL);
int pos = ui.cmbInterval->findData(UpdateInterval);
if (pos == -1)
ui.cmbInterval->setCurrentText(QString::number(UpdateInterval));
else
ui.cmbInterval->setCurrentIndex(pos);
QString ReleaseChannel = theConf->GetString("Options/ReleaseChannel", "stable");
ui.radStable->setChecked(ReleaseChannel == "stable");
ui.radPreview->setChecked(ReleaseChannel == "preview");
@ -1368,6 +1382,13 @@ void CSettingsWindow::SaveSettings()
theConf->SetValue("Options/CheckForUpdates", CSettingsWindow__Chk2Int(ui.chkAutoUpdate->checkState()));
int UpdateInterval = ui.cmbInterval->currentData().toInt();
if (!UpdateInterval)
UpdateInterval = ui.cmbInterval->currentText().toInt();
if (!UpdateInterval)
UpdateInterval = UPDATE_INTERVAL;
theConf->SetValue("Options/UpdateInterval", UpdateInterval);
QString ReleaseChannel;
if (ui.radStable->isChecked())
ReleaseChannel = "stable";