Browse Source

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
pull/6227/merge
sudden6 5 years ago
parent
commit
31be947ac5
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
  1. 5
      src/net/updatecheck.cpp
  2. 1
      src/net/updatecheck.h
  3. 8
      src/widget/form/settings/aboutform.cpp
  4. 1
      src/widget/form/settings/aboutform.h
  5. 35
      src/widget/form/settings/aboutsettings.ui
  6. 2
      src/widget/style.cpp
  7. 1
      src/widget/style.h
  8. 3
      themes/dark/palette.ini
  9. 10
      themes/dark/window/general.css
  10. 3
      themes/default/palette.ini
  11. 10
      themes/default/window/general.css

5
src/net/updatecheck.cpp

@ -120,8 +120,11 @@ void UpdateCheck::checkForUpdate() @@ -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);

1
src/net/updatecheck.h

@ -41,6 +41,7 @@ signals: @@ -41,6 +41,7 @@ signals:
void updateAvailable(QString latestVersion, QUrl link);
void upToDate();
void updateCheckFailed();
void versionIsUnstable();
private slots:
void handleResponse(QNetworkReply* reply);

8
src/widget/form/settings/aboutform.cpp

@ -62,6 +62,9 @@ AboutForm::AboutForm(UpdateCheck* updateCheck) @@ -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() @@ -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.

1
src/widget/form/settings/aboutform.h

@ -48,6 +48,7 @@ public slots: @@ -48,6 +48,7 @@ public slots:
void onUpToDate();
void onUpdateCheckFailed();
void reloadTheme() override;
void onUnstableVersion();
private:
void retranslateUi();

35
src/widget/form/settings/aboutsettings.ui

@ -30,8 +30,8 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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 @@ @@ -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>

2
src/widget/style.cpp

@ -147,6 +147,7 @@ static const QMap<Style::ColorPalette, QString> aliasColors = { @@ -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() @@ -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()},

1
src/widget/style.h

@ -40,6 +40,7 @@ public: @@ -40,6 +40,7 @@ public:
GroundExtra,
GroundBase,
Orange,
Yellow,
ThemeDark,
ThemeMediumDark,
ThemeMedium,

3
themes/dark/palette.ini

@ -9,6 +9,7 @@ statusActive="#d1d1d1" @@ -9,6 +9,7 @@ statusActive="#d1d1d1"
groundExtra="#d1d1d1"
groundBase="#201f1f"
orange="#713400"
yellow="#adab00"
themeDark="#1c1c1c"
themeMediumDark="#2a2a2a"
themeMedium="#100f0f"
@ -16,4 +17,4 @@ themeLight="#201f1f" @@ -16,4 +17,4 @@ themeLight="#201f1f"
action="#546eff"
link="#d292ff"
searchHighlighted="#7e2a00"
selectText = "#515151"
selectText = "#515151"

10
themes/dark/window/general.css

@ -21,13 +21,13 @@ QTabWidget @@ -21,13 +21,13 @@ QTabWidget
background-color: #100f0f;
}
QTabBar::tab:selected
QTabBar::tab:selected
{
background: #100f0f;
color: @mainText;
}
QTabBar::tab:!selected
QTabBar::tab:!selected
{
background: #444242;
color: #8e8e8e;
@ -302,3 +302,9 @@ QSplitter:handle @@ -302,3 +302,9 @@ QSplitter:handle
color: @groundBase;
background-color: @groundBase;
}
QLabel#unstableVersion
{
color: black;
background-color: @yellow;
}

3
themes/default/palette.ini

@ -9,6 +9,7 @@ statusActive="#414141" @@ -9,6 +9,7 @@ statusActive="#414141"
groundExtra="#d1d1d1"
groundBase="#ffffff"
orange="#ff7700"
yellow="#9c9100"
themeDark="#1c1c1c"
themeMediumDark="#2a2a2a"
themeMedium="#414141"
@ -16,4 +17,4 @@ themeLight="#4e4e4e" @@ -16,4 +17,4 @@ themeLight="#4e4e4e"
action="#1818FF"
link="#0000ff"
searchHighlighted="#ff7626"
selectText = "#9edeff"
selectText = "#9edeff"

10
themes/default/window/general.css

@ -21,13 +21,13 @@ QTabWidget @@ -21,13 +21,13 @@ QTabWidget
background-color: white;
}
QTabBar::tab:selected
QTabBar::tab:selected
{
background: #2d3136;
color: #f1f1f1;
}
QTabBar::tab:!selected
QTabBar::tab:!selected
{
background: #d0d1d1;
color: #5e5e5e;
@ -277,3 +277,9 @@ QSplitter:handle @@ -277,3 +277,9 @@ QSplitter:handle
color: white;
background-color: white;
}
QLabel#unstableVersion
{
color: @mainText;
background-color: @yellow;
}

Loading…
Cancel
Save