You've already forked ukui-bluetooth
mirror of
https://github.com/ukui/ukui-bluetooth.git
synced 2026-03-09 09:31:11 -07:00
Synchronous modification
This commit is contained in:
@@ -80,11 +80,7 @@ void BluetoothAgent::requestConfirmation(BluezQt::DevicePtr device, const QStrin
|
||||
return;
|
||||
});
|
||||
|
||||
pincodewidget->exec();
|
||||
|
||||
// QMessageBox msgBox;
|
||||
// msgBox.setText(device->name()+"------"+passkey);
|
||||
// msgBox.exec();
|
||||
pincodewidget->show();
|
||||
|
||||
request.accept();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
BluetoothObexAgent::BluetoothObexAgent(QObject *parent):ObexAgent(parent)
|
||||
{
|
||||
if(daemonIsNotRunning()){
|
||||
qDebug() << Q_FUNC_INFO << __LINE__;
|
||||
QDBusConnection bus = QDBusConnection::sessionBus();
|
||||
// 在session bus上注册名为"com.kylin_user_guide.hotel"的service
|
||||
|
||||
if (!bus.registerService("org.ukui.bluetooth")) { //注意命名规则-和_
|
||||
qDebug() << bus.lastError().message();
|
||||
@@ -17,27 +17,28 @@ BluetoothObexAgent::BluetoothObexAgent(QObject *parent):ObexAgent(parent)
|
||||
|
||||
void BluetoothObexAgent::authorizePush(BluezQt::ObexTransferPtr transfer, BluezQt::ObexSessionPtr session, const BluezQt::Request<QString> &request)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << transfer->status() << transfer->fileName() << transfer->name() <<transfer->objectPath().path() << transfer->transferred();
|
||||
FileReceivingPopupWidget *receiving_widget = new FileReceivingPopupWidget(session->destination(),transfer->name());
|
||||
qDebug() << Q_FUNC_INFO << __LINE__;
|
||||
// qDebug() << Q_FUNC_INFO << transfer->status() << transfer->fileName() << transfer->name() <<transfer->objectPath().path() << transfer->transferred();
|
||||
if(transfer->status() == BluezQt::ObexTransfer::Queued){
|
||||
FileReceivingPopupWidget *receiving_widget = new FileReceivingPopupWidget(session->destination(),transfer->name(),session->source());
|
||||
qDebug() << Q_FUNC_INFO << __LINE__;
|
||||
|
||||
connect(receiving_widget,&FileReceivingPopupWidget::accepted,this,[=]{
|
||||
request.accept(transfer->name());
|
||||
receiving_widget->configuration_transfer_progress_bar(transfer->size());
|
||||
connect(transfer.data(),&BluezQt::ObexTransfer::transferredChanged,receiving_widget,&FileReceivingPopupWidget::update_transfer_progress_bar);
|
||||
connect(transfer.data(),&BluezQt::ObexTransfer::statusChanged,receiving_widget,&FileReceivingPopupWidget::file_transfer_completed);
|
||||
connect(receiving_widget,&FileReceivingPopupWidget::cancel,this,[=]{
|
||||
transfer->cancel();
|
||||
connect(receiving_widget,&FileReceivingPopupWidget::accepted,this,[=]{
|
||||
request.accept(transfer->name());
|
||||
receiving_widget->configuration_transfer_progress_bar(transfer->size());
|
||||
connect(transfer.data(),&BluezQt::ObexTransfer::transferredChanged,receiving_widget,&FileReceivingPopupWidget::update_transfer_progress_bar);
|
||||
connect(transfer.data(),&BluezQt::ObexTransfer::statusChanged,receiving_widget,&FileReceivingPopupWidget::file_transfer_completed);
|
||||
connect(receiving_widget,&FileReceivingPopupWidget::cancel,this,[=]{
|
||||
transfer->cancel();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
connect(receiving_widget,&FileReceivingPopupWidget::rejected,this,[=]{
|
||||
request.reject();
|
||||
});
|
||||
connect(receiving_widget,&FileReceivingPopupWidget::rejected,this,[=]{
|
||||
request.reject();
|
||||
});
|
||||
|
||||
receiving_widget->exec();
|
||||
|
||||
qDebug() << Q_FUNC_INFO << transfer->status() << transfer->type() << transfer->fileName() << transfer->transferred();
|
||||
receiving_widget->show();
|
||||
}
|
||||
// qDebug() << Q_FUNC_INFO << transfer->status() << transfer->type() << transfer->fileName() << transfer->transferred();
|
||||
}
|
||||
|
||||
QDBusObjectPath BluetoothObexAgent::objectPath() const
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
<summary>List of paired device address</summary>
|
||||
<description>Save a list of paired device address</description>
|
||||
</key>
|
||||
<key type="as" name="adapter-address-list">
|
||||
<default>[]</default>
|
||||
<summary>List of adapter address</summary>
|
||||
<description>Save a list of adapter address</description>
|
||||
</key>
|
||||
<key type="s" name="adapter-address">
|
||||
<default>""</default>
|
||||
<summary>Save the Adapter used by default</summary>
|
||||
|
||||
185
debian/changelog
vendored
Normal file
185
debian/changelog
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
ukui-bluetooth (1.0.0-1kylin1k21) v101; urgency=medium
|
||||
|
||||
* 修复bug#38600、bug#38599、bug#37905、bug#37921、bug#37945、bug#38597 (吕晗)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Fri, 26 Feb 2021 17:05:56 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k20) v101; urgency=medium
|
||||
|
||||
* 修改蓝牙设备回连机制
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Sun, 21 Feb 2021 10:53:46 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k19) v101; urgency=medium
|
||||
|
||||
* 系统正在接收文件,点击取消或关闭,界面无法退出,一直弹出接收确认界面(bug#35566)
|
||||
* 蓝牙连接成功失败断开等通知信息,在侧边栏通知详情里显示蓝牙与蓝牙设备,无具体信息(bug#31532)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Fri, 05 Feb 2021 16:08:17 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k18) v101; urgency=medium
|
||||
|
||||
* 断开蓝牙音响,测试机系统提示与蓝牙设备断开连接“X6”,建议改为:与蓝牙设备“X6”断开成功(bug#37195)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Tue, 02 Feb 2021 20:53:21 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k17) v101; urgency=medium
|
||||
|
||||
* 解决中文文件路径异常
|
||||
- 通过鼠标右键蓝牙发送文件,文件传输界面崩溃(bug#36787)
|
||||
- 测试机可以接收手机端发送的文件,但去个人路径下无法找到刚刚接收到的doc文件(bug#37157)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Mon, 01 Feb 2021 14:00:14 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k16) v101; urgency=medium
|
||||
|
||||
* 已配对连接蓝牙成功后,进行S3/S4操作,唤醒后登录,任务栏蓝牙图标已丢失(bug#36744)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Sat, 30 Jan 2021 18:16:55 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k15) v101; urgency=medium
|
||||
|
||||
* 修复机器第一次启动蓝牙传输服务没启动问题,相关问题如下
|
||||
- 手机端没有收到测试机传输内容(bug#37140)
|
||||
- 系统与手机蓝牙配对连接成功后,发送文件无任何提示,手机端也未收到接收请求(bug#31237)
|
||||
- 通过鼠标右键蓝牙发送文件,文件传输界面崩溃(bug#36787)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Sat, 30 Jan 2021 11:19:28 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k14) v101; urgency=medium
|
||||
|
||||
* 由于可发现时间导致外设备无法扫描到设备信息(bug#32043)
|
||||
* 选择“从蓝牙发送文件到...”选项,弹出的界面窗口在任务栏无任务窗口图标显示(bug#33367)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Fri, 29 Jan 2021 19:02:35 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k13) v101; urgency=medium
|
||||
|
||||
* 解决程序托盘首次点击事件为右键时出现一条黑线
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Thu, 28 Jan 2021 15:28:30 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k12) v101; urgency=medium
|
||||
|
||||
* 添加与飞行模式联调代码
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Tue, 26 Jan 2021 17:13:12 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k11) v101; urgency=medium
|
||||
|
||||
* 解决对端手机蓝牙关闭,系统发送文件,导致蓝牙崩溃退出(bug#33575)
|
||||
* 系统接收完通过蓝牙的传输的文件,弹出的查看按钮点击无响应(bug#35564)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Fri, 22 Jan 2021 19:32:26 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k10) v101; urgency=medium
|
||||
|
||||
* 添加文件管理器蓝牙插件安装依赖
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Thu, 21 Jan 2021 15:41:14 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k9) v101; urgency=medium
|
||||
|
||||
* 添加对多个适配器的支持
|
||||
* 添加外设的电量显示 (bug#33902)
|
||||
* 优化s3/s4的代码逻辑
|
||||
* 在控制面板将蓝牙关闭后,重启系统再次打开控制面板-设备-蓝牙,显示蓝牙打开状态(bug#31252)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Wed, 20 Jan 2021 15:23:50 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k8) v101; urgency=medium
|
||||
|
||||
* 偶现控制面板开关蓝牙和任务栏图标开关蓝牙不一致,且互相不影响 (bug#32507)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Thu, 14 Jan 2021 15:44:14 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k7) v101; urgency=medium
|
||||
|
||||
* 适应主题的深色模式 (bug#32981、bug#32969)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Wed, 13 Jan 2021 17:35:30 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k6) v101; urgency=medium
|
||||
|
||||
* 修改传输文件对话框为非模态 (bug#33370)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Wed, 13 Jan 2021 13:54:51 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k5) v101; urgency=medium
|
||||
|
||||
* 添加blueman包冲突,以解决系统升级后存在blueman (bug#33299)
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Wed, 13 Jan 2021 11:31:48 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k4) v101; urgency=medium
|
||||
|
||||
* 去除Kwin的依赖,添加对bluez-obex的依赖
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Tue, 12 Jan 2021 16:34:27 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k3) v101; urgency=medium
|
||||
|
||||
* 修复设备不可见问题
|
||||
* 修改蓝牙鼠标键盘的连接机制
|
||||
* 修改显示多条通知弹窗
|
||||
* 修改配对后不会自动连接
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Sat, 09 Jan 2021 14:55:18 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k2) v101; urgency=medium
|
||||
|
||||
* 添加设备回连机制
|
||||
* 添加所有弹窗窗口标题
|
||||
* 添加设备配对超时消息弹窗
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Mon, 04 Jan 2021 09:41:55 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1kylin1k1) v101; urgency=medium
|
||||
|
||||
* 配对界面使用窗管圆角
|
||||
* 弹窗按钮使用主题统一规格
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Sat, 19 Dec 2020 17:14:50 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1) v101; urgency=medium
|
||||
|
||||
* 上传v101正式版本ppa
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Fri, 04 Dec 2020 11:59:40 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1~rc9) v101; urgency=medium
|
||||
|
||||
* 解决系统挂起后,再唤醒,程序退出问题
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Fri, 04 Dec 2020 11:11:09 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1~rc8) v101; urgency=medium
|
||||
|
||||
* 添加托盘菜单没有配对设备提示信息
|
||||
* 添加对系统挂起休眠信号的监听
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Thu, 03 Dec 2020 15:03:27 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1~rc7) v101; urgency=medium
|
||||
|
||||
* 添加窗管圆角特性
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Mon, 30 Nov 2020 18:46:44 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1~rc3) v101; urgency=medium
|
||||
|
||||
* add .desktop files
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Sat, 28 Nov 2020 16:13:21 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1~rc2) v101; urgency=medium
|
||||
|
||||
* fix deps
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Sat, 28 Nov 2020 14:57:00 +0800
|
||||
|
||||
ukui-bluetooth (1.0.0-1~rc1) v101; urgency=medium
|
||||
|
||||
* Initial release
|
||||
|
||||
-- tang guang <tangguang@kylinos.cn> Fri, 27 Nov 2020 13:47:23 +0800
|
||||
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@@ -0,0 +1 @@
|
||||
10
|
||||
33
debian/control
vendored
Normal file
33
debian/control
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
Source: ukui-bluetooth
|
||||
Section: x11
|
||||
Priority: optional
|
||||
Maintainer: tang guang <tangguang@kylinos.cn>
|
||||
Build-Depends: debhelper (>= 9),
|
||||
libgsettings-qt-dev,
|
||||
libglib2.0-dev,
|
||||
libkf5bluezqt-dev,
|
||||
libkf5windowsystem-dev,
|
||||
libqt5x11extras5-dev,
|
||||
libxrandr-dev,
|
||||
libxinerama-dev,
|
||||
libxi-dev,
|
||||
libxcursor-dev
|
||||
# libkf5bluezqt6-dev
|
||||
Standards-Version: 4.4.1
|
||||
Homepage: https://github.com/supreme886/ukui-bluetooth
|
||||
#Vcs-Browser: https://salsa.debian.org/debian/ukui-bluetooth-1.0.0
|
||||
#Vcs-Git: https://salsa.debian.org/debian/ukui-bluetooth-1.0.0.git
|
||||
|
||||
Package: ukui-bluetooth
|
||||
Architecture: any
|
||||
Depends: libkf5bluezqt6,
|
||||
libkf5bluezqt-data,
|
||||
libnotify-bin,
|
||||
bluez (>= 5),
|
||||
bluez-obexd,
|
||||
peony-bluetooth,
|
||||
${shlibs:Depends}, ${misc:Depends}
|
||||
Recommends: pulseaudio-module-bluetooth
|
||||
Conflicts: blueman
|
||||
Description: <insert up to 60 chars description>
|
||||
<insert long description, indented with spaces>
|
||||
43
debian/copyright
vendored
Normal file
43
debian/copyright
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: ukui-bluetooth-1.0.0
|
||||
Upstream-Contact: <preferred name and address to reach the upstream project>
|
||||
Source: <url://example.com>
|
||||
|
||||
Files: *
|
||||
Copyright: <years> <put author's name and email here>
|
||||
<years> <likewise for another author>
|
||||
License: <special license>
|
||||
<Put the license of the package here indented by 1 space>
|
||||
<This follows the format of Description: lines in control file>
|
||||
.
|
||||
<Including paragraphs>
|
||||
|
||||
# If you want to use GPL v2 or later for the /debian/* files use
|
||||
# the following clauses, or change it to suit. Delete these two lines
|
||||
Files: debian/*
|
||||
Copyright: 2020 tang guang <tangguang tangguang@kylinos.cn>
|
||||
License: GPL-2+
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
This package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
|
||||
|
||||
# Please also look if there are files or directories which have a
|
||||
# different copyright/license attached and list them here.
|
||||
# Please avoid picking licenses with terms that are more restrictive than the
|
||||
# packaged work, as it may make Debian's contributions unacceptable upstream.
|
||||
#
|
||||
# If you need, there are some extra license texts available in two places:
|
||||
# /usr/share/debhelper/dh_make/licenses/
|
||||
# /usr/share/common-licenses/
|
||||
25
debian/rules
vendored
Executable file
25
debian/rules
vendored
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/make -f
|
||||
# See debhelper(7) (uncomment to enable)
|
||||
# output every command that modifies files on the build system.
|
||||
#export DH_VERBOSE = 1
|
||||
|
||||
|
||||
# see FEATURE AREAS in dpkg-buildflags(1)
|
||||
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
|
||||
# see ENVIRONMENT in dpkg-buildflags(1)
|
||||
# package maintainers to append CFLAGS
|
||||
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
|
||||
# package maintainers to append LDFLAGS
|
||||
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
|
||||
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
|
||||
# dh_make generated override targets
|
||||
# This is example for Cmake (See https://bugs.debian.org/641051 )
|
||||
#override_dh_auto_configure:
|
||||
# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
|
||||
|
||||
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
@@ -0,0 +1 @@
|
||||
3.0 (native)
|
||||
2
debian/ukui-bluetooth.install
vendored
Normal file
2
debian/ukui-bluetooth.install
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
translations/*.qm /usr/share/ukui-bluetooth/translations/
|
||||
data/ukui-bluetooth.desktop /etc/xdg/autostart/
|
||||
6
debian/ukui-bluetooth.postinst
vendored
Normal file
6
debian/ukui-bluetooth.postinst
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
glib-compile-schemas /usr/share/glib-2.0/schemas/
|
||||
#DEBHELPER#
|
||||
Binary file not shown.
@@ -4,40 +4,40 @@
|
||||
<context>
|
||||
<name>BluetoothFileTransferWidget</name>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="19"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="29"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="28"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="43"/>
|
||||
<source>Bluetooth file transfer</source>
|
||||
<translation>蓝牙文件传输</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="43"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="166"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="57"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="187"/>
|
||||
<source>Transferring to "</source>
|
||||
<translation>正在传输至 "</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="79"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="93"/>
|
||||
<source>OK</source>
|
||||
<translation>确定</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="84"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="104"/>
|
||||
<source>Cancel</source>
|
||||
<translation>取消</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="235"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="256"/>
|
||||
<source>Successfully transmitted!</source>
|
||||
<translation>文件传输成功!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="238"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="260"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="259"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="287"/>
|
||||
<source>Close</source>
|
||||
<translation>关闭</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="257"/>
|
||||
<location filename="../ukui-bluetooth-tray/bluetoothfiletransferwidget.cpp" line="284"/>
|
||||
<source>Transmission failed!</source>
|
||||
<translation>传输失败!</translation>
|
||||
</message>
|
||||
@@ -45,7 +45,7 @@
|
||||
<context>
|
||||
<name>DeviceSeleterWidget</name>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/deviceseleterwidget.cpp" line="21"/>
|
||||
<location filename="../ukui-bluetooth-tray/deviceseleterwidget.cpp" line="35"/>
|
||||
<source>Select equipment</source>
|
||||
<translation>选择设备</translation>
|
||||
</message>
|
||||
@@ -53,119 +53,153 @@
|
||||
<context>
|
||||
<name>FeaturesWidget</name>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="97"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="131"/>
|
||||
<source>Bluetooth</source>
|
||||
<translation>蓝牙</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="128"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="410"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="170"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="716"/>
|
||||
<source>Turn on bluetooth</source>
|
||||
<translation>开启蓝牙</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="134"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="181"/>
|
||||
<source>Devices</source>
|
||||
<translation>设备</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="152"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="418"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="215"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="724"/>
|
||||
<source>Disconnection</source>
|
||||
<translation>断开连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="155"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="420"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="223"/>
|
||||
<source>Power </source>
|
||||
<translation>电量 </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="227"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="726"/>
|
||||
<source>Connection</source>
|
||||
<translation>连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="156"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="424"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="228"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="730"/>
|
||||
<source>Remove</source>
|
||||
<translation>移除</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="160"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="422"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="233"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="728"/>
|
||||
<source>Send files</source>
|
||||
<translation>发送文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="170"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="243"/>
|
||||
<source>No paired devices</source>
|
||||
<translation>没有已配对设备</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="176"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="416"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="249"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="722"/>
|
||||
<source>Bluetooth settings</source>
|
||||
<translation>蓝牙设置</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="213"/>
|
||||
<source>Disconnect from the Bluetooth device "</source>
|
||||
<translation>与蓝牙设备断开连接 "</translation>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="283"/>
|
||||
<source>Bluetooth device “%1” disconnected successfully</source>
|
||||
<translation>蓝牙设备“%1”断开连接成功</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="213"/>
|
||||
<source>"</source>
|
||||
<translation>"</translation>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="332"/>
|
||||
<source>Bluetooth device “%1” disconnected!</source>
|
||||
<translation>蓝牙设备“%1”失去连接!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="214"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="219"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="250"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="286"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="295"/>
|
||||
<source>BlueTooth</source>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="364"/>
|
||||
<source>The connection with the Bluetooth device “%1” is successful!</source>
|
||||
<translation>与蓝牙设备“%1”的连接成功!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="375"/>
|
||||
<source>The connection with the Bluetooth device “%1” is failed!</source>
|
||||
<translation>与蓝牙设备“%1”的连接失败!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="400"/>
|
||||
<source>ukui-bluetooth</source>
|
||||
<translation>蓝牙</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="218"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="403"/>
|
||||
<source>Bluetooth message</source>
|
||||
<translation>蓝牙消息</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bluetooth device "</source>
|
||||
<translation type="vanished">与蓝牙设备 "</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>" disconnected successfully</source>
|
||||
<translation type="vanished">" 断开成功</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disconnect from the Bluetooth device "</source>
|
||||
<translation type="vanished">与蓝牙设备断开连接 "</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>"</source>
|
||||
<translation type="vanished">"</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>BlueTooth</source>
|
||||
<translation type="vanished">蓝牙</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ukui-Bluetooth</source>
|
||||
<translation type="vanished">蓝牙</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="287"/>
|
||||
<source>Disconnect Error!!!</source>
|
||||
<translation>断开连接出错!!!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="249"/>
|
||||
<source>Bluetooth device</source>
|
||||
<translation>蓝牙设备</translation>
|
||||
<translation type="vanished">蓝牙设备</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="249"/>
|
||||
<source>disconnected!</source>
|
||||
<translation>断开连接!!!</translation>
|
||||
<translation type="vanished">断开连接!!!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="285"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="294"/>
|
||||
<source>The connection with the Bluetooth device "</source>
|
||||
<translation>与蓝牙设备 "</translation>
|
||||
<translation type="vanished">与蓝牙设备 "</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="285"/>
|
||||
<source>" is successful!</source>
|
||||
<translation>" 连接成功!</translation>
|
||||
<translation type="vanished">" 连接成功!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="294"/>
|
||||
<source>" failed!</source>
|
||||
<translation>" 连接失败!</translation>
|
||||
<translation type="vanished">" 连接失败!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="315"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="426"/>
|
||||
<source>Select the file to be sent</source>
|
||||
<translation>选择要发送的文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="315"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="426"/>
|
||||
<source>All Files (*)</source>
|
||||
<translation>所有文件 (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="131"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="413"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="177"/>
|
||||
<location filename="../ukui-bluetooth-tray/featureswidget.cpp" line="719"/>
|
||||
<source>Turn off bluetooth</source>
|
||||
<translation>关闭蓝牙</translation>
|
||||
</message>
|
||||
@@ -173,32 +207,32 @@
|
||||
<context>
|
||||
<name>FileReceivingPopupWidget</name>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="18"/>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="24"/>
|
||||
<source>Bluetooth file transfer</source>
|
||||
<translation>蓝牙文件传输</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="58"/>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="69"/>
|
||||
<source>Bluetooth file transfer from "</source>
|
||||
<translation>蓝牙文件传输来着 "</translation>
|
||||
<translation>蓝牙文件传输来自 "</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="84"/>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="94"/>
|
||||
<source>Cancel</source>
|
||||
<translation>取消</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="91"/>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="101"/>
|
||||
<source>Accept</source>
|
||||
<translation>接收</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="97"/>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="107"/>
|
||||
<source>View</source>
|
||||
<translation>查看</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="242"/>
|
||||
<location filename="../ukui-bluetooth-tray/filereceivingpopupwidget.cpp" line="255"/>
|
||||
<source>Sender canceled or transmission error</source>
|
||||
<translation>发送方取消或传输出错</translation>
|
||||
</message>
|
||||
@@ -206,44 +240,52 @@
|
||||
<context>
|
||||
<name>PinCodeWidget</name>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="18"/>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="23"/>
|
||||
<source>Bluetooth pairing</source>
|
||||
<translation>蓝牙设备配对</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="21"/>
|
||||
<source>Is it paired with "</source>
|
||||
<translation>正在等待 "</translation>
|
||||
<translation type="vanished">正在等待 "</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="21"/>
|
||||
<source>"</source>
|
||||
<translation>"接受连接请求</translation>
|
||||
<translation type="vanished">"接受连接请求</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="22"/>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="34"/>
|
||||
<source>Is it paired with:</source>
|
||||
<translation>正在进行配对:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="35"/>
|
||||
<source>Please make sure the number displayed on "</source>
|
||||
<translation>请确定 "</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="22"/>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="35"/>
|
||||
<source>" matches the number below. Please do not enter this code on any other accessories.</source>
|
||||
<translation>" 上显示的数字与下面的数字匹配。请不要在任何其他配件上输入此代码。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="50"/>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="60"/>
|
||||
<source>Accept</source>
|
||||
<translation>连接</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="60"/>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="70"/>
|
||||
<source>Refush</source>
|
||||
<translation>取消</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="90"/>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="100"/>
|
||||
<source>Pair</source>
|
||||
<translation>配对</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ukui-bluetooth-tray/pincodewidget.cpp" line="101"/>
|
||||
<source>Connection timed out !!!</source>
|
||||
<translation>连接超时!!!</translation>
|
||||
<translation>连接超时 !!!</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -1,25 +1,39 @@
|
||||
#include "bluetoothfiletransferwidget.h"
|
||||
#include "xatom-helper.h"
|
||||
|
||||
BluetoothFileTransferWidget::BluetoothFileTransferWidget(QString name, QString dev_address):
|
||||
bool BluetoothFileTransferWidget::isShow = false;
|
||||
BluetoothFileTransferWidget::BluetoothFileTransferWidget(QUrl name, QString dev_address):
|
||||
// QWidget(parent),
|
||||
file_name(name)
|
||||
{
|
||||
// 添加窗管协议
|
||||
isShow = true;
|
||||
|
||||
if(QGSettings::isSchemaInstalled("org.ukui.style")){
|
||||
GSettings = new QGSettings("org.ukui.style");
|
||||
connect(GSettings,&QGSettings::changed,this,&BluetoothFileTransferWidget::GSettingsChanges);
|
||||
}
|
||||
|
||||
// =================添加窗管协议================================
|
||||
MotifWmHints hints;
|
||||
hints.flags = MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS;
|
||||
hints.functions = MWM_FUNC_ALL;
|
||||
hints.decorations = MWM_DECOR_BORDER;
|
||||
XAtomHelper::getInstance()->setWindowMotifHint(this->winId(), hints);
|
||||
// ===========================================================
|
||||
|
||||
qDebug() << Q_FUNC_INFO << __LINE__;
|
||||
this->setFixedSize(440,510);
|
||||
this->setWindowFlags(Qt::Dialog/*|Qt::FramelessWindowHint*/);
|
||||
// this->setWindowFlags(Qt::Dialog/*|Qt::FramelessWindowHint*/);
|
||||
this->setWindowIcon(QIcon::fromTheme("bluetooth"));
|
||||
this->setWindowTitle(tr("Bluetooth file transfer"));
|
||||
this->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
QPalette palette;
|
||||
palette.setColor(QPalette::Background,QColor(255,255,255));
|
||||
if(GSettings->get("style-name").toString() == "ukui-black"){
|
||||
palette.setColor(QPalette::Background,QColor(Qt::black));
|
||||
}else{
|
||||
palette.setColor(QPalette::Background,QColor(Qt::white));
|
||||
}
|
||||
this->setPalette(palette);
|
||||
|
||||
title_icon = new QLabel(this);
|
||||
@@ -60,8 +74,8 @@ BluetoothFileTransferWidget::BluetoothFileTransferWidget(QString name, QString d
|
||||
target_icon->setGeometry(0,2,60,40);
|
||||
target_icon->setAlignment(Qt::AlignCenter);
|
||||
|
||||
target_name = new QLabel(file_name.split("/").at(file_name.split("/").length()-1),target_frame);
|
||||
target_name->setToolTip(file_name);
|
||||
target_name = new QLabel(file_name.path().split("/").at(file_name.path().split("/").length()-1),target_frame);
|
||||
target_name->setToolTip(file_name.path());
|
||||
target_name->setGeometry(75,0,200,20);
|
||||
|
||||
m_progressbar = new QProgressBar(this);
|
||||
@@ -79,6 +93,12 @@ BluetoothFileTransferWidget::BluetoothFileTransferWidget(QString name, QString d
|
||||
ok_btn = new QPushButton(tr("OK"),this);
|
||||
ok_btn->setFixedSize(120,36);
|
||||
ok_btn->setGeometry(288,435,120,36);
|
||||
if(dev_widget->get_seleter_device() == ""){
|
||||
ok_btn->setEnabled(false);
|
||||
}
|
||||
connect(dev_widget, &DeviceSeleterWidget::sign_select, this, [=] {
|
||||
ok_btn->setEnabled(true);
|
||||
});
|
||||
connect(ok_btn,&QPushButton::clicked,this,&BluetoothFileTransferWidget::onClicked_OK_Btn);
|
||||
|
||||
cancel_btn = new QPushButton(tr("Cancel"),this);
|
||||
@@ -109,17 +129,18 @@ BluetoothFileTransferWidget::BluetoothFileTransferWidget(QString name, QString d
|
||||
|
||||
BluetoothFileTransferWidget::~BluetoothFileTransferWidget()
|
||||
{
|
||||
|
||||
isShow = false;
|
||||
}
|
||||
|
||||
void BluetoothFileTransferWidget::Get_fie_type()
|
||||
{
|
||||
GError *error;
|
||||
GFile *file = g_file_new_for_path(file_name.toLatin1().data());
|
||||
qDebug() << Q_FUNC_INFO << file_name.path();
|
||||
GFile *file = g_file_new_for_path(file_name.path().toStdString().c_str());
|
||||
GFileInfo *file_info = g_file_query_info(file,"*",G_FILE_QUERY_INFO_NONE,NULL,&error);
|
||||
qDebug() << Q_FUNC_INFO << g_file_info_get_size(file_info) << g_file_info_get_content_type(file_info);
|
||||
|
||||
QFileInfo qinfo(file_name);
|
||||
QFileInfo qinfo(file_name.path());
|
||||
Get_file_size(float(qinfo.size()));
|
||||
|
||||
QString str = g_file_info_get_content_type(file_info);
|
||||
@@ -239,34 +260,58 @@ void BluetoothFileTransferWidget::get_transfer_status(QString status)
|
||||
}else if(status == "active"){
|
||||
|
||||
}else if(status == "error"){
|
||||
if(main_animation_group->state() == QAbstractAnimation::Running){
|
||||
connect(main_animation_group,&QParallelAnimationGroup::finished,this,[=]{
|
||||
tip_text->setVisible(false);
|
||||
target_frame->setVisible(false);
|
||||
m_progressbar->setVisible(false);
|
||||
});
|
||||
}
|
||||
tip_text->setVisible(false);
|
||||
target_frame->setVisible(false);
|
||||
m_progressbar->setVisible(false);
|
||||
|
||||
tranfer_status_icon->setPixmap(QIcon::fromTheme("edit-clear-all-symbolic").pixmap(64,64));
|
||||
tranfer_status_icon->setProperty("setIconHighlightEffectDefaultColor", QColor(248, 206, 83));
|
||||
tranfer_status_icon->setProperty("useIconHighlightEffect", 0x10);
|
||||
tranfer_status_icon->setVisible(true);
|
||||
tranfer_status_text->setText(tr("Transmission failed!"));
|
||||
tranfer_status_text->setVisible(true);
|
||||
|
||||
cancel_btn->setText(tr("Close"));
|
||||
tranfer_error();
|
||||
}
|
||||
}
|
||||
|
||||
void BluetoothFileTransferWidget::tranfer_error()
|
||||
{
|
||||
if(main_animation_group->state() == QAbstractAnimation::Running){
|
||||
connect(main_animation_group,&QParallelAnimationGroup::finished,this,[=]{
|
||||
tip_text->setVisible(false);
|
||||
target_frame->setVisible(false);
|
||||
m_progressbar->setVisible(false);
|
||||
});
|
||||
}
|
||||
tip_text->setVisible(false);
|
||||
target_frame->setVisible(false);
|
||||
m_progressbar->setVisible(false);
|
||||
|
||||
tranfer_status_icon->setPixmap(QIcon::fromTheme("edit-clear-all-symbolic").pixmap(64,64));
|
||||
tranfer_status_icon->setProperty("setIconHighlightEffectDefaultColor", QColor(248, 206, 83));
|
||||
tranfer_status_icon->setProperty("useIconHighlightEffect", 0x10);
|
||||
tranfer_status_icon->setVisible(true);
|
||||
tranfer_status_text->setText(tr("Transmission failed!"));
|
||||
tranfer_status_text->setVisible(true);
|
||||
|
||||
cancel_btn->setText(tr("Close"));
|
||||
emit this->close_the_pre_session();
|
||||
}
|
||||
|
||||
void BluetoothFileTransferWidget::set_m_progressbar_value(quint64 value)
|
||||
{
|
||||
if(--active_flag <= 0)
|
||||
m_progressbar->setValue(value);
|
||||
}
|
||||
|
||||
void BluetoothFileTransferWidget::GSettingsChanges(const QString &key)
|
||||
{
|
||||
QPalette palette;
|
||||
qDebug() << Q_FUNC_INFO << key;
|
||||
if(key == "styleName"){
|
||||
if(GSettings->get("style-name").toString() == "ukui-black"){
|
||||
palette.setColor(QPalette::Background,QColor(Qt::black));
|
||||
target_icon->setProperty("setIconHighlightEffectDefaultColor", QColor(Qt::white));
|
||||
target_icon->setProperty("useIconHighlightEffect", 0x10);
|
||||
}else{
|
||||
palette.setColor(QPalette::Background,QColor(Qt::white));
|
||||
target_icon->setProperty("setIconHighlightEffectDefaultColor", QColor(Qt::black));
|
||||
target_icon->setProperty("useIconHighlightEffect", 0x10);
|
||||
}
|
||||
}
|
||||
this->setPalette(palette);
|
||||
}
|
||||
|
||||
void BluetoothFileTransferWidget::onClicked_OK_Btn()
|
||||
{
|
||||
// qDebug() << Q_FUNC_INFO << this->rect() << this->geometry() << dev_widget->geometry() << ok_btn->geometry() << target_frame->geometry();
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <gio/gfileinfo.h>
|
||||
#include <gio/gioerror.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <KF5/BluezQt/bluezqt/obexmanager.h>
|
||||
#include <KF5/BluezQt/bluezqt/initobexmanagerjob.h>
|
||||
#include <KF5/BluezQt/bluezqt/obexobjectpush.h>
|
||||
@@ -23,12 +25,14 @@
|
||||
#include <QString>
|
||||
#include <QFont>
|
||||
#include <QDebug>
|
||||
#include <QUrl>
|
||||
#include <QDialog>
|
||||
#include <QFileInfo>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QSequentialAnimationGroup>
|
||||
#include <QParallelAnimationGroup>
|
||||
#include <QProgressBar>
|
||||
#include <QGSettings>
|
||||
|
||||
class DeviceSeleterWidget;
|
||||
|
||||
@@ -39,25 +43,31 @@ enum FILE_TYPE{
|
||||
image,
|
||||
};
|
||||
|
||||
class BluetoothFileTransferWidget : public QDialog
|
||||
class BluetoothFileTransferWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BluetoothFileTransferWidget(QString name = "",QString dev_address = "");
|
||||
explicit BluetoothFileTransferWidget(QUrl name,QString dev_address = "");
|
||||
~BluetoothFileTransferWidget();
|
||||
|
||||
static bool isShow;
|
||||
|
||||
void Get_fie_type();
|
||||
void Get_file_size(float);
|
||||
void Initialize_and_start_animation();
|
||||
void init_m_progressbar_value(quint64);
|
||||
void get_transfer_status(QString);
|
||||
void tranfer_error();
|
||||
signals:
|
||||
void sender_dev_name(QString);
|
||||
void close_the_pre_session();
|
||||
public slots:
|
||||
void onClicked_OK_Btn();
|
||||
void set_m_progressbar_value(quint64);
|
||||
void GSettingsChanges(const QString &key);
|
||||
private:
|
||||
QGSettings *GSettings;
|
||||
|
||||
QLabel *tip_text;
|
||||
|
||||
QLabel *title_icon;
|
||||
@@ -83,7 +93,7 @@ private:
|
||||
QPushButton *cancel_btn;
|
||||
QPushButton *ok_btn;
|
||||
|
||||
QString file_name;
|
||||
QUrl file_name;
|
||||
QString file_size;
|
||||
QString dev_name;
|
||||
};
|
||||
|
||||
@@ -4,9 +4,23 @@ DeviceSeleterWidget::DeviceSeleterWidget(QWidget *parent, QString dev, bool f):
|
||||
QWidget(parent),
|
||||
select_dev(dev)
|
||||
{
|
||||
if(QGSettings::isSchemaInstalled("org.ukui.style")){
|
||||
GSettings = new QGSettings("org.ukui.style");
|
||||
connect(GSettings,&QGSettings::changed,this,&DeviceSeleterWidget::GSettingsChanges);
|
||||
}
|
||||
if(QGSettings::isSchemaInstalled("org.ukui.bluetooth")){
|
||||
settings = new QGSettings("org.ukui.bluetooth");
|
||||
}
|
||||
|
||||
this->resize(372,270);
|
||||
this->setAutoFillBackground(false);
|
||||
|
||||
QPalette palette;
|
||||
palette.setColor(QPalette::Background,QColor(235,235,235));
|
||||
if(GSettings->get("style-name").toString() == "ukui-black"){
|
||||
palette.setColor(QPalette::Background,QColor(Qt::black));
|
||||
}else{
|
||||
palette.setColor(QPalette::Background,QColor(235,235,235));
|
||||
}
|
||||
this->setPalette(palette);
|
||||
|
||||
m_manager = new BluezQt::Manager(this);
|
||||
@@ -53,7 +67,7 @@ DeviceSeleterWidget::~DeviceSeleterWidget()
|
||||
|
||||
void DeviceSeleterWidget::InitUI()
|
||||
{
|
||||
QList<BluezQt::DevicePtr> device_list = m_manager->usableAdapter()->devices();
|
||||
QList<BluezQt::DevicePtr> device_list = m_manager->adapterForAddress(settings->get("adapter-address").toString())->devices();
|
||||
qDebug() << Q_FUNC_INFO << __LINE__ << device_list.size();
|
||||
for(int i=0; i < device_list.size(); i++){
|
||||
// qDebug() << Q_FUNC_INFO << device_list.at(i)->type() << device_list.at(i)->name();
|
||||
@@ -83,7 +97,7 @@ void DeviceSeleterWidget::InitUI()
|
||||
|
||||
if(select_dev != ""){
|
||||
if(device_list.at(i)->address() == select_dev){
|
||||
item->setStyleSheet("QToolButton{background:white;}");
|
||||
item->setStyleSheet("QToolButton{background:white;color:black;}");
|
||||
item->setChecked(true);
|
||||
btn = item;
|
||||
select_name = device_list.at(i)->name();
|
||||
@@ -123,17 +137,33 @@ void DeviceSeleterWidget::itemToolbuttonClicked()
|
||||
{
|
||||
|
||||
if(btn != nullptr || flag){
|
||||
btn->setStyleSheet("QToolButton{background:#D9D9D9;}");
|
||||
btn->setStyleSheet("QToolButton{background:#D9D9D9;color:black;}");
|
||||
btn->setChecked(false);
|
||||
}
|
||||
|
||||
QToolButton *p = qobject_cast<QToolButton *>(sender());
|
||||
btn = p;
|
||||
p->setStyleSheet("QToolButton{background:white;}");
|
||||
p->setStyleSheet("QToolButton{background:lightgreen;color:black;}");
|
||||
p->setChecked(true);
|
||||
select_dev = p->statusTip();
|
||||
select_name = p->text();
|
||||
|
||||
emit sign_select();
|
||||
|
||||
if(flag == false)
|
||||
flag = true;
|
||||
}
|
||||
|
||||
void DeviceSeleterWidget::GSettingsChanges(const QString &key)
|
||||
{
|
||||
QPalette palette;
|
||||
qDebug() << Q_FUNC_INFO << key;
|
||||
if(key == "styleName"){
|
||||
if(GSettings->get("style-name").toString() == "ukui-black"){
|
||||
palette.setColor(QPalette::Background,QColor(Qt::black));
|
||||
}else{
|
||||
palette.setColor(QPalette::Background,QColor(235,235,235));
|
||||
}
|
||||
}
|
||||
this->setPalette(palette);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <QList>
|
||||
#include <QPalette>
|
||||
#include <QColor>
|
||||
#include <QGSettings>
|
||||
|
||||
class DeviceSeleterWidget : public QWidget
|
||||
{
|
||||
@@ -34,10 +35,14 @@ public:
|
||||
QString get_seleter_device();
|
||||
QString get_seleter_dev_name();
|
||||
signals:
|
||||
void sign_select();
|
||||
|
||||
private slots:
|
||||
void itemToolbuttonClicked();
|
||||
|
||||
void GSettingsChanges(const QString &key);
|
||||
private:
|
||||
QGSettings *GSettings;
|
||||
QGSettings *settings;
|
||||
private:
|
||||
BluezQt::Manager *m_manager;
|
||||
QString select_dev;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,10 @@
|
||||
#include "../daemon/bluetoothdbus.h"
|
||||
#include "../daemon/bluetoothobexagent.h"
|
||||
|
||||
#include <string>
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
|
||||
#include <QDBusObjectPath>
|
||||
|
||||
#include <KF5/BluezQt/bluezqt/adapter.h>
|
||||
@@ -13,6 +17,7 @@
|
||||
#include <KF5/BluezQt/bluezqt/initmanagerjob.h>
|
||||
#include <KF5/BluezQt/bluezqt/device.h>
|
||||
#include <KF5/BluezQt/bluezqt/agent.h>
|
||||
#include <KF5/BluezQt/bluezqt/battery.h>
|
||||
#include <KF5/BluezQt/bluezqt/pendingcall.h>
|
||||
#include <KF5/BluezQt/bluezqt/obexmanager.h>
|
||||
#include <KF5/BluezQt/bluezqt/initobexmanagerjob.h>
|
||||
@@ -33,8 +38,14 @@
|
||||
#include <QStringList>
|
||||
#include <QFileDialog>
|
||||
#include <QVariant>
|
||||
#include <QPalette>
|
||||
#include <QTextCodec>
|
||||
#include <QRect>
|
||||
#include <QUrl>
|
||||
#include <QProcess>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QDateTime>
|
||||
|
||||
using namespace std;
|
||||
class BluetoothDbus;
|
||||
@@ -50,17 +61,21 @@ public:
|
||||
void Pair_device_by_address(QString);
|
||||
void Disconnect_device_by_address(QString);
|
||||
void Remove_device_by_address(QString);
|
||||
void Connect_device_by_address(QString);
|
||||
bool Connect_device_by_address(QString);
|
||||
void Send_files_by_address(QString);
|
||||
void Turn_on_or_off_bluetooth(bool);
|
||||
void Connect_device(BluezQt::DevicePtr);
|
||||
bool Connect_device(BluezQt::DevicePtr);
|
||||
void Open_bluetooth_settings();
|
||||
void SendNotifyMessage(QString);
|
||||
|
||||
void Dbus_file_transfer(QString);
|
||||
void Dbus_file_transfer(QUrl);
|
||||
void Monitor_sleep_signal();
|
||||
|
||||
void Connect_the_last_connected_device();
|
||||
|
||||
void adapterChangeFUN();
|
||||
void createPairDeviceFile();
|
||||
void writeDeviceInfoToFile(const QString& devAddress,const QString& devName);
|
||||
QStringList getDeviceConnectTimeList();
|
||||
bool exit_flag = false;
|
||||
signals:
|
||||
void ProgramExit();
|
||||
@@ -73,6 +88,8 @@ public slots:
|
||||
void GSettings_value_chanage(const QString &key);
|
||||
void Dbus_bluetooth_switch(bool);
|
||||
void Monitor_sleep_Slot(bool);
|
||||
void adapterPoweredChanged(bool value);
|
||||
void adapterDeviceRemove(BluezQt::DevicePtr ptr);
|
||||
private:
|
||||
QSystemTrayIcon *bluetooth_tray_icon;
|
||||
QMenu *tray_Menu;
|
||||
@@ -83,8 +100,9 @@ private:
|
||||
QString finally_connect_the_device;
|
||||
QString Default_Adapter;
|
||||
QString File_save_path;
|
||||
|
||||
QString selected_file;
|
||||
QString cur_adapter_address;
|
||||
QStringList adapter_list;
|
||||
QUrl selected_file;
|
||||
quint64 transfer_file_size = 0;
|
||||
bool flag = true;
|
||||
|
||||
@@ -97,8 +115,13 @@ private:
|
||||
BluetoothAgent *bluetoothAgent = nullptr;
|
||||
BluetoothObexAgent *bluetoothObexAgent = nullptr;
|
||||
BluezQt::ObexObjectPush *opp = nullptr;
|
||||
BluezQt::ObexTransferPtr filePtr = nullptr;
|
||||
QDBusObjectPath pre_session;
|
||||
bool dev_remove_flag = false;
|
||||
bool sleep_flag = false;
|
||||
bool dev_connected_when_sleep = false;
|
||||
bool dev_disconnected_flag = true;
|
||||
QString pair_device_file;
|
||||
int dev_callbak_flag = 0;
|
||||
} ;
|
||||
#endif // FEATURESWIDGET_H
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
#include "filereceivingpopupwidget.h"
|
||||
#include "xatom-helper.h"
|
||||
|
||||
FileReceivingPopupWidget::FileReceivingPopupWidget(QString address, QString source):
|
||||
FileReceivingPopupWidget::FileReceivingPopupWidget(QString address, QString source, QString root):
|
||||
target_address(address),
|
||||
target_source(source)
|
||||
target_source(source),
|
||||
root_address(root)
|
||||
{
|
||||
if(QGSettings::isSchemaInstalled("org.ukui.style")){
|
||||
StyleSettings = new QGSettings("org.ukui.style");
|
||||
connect(StyleSettings,&QGSettings::changed,this,&FileReceivingPopupWidget::GSettingsChanges);
|
||||
}
|
||||
|
||||
// 添加窗管协议
|
||||
MotifWmHints hints;
|
||||
hints.flags = MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS;
|
||||
@@ -12,13 +18,18 @@ FileReceivingPopupWidget::FileReceivingPopupWidget(QString address, QString sour
|
||||
hints.decorations = MWM_DECOR_BORDER;
|
||||
XAtomHelper::getInstance()->setWindowMotifHint(this->winId(), hints);
|
||||
|
||||
this->setWindowFlags(Qt::Dialog/*|Qt::FramelessWindowHint*/);
|
||||
// this->setWindowFlags(Qt::Dialog/*|Qt::FramelessWindowHint*/);
|
||||
this->setFixedSize(440,250);
|
||||
this->setWindowIcon(QIcon::fromTheme("bluetooth"));
|
||||
this->setWindowTitle(tr("Bluetooth file transfer"));
|
||||
this->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
QPalette palette;
|
||||
palette.setColor(QPalette::Background,QColor(255,255,255));
|
||||
if(StyleSettings->get("style-name").toString() == "ukui-black"){
|
||||
palette.setColor(QPalette::Background,QColor(Qt::black));
|
||||
}else{
|
||||
palette.setColor(QPalette::Background,QColor(Qt::white));
|
||||
}
|
||||
this->setPalette(palette);
|
||||
|
||||
if(QGSettings::isSchemaInstalled("org.ukui.bluetooth")){
|
||||
@@ -63,7 +74,6 @@ FileReceivingPopupWidget::FileReceivingPopupWidget(QString address, QString sour
|
||||
font-size: 18px;\
|
||||
font-family: PingFangSC-Medium, PingFang SC;\
|
||||
font-weight: 500;\
|
||||
color: rgba(0, 0, 0, 0.85);\
|
||||
line-height: 25px;}");
|
||||
|
||||
file_icon = new QLabel(this);
|
||||
@@ -110,8 +120,10 @@ QString FileReceivingPopupWidget::getDeviceNameByAddress(QString address)
|
||||
BluezQt::Manager *manager = new BluezQt::Manager(this);
|
||||
BluezQt::InitManagerJob *job = manager->init();
|
||||
job->exec();
|
||||
BluezQt::AdapterPtr adapter = manager->usableAdapter();
|
||||
BluezQt::AdapterPtr adapter = manager->adapterForAddress(root_address);
|
||||
// BluezQt::AdapterPtr adapter = manager->usableAdapter();
|
||||
QString name = adapter->deviceForAddress(address)->name();
|
||||
qDebug() << Q_FUNC_INFO << __LINE__;
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -144,9 +156,10 @@ bool FileReceivingPopupWidget::move_file()
|
||||
QString s = QDir::homePath()+"/.cache/obexd/"+target_source;
|
||||
QString d = file_path+"/"+target_source;
|
||||
GError *error;
|
||||
GFile *source = g_file_new_for_path(s.toLatin1().data());
|
||||
GFile *destination = g_file_new_for_path(d.toLatin1().data());
|
||||
GFile *source = g_file_new_for_path(s.toStdString().c_str());
|
||||
GFile *destination = g_file_new_for_path(d.toStdString().c_str());
|
||||
bool flag = g_file_move(source,destination,G_FILE_COPY_OVERWRITE,NULL,NULL,NULL,&error);
|
||||
qDebug() << Q_FUNC_INFO << "move file" << "target_path =" << s << " source_path =" << d << "flag =" << flag;
|
||||
return flag;
|
||||
}
|
||||
|
||||
@@ -210,14 +223,14 @@ void FileReceivingPopupWidget::file_transfer_completed(BluezQt::ObexTransfer::St
|
||||
qDebug() << Q_FUNC_INFO << __LINE__ << x;
|
||||
if(x){
|
||||
connect(view_btn,&QPushButton::clicked,this,[=]{
|
||||
this->close();
|
||||
qDebug() << Q_FUNC_INFO << __LINE__;
|
||||
QProcess *process = new QProcess(this);
|
||||
QString cmd = "peony";
|
||||
QStringList arg;
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
arg << file_path;
|
||||
process->start(cmd,arg);
|
||||
process->startDetached(cmd,arg);
|
||||
this->close();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -256,3 +269,17 @@ void FileReceivingPopupWidget::GSettings_value_chanage(const QString &key)
|
||||
file_path = settings->get("file-save-path").toString();
|
||||
}
|
||||
}
|
||||
|
||||
void FileReceivingPopupWidget::GSettingsChanges(const QString &key)
|
||||
{
|
||||
QPalette palette;
|
||||
qDebug() << Q_FUNC_INFO << key;
|
||||
if(key == "styleName"){
|
||||
if(StyleSettings->get("style-name").toString() == "ukui-black"){
|
||||
palette.setColor(QPalette::Background,QColor(Qt::black));
|
||||
}else{
|
||||
palette.setColor(QPalette::Background,QColor(Qt::white));
|
||||
}
|
||||
}
|
||||
this->setPalette(palette);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user