修改: src/downloadlist.cpp

修改:     src/widget.cpp
	重命名:   pkg/usr/share/polkit-1/actions/store.spark-app.ssinstall.policy -> tool/auto-install-policy/store.spark-app.ssinstall.policy
	修改:     tool/update-upgrade/ss-update-controler.sh
	修改:     translations/spark-store_en.ts
	修改:     translations/spark-store_fr.ts
	修改:     translations/spark-store_zh_CN.ts
This commit is contained in:
shenmo 2022-05-08 23:11:42 +08:00
parent 00f9b62b80
commit 3b3bf8f0de
7 changed files with 92 additions and 44 deletions

View File

@ -71,7 +71,7 @@ void downloadlist::setValue(qint64 value)
ui->label_2->setText(QString::number(double(value) / 100) + "% (" + speed + ")");
if(ui->label_2->text().left(4) == "100%")
{
ui->label_2->setText(tr("Downloaded, waiting to install"));
ui->label_2->setText(tr("Downloaded. Open APP Upgrade and Install Settings to enable password-free installation"));
}
}

View File

@ -192,7 +192,7 @@ void Widget::initUI()
// 添加菜单项
QAction *actionSubmission = new QAction(tr("Submit App"), this);
QAction *setting = new QAction(tr("Settings"));
QAction *upgrade = new QAction(tr("App Upgrade"));
QAction *upgrade = new QAction(tr("APP Upgrade and Install Settings"));
QMenu *menu = new QMenu;
menu->addAction(setting);

View File

@ -1,8 +1,40 @@
#!/bin/bash
set -e
echo "因为目前没有有时间的Qt程序员志愿者所以现在加功能只有让shenmo写脚本了..."
echo
echo "此功能被添加的原因是为了防止影响系统更新星火源默认的优先级是400低于默认的500。这导致了与系统仓库相同包名的软件包无法正常更新到比系统仓库更高的版本。例如hugo系统仓库中的低版本会被优先安装而且默认不会更新到星火的更新的版本"
reset
endloop=0
#####################检测是否启动过了更新检测工具
while [ $endloop -eq 0 ] ;do
if [ -f /etc/xdg/autostart/spark-update-notifier.desktop ];then
text_update_open="关闭"
#已经开启了就显示关闭
else
text_update_open="开启"
fi
if [ -f /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy ];then
text_auto_install_open="关闭"
#已经开启了就显示关闭
else
text_auto_install_open="开启"
fi
echo "欢迎使用星火更新和安装设置工具"
echo "请在以下操作中选择一个进行~"
echo "输入0 查看自动更新相关功能使用前须知(重要)"
echo "输入1 $text_update_open星火更新检测工具(如果开启则会在系统启动后自动检测更新。如有更新则会弹出通知)"
echo "输入2 查看可更新软件包列表并决定是否更新"
echo "输入3 $text_auto_install_open点击安装免输入密码功能"
echo "输入4 退出脚本"
read option
case $option in
0)
reset
echo "此须知适用于自动更新功能"
echo "此脚本可以检测星火源中是否有比当前系统更高版本的软件包,由您决定是否安装"
echo "此脚本使用apt update/apt list --upgrade/apt upgrade来更新软件源、列出更新列表和操作更新"
echo
@ -14,44 +46,26 @@ echo
echo "请按回车继续..."
#"只有回车可以用啊!""啊?"“你说的任意都行啊”“唔。。。戳到我的盲区了”
read
reset
endloop=0
while [ $endloop -eq 0 ] ;do
if [ -f /etc/xdg/autostart/spark-update-notifier.desktop ];then
textupdateopen="关闭"
#已经开启了就显示关闭
else
textupdateopen="开启"
fi
echo "欢迎使用星火更新工具 脚本版 "
echo "请在以下操作中选择一个进行~"
echo "输入1 $textupdateopen星火更新检测工具(如果开启则会在系统启动后自动检测更新。如有更新则会弹出通知)"
echo "输入2 查看可更新软件包列表并决定是否更新"
echo "输入3 退出脚本"
read option
case $option in
;;
1)
echo "执行以下操作需要授权..."
if [ -f /etc/xdg/autostart/spark-update-notifier.desktop ];then
echo "检测到已经启动了自动更新检测,关闭"
echo "检测到已经启动了自动更新检测,执行关闭"
sudo systemctl disable spark-update-notifier
sudo rm /etc/xdg/autostart/spark-update-notifier.desktop
sleep 3
reset
else
echo "未检测到自动更新检测,启动"
echo "未检测到自动更新检测,启动"
sudo systemctl enable spark-update-notifier
sudo service spark-update-notifier start
# ln -s /opt/durapps/spark-store/bin/update-upgrade/autostart/spark-update-notifier.desktop $XDG_CONFIG_HOME/autostart
#
sudo ln -s /opt/durapps/spark-store/bin/update-upgrade/autostart/spark-update-notifier.desktop /etc/xdg/autostart
/opt/durapps/spark-store/bin/update-upgrade/ss-update-notify.sh now
sleep 3
reset
fi
;;
@ -59,10 +73,40 @@ case $option in
echo "执行以下操作需要授权..."
/opt/durapps/spark-store/bin/update-upgrade/ss-upgrade-list.sh
/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade.sh
echo "请按回车返回"
read
reset
;;
3)
echo "按回车退出"
if [ -f /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy ];then
echo "检测到已经启动了免输入密码,执行关闭"
sudo rm /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy
sleep 3
reset
else
cat << EOF
请注意这个功能尚未开发完成一旦开启则运行pkexec ssinstall时不再需要授权
仅对星火内置安装器生效
理论上会存在一定的安全风险~
如果接受请输入1否则输入2
EOF
read is_accept_polkiy
if [ "$is_accept_polkiy" = "1" ];then
echo "执行以下操作需要授权..."
sudo ln /opt/durapps/spark-store/bin/auto-install-policy/store.spark-app.ssinstall.policy /usr/share/polkit-1/actions/store.spark-app.ssinstall.policy
echo 已启动
sleep 3
reset
else
echo 未同意,返回
sleep 3
reset
fi
fi
;;
4)
exit 0
;;
*)

View File

@ -447,6 +447,11 @@
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/widget.cpp" line="195"/>
<source>APP Upgrade and Install Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/widget.cpp" line="344"/>
<source>Not Exist</source>
@ -472,11 +477,6 @@
<source>Failed to get the name to the file to be downloaded.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/widget.cpp" line="195"/>
<source>App Upgrade</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/widget.cpp" line="900"/>
<source>Upgrade</source>
@ -582,7 +582,7 @@
</message>
<message>
<location filename="../src/downloadlist.cpp" line="74"/>
<source>Downloaded, waiting to install</source>
<source>Downloaded. Open APP Upgrade and Install Settings to enable password-free installation</source>
<translation type="unfinished"></translation>
</message>
<message>

View File

@ -629,6 +629,11 @@ Nous sommes nés pour le changement.</translation>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/widget.cpp" line="195"/>
<source>APP Upgrade and Install Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/widget.cpp" line="344"/>
<source>Not Exist</source>
@ -645,11 +650,6 @@ Nous sommes nés pour le changement.</translation>
<source>Failed to get the name to the file to be downloaded.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/widget.cpp" line="195"/>
<source>App Upgrade</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/widget.cpp" line="706"/>
<source>Relative apps Not Found!</source>
@ -776,7 +776,7 @@ Nous sommes nés pour le changement.</translation>
</message>
<message>
<location filename="../src/downloadlist.cpp" line="74"/>
<source>Downloaded, waiting to install</source>
<source>Downloaded. Open APP Upgrade and Install Settings to enable password-free installation</source>
<translation type="unfinished"></translation>
</message>
<message>

View File

@ -505,8 +505,8 @@
</message>
<message>
<location filename="../src/widget.cpp" line="195"/>
<source>App Upgrade</source>
<translation type="unfinished"></translation>
<source>APP Upgrade and Install Settings</source>
<translation></translation>
</message>
<message>
<location filename="../src/widget.cpp" line="344"/>
@ -728,9 +728,8 @@ Click yes to continue.</source>
<translation></translation>
</message>
<message>
<location filename="../src/downloadlist.cpp" line="74"/>
<source>Downloaded, waiting to install</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/downloadlist.cpp" line="100"/>
@ -756,6 +755,11 @@ Click yes to continue.</source>
<source>Installing...</source>
<translation type="obsolete"></translation>
</message>
<message>
<location filename="../src/downloadlist.cpp" line="74"/>
<source>Downloaded. Open APP Upgrade and Install Settings to enable password-free installation</source>
<translation type="unfinished"> </translation>
</message>
<message>
<location filename="../src/downloadlist.cpp" line="190"/>
<source>Finish</source>