mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #6272
powerjungle (3): feat(ui): add warning in GUI when running unstable version refactor(log): change unstable version warning message refactor(ui): change unstable version warning message
This commit is contained in:
commit
31be947ac5
|
@ -120,8 +120,11 @@ void UpdateCheck::checkForUpdate()
|
|||
|
||||
void UpdateCheck::handleResponse(QNetworkReply* reply)
|
||||
{
|
||||
qInfo() << "qTox is running version:" << GIT_DESCRIBE;
|
||||
|
||||
if (isCurrentVersionStable() == false) {
|
||||
qWarning() << "qTox is running an unstable version";
|
||||
qWarning() << "Currently running an untested/unstable version of qTox";
|
||||
emit versionIsUnstable();
|
||||
}
|
||||
|
||||
assert(reply != nullptr);
|
||||
|
|
|
@ -41,6 +41,7 @@ signals:
|
|||
void updateAvailable(QString latestVersion, QUrl link);
|
||||
void upToDate();
|
||||
void updateCheckFailed();
|
||||
void versionIsUnstable();
|
||||
|
||||
private slots:
|
||||
void handleResponse(QNetworkReply* reply);
|
||||
|
|
|
@ -62,6 +62,9 @@ AboutForm::AboutForm(UpdateCheck* updateCheck)
|
|||
{
|
||||
bodyUI->setupUi(this);
|
||||
|
||||
bodyUI->unstableVersion->setVisible(false);
|
||||
connect(updateCheck, &UpdateCheck::versionIsUnstable, this, &AboutForm::onUnstableVersion);
|
||||
|
||||
// block all child signals during initialization
|
||||
const RecursiveSignalBlocker signalBlocker(this);
|
||||
|
||||
|
@ -187,6 +190,11 @@ void AboutForm::reloadTheme()
|
|||
replaceVersions();
|
||||
}
|
||||
|
||||
void AboutForm::onUnstableVersion()
|
||||
{
|
||||
bodyUI->unstableVersion->setVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates hyperlink with specific style.
|
||||
* @param path The URL of the page the link goes to.
|
||||
|
|
|
@ -48,6 +48,7 @@ public slots:
|
|||
void onUpToDate();
|
||||
void onUpdateCheckFailed();
|
||||
void reloadTheme() override;
|
||||
void onUnstableVersion();
|
||||
|
||||
private:
|
||||
void retranslateUi();
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>506</width>
|
||||
<height>550</height>
|
||||
<width>496</width>
|
||||
<height>599</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,1,0,0">
|
||||
|
@ -53,7 +53,7 @@
|
|||
<string>Version</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QLabel" name="youAreUsing">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
|
@ -83,7 +83,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="qtVersion">
|
||||
<property name="font">
|
||||
<font>
|
||||
|
@ -98,7 +98,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="toxCoreVersion">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
|
@ -122,7 +122,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="gitVersion">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
|
@ -149,7 +149,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QStackedWidget" name="updateStack">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
|
@ -197,7 +197,10 @@
|
|||
</sizepolicy>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>qTox is up to date ✓</string>
|
||||
|
@ -230,6 +233,22 @@
|
|||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="unstableVersion">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Currently running an untested/unstable version of qTox</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -147,6 +147,7 @@ static const QMap<Style::ColorPalette, QString> aliasColors = {
|
|||
{Style::GroundExtra, "groundExtra"},
|
||||
{Style::GroundBase, "groundBase"},
|
||||
{Style::Orange, "orange"},
|
||||
{Style::Yellow, "yellow"},
|
||||
{Style::ThemeDark, "themeDark"},
|
||||
{Style::ThemeMediumDark, "themeMediumDark"},
|
||||
{Style::ThemeMedium, "themeMedium"},
|
||||
|
@ -417,6 +418,7 @@ void Style::initDictColor()
|
|||
{"@groundExtra", Style::getColor(Style::GroundExtra).name()},
|
||||
{"@groundBase", Style::getColor(Style::GroundBase).name()},
|
||||
{"@orange", Style::getColor(Style::Orange).name()},
|
||||
{"@yellow", Style::getColor(Style::Yellow).name()},
|
||||
{"@action", Style::getColor(Style::Action).name()},
|
||||
{"@link", Style::getColor(Style::Link).name()},
|
||||
{"@searchHighlighted", Style::getColor(Style::SearchHighlighted).name()},
|
||||
|
|
|
@ -40,6 +40,7 @@ public:
|
|||
GroundExtra,
|
||||
GroundBase,
|
||||
Orange,
|
||||
Yellow,
|
||||
ThemeDark,
|
||||
ThemeMediumDark,
|
||||
ThemeMedium,
|
||||
|
|
|
@ -9,6 +9,7 @@ statusActive="#d1d1d1"
|
|||
groundExtra="#d1d1d1"
|
||||
groundBase="#201f1f"
|
||||
orange="#713400"
|
||||
yellow="#adab00"
|
||||
themeDark="#1c1c1c"
|
||||
themeMediumDark="#2a2a2a"
|
||||
themeMedium="#100f0f"
|
||||
|
|
|
@ -302,3 +302,9 @@ QSplitter:handle
|
|||
color: @groundBase;
|
||||
background-color: @groundBase;
|
||||
}
|
||||
|
||||
QLabel#unstableVersion
|
||||
{
|
||||
color: black;
|
||||
background-color: @yellow;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ statusActive="#414141"
|
|||
groundExtra="#d1d1d1"
|
||||
groundBase="#ffffff"
|
||||
orange="#ff7700"
|
||||
yellow="#9c9100"
|
||||
themeDark="#1c1c1c"
|
||||
themeMediumDark="#2a2a2a"
|
||||
themeMedium="#414141"
|
||||
|
|
|
@ -277,3 +277,9 @@ QSplitter:handle
|
|||
color: white;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
QLabel#unstableVersion
|
||||
{
|
||||
color: @mainText;
|
||||
background-color: @yellow;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user