update to upstream version 3.1.3

(cherry picked from commit 27e8061f622b7d757c341de8c4045b8bc02d0494)
This commit is contained in:
peijiankang 2022-08-02 13:20:13 +08:00 committed by openeuler-sync-bot
parent eca63899e9
commit 46f6e24546
15 changed files with 5 additions and 827 deletions

View File

@ -1,25 +0,0 @@
From 0e535fa024870259a89875fe3ceb6a6a7af39032 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Fri, 24 Jun 2022 14:36:45 +0800
Subject: [PATCH] Modified kylin-weather display is incomplete
---
src/citycollectionwidget.ui | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/citycollectionwidget.ui b/src/citycollectionwidget.ui
index ad0ec8c..6f98797 100644
--- a/src/citycollectionwidget.ui
+++ b/src/citycollectionwidget.ui
@@ -31,7 +31,7 @@
<rect>
<x>46</x>
<y>24</y>
- <width>56</width>
+ <width>121</width>
<height>17</height>
</rect>
</property>
--
2.33.0

View File

@ -1,21 +0,0 @@
From c551c81279de6ea2d9494f304d385d12377ab006 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Fri, 24 Jun 2022 15:00:07 +0800
Subject: [PATCH] add X-UKUI-AutoRestart filed in desktop
---
indicator-china-weather.desktop | 1 +
1 file changed, 1 insertion(+)
diff --git a/indicator-china-weather.desktop b/indicator-china-weather.desktop
index ab54ec1..1dbd4d3 100644
--- a/indicator-china-weather.desktop
+++ b/indicator-china-weather.desktop
@@ -14,3 +14,4 @@ Terminal=false
Type=Application
X-GNOME-Autostart-Delay=10
Categories=GNOME;Utility;
+X-UKUI-AutoRestart=true;
--
2.33.0

View File

@ -1,179 +0,0 @@
From f0f0c097544cfc115015053525c8c3e9a68a6b15 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Mon, 27 Jun 2022 17:07:15 +0800
Subject: [PATCH] update translation file
---
debian/changelog | 6 +++++
src/citycollectionwidget.cpp | 6 ++---
src/citycollectionwidget.ui | 2 +-
translations/indicator-china-weather_bo.ts | 22 +++++++++++++++++--
translations/indicator-china-weather_zh_CN.ts | 22 +++++++++++++++++--
5 files changed, 50 insertions(+), 8 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 7838b0a..7b4b0f7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+indicator-china-weather (3.1.0-37) v101; urgency=medium
+
+ * 解决了BUG#30685 程序没有IP定位功能
+
+ -- shixiaoshuo <shixiaoshuo@kylinos.cn> Fri,8 Jan 2021 10:33:00 +0800
+
indicator-china-weather (3.1.0-36) v101; urgency=medium
* 修复了一处因为gsetting文件初始化问题引起的严重BUG
diff --git a/src/citycollectionwidget.cpp b/src/citycollectionwidget.cpp
index 21773d4..335d3c9 100644
--- a/src/citycollectionwidget.cpp
+++ b/src/citycollectionwidget.cpp
@@ -81,8 +81,8 @@ CityCollectionWidget::CityCollectionWidget(QWidget *parent) :
ui->btnCancel->setFocusPolicy(Qt::NoFocus);
ui->lbLeftUpTitle->setText(tr("Kylin Weather"));
ui->lbLeftUpTitle->setFixedWidth(100);
- ui->lbCityCollect->setText("收藏城市");
- ui->lbCityCurrent->setText("当前城市");
+ ui->lbCityCollect->setText(tr("Collections")); //收藏城市
+ ui->lbCityCurrent->setText(tr("Local")); //当前城市
ui->lbCityCount->setText("0/8");
m_citynumber = 0;
@@ -97,7 +97,7 @@ CityCollectionWidget::CityCollectionWidget(QWidget *parent) :
m_tipLabel->setWordWrap(true);
m_tipLabel->setAlignment(Qt::AlignCenter);
m_tipLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
- m_tipLabel->setText("当前网络异常,请检查网络设置");//Current Network Exception, Please Check Network Settings
+ m_tipLabel->setText(tr("Current Network Exception, Please Check Network Settings"));//当前网络异常,请检查网络设置
m_tipLabel->move(0, 300);
m_tipLabel->hide();
diff --git a/src/citycollectionwidget.ui b/src/citycollectionwidget.ui
index 6f98797..5b25158 100644
--- a/src/citycollectionwidget.ui
+++ b/src/citycollectionwidget.ui
@@ -70,7 +70,7 @@
<rect>
<x>45</x>
<y>223</y>
- <width>72</width>
+ <width>101</width>
<height>19</height>
</rect>
</property>
diff --git a/translations/indicator-china-weather_bo.ts b/translations/indicator-china-weather_bo.ts
index fafdf61..da5ae2c 100644
--- a/translations/indicator-china-weather_bo.ts
+++ b/translations/indicator-china-weather_bo.ts
@@ -17,6 +17,21 @@
<source>Kylin Weather</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <location filename="../src/citycollectionwidget.cpp" line="84"/>
+ <source>Collections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/citycollectionwidget.cpp" line="85"/>
+ <source>Local</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../src/citycollectionwidget.cpp" line="100"/>
+ <source>Current Network Exception, Please Check Network Settings</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>LeftUpSearchBox</name>
@@ -31,7 +46,7 @@
<message>
<location filename="../src/mainwindow.cpp" line="44"/>
<location filename="../src/mainwindow.cpp" line="95"/>
- <location filename="../src/mainwindow.cpp" line="405"/>
+ <location filename="../src/mainwindow.cpp" line="409"/>
<source>Kylin Weather</source>
<translation type="unfinished"></translation>
</message>
@@ -133,16 +148,19 @@
</message>
<message>
<location filename="../src/menumodule.cpp" line="24"/>
- <source>Help</source>
+ <location filename="../src/menumodule.cpp" line="106"/>
+ <source>Help</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/menumodule.cpp" line="26"/>
+ <location filename="../src/menumodule.cpp" line="104"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/menumodule.cpp" line="28"/>
+ <location filename="../src/menumodule.cpp" line="102"/>
<source>Quit</source>
<translation type="unfinished"></translation>
</message>
diff --git a/translations/indicator-china-weather_zh_CN.ts b/translations/indicator-china-weather_zh_CN.ts
index 32aac9b..e656456 100644
--- a/translations/indicator-china-weather_zh_CN.ts
+++ b/translations/indicator-china-weather_zh_CN.ts
@@ -17,6 +17,21 @@
<source>Kylin Weather</source>
<translation>麒麟天气</translation>
</message>
+ <message>
+ <location filename="../src/citycollectionwidget.cpp" line="84"/>
+ <source>Collections</source>
+ <translation>收藏城市</translation>
+ </message>
+ <message>
+ <location filename="../src/citycollectionwidget.cpp" line="85"/>
+ <source>Local</source>
+ <translation>当前城市</translation>
+ </message>
+ <message>
+ <location filename="../src/citycollectionwidget.cpp" line="100"/>
+ <source>Current Network Exception, Please Check Network Settings</source>
+ <translation>当前网络异常,请检查网络设置</translation>
+ </message>
</context>
<context>
<name>LeftUpSearchBox</name>
@@ -31,7 +46,7 @@
<message>
<location filename="../src/mainwindow.cpp" line="44"/>
<location filename="../src/mainwindow.cpp" line="95"/>
- <location filename="../src/mainwindow.cpp" line="405"/>
+ <location filename="../src/mainwindow.cpp" line="409"/>
<source>Kylin Weather</source>
<translation>麒麟天气</translation>
</message>
@@ -137,16 +152,19 @@
</message>
<message>
<location filename="../src/menumodule.cpp" line="24"/>
- <source>Help</source>
+ <location filename="../src/menumodule.cpp" line="106"/>
+ <source>Help</source>
<translation>帮助</translation>
</message>
<message>
<location filename="../src/menumodule.cpp" line="26"/>
+ <location filename="../src/menumodule.cpp" line="104"/>
<source>About</source>
<translation>关于</translation>
</message>
<message>
<location filename="../src/menumodule.cpp" line="28"/>
+ <location filename="../src/menumodule.cpp" line="102"/>
<source>Quit</source>
<translation>退出</translation>
</message>
--
2.33.0

View File

@ -1,51 +0,0 @@
From 1c7c1137638b494da26ee419afa7a7074fafe301 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Tue, 28 Jun 2022 09:46:12 +0800
Subject: [PATCH] Increase the drag bar of forecast part
---
debian/changelog | 1 +
src/mainwindow.cpp | 2 +-
translations/generate_translations_pm.sh | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 7b4b0f7..a18e2f5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
indicator-china-weather (3.1.0-37) v101; urgency=medium
* 解决了BUG#30685 程序没有IP定位功能
+ * 解决了BUG#27090 收藏界面国际化问题
-- shixiaoshuo <shixiaoshuo@kylinos.cn> Fri,8 Jan 2021 10:33:00 +0800
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index eb4c764..4b6ab78 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -264,7 +264,7 @@ void MainWindow::initControlQss()
m_scrollarea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_scrollarea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
- m_scrollarea->verticalScrollBar()->setStyleSheet("QScrollBar:vertical{margin:0px 2px 0px 2px;width:10px;background:rgba(255,255,255,0);border-radius:6px;}"
+ m_scrollarea->verticalScrollBar()->setStyleSheet("QScrollBar:vertical{margin:0px 2px 0px 2px;width:13px;background:rgba(255,255,255,0);border-radius:6px;}"
"QScrollBar::up-arrow:vertical{height:0px;}"
"QScrollBar::sub-line:vertical{border:0px solid;height:0px}"
"QScrollBar::sub-page:vertical{background:transparent;}"
diff --git a/translations/generate_translations_pm.sh b/translations/generate_translations_pm.sh
index 2359710..2170239 100755
--- a/translations/generate_translations_pm.sh
+++ b/translations/generate_translations_pm.sh
@@ -1,6 +1,6 @@
#! /bin/bash
-ts_file_list=(`ls translations/*.ts`)
+ts_file_list=(`ls ./*.ts`)
for ts in "${ts_file_list[@]}"
do
--
2.33.0

View File

@ -1,47 +0,0 @@
From 20e81b00cac3c11611ad1a0af74c55af370912c0 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Wed, 29 Jun 2022 10:25:24 +0800
Subject: [PATCH] Hide tray icon in case of network exception
---
debian/changelog | 1 +
src/mainwindow.cpp | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index a18e2f5..d698926 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ indicator-china-weather (3.1.0-37) v101; urgency=medium
* 解决了BUG#30685 程序没有IP定位功能
* 解决了BUG#27090 收藏界面国际化问题
+ * 解决了BUG#34026 断网情况下隐藏托盘icon
-- shixiaoshuo <shixiaoshuo@kylinos.cn> Fri,8 Jan 2021 10:33:00 +0800
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 4b6ab78..9c43bde 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -368,6 +368,7 @@ void MainWindow::initConnections()
QStringList listCityId = getCityList().split(",");
qDebug()<<"listCityId:"<<listCityId;
m_weatherManager->startGetTheWeatherData(listCityId.at(0));
+ m_trayIcon->show();
} else {
if (status == "Fail") {
onHandelAbnormalSituation("Without wired Carrier");
@@ -554,7 +555,8 @@ void MainWindow::onHandelAbnormalSituation(QString abnormalText){
//处理异常时的主界面显示
void MainWindow::setAbnormalMainWindow()
{
- m_trayIcon->setIcon(QIcon::fromTheme(QString("999"), QIcon(QString(":/res/weather_icons/white/999.png"))) );
+ //m_trayIcon->setIcon(QIcon::fromTheme(QString("999"), QIcon(QString(":/res/weather_icons/white/999.png"))) );
+ m_trayIcon->hide();
// m_openAction->setIcon(QIcon::fromTheme(QString("999"), QIcon(QString(":/res/weather_icons/white/999.png"))) );
ui->lbCurrTmp->setText("");
ui->lbCurrTmpUnit->setText("");
--
2.33.0

View File

@ -1,81 +0,0 @@
From dc3c07f95c6e8c87f184afb5ac45ec52b38579a8 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Wed, 29 Jun 2022 10:43:03 +0800
Subject: [PATCH] Repair menu button hover style exception
---
src/leftupsearchbox.cpp | 9 +++------
src/menumodule.cpp | 10 +++++++++-
src/menumodule.h | 1 +
3 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/leftupsearchbox.cpp b/src/leftupsearchbox.cpp
index 5412056..6e2a95e 100644
--- a/src/leftupsearchbox.cpp
+++ b/src/leftupsearchbox.cpp
@@ -87,18 +87,15 @@ bool LeftUpSearchBox::event(QEvent *e){
switch(k->key()){
case Qt::Key_Up:{
emit lineEditKeyEvent("up");
-// return true;
- break;
+ break;
}
case Qt::Key_Down:{
emit lineEditKeyEvent("down");
- // return true;
- break;
+ break;
}
case Qt::Key_Return:{
emit lineEditKeyEvent("enter");
- // return true;
- break;
+ break;
}
}
}
diff --git a/src/menumodule.cpp b/src/menumodule.cpp
index 39d8a8d..3e83462 100644
--- a/src/menumodule.cpp
+++ b/src/menumodule.cpp
@@ -14,7 +14,9 @@ void menuModule::initAction(){
iconSize = QSize(30,30);
menuButton = new QPushButton;
menuButton->setIcon(QIcon::fromTheme("application-menu"));
+ menuButton->setFlat(true);
menuButton->setFixedSize(iconSize);
+
m_menu = new QMenu();
addCityAction = new AddCityAction(m_menu);
QList<QAction *> actions ;
@@ -249,7 +251,13 @@ QVBoxLayout* menuModule::initBody(){
}
void menuModule::setStyle(){
- menuButton->setStyleSheet("QPushButton::menu-indicator{image:None;}");
+ //menuButton->setStyleSheet("QPushButton{border:0px;border-radius:4px;background:transparent;}"
+ // "QPushButton:Hover{border:0px;border-radius:4px;background:transparent;background-color:rgba(0,0,0,0.1);}"
+ // "QPushButton:Pressed{border:0px;border-radius:4px;background:transparent;background-color:rgba(0,0,0,0.15);}");
+ menuButton->setStyleSheet("QPushButton{border:0px;border-radius:4px;background:transparent;}"
+ "QPushButton:Hover{border:0px;border-radius:4px;background:transparent;background-color:rgba(0,0,0,0.1);}"
+ "QPushButton:Pressed{border:0px;border-radius:4px;background:transparent;background-color:rgba(0,0,0,0.15);}"
+ "QPushButton::menu-indicator{image:None;}");
}
void menuModule::initGsetting(){
diff --git a/src/menumodule.h b/src/menumodule.h
index 480443b..d3a8717 100644
--- a/src/menumodule.h
+++ b/src/menumodule.h
@@ -9,6 +9,7 @@
#include <QWidget>
#include <QMenu>
#include <QPushButton>
+#include <QToolButton>
#include <QDebug>
#include <QString>
#include <QLabel>
--
2.33.0

View File

@ -1,111 +0,0 @@
From 18a5bdd07df6e7e783e6b8a67d8e683c4e88caa0 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Mon, 11 Jul 2022 14:48:55 +0800
Subject: [PATCH] Solve the problem of button backlighting
---
debian/changelog | 6 ++++++
debian/files | 2 +-
res.qrc | 2 ++
res/control_icons/dark-window-close.svg | 1 +
res/control_icons/dark-window-min.svg | 1 +
src/mainwindow.cpp | 4 ++--
src/menumodule.cpp | 3 +++
7 files changed, 16 insertions(+), 3 deletions(-)
create mode 100755 res/control_icons/dark-window-close.svg
create mode 100755 res/control_icons/dark-window-min.svg
diff --git a/debian/changelog b/debian/changelog
index d698926..00662f9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+indicator-china-weather (3.1.0-38) v101; urgency=medium
+
+ * 按钮反白
+
+ -- baijincheng <baijincheng@kylinos.cn> Sat,16 Jan 2021 21:33:00 +0800
+
indicator-china-weather (3.1.0-37) v101; urgency=medium
* 解决了BUG#30685 程序没有IP定位功能
diff --git a/debian/files b/debian/files
index ae998ce..57d4dc5 100644
--- a/debian/files
+++ b/debian/files
@@ -1 +1 @@
-indicator-china-weather_3.1.0-32_source.buildinfo utils optional
+indicator-china-weather_3.1.0-38_source.buildinfo utils optional
diff --git a/res.qrc b/res.qrc
index 587661d..5655539 100644
--- a/res.qrc
+++ b/res.qrc
@@ -386,6 +386,8 @@
<file>res/forecast-icons/1x/900.png</file>
<file>res/forecast-icons/1x/901.png</file>
<file>res/forecast-icons/1x/999.png</file>
+ <file>res/control_icons/dark-window-close.svg</file>
+ <file>res/control_icons/dark-window-min.svg</file>
</qresource>
<qresource prefix="/data">
<file>data/china-city-list.csv</file>
diff --git a/res/control_icons/dark-window-close.svg b/res/control_icons/dark-window-close.svg
new file mode 100755
index 0000000..f5b9a00
--- /dev/null
+++ b/res/control_icons/dark-window-close.svg
@@ -0,0 +1 @@
+<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><defs><style>.cls-1{fill:#fff;}</style></defs><title>画板 4</title><rect class="cls-1" x="6.45" y="0.45" width="1" height="13" transform="translate(6.95 -2.88) rotate(45)"/><rect class="cls-1" x="6.45" y="0.45" width="1" height="13" transform="translate(16.78 6.95) rotate(135)"/></svg>
\ No newline at end of file
diff --git a/res/control_icons/dark-window-min.svg b/res/control_icons/dark-window-min.svg
new file mode 100755
index 0000000..8c0e53e
--- /dev/null
+++ b/res/control_icons/dark-window-min.svg
@@ -0,0 +1 @@
+<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><defs><style>.cls-1{fill:#fff;}</style></defs><title>画板 3</title><rect class="cls-1" x="2" y="7" width="10" height="1"/></svg>
\ No newline at end of file
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 9c43bde..53d3915 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -231,14 +231,14 @@ void MainWindow::initControlQss()
ui->centralwidget->setStyleSheet("#centralwidget{color:white;background-image:url(':/res/background/weather-clear.png');background-repeat:no-repeat;}");
ui->centralwidget->move(10,10);
ui->centralwidget->setFixedSize(865,520);
- ui->btnMinimize->setIcon(QIcon::fromTheme("window-minimize-symbolic"));
+ ui->btnMinimize->setIcon(QIcon::fromTheme(":/res/control_icons/dark-window-min.svg"));
ui->btnMinimize->setFixedSize(30,30);
ui->btnMinimize->setStyleSheet("QPushButton{border:0px;border-radius:4px;background:transparent;}"
"QPushButton:Hover{border:0px;border-radius:4px;background:transparent;background-color:rgba(0,0,0,0.1);}"
"QPushButton:Pressed{border:0px;border-radius:4px;background:transparent;background-color:rgba(0,0,0,0.15);}");
ui->btnMinimize->setFocusPolicy(Qt::NoFocus);//设置焦点类型
- ui->btnCancel->setIcon(QIcon::fromTheme("window-close-symbolic"));
+ ui->btnCancel->setIcon(QIcon::fromTheme(":/res/control_icons/dark-window-close.svg"));
ui->btnCancel->setFixedSize(30,30);
ui->btnCancel->setStyleSheet("QPushButton{border:0px;border-radius:4px;background:transparent;}"
"QPushButton:Hover{border:0px;border-radius:4px;background:transparent;background-color:#F86457;}"
diff --git a/src/menumodule.cpp b/src/menumodule.cpp
index 3e83462..b5372f9 100644
--- a/src/menumodule.cpp
+++ b/src/menumodule.cpp
@@ -1,5 +1,6 @@
#include "menumodule.h"
#include "xatom-helper.h"
+
menuModule::menuModule(QWidget *parent = nullptr) : QWidget(parent)
{
init();
@@ -14,6 +15,8 @@ void menuModule::initAction(){
iconSize = QSize(30,30);
menuButton = new QPushButton;
menuButton->setIcon(QIcon::fromTheme("application-menu"));
+ menuButton->setProperty("setIconHighlightEffectDefaultColor", QColor(Qt::white));
+ menuButton->setStyleSheet("color:rgba(255,255,2551);");
menuButton->setFlat(true);
menuButton->setFixedSize(iconSize);
--
2.33.0

View File

@ -1,29 +0,0 @@
From a7142ce48feb6b4f865fe93bf25376971f0d0546 Mon Sep 17 00:00:00 2001
From: tanyulong2021 <tanyulong@kylinos.cn>
Date: Wed, 13 Jul 2022 14:58:18 +0800
Subject: [PATCH] Update ts file and add today translation
---
translations/indicator-china-weather_zh_CN.ts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/translations/indicator-china-weather_zh_CN.ts b/translations/indicator-china-weather_zh_CN.ts
index e656456..a525289 100644
--- a/translations/indicator-china-weather_zh_CN.ts
+++ b/translations/indicator-china-weather_zh_CN.ts
@@ -184,4 +184,12 @@
<translation>支持support@kylinos.cn</translation>
</message>
</context>
+<context>
+ <name>Information</name>
+ <message>
+ <location filename="../src/informationwidget.cpp" line="233"/>
+ <source>Today</source>
+ <translation>今天</translation>
+ </message>
+</context>
</TS>
--
2.33.0

View File

@ -1,25 +0,0 @@
From 020c2d7b007d457fa7d728eea9dde2eabc385681 Mon Sep 17 00:00:00 2001
From: tanyulong2021 <tanyulong@kylinos.cn>
Date: Wed, 13 Jul 2022 15:13:26 +0800
Subject: [PATCH] update translation file
---
src/informationwidget.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/informationwidget.cpp b/src/informationwidget.cpp
index 7d4578b..d83eb3c 100644
--- a/src/informationwidget.cpp
+++ b/src/informationwidget.cpp
@@ -230,7 +230,7 @@ void Information::onSetForecastWeather(ForecastWeather forecastweather)
//获取星期
QDateTime current_date_time = QDateTime::fromString(forecastweather.dateTime,"yyyy-MM-dd");//将从服务器上获取到的日期处理成特定格式
- QString current_week_1 = "今天";//current_date_time.toString("ddd");
+ QString current_week_1 = tr("Today");//current_date_time.toString("ddd");
QString current_week_2 = current_date_time.addDays(+1).toString("ddd");
QString current_week_3 = current_date_time.addDays(+2).toString("ddd");
QString current_week_4 = current_date_time.addDays(+3).toString("ddd");
--
2.33.0

View File

@ -1,23 +0,0 @@
From 949e674399ba4ad597b933a01f01bebd0a39db1d Mon Sep 17 00:00:00 2001
From: tanyulong2021 <tanyulong@kylinos.cn>
Date: Thu, 14 Jul 2022 09:45:11 +0800
Subject: [PATCH] The application category is changed to system
---
indicator-china-weather.desktop | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/indicator-china-weather.desktop b/indicator-china-weather.desktop
index 1dbd4d3..36a6137 100644
--- a/indicator-china-weather.desktop
+++ b/indicator-china-weather.desktop
@@ -13,5 +13,5 @@ Icon=indicator-china-weather
Terminal=false
Type=Application
X-GNOME-Autostart-Delay=10
-Categories=GNOME;Utility;
+Categories=System Settings Security;
X-UKUI-AutoRestart=true;
--
2.33.0

View File

@ -1,112 +0,0 @@
diff -Naur indicator-china-weather-3.1.0/src/geoipworker.cpp indicator-china-weather-3.1.0~/src/geoipworker.cpp
--- indicator-china-weather-3.1.0/src/geoipworker.cpp 2021-11-27 03:59:19.000000000 +0800
+++ indicator-china-weather-3.1.0~/src/geoipworker.cpp 2022-01-10 14:49:04.598862385 +0800
@@ -264,29 +264,33 @@
const QString automaicCity()
{
- QString ip;
- QString city;
+// QString ip;
+// QString city;
- getIpAndCityByUbuntu(UbuntuUrl, ip, city);
- if (ip.isEmpty() || ip == "0.0.0.0") {
- ip = getIpByPconline(PconlineUrl);
- }
-
-// qDebug() << "ip:" << ip;
-
- if (city.isEmpty()) {
- city = getCityFromIPAddr(ip);//根据ip从geoip库定位城市
- if (city.isEmpty()) {
- city = getCityFromIpByAmap(ip);//根据ip从高德API定位城市该方式使用高德key访问次数有限
- }
- if (city.isEmpty()) {
- city = getCityFromIpByTaobao(ip);//根据ip从淘宝service定位城市该方式访问速度慢可能访问失败
- }
- }
-
-// qDebug() << "city:" << city;
-
- return city;
+// getIpAndCityByUbuntu(UbuntuUrl, ip, city);
+// if (ip.isEmpty() || ip == "0.0.0.0") {
+// ip = getIpByPconline(PconlineUrl);
+// }
+// if (city.isEmpty()) {
+// city = getCityFromIPAddr(ip);//根据ip从geoip库定位城市
+// if (city.isEmpty()) {
+// city = getCityFromIpByAmap(ip);//根据ip从高德API定位城市该方式使用高德key访问次数有限
+// }
+// if (city.isEmpty()) {
+// city = getCityFromIpByTaobao(ip);//根据ip从淘宝service定位城市该方式访问速度慢可能访问失败
+// }
+// }
+// return city;
+ QNetworkAccessManager *manager = new QNetworkAccessManager();
+ QNetworkReply *reply = manager->get(QNetworkRequest(QUrl("http://myip.ipip.net")));
+ QByteArray responseData ;
+ QEventLoop eventLoop;
+ QObject::connect(manager,&QNetworkAccessManager::finished,&eventLoop,&QEventLoop::quit);
+ eventLoop.exec();
+ responseData = reply->readAll();
+ QString str = responseData;
+ QStringList respList = str.split(' ');
+ return respList[5];
}
} // namespace
diff -Naur indicator-china-weather-3.1.0/src/geoipworker.h indicator-china-weather-3.1.0~/src/geoipworker.h
--- indicator-china-weather-3.1.0/src/geoipworker.h 2021-11-27 03:59:19.000000000 +0800
+++ indicator-china-weather-3.1.0~/src/geoipworker.h 2022-01-10 14:49:04.574862040 +0800
@@ -21,6 +21,10 @@
#define GEOIP_WORKER_H
#include <QObject>
+#include <QNetworkAccessManager>
+#include <QNetworkReply>
+#include <QNetworkRequest>
+#include <QEventLoop>
class QNetworkAccessManager;
class QNetworkReply;
diff -Naur indicator-china-weather-3.1.0/src/mainwindow.cpp indicator-china-weather-3.1.0~/src/mainwindow.cpp
--- indicator-china-weather-3.1.0/src/mainwindow.cpp 2021-11-27 03:59:19.000000000 +0800
+++ indicator-china-weather-3.1.0~/src/mainwindow.cpp 2022-01-10 14:49:04.606862500 +0800
@@ -361,11 +361,12 @@
//根据获取到网络探测的结果分别处理
connect(m_weatherManager, &WeatherManager::nofityNetworkStatus, this, [=] (const QString &status) {
if (status == "OK") {
- //m_weatherManager->startAutoLocationTask();//开始自动定位城市
+ m_weatherManager->startAutoLocationTask();//开始自动定位城市
//CN101010100,beijing,北京,CN,China,中国
- // m_weatherManager->startGetTheWeatherData("101010100");
+// m_weatherManager->startGetTheWeatherData("101010100");
QStringList listCityId = getCityList().split(",");
+ qDebug()<<"listCityId:"<<listCityId;
m_weatherManager->startGetTheWeatherData(listCityId.at(0));
} else {
if (status == "Fail") {
@@ -381,6 +382,9 @@
connect(m_weatherManager, &WeatherManager::requestAutoLocationData, this, [=] (const CitySettingData &info, bool success) {
if (success) {
//自动定位城市成功后更新各个ui然后获取天气数据
+ m_weatherManager->startGetTheWeatherData(info.id);
+
+
} else {
//自动定位城市失败后,获取天气数据
}
diff -Naur indicator-china-weather-3.1.0/src/weathermanager.cpp indicator-china-weather-3.1.0~/src/weathermanager.cpp
--- indicator-china-weather-3.1.0/src/weathermanager.cpp 2021-11-27 03:59:19.000000000 +0800
+++ indicator-china-weather-3.1.0~/src/weathermanager.cpp 2022-01-10 14:49:04.559861824 +0800
@@ -165,7 +165,6 @@
}
file.close();
}
-
if (autoSuccess) {
emit this->requestAutoLocationData(info, true);
} else {

View File

@ -1,97 +0,0 @@
diff -Naur indicator-china-weather-3.1.0/data/org.china-weather-data.gschema.xml indicator-china-weather-3.1.0~/data/org.china-weather-data.gschema.xml
--- indicator-china-weather-3.1.0/data/org.china-weather-data.gschema.xml 2021-11-27 03:59:19.000000000 +0800
+++ indicator-china-weather-3.1.0~/data/org.china-weather-data.gschema.xml 2021-12-07 16:56:56.281416120 +0800
@@ -10,5 +10,10 @@
<summary>thisweather</summary>
<description>current weather of this city</description>
</key>
+ <key name="thememode" type="s">
+ <default>"auto"</default>
+ <summary>"record theme mode"</summary>
+ <description>record theme mode.there's three mode.auto,lightonly and darkonly</description>
+ </key>
</schema>
</schemalist>
diff -Naur indicator-china-weather-3.1.0/debian/changelog indicator-china-weather-3.1.0~/debian/changelog
--- indicator-china-weather-3.1.0/debian/changelog 2021-11-27 03:59:18.000000000 +0800
+++ indicator-china-weather-3.1.0~/debian/changelog 2021-12-07 16:56:54.918395675 +0800
@@ -1,3 +1,17 @@
+indicator-china-weather (3.1.0-36) v101; urgency=medium
+
+ * 修复了一处因为gsetting文件初始化问题引起的严重BUG
+
+ -- shixiaoshuo <shixiaoshuo@kylinos.cn> Fri,8 Jan 2021 10:33:00 +0800
+
+indicator-china-weather (3.1.0-35) v101; urgency=medium
+
+ * 菜单按钮功能上线。
+ * 修复高危BUG#32077 按钮位置异常
+ * 修复高优先BUG#30941 关于按钮无反应
+
+ -- shixiaoshuo <shixiaoshuo@kylinos.cn> Thu,7 Jan 2021 10:33:00 +0800
+
indicator-china-weather (3.1.0-34) v101; urgency=medium
* 菜单按钮因可能导致功能缺失因此补充上线
diff -Naur indicator-china-weather-3.1.0/src/menumodule.cpp indicator-china-weather-3.1.0~/src/menumodule.cpp
--- indicator-china-weather-3.1.0/src/menumodule.cpp 2021-11-27 03:59:19.000000000 +0800
+++ indicator-china-weather-3.1.0~/src/menumodule.cpp 2021-12-07 16:56:56.406417995 +0800
@@ -58,9 +58,9 @@
void menuModule::setThemeFromLocalThemeSetting(QList<QAction* > themeActions)
{
#if DEBUG_MENUMODULE
- confPath = "org.kylin-usb-creator-data.settings";
+// confPath = "org.kylin-usb-creator-data.settings";
#endif
- m_pGsettingThemeStatus = new QGSettings(confPath.toLocal8Bit());
+ m_pGsettingThemeStatus = new QGSettings(APPDATA);
QString appConf = m_pGsettingThemeStatus->get("thememode").toString();
if("lightonly" == appConf){
themeStatus = themeLightOnly;
@@ -111,7 +111,7 @@
void menuModule::triggerThemeMenu(QAction *act){
if(!m_pGsettingThemeStatus)
{
- m_pGsettingThemeStatus = new QGSettings(confPath.toLocal8Bit()); //m_pGsettingThemeStatus指针重复使用避免占用栈空间
+ m_pGsettingThemeStatus = new QGSettings(APPDATA); //m_pGsettingThemeStatus指针重复使用避免占用栈空间
}
QString str = act->text();
if("Light" == str){
@@ -214,7 +214,7 @@
#if DEBUG_MENUMODULE
appVersion = "2020.12.12-test";
#endif
- appVersion = "3.1.0-33kord";
+ appVersion = "3.1.0-33";
QLabel* bodyIcon = new QLabel();
bodyIcon->setFixedSize(96,96);
bodyIcon->setPixmap(QPixmap::fromImage(QImage(iconPath)));
diff -Naur indicator-china-weather-3.1.0/src/menumodule.h indicator-china-weather-3.1.0~/src/menumodule.h
--- indicator-china-weather-3.1.0/src/menumodule.h 2021-11-27 03:59:19.000000000 +0800
+++ indicator-china-weather-3.1.0~/src/menumodule.h 2021-12-07 16:56:56.431418370 +0800
@@ -1,7 +1,8 @@
#ifndef MENUMODULE_H
#define MENUMODULE_H
-#define DEBUG_MENUMODULE 1 //DEBUG模式开关代码上线之前务必关掉
+#define DEBUG_MENUMODULE 0 //DEBUG模式开关代码上线之前务必关掉
#define FITTHEMEWINDOW "org.ukui.style"
+#define APPDATA "org.china-weather-data.settings"
#include <QObject>
@@ -41,13 +42,13 @@
QString appVersion = "appVersion字段未填充!";
QString appDesc = "appDesc字段未填充!";
QString iconPath = "iconPath字段未填充!";
- QString confPath = "gsetting文件路径未配置";
+ QString confPath = "org.china-weather-data.settings";
private:
QMenu *m_menu = nullptr;
QMenu *themeMenu = nullptr;
QSize iconSize;
- QString appPath = "tools/kylin-usb-creator"; //拉起帮助菜单时使用appName字段
+// QString appPath = "tools/kylin-usb-creator"; //拉起帮助菜单时使用appName字段
QWidget *aboutWindow = nullptr;
QGSettings *m_pGsettingThemeData = nullptr;
QGSettings *m_pGsettingThemeStatus = nullptr;

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,7 @@
%define debug_package %{nil}
Name: indicator-china-weather
Version: 3.1.0
Release: 18
Version: 3.1.3
Release: 1
Summary: The weather data are from the heweather API s6 version.
License: GPL-3.0+
URL: https://github.com/UbuntuKylin/indicator-china-weather
@ -21,18 +21,6 @@ BuildRequires: GeoIP-devel
# Requires: NetworkManager
patch0: fix-gsetting-issue.patch
patch1: fix-auto-get-location.patch
patch2: 0002-Modified-kylin-weather-display-is-incomplete.patch
patch3: 0003-add-X-UKUI-AutoRestart-filed-in-desktop.patch
patch4: 0004-update-translation-file.patch
patch5: 0005-Increase-the-drag-bar-of-forecast-part.patch
patch6: 0006-Hide-tray-icon-in-case-of-network-exception.patch
patch7: 0007-Repair-menu-button-hover-style-exception.patch
patch8: 0008-Solve-the-problem-of-button-backlighting.patch
patch9: 0009-Update-ts-file-and-add-today-translation.patch
patch10:0010-update-translation-file.patch
patch11:0011-The-application-category-is-changed-to-system.patch
%description
Indicator that displays China weather information
@ -42,18 +30,6 @@ patch11:0011-The-application-category-is-changed-to-system.patch
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%build
%{qmake_qt5} %{_qt5_qmake_flags} CONFIG+=enable-by-default indicator-china-weather.pro
@ -85,6 +61,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/man/man1/indicator-china-weather.1.gz
%changelog
* Wed Aug 03 2022 peijiankang <peijiankang@kylinos.cn> - 3.1.3-1
- update to uptream version 3.1.3
* Thu Jul 14 2022 tanyulong <tanyulong@kylinos.cn> - 3.1.0-18
- The application category is changed to system