🌈 style(替换手机助手关键词): 将原手机助手一些重要关键词替换为多端协同
|
@ -32,9 +32,9 @@
|
|||
*.app
|
||||
|
||||
CMakeLists.txt.user
|
||||
kylin-mobile-assistant.pro.user
|
||||
kylin-connectivity.pro.user
|
||||
build/
|
||||
../build-kylin-mobile-assistant-unknown-Debug/
|
||||
../build-kylin-connectivity-unknown-Debug/
|
||||
cmake-build-debug/
|
||||
/.idea/.gitignore
|
||||
/.idea/misc.xml
|
||||
|
@ -46,7 +46,7 @@ node_modules/
|
|||
package-lock.json
|
||||
package.json
|
||||
.idea
|
||||
/kylin-mobile-assistant
|
||||
/kylin-connectivity
|
||||
translations/*.qm
|
||||
plugin/peony-vfs-kylin-multiterminal/translations/*.qm
|
||||
.vscode/
|
||||
|
|
|
@ -37,7 +37,7 @@ set(SUBDIRECTORIES_MAIN
|
|||
filesearch
|
||||
filetransfer
|
||||
filesync
|
||||
kylin-mobile-assistant-mountftp
|
||||
kylinconnectivitymanager
|
||||
plugin
|
||||
projection
|
||||
ui
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
1. 在麒麟操作系统上搭建Qt开发环境
|
||||
Qt版本>=5.12
|
||||
2. 克隆该项目
|
||||
3. 根据kylin-mobile-assistant.pro 或 CmakeList.txt 打开项目
|
||||
3. 根据kylin-connectivity.pro 或 CmakeList.txt 打开项目
|
||||
4. 编译,运行
|
||||
|
||||
### 依赖
|
||||
|
|
|
@ -63,27 +63,24 @@ QString Config::s_configPath = "";
|
|||
|
||||
Config::Config(QObject *parent) : QObject(parent)
|
||||
{
|
||||
|
||||
|
||||
const QString &configPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/.config";
|
||||
if (!QDir(configPath).exists("kylin-mobile-assistant")) {
|
||||
QDir(configPath).mkdir("kylin-mobile-assistant");
|
||||
if (!QDir(configPath).exists("kylin-connectivity")) {
|
||||
QDir(configPath).mkdir("kylin-connectivity");
|
||||
}
|
||||
QString setName = QDir::homePath() + "/.config/kylin-mobile-assistant/phoneServerConfig.ini";
|
||||
QString setName = QDir::homePath() + "/.config/kylin-connectivity/phoneServerConfig.ini";
|
||||
m_settings = new QSettings(setName, QSettings::IniFormat);
|
||||
m_settings->setIniCodec("UTF-8");
|
||||
|
||||
QString userDataName = QDir::homePath() + "/.config/kylin-mobile-assistant/phoneDeviceConfig.ini";
|
||||
QString userDataName = QDir::homePath() + "/.config/kylin-connectivity/phoneDeviceConfig.ini";
|
||||
m_userData = new QSettings(userDataName, QSettings::IniFormat);
|
||||
m_userData->setIniCodec("UTF-8");
|
||||
|
||||
QString scrollSetName = QDir::homePath() + "/.config/kylin-mobile-assistant/scrollConfig.ini";
|
||||
QString scrollSetName = QDir::homePath() + "/.config/kylin-connectivity/scrollConfig.ini";
|
||||
m_scrollSet = new QSettings(scrollSetName, QSettings::IniFormat);
|
||||
m_scrollSet->setIniCodec("UTF-8");
|
||||
|
||||
m_password = new QSettings(getenv("HOME") + QString("/.mobilecache/setting.ini"), QSettings::IniFormat);
|
||||
m_password = new QSettings(getenv("HOME") + QString("/.connectivitycache/setting.ini"), QSettings::IniFormat);
|
||||
m_password->setIniCodec("UTF-8");
|
||||
|
||||
}
|
||||
|
||||
Config &Config::getInstance()
|
||||
|
@ -278,5 +275,4 @@ void Config::updateDistance(const int distance)
|
|||
m_scrollSet->setValue(DEFAULT_SCROLL_KEY, distance);
|
||||
m_scrollSet->endGroup();
|
||||
m_scrollSet->sync();
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[common]
|
||||
# 窗口标题
|
||||
WindowTitle = kylin-mobile-assistant
|
||||
WindowTitle = kylin-connectivity
|
||||
# 推送到安卓设备的文件保存路径(必须以/结尾)
|
||||
PushFilePath = /sdcard/
|
||||
# 最大fps(仅支持Android 10以上)
|
||||
|
|
|
@ -18,7 +18,7 @@ const int FORWARD_PORT1 = 2301;
|
|||
const int HEARTBEAT_PORT = 27181;
|
||||
const int HEART_RATE = 10000;
|
||||
const QString FILE_SAVE_PATH = getenv("HOME") + QString("/下载/");
|
||||
const QString UUID_FILE_LOACLPATH = getenv("HOME") + QString("/.mobilecache/UUID");
|
||||
const QString UUID_FILE_LOACLPATH = getenv("HOME") + QString("/.connectivitycache/UUID");
|
||||
const QString UUID_FILE_REMOTEPATH = QString("/storage/emulated/0/Android/data/com.kylin.mobileassistant/cache/UUID");
|
||||
|
||||
ConnectionService::ConnectionService(QObject *parent) : QObject(parent)
|
||||
|
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 608 KiB After Width: | Height: | Size: 608 KiB |
Before Width: | Height: | Size: 608 KiB After Width: | Height: | Size: 608 KiB |
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 289 KiB After Width: | Height: | Size: 289 KiB |
Before Width: | Height: | Size: 425 KiB After Width: | Height: | Size: 425 KiB |
Before Width: | Height: | Size: 393 KiB After Width: | Height: | Size: 393 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 624 KiB After Width: | Height: | Size: 624 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
@ -1,9 +1,9 @@
|
|||
#ifndef DBUSVFSINTERFACE_H
|
||||
#define DBUSVFSINTERFACE_H
|
||||
|
||||
#define KYLIN_MOBILE_PATH "/"
|
||||
#define KYLIN_MOBILE_SERVICE "com.kylinos.Multiterminal.Manager"
|
||||
#define KYLIN_MOBILE_INTERFACE "com.kylinos.Multiterminal.Manager"
|
||||
#define KYLIN_CONNECTIVITY_PATH "/"
|
||||
#define KYLIN_CONNECTIVITY_SERVICE "com.kylinos.Multiterminal.Manager"
|
||||
#define KYLIN_CONNECTIVITY_INTERFACE "com.kylinos.Multiterminal.Manager"
|
||||
|
||||
#include <QObject>
|
||||
#include "fileinfo.h"
|
||||
|
@ -12,7 +12,7 @@
|
|||
class DbusVfsInterface : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", KYLIN_MOBILE_SERVICE)
|
||||
Q_CLASSINFO("D-Bus Interface", KYLIN_CONNECTIVITY_SERVICE)
|
||||
public:
|
||||
DbusVfsInterface(QObject *parent = nullptr);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <QtSql/QSqlRecord>
|
||||
|
||||
const QString DATABASE_NAME = QString("pcsearchInfo.db");
|
||||
const QString DATABASE_PATH = getenv("HOME") + QString("/.mobilecache/");
|
||||
const QString DATABASE_PATH = getenv("HOME") + QString("/.connectivitycache/");
|
||||
const QString TABLE_NAME = QString("search");
|
||||
|
||||
// 数据项
|
||||
|
|
|
@ -18,9 +18,9 @@ const QString FILE_PATH_PICTURE = ANDROID_FILE_PATH + QString("picture/pictureIn
|
|||
const QString FILE_PATH_VIDEO = ANDROID_FILE_PATH + QString("video/videoInfo");
|
||||
const QString FILE_PATH_QQ = ANDROID_FILE_PATH + QString("qqFiles/");
|
||||
const QString FILE_PATH_WECHAT = ANDROID_FILE_PATH + QString("wechatFiles/");
|
||||
const QString FILE_DOWN_PATH = getenv("HOME") + QString("/.mobilecache/cache/");
|
||||
const QString FILE_DOWN_PATH = getenv("HOME") + QString("/.connectivitycache/cache/");
|
||||
const QString FILE_HOME_PATH = QString("/home/");
|
||||
const QString FILE_PATH_PCSEARCH = QString("/.mobilecache/pcsearchInfo.db");
|
||||
const QString FILE_PATH_PCSEARCH = QString("/.connectivitycache/pcsearchInfo.db");
|
||||
const QString THUMB_DOWN_PATH = "/thumbnail/";
|
||||
const QString TEMP_DOWN_PATH = "/temp/";
|
||||
const QString QQ_FLAGE = "qq_";
|
||||
|
|
31
installfile
|
@ -1,27 +1,30 @@
|
|||
#!/bin/bash
|
||||
if [ ! -d "/usr/share/kylin-connectivity" ]; then
|
||||
mkdir /usr/share/kylin-connectivity
|
||||
fi
|
||||
cp ./build/kylin-connectivity /usr/bin/
|
||||
cp ./mobile-assistant.desktop /usr/share/applications/
|
||||
cp ./third_party/scrcpy-server.jar /usr/share/kylin-mobile-assistant/
|
||||
cp ./third_party/sndcpy /usr/share/kylin-mobile-assistant/
|
||||
cp -r ./translations/ /usr/share/kylin-mobile-assistant/
|
||||
cp ./plugin/peony-vfs-kylin-multiterminal/translations/* /usr/share/kylin-mobile-assistant/translations/
|
||||
cp ./plugin/peony-vfs-kylin-multiterminal/lib/libpeony-vfs-kylin-multiterminal.so /lib
|
||||
cp ./plugin/peony-send-to-mobile-assistant/translations/peony-send-to-mobile-assistant_zh_CN.ts /usr/share/kylin-mobile-assistant/translations/
|
||||
cp ./plugin/peony-send-to-mobile-assistant/translations/peony-send-to-mobile-assistant_zh_CN.qm /usr/share/kylin-mobile-assistant/translations/
|
||||
cp ./plugin/peony-send-to-mobile-assistant/lib/libpeony-send-to-mobile-assistant.so /lib
|
||||
cp ./config/control.conf /usr/share/kylin-mobile-assistant/
|
||||
cp ./kylin-connectivity.desktop /usr/share/applications/
|
||||
cp ./third_party/scrcpy-server.jar /usr/share/kylin-connectivity/
|
||||
cp ./third_party/sndcpy /usr/share/kylin-connectivity/
|
||||
cp -r ./translations/ /usr/share/kylin-connectivity/
|
||||
cp ./output/lib/plugin/libpeony-vfs-kylin-multiterminal.so /lib
|
||||
cp ./output/lib/plugin/libpeony-send-to-connectivity.so /lib
|
||||
cp ./config/control.conf /usr/share/kylin-connectivity/
|
||||
|
||||
mkdir "/opt/kylin-mobile-assistant/"
|
||||
cp ./output/bin/* /opt/kylin-mobile-assistant/
|
||||
if [ ! -d "/opt/kylin-connectivity/" ]; then
|
||||
mkdir /opt/kylin-connectivity/
|
||||
fi
|
||||
|
||||
cp ./output/bin/* /opt/kylin-connectivity/
|
||||
|
||||
#arch
|
||||
get_arch=`uname -i`
|
||||
if [[ $get_arch =~ "x86_64" ]];then
|
||||
mv /lib/libpeony-vfs-kylin-multiterminal.so /lib/x86_64-linux-gnu/peony-extensions/
|
||||
mv /lib/libpeony-send-to-mobile-assistant.so /lib/x86_64-linux-gnu/peony-extensions/
|
||||
mv /lib/libpeony-send-to-connectivity.so /lib/x86_64-linux-gnu/peony-extensions/
|
||||
elif [[ $get_arch =~ "aarch64" ]];then
|
||||
mv /lib/libpeony-vfs-kylin-multiterminal.so /lib/aarch64-linux-gnu/peony-extensions/
|
||||
mv /lib/libpeony-send-to-mobile-assistant.so /lib/aarch64-linux-gnu/peony-extensions/
|
||||
mv /lib/libpeony-send-to-connectivity.so /lib/aarch64-linux-gnu/peony-extensions/
|
||||
else
|
||||
echo "unknown!!"
|
||||
fi
|
||||
|
|
|
@ -10,7 +10,7 @@ include(filesync/filesync.pri)
|
|||
include(pcscreenmanage/pcscreenmanage.pri)
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = kylin-mobile-assistant
|
||||
TARGET = kylin-connectivity
|
||||
|
||||
CONFIG += force_debug_info
|
||||
|
||||
|
@ -32,9 +32,9 @@ INCLUDEPATH += \
|
|||
|
||||
!system($$PWD/translations/generate_translations_pm.sh $$PWD): error("Failed to generate qm")
|
||||
|
||||
TRANSLATIONS += $$PWD/translations/kylin-mobile-assistant_en.ts \
|
||||
translations/kylin-mobile-assistant_zh_CN.ts
|
||||
QM_FILES_INSTALL_PATH = /usr/share/kylin-mobile-assistant/translations/
|
||||
TRANSLATIONS += $$PWD/translations/kylin-connectivity_en.ts \
|
||||
translations/kylin-connectivity_zh_CN.ts
|
||||
QM_FILES_INSTALL_PATH = /usr/share/kylin-connectivity/translations/
|
||||
|
||||
|
||||
SOURCES += \
|
|
@ -1,4 +0,0 @@
|
|||
[D-BUS Service]
|
||||
Name=com.kylin.mobile.assistant.mountftp
|
||||
Exec=/usr/bin/kylin-mobile-assistant-mountftp
|
||||
User=root
|
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(kylin-mobile-assistant-mountftp LANGUAGES CXX)
|
||||
project(kylin-connectivity-manager LANGUAGES CXX)
|
||||
|
||||
set(TOP_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
@ -8,8 +8,8 @@ set(CMAKE_AUTOMOC ON)
|
|||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(SRCS
|
||||
"${TOP_DIR}/mountftp.cpp"
|
||||
"${TOP_DIR}/mountftp.cpp"
|
||||
"${TOP_DIR}/connectivitymanager.cpp"
|
||||
"${TOP_DIR}/connectivitymanager.cpp"
|
||||
"${TOP_DIR}/main.cpp"
|
||||
)
|
||||
|
||||
|
@ -25,5 +25,5 @@ find_package(Qt5 REQUIRED COMPONENTS DBus)
|
|||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::DBus)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin/)
|
||||
install(FILES ${TOP_DIR}/com.kylin.mobile.assistant.mountftp.conf DESTINATION /etc/dbus-1/system.d/)
|
||||
install(FILES ${TOP_DIR}/com.kylin.mobile.assistant.mountftp.service DESTINATION /usr/share/dbus-1/system-services/)
|
||||
install(FILES ${TOP_DIR}/com.kylin.connectivity.manager.conf DESTINATION /etc/dbus-1/system.d/)
|
||||
install(FILES ${TOP_DIR}/com.kylin.connectivity.manager.service DESTINATION /usr/share/dbus-1/system-services/)
|
|
@ -6,17 +6,17 @@
|
|||
<busconfig>
|
||||
<!-- Only root can own the service -->
|
||||
<policy user="root">
|
||||
<allow own="com.kylin.mobile.assistant.mountftp"/>
|
||||
<allow send_interface="com.kylin.mobile.assistant.mountftp"/>
|
||||
<allow own="com.kylin.connectivity.manager"/>
|
||||
<allow send_interface="com.kylin.connectivity.manager"/>
|
||||
</policy>
|
||||
|
||||
<!-- Allow anyone to invoke methods on the interfaces -->
|
||||
<policy context="default">
|
||||
<allow send_destination="com.kylin.mobile.assistant.mountftp"
|
||||
send_interface="com.kylin.mobile.assistant.mountftp"/>
|
||||
<allow send_destination="com.kylin.mobile.assistant.mountftp"
|
||||
<allow send_destination="com.kylin.connectivity.manager"
|
||||
send_interface="com.kylin.connectivity.manager"/>
|
||||
<allow send_destination="com.kylin.connectivity.manager"
|
||||
send_interface="org.freedesktop.DBus.Introspectable"/>
|
||||
<allow send_destination="com.kylin.mobile.assistant.mountftp"
|
||||
<allow send_destination="com.kylin.connectivity.manager"
|
||||
send_interface="org.freedesktop.DBus.Properties"/>
|
||||
</policy>
|
||||
</busconfig>
|
|
@ -0,0 +1,4 @@
|
|||
[D-BUS Service]
|
||||
Name=com.kylin.connectivity.manager
|
||||
Exec=/usr/bin/kylin-connectivity-manager
|
||||
User=root
|
|
@ -1,4 +1,4 @@
|
|||
#include "mountftp.h"
|
||||
#include "connectivitymanager.h"
|
||||
#include <QString>
|
||||
#include <QUrl>
|
||||
#include <QDebug>
|
||||
|
@ -7,13 +7,14 @@
|
|||
#include <unistd.h>
|
||||
#include <QFile>
|
||||
|
||||
MountFtp::MountFtp()
|
||||
ConnectivityManager::ConnectivityManager()
|
||||
{
|
||||
m_discServer = new QProcess(this);
|
||||
}
|
||||
MountFtp::~MountFtp() = default;
|
||||
|
||||
void MountFtp::mountFtp(QString urlStr, QString userName, QString pwd, QString path)
|
||||
ConnectivityManager::~ConnectivityManager() = default;
|
||||
|
||||
void ConnectivityManager::mountFtp(QString urlStr, QString userName, QString pwd, QString path)
|
||||
{
|
||||
m_isMount = true;
|
||||
killProcess();
|
||||
|
@ -23,7 +24,8 @@ void MountFtp::mountFtp(QString urlStr, QString userName, QString pwd, QString p
|
|||
+ ":" + pwd + "@" + url.host() + ":" + QString::number(url.port()) + " " + path;
|
||||
startCommand(common);
|
||||
}
|
||||
void MountFtp::umountFtp(QString path)
|
||||
|
||||
void ConnectivityManager::umountFtp(QString path)
|
||||
{
|
||||
m_isMount = false;
|
||||
killProcess();
|
||||
|
@ -31,7 +33,7 @@ void MountFtp::umountFtp(QString path)
|
|||
startCommand(common);
|
||||
}
|
||||
|
||||
void MountFtp::startCommand(QString common)
|
||||
void ConnectivityManager::startCommand(QString common)
|
||||
{
|
||||
qInfo() << common;
|
||||
QProcess *process = new QProcess(this);
|
||||
|
@ -47,7 +49,7 @@ void MountFtp::startCommand(QString common)
|
|||
});
|
||||
}
|
||||
|
||||
void MountFtp::killProcess()
|
||||
void ConnectivityManager::killProcess()
|
||||
{
|
||||
static const char *cmd = "ps -aux | /var/lib/mult/";
|
||||
|
||||
|
@ -85,7 +87,7 @@ void MountFtp::killProcess()
|
|||
pclose(fp);
|
||||
}
|
||||
|
||||
void MountFtp::startDiscServer(QString cmd)
|
||||
void ConnectivityManager::startDiscServer(QString cmd)
|
||||
{
|
||||
qInfo() << "disc softbus init";
|
||||
if (QFile().exists(cmd)) {
|
||||
|
@ -99,7 +101,7 @@ void MountFtp::startDiscServer(QString cmd)
|
|||
Q_EMIT sigInitDiscServer(m_isDiscServerInit);
|
||||
}
|
||||
|
||||
void MountFtp::stopDiscServer()
|
||||
void ConnectivityManager::stopDiscServer()
|
||||
{
|
||||
qInfo() << "stop disc server";
|
||||
if (m_discServer) {
|
|
@ -1,16 +1,16 @@
|
|||
#ifndef CRASH_CRASH_INTERFACE_H_
|
||||
#define CRASH_CRASH_INTERFACE_H_
|
||||
#ifndef CONNECTIVITYMANAGER_H
|
||||
#define CONNECTIVITYMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
|
||||
class MountFtp : public QObject
|
||||
class ConnectivityManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", "com.kylin.mobile.assistant.mountftp")
|
||||
Q_CLASSINFO("D-Bus Interface", "com.kylin.connectivity.manager")
|
||||
public:
|
||||
MountFtp();
|
||||
~MountFtp();
|
||||
ConnectivityManager();
|
||||
~ConnectivityManager();
|
||||
|
||||
private:
|
||||
void startCommand(QString common);
|
||||
|
@ -34,4 +34,4 @@ private:
|
|||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // !CONNECTIVITYMANAGER_H
|
|
@ -3,13 +3,13 @@
|
|||
#include <QDBusError>
|
||||
#include <QDebug>
|
||||
|
||||
#include "mountftp.h"
|
||||
#include "connectivitymanager.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
app.setOrganizationName("kylin mobile assistant");
|
||||
app.setApplicationName("kylin mobile assistant mountftp");
|
||||
app.setOrganizationName("kylin connectivity");
|
||||
app.setApplicationName("kylin connectivity manager");
|
||||
|
||||
QDBusConnection systemBus = QDBusConnection::systemBus();
|
||||
if (!systemBus.isConnected()) {
|
||||
|
@ -17,12 +17,12 @@ int main(int argc, char *argv[])
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!systemBus.registerService("com.kylin.mobile.assistant.mountftp")) {
|
||||
if (!systemBus.registerService("com.kylin.connectivity.manager")) {
|
||||
qCritical() << "d-bus register service fail ! d-bus error : " << systemBus.lastError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!systemBus.registerObject("/", new MountFtp,
|
||||
if (!systemBus.registerObject("/", new ConnectivityManager,
|
||||
QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals)) {
|
||||
qCritical() << "d-bus register crash object fail ! d-bus error : " << systemBus.lastError();
|
||||
return -1;
|
14
main.cpp
|
@ -28,9 +28,9 @@ int main(int argc, char *argv[])
|
|||
// set env
|
||||
#ifdef Q_OS_LINUX
|
||||
qputenv("ADB_PATH", "/usr/lib/android-sdk/platform-tools/adb");
|
||||
qputenv("SERVER_PATH", "/usr/share/kylin-mobile-assistant/scrcpy-server.jar");
|
||||
qputenv("CONFIG_PATH", "/usr/share/kylin-mobile-assistant/config");
|
||||
qputenv("KEYMAP_PATH", "/usr/share/kylin-mobile-assistant/keymap");
|
||||
qputenv("SERVER_PATH", "/usr/share/kylin-connectivity/scrcpy-server.jar");
|
||||
qputenv("CONFIG_PATH", "/usr/share/kylin-connectivity/config");
|
||||
qputenv("KEYMAP_PATH", "/usr/share/kylin-connectivity/keymap");
|
||||
#endif
|
||||
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
|
@ -62,9 +62,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
// 加载翻译
|
||||
// 加载自定义翻译文件
|
||||
QString tranPath("/usr/share/kylin-mobile-assistant/translations/");
|
||||
QString tranPath("/usr/share/kylin-connectivity/translations/");
|
||||
QTranslator tran;
|
||||
if (tran.load(QLocale(), QString("kylin-mobile-assistant"), QString("_"), tranPath)) {
|
||||
if (tran.load(QLocale(), QString("kylin-connectivity"), QString("_"), tranPath)) {
|
||||
app.installTranslator(&tran);
|
||||
} else {
|
||||
qWarning() << "Waring : load translation file fail";
|
||||
|
@ -104,8 +104,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
DbusVfsInterface vfsDbus;
|
||||
QDBusConnection connection = QDBusConnection::sessionBus();
|
||||
connection.registerService(KYLIN_MOBILE_SERVICE);
|
||||
connection.registerObject(KYLIN_MOBILE_PATH, &vfsDbus,
|
||||
connection.registerService(KYLIN_CONNECTIVITY_SERVICE);
|
||||
connection.registerObject(KYLIN_CONNECTIVITY_PATH, &vfsDbus,
|
||||
QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals);
|
||||
|
||||
int ret = app.exec();
|
||||
|
|
|
@ -41,9 +41,9 @@ void Control::startServer()
|
|||
{
|
||||
m_isServer = true;
|
||||
QString serverpara = "anti-control-server -f --debug DEBUG --name server --disable-crypto --log " + QDir::homePath()
|
||||
+ "/.log/kylin-mobile-control.log --disable-client-cert-checking"
|
||||
+ "/.log/kylin-connectivity-control.log --disable-client-cert-checking"
|
||||
" -c "
|
||||
+ "/usr/share/kylin-mobile-assistant/control.conf --address :27194";
|
||||
+ "/usr/share/kylin-connectivity-assistant/control.conf --address :27194";
|
||||
qInfo() << "Anti control server starting...";
|
||||
m_process->start(serverpara);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ void Control::startClient(QString address)
|
|||
{
|
||||
m_isServer = false;
|
||||
QString clientpara = "anti-control-client -f --debug DEBUG --name client --disable-crypto --log " + QDir::homePath()
|
||||
+ "/.log/kylin-mobile-control.log"
|
||||
+ "/.log/kylin-connectivity-control.log"
|
||||
" ["
|
||||
+ address + "]:27194 ";
|
||||
qInfo() << "Anti control client starting..";
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
add_subdirectory(os-manager-mobile-assistant)
|
||||
add_subdirectory(peony-vfs-kylin-multiterminal)
|
||||
add_subdirectory(peony-send-to-mobile-assistant)
|
||||
add_subdirectory(peony-send-to-connectivity)
|
|
@ -1,44 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(plugin-mobileassistant)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
add_library(${PROJECT_NAME} SHARED )
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output/lib/plugin)
|
||||
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -g -rdynamic)
|
||||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/interface)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/internal/kyplugin)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
pkg_check_modules(KYSDK_QTWIDGETS kysdk-qtwidgets)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${KYSDK_QTWIDGETS_INCLUDE_DIRS})
|
||||
target_link_directories(${PROJECT_NAME} PRIVATE ${KYSDK_QTWIDGETS_LIBRARY_DIRS})
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE ${KYSDK_QTWIDGETS_LIBRARIES})
|
||||
|
||||
pkg_check_modules(KYSDK_UKENV kysdk-ukenv)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${KYSDK_UKENV_INCLUDE_DIRS})
|
||||
target_link_directories(${PROJECT_NAME} PRIVATE ${KYSDK_UKENV_LIBRARY_DIRS})
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE ${KYSDK_UKENV_LIBRARIES})
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Widgets)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE mobileui)
|
||||
|
||||
file(GLOB SRCS
|
||||
"*.cpp"
|
||||
"*.h"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/interface/kymanager_plugin.cpp"
|
||||
)
|
||||
set(QRC_MAIN "../../res/resources.qrc")
|
||||
|
||||
target_sources(${PROJECT_NAME} PRIVATE ${SRCS} ${QRC_MAIN})
|
||||
|
||||
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
#include "mobileplugin.h"
|
||||
|
||||
extern "C" bool connect(kyplugin::Host &host)
|
||||
{
|
||||
host.add(new KyManagerMobilePlugin::PluginProvider());
|
||||
|
||||
return true;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
#include "kymanager_plugin.h"
|
||||
|
||||
const std::string KyManagerPluginProvider::providerType = "KyManagerPlugin";
|
||||
const unsigned int KyManagerPluginProvider::providerVersion = 1;
|
||||
const unsigned int KyManagerPluginProvider::providerLowestVersion = 1;
|
|
@ -1,58 +0,0 @@
|
|||
#ifndef INTERFACE_KYMANAGER_PLUGIN_H_
|
||||
#define INTERFACE_KYMANAGER_PLUGIN_H_
|
||||
|
||||
#include <kyplugin.h>
|
||||
#include <QWidget>
|
||||
|
||||
class KyManagerPlugin
|
||||
{
|
||||
public:
|
||||
typedef void(generateReport_t)(std::string name, std::string data);
|
||||
|
||||
virtual ~KyManagerPlugin() = default;
|
||||
|
||||
/* 返回插件名 */
|
||||
virtual std::string name() = 0;
|
||||
/* 返回插件中文名 */
|
||||
virtual std::string nameCN() = 0;
|
||||
/* 返回插件描述 */
|
||||
virtual std::string description() = 0;
|
||||
/* 插件界面指针 */
|
||||
virtual QWidget *createWidget() = 0;
|
||||
|
||||
/* 由插件管理器调用 , 用于给 generateReport 赋值 */
|
||||
void setGenerateReportCb(generateReport_t *point)
|
||||
{
|
||||
generateReport = point;
|
||||
}
|
||||
|
||||
protected:
|
||||
/* 用于插件回调 , 生成结果报告 */
|
||||
generateReport_t *generateReport = nullptr;
|
||||
};
|
||||
|
||||
|
||||
class KyManagerPluginProvider : public kyplugin::Provider
|
||||
{
|
||||
public:
|
||||
virtual KyManagerPlugin *create() const = 0;
|
||||
|
||||
unsigned int getVersion() const
|
||||
{
|
||||
return providerVersion;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class kyplugin::KyPlugin;
|
||||
|
||||
std::string kypluginGetType() const
|
||||
{
|
||||
return providerType;
|
||||
}
|
||||
|
||||
static const unsigned int providerVersion;
|
||||
static const unsigned int providerLowestVersion;
|
||||
static const std::string providerType;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,9 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(internal)
|
||||
|
||||
set(CMAKE_AUTORCC OFF)
|
||||
set(CMAKE_AUTOMCC OFF)
|
||||
set(CMAKE_AUTOUIC OFF)
|
||||
|
||||
add_subdirectory(kyplugin)
|
|
@ -1,15 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(kyplugin LANGUAGES CXX)
|
||||
|
||||
add_library(${PROJECT_NAME} SHARED)
|
||||
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -g)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE dl)
|
||||
|
||||
file(GLOB SRCS
|
||||
# "*.cpp"
|
||||
"*.h")
|
||||
|
||||
target_sources(${PROJECT_NAME} PRIVATE ${SRCS})
|
|
@ -1,18 +0,0 @@
|
|||
#ifndef KYPLUGIN_DIR_H_
|
||||
#define KYPLUGIN_DIR_H_
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
||||
namespace kyplugin
|
||||
{
|
||||
namespace dir
|
||||
{
|
||||
|
||||
void listFiles(std::list<std::string> &list, const std::string &folder, const std::string &extension = "",
|
||||
bool recursive = false);
|
||||
|
||||
} // namespace dir
|
||||
} // namespace kyplugin
|
||||
|
||||
#endif
|
|
@ -1,26 +0,0 @@
|
|||
#ifndef KYPLUGIN_DLIBRARY_H_
|
||||
#define KYPLUGIN_DLIBRARY_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace kyplugin
|
||||
{
|
||||
|
||||
class DLibrary
|
||||
{
|
||||
public:
|
||||
~DLibrary();
|
||||
|
||||
static DLibrary *load(const std::string &path);
|
||||
void *getSymbol(const std::string &symbol);
|
||||
|
||||
private:
|
||||
void *m_handle;
|
||||
|
||||
DLibrary();
|
||||
DLibrary(void *handle);
|
||||
};
|
||||
|
||||
} // namespace kyplugin
|
||||
|
||||
#endif
|
|
@ -1,55 +0,0 @@
|
|||
#ifndef KYPLUGIN_HOST_H_
|
||||
#define KYPLUGIN_HOST_H_
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
#include "provider.h"
|
||||
|
||||
namespace kyplugin
|
||||
{
|
||||
|
||||
class Host
|
||||
{
|
||||
friend class PluginManager;
|
||||
friend class Provider;
|
||||
|
||||
public:
|
||||
bool add(Provider *provider);
|
||||
|
||||
private:
|
||||
Host();
|
||||
~Host();
|
||||
|
||||
bool knows(const std::string &type) const;
|
||||
unsigned int getVersion(const std::string &type) const;
|
||||
unsigned int getLowestVersion(const std::string &type) const;
|
||||
void registerType(const std::string &type, unsigned int version, unsigned int lowestVersion);
|
||||
const std::list<Provider *> *getProviders(const std::string &type) const;
|
||||
void clearProviders();
|
||||
bool validateProvider(Provider *provider) const;
|
||||
bool registerProvider(Provider *provider);
|
||||
void cancelAddictions();
|
||||
bool confirmAddictions();
|
||||
|
||||
private:
|
||||
struct ProviderInfo
|
||||
{
|
||||
unsigned int version; /* 主机方的版本 */
|
||||
unsigned int lowestVersion; /* 主机方的最低兼容版本 */
|
||||
std::list<Provider *> providers;
|
||||
};
|
||||
|
||||
typedef std::map<std::string, ProviderInfo> providersMap;
|
||||
typedef std::map<std::string, std::list<Provider *>> tempProvidersMap;
|
||||
|
||||
/* 注册类型 Map 表 */
|
||||
providersMap m_knownTypes;
|
||||
/* 临时添加的 providers */
|
||||
tempProvidersMap m_addRequests;
|
||||
};
|
||||
|
||||
} // namespace kyplugin
|
||||
|
||||
#endif
|
|
@ -1,51 +0,0 @@
|
|||
#ifndef KYPLUGIN_KYPLUGIN_H_
|
||||
#define KYPLUGIN_KYPLUGIN_H_
|
||||
|
||||
#include "provider.h"
|
||||
#include "plugin_manager.h"
|
||||
|
||||
namespace kyplugin
|
||||
{
|
||||
|
||||
class KyPlugin : public PluginManager
|
||||
{
|
||||
public:
|
||||
KyPlugin();
|
||||
|
||||
template <typename ProviderType> void acceptProviderType();
|
||||
template <typename ProviderType> void getProviders(std::vector<ProviderType *> &providers);
|
||||
|
||||
static void generateReport(std::string name, std::string data);
|
||||
static std::string exportReport(void);
|
||||
|
||||
private:
|
||||
static std::map<std::string, std::string> m_report;
|
||||
|
||||
static std::string generateReportHead(std::string name);
|
||||
};
|
||||
|
||||
template <typename ProviderType> void KyPlugin::acceptProviderType()
|
||||
{
|
||||
PluginManager::registerType(ProviderType::providerType, ProviderType::providerLowestVersion,
|
||||
ProviderType::providerVersion);
|
||||
}
|
||||
|
||||
template <typename ProviderType> void KyPlugin::getProviders(std::vector<ProviderType *> &providers)
|
||||
{
|
||||
const std::list<Provider *> *lst = PluginManager::getProviders(ProviderType::providerType);
|
||||
if (!lst) {
|
||||
return;
|
||||
}
|
||||
|
||||
providers.reserve(providers.size() + lst->size());
|
||||
std::list<Provider *>::const_iterator it;
|
||||
for (it = lst->begin(); it != lst->end(); ++it) {
|
||||
providers.push_back(static_cast<ProviderType *>(*it));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
} // namespace kyplugin
|
||||
|
||||
#endif
|
|
@ -1,49 +0,0 @@
|
|||
#ifndef KYPLUGIN_MANAGER_H_
|
||||
#define KYPLUGIN_MANAGER_H_
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#include "host.h"
|
||||
|
||||
namespace kyplugin
|
||||
{
|
||||
|
||||
class DLibrary;
|
||||
|
||||
class PluginManager
|
||||
{
|
||||
public:
|
||||
~PluginManager();
|
||||
|
||||
bool load(const std::string &path);
|
||||
bool load(const std::string &folder, const std::string &pluginName);
|
||||
int loadFromFolder(const std::string &folder, bool recursive = false);
|
||||
bool unload(const std::string &pluginName);
|
||||
void unloadAll();
|
||||
bool addProvider(Provider *provider);
|
||||
void getLoadedPlugins(std::vector<const std::string *> &pluginNames) const;
|
||||
bool isLoaded(const std::string &pluginName) const;
|
||||
|
||||
protected:
|
||||
PluginManager();
|
||||
void registerType(const std::string &type, unsigned int version, unsigned int lowestVersion);
|
||||
const std::list<Provider *> *getProviders(const std::string &type) const;
|
||||
|
||||
private:
|
||||
static std::string getPluginName(const std::string &path);
|
||||
static std::string resolvePathExtension(const std::string &path);
|
||||
|
||||
typedef bool fnRegisterPlugin(Host &);
|
||||
typedef std::map<std::string, DLibrary *> libMap;
|
||||
|
||||
libMap m_libraries;
|
||||
|
||||
/* Host 类为友元类 */
|
||||
/* 处理所有的 provider */
|
||||
Host m_host;
|
||||
};
|
||||
|
||||
} // namespace kyplugin
|
||||
|
||||
#endif
|
|
@ -1,26 +0,0 @@
|
|||
#ifndef KYPLUGIN_PROVIDER_H_
|
||||
#define KYPLUGIN_PROVIDER_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace kyplugin
|
||||
{
|
||||
|
||||
class Host;
|
||||
|
||||
class Provider
|
||||
{
|
||||
friend class Host;
|
||||
|
||||
public:
|
||||
virtual ~Provider();
|
||||
virtual unsigned int getVersion() const = 0;
|
||||
bool isCompatible(const Host &host) const;
|
||||
|
||||
private:
|
||||
virtual std::string kypluginGetType() const = 0;
|
||||
};
|
||||
|
||||
} // namespace kyplugin
|
||||
|
||||
#endif
|
|
@ -1,92 +0,0 @@
|
|||
//
|
||||
// Created by sqp on 2022/4/21.
|
||||
//
|
||||
|
||||
#include <QLibraryInfo>
|
||||
#include <QTranslator>
|
||||
#include <QMessageBox>
|
||||
#include "mobileplugin.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
namespace KyManagerMobilePlugin
|
||||
{
|
||||
|
||||
const QString VERSION = "1.0.9";
|
||||
|
||||
void installTranslator()
|
||||
{
|
||||
// 加载自定义翻译文件
|
||||
QString tranPath("/usr/share/kylin-mobile-assistant/translations/");
|
||||
QTranslator *tran = new QTranslator;
|
||||
if (tran->load(QLocale(), QString("kylin-mobile-assistant"), QString("_"), tranPath)) {
|
||||
QApplication::installTranslator(tran);
|
||||
} else {
|
||||
qWarning() << "Waring : load translation file fail";
|
||||
}
|
||||
|
||||
// 加载qt翻译文件, 更改fileDialog英文
|
||||
QString qtTransPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||
QTranslator *tranQt = new QTranslator;
|
||||
if (tranQt->load(QLocale(), QString("qt"), QString("_"), qtTransPath)) {
|
||||
QApplication::installTranslator(tranQt);
|
||||
} else {
|
||||
qWarning() << "Waring : load qt translation file fail";
|
||||
}
|
||||
}
|
||||
|
||||
bool initVLC()
|
||||
{
|
||||
QFileInfo file("/bin/vlc");
|
||||
return file.isExecutable();
|
||||
}
|
||||
|
||||
|
||||
std::string MobilePlugin::name()
|
||||
{
|
||||
return "Plugin-MultiTerminal";
|
||||
}
|
||||
|
||||
std::string MobilePlugin::nameCN()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string MobilePlugin::description()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
QWidget *MobilePlugin::createWidget()
|
||||
{
|
||||
|
||||
// set env
|
||||
#ifdef Q_OS_LINUX
|
||||
qputenv("ADB_PATH", "/usr/lib/android-sdk/platform-tools/adb");
|
||||
qputenv("SERVER_PATH", "/usr/share/kylin-mobile-assistant/scrcpy-server.jar");
|
||||
qputenv("CONFIG_PATH", "/usr/share/kylin-mobile-assistant/config");
|
||||
qputenv("KEYMAP_PATH", "/usr/share/kylin-mobile-assistant/keymap");
|
||||
#endif
|
||||
// qInstallMessageHandler(kdk::kabase::Log::logOutput);
|
||||
// 加载翻译
|
||||
// installTranslator();
|
||||
if (!initVLC()) {
|
||||
qCritical() << "vlc not installed!";
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(QObject::tr(
|
||||
"In order to ensure the normal operation of the program, please install the VLC program first!"));
|
||||
msgBox.setIcon(QMessageBox::Critical);
|
||||
msgBox.exec();
|
||||
return nullptr;
|
||||
}
|
||||
// update version
|
||||
qApp->setApplicationVersion(VERSION);
|
||||
// MainWindow *mobileWidget = new MainWindow();
|
||||
// return MobileWidget::getInstance();
|
||||
return MainWindow::getInstance();
|
||||
}
|
||||
|
||||
KyManagerPlugin *PluginProvider::create() const
|
||||
{
|
||||
return new MobilePlugin();
|
||||
}
|
||||
} // namespace KyManagerMobilePlugin
|
|
@ -1,38 +0,0 @@
|
|||
//
|
||||
// Created by sqp on 2022/4/21.
|
||||
//
|
||||
|
||||
#ifndef KYLIN_OS_MANAGER_MOBILEPLUGIN_H
|
||||
#define KYLIN_OS_MANAGER_MOBILEPLUGIN_H
|
||||
|
||||
#include "kymanager_plugin.h"
|
||||
|
||||
namespace KyManagerMobilePlugin
|
||||
{
|
||||
class MobilePlugin : public KyManagerPlugin
|
||||
{
|
||||
virtual ~MobilePlugin() {};
|
||||
|
||||
/* 返回插件名 */
|
||||
virtual std::string name();
|
||||
|
||||
/* 返回插件中文名 */
|
||||
virtual std::string nameCN();
|
||||
|
||||
/* 返回插件描述 */
|
||||
virtual std::string description();
|
||||
|
||||
/* 插件界面指针 */
|
||||
virtual QWidget *createWidget();
|
||||
};
|
||||
|
||||
class PluginProvider : public KyManagerPluginProvider
|
||||
{
|
||||
public:
|
||||
KyManagerPlugin *create() const;
|
||||
};
|
||||
} // namespace KyManagerMobilePlugin
|
||||
|
||||
|
||||
|
||||
#endif // KYLIN_OS_MANAGER_MOBILEPLUGIN_H
|
|
@ -0,0 +1,35 @@
|
|||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
project(peony-send-to-connectivity)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(RIGHTSEND_SOURCES
|
||||
send-to-connectivity.cpp
|
||||
send-to-connectivity.h
|
||||
send-to-connectivity_global.h
|
||||
)
|
||||
|
||||
add_library(peony-send-to-connectivity SHARED ${RIGHTSEND_SOURCES})
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output/lib/plugin)
|
||||
|
||||
find_package(Qt5DBus COMPONENTS Dbus REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GLIB
|
||||
glib-2.0
|
||||
gobject-2.0
|
||||
gio-2.0
|
||||
)
|
||||
|
||||
|
||||
target_include_directories(peony-send-to-connectivity PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_include_directories(peony-send-to-connectivity PUBLIC /usr/include/peony-qt/)
|
||||
target_include_directories(peony-send-to-connectivity PUBLIC ${GLIB_INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(peony-send-to-connectivity PUBLIC Qt${QT_VERSION_MAJOR}::Widgets)
|
||||
target_link_libraries(peony-send-to-connectivity PUBLIC peony)
|
||||
target_link_libraries(peony-send-to-connectivity PUBLIC ${Qt5DBus_LIBRARIES})
|
||||
target_link_libraries(peony-send-to-connectivity PUBLIC ${GLIB_LIBRARIES})
|
|
@ -2,10 +2,10 @@ QT += widgets dbus
|
|||
|
||||
include(common.pri)
|
||||
|
||||
TARGET = peony-send-to-mobile-assistant
|
||||
TARGET = peony-send-to-connectivity
|
||||
TEMPLATE = lib
|
||||
|
||||
DEFINES += PEONYSENDTOMOBILEASSISTANT_LIBRARY
|
||||
DEFINES += PEONYSENDTOCONNECTIVITY_LIBRARY
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked deprecated (the exact warnings
|
||||
|
@ -23,19 +23,19 @@ PKGCONFIG += peony
|
|||
CONFIG += debug link_pkgconfig plugin
|
||||
|
||||
SOURCES += \
|
||||
send-to-mobile-assistant.cpp
|
||||
send-to-connectivity.cpp
|
||||
|
||||
HEADERS += \
|
||||
send-to-mobile-assistant.h \
|
||||
send-to-mobile-assistant_global.h
|
||||
send-to-connectivity.h \
|
||||
send-to-connectivity_global.h
|
||||
|
||||
TRANSLATIONS += \
|
||||
translations/peony-send-to-mobile-assistant_cs.ts \
|
||||
translations/peony-send-to-mobile-assistant_tr.ts \
|
||||
translations/peony-send-to-mobile-assistant_zh_CN.ts
|
||||
translations/peony-send-to-connectivity_cs.ts \
|
||||
translations/peony-send-to-connectivity_tr.ts \
|
||||
translations/peony-send-to-connectivity_zh_CN.ts
|
||||
|
||||
target.path = $$[QT_INSTALL_LIBS]/peony-extensions
|
||||
INSTALLS += target
|
||||
|
||||
RESOURCES += \
|
||||
peony-send-to-mobile-assistant.qrc
|
||||
peony-send-to-connectivity.qrc
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "send-to-mobile-assistant.h"
|
||||
#include "send-to-connectivity.h"
|
||||
#include <file-info.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
|
@ -39,30 +39,25 @@ using namespace Peony;
|
|||
SendToMobileAssistant::SendToMobileAssistant(QObject *parent) : QObject(parent)
|
||||
{
|
||||
QTranslator *t = new QTranslator(this);
|
||||
t->load("/usr/share/kylin-mobile-assistant/translations/peony-send-to-mobile-assistant_" + QLocale::system().name());
|
||||
t->load("/usr/share/kylin-connectivity/translations/peony-send-to-connectivity_" + QLocale::system().name());
|
||||
QApplication::installTranslator(t);
|
||||
|
||||
m_interface = new QDBusInterface("com.kylin.mobile_assistant",
|
||||
"/com/kylin/mobile_assistant",
|
||||
"com.kylin.mobile_assistant",
|
||||
QDBusConnection::sessionBus());
|
||||
m_interface = new QDBusInterface("com.kylin.connectivity.send", "/com/kylin/connectivity",
|
||||
"com.kylin.connectivity.send", QDBusConnection::sessionBus());
|
||||
}
|
||||
|
||||
QList<QAction*> SendToMobileAssistant::menuActions(Types types, const QString &uri, const QStringList &selectionUris)
|
||||
QList<QAction *> SendToMobileAssistant::menuActions(Types types, const QString &uri, const QStringList &selectionUris)
|
||||
{
|
||||
Q_UNUSED(uri);
|
||||
QList<QAction*> actions;
|
||||
if (types == MenuPluginInterface::DirectoryView || types == MenuPluginInterface::DesktopWindow)
|
||||
{
|
||||
QList<QAction *> actions;
|
||||
if (types == MenuPluginInterface::DirectoryView || types == MenuPluginInterface::DesktopWindow) {
|
||||
if (!selectionUris.isEmpty()) {
|
||||
auto info = FileInfo::fromUri(selectionUris.first());
|
||||
//special type mountable, return
|
||||
if (selectionUris.first().startsWith("computer:///") ||
|
||||
selectionUris.first().startsWith("trash:///") ||
|
||||
selectionUris.first().startsWith("recent:///") ||
|
||||
selectionUris.first().startsWith("filesafe:///") ||
|
||||
info->isVirtual())
|
||||
return actions;
|
||||
// special type mountable, return
|
||||
if (selectionUris.first().startsWith("computer:///") || selectionUris.first().startsWith("trash:///")
|
||||
|| selectionUris.first().startsWith("recent:///") || selectionUris.first().startsWith("filesafe:///")
|
||||
|| info->isVirtual())
|
||||
return actions;
|
||||
|
||||
QStringList pathList;
|
||||
for (auto path : selectionUris) {
|
||||
|
@ -72,7 +67,7 @@ QList<QAction*> SendToMobileAssistant::menuActions(Types types, const QString &u
|
|||
}
|
||||
if (pathList.size() > 0) {
|
||||
if (m_interface->isValid()) {
|
||||
QAction *sendToMobileAssistant = new QAction(tr("send to mobile assistant"));
|
||||
QAction *sendToMobileAssistant = new QAction(tr("send to connectivity"));
|
||||
actions << sendToMobileAssistant;
|
||||
connect(sendToMobileAssistant, &QAction::triggered, [=]() {
|
||||
m_interface->call("setLocalPathList", pathList);
|
|
@ -21,16 +21,17 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef SENDTOMOBILEASSISTANT_H
|
||||
#define SENDTOMOBILEASSISTANT_H
|
||||
#ifndef SENDTOCONNECTIVITY_H
|
||||
#define SENDTOCONNECTIVITY_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
#include <menu-plugin-iface.h>
|
||||
#include <QDBusInterface>
|
||||
#include "send-to-mobile-assistant_global.h"
|
||||
#include "send-to-connectivity_global.h"
|
||||
|
||||
namespace Peony {
|
||||
namespace Peony
|
||||
{
|
||||
|
||||
class PEONYQTENGRAMPAMENUPLUGINSHARED_EXPORT SendToMobileAssistant : public QObject, public MenuPluginInterface
|
||||
{
|
||||
|
@ -40,13 +41,34 @@ class PEONYQTENGRAMPAMENUPLUGINSHARED_EXPORT SendToMobileAssistant : public QObj
|
|||
public:
|
||||
explicit SendToMobileAssistant(QObject *parent = nullptr);
|
||||
|
||||
QString testPlugin() override {return "";}
|
||||
bool isEnable() override {return m_enable;}
|
||||
void setEnable(bool enable) override {m_enable = enable;}
|
||||
const QString description() override {return tr("Send to a mobile assistant");}
|
||||
const QString name() override {return "Peony Qt Send to a mobile assistant";}
|
||||
const QIcon icon() override {return QIcon::fromTheme("");}
|
||||
PluginInterface::PluginType pluginType() override {return PluginInterface::MenuPlugin;}
|
||||
QString testPlugin() override
|
||||
{
|
||||
return "";
|
||||
}
|
||||
bool isEnable() override
|
||||
{
|
||||
return m_enable;
|
||||
}
|
||||
void setEnable(bool enable) override
|
||||
{
|
||||
m_enable = enable;
|
||||
}
|
||||
const QString description() override
|
||||
{
|
||||
return tr("Send to a connectivity");
|
||||
}
|
||||
const QString name() override
|
||||
{
|
||||
return "Peony Qt Send to a mobile assistant";
|
||||
}
|
||||
const QIcon icon() override
|
||||
{
|
||||
return QIcon::fromTheme("");
|
||||
}
|
||||
PluginInterface::PluginType pluginType() override
|
||||
{
|
||||
return PluginInterface::MenuPlugin;
|
||||
}
|
||||
|
||||
QList<QAction *> menuActions(Types types, const QString &uri, const QStringList &selectionUris) override;
|
||||
|
||||
|
@ -56,6 +78,6 @@ private:
|
|||
QDBusInterface *m_interface = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace Peony
|
||||
|
||||
#endif // SENDTOMOBILEASSISTANT_H
|
||||
#endif // SENDTOCONNECTIVITY_H
|
|
@ -25,10 +25,10 @@
|
|||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if defined(PEONYSENDTOMOBILEASSISTANT_LIBRARY)
|
||||
# define PEONYQTENGRAMPAMENUPLUGINSHARED_EXPORT Q_DECL_EXPORT
|
||||
#if defined(PEONYSENDTOCONNECTIVITY_LIBRARY)
|
||||
#define PEONYQTENGRAMPAMENUPLUGINSHARED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define PEONYQTENGRAMPAMENUPLUGINSHARED_EXPORT Q_DECL_IMPORT
|
||||
#define PEONYQTENGRAMPAMENUPLUGINSHARED_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // PEONYQTENGRAMPAMENUPLUGIN_GLOBAL_H
|
|
@ -1,36 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||
project(peony-send-to-mobile-assistant)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
set(RIGHTSEND_SOURCES
|
||||
send-to-mobile-assistant.cpp
|
||||
send-to-mobile-assistant.h
|
||||
send-to-mobile-assistant_global.h
|
||||
)
|
||||
|
||||
add_library(peony-send-to-mobile-assistant SHARED ${RIGHTSEND_SOURCES})
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output/lib/plugin)
|
||||
|
||||
find_package(Qt5DBus COMPONENTS Dbus REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GLIB
|
||||
glib-2.0
|
||||
gobject-2.0
|
||||
gio-2.0
|
||||
)
|
||||
|
||||
|
||||
target_include_directories(peony-send-to-mobile-assistant PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_include_directories(peony-send-to-mobile-assistant PUBLIC /usr/include/peony-qt/)
|
||||
target_include_directories(peony-send-to-mobile-assistant PUBLIC ${GLIB_INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(peony-send-to-mobile-assistant PUBLIC Qt${QT_VERSION_MAJOR}::Widgets)
|
||||
target_link_libraries(peony-send-to-mobile-assistant PUBLIC peony)
|
||||
target_link_libraries(peony-send-to-mobile-assistant PUBLIC ${Qt5DBus_LIBRARIES})
|
||||
target_link_libraries(peony-send-to-mobile-assistant PUBLIC ${GLIB_LIBRARIES})
|
||||
#target_link_libraries(peony-send-to-mobile-assistant PUBLIC mobile_common)
|
|
@ -30,9 +30,9 @@
|
|||
#include <QEventLoop>
|
||||
#include <QTimer>
|
||||
|
||||
#define KYLIN_MOBILE_PATH "/"
|
||||
#define KYLIN_MOBILE_SERVICE "com.kylinos.Multiterminal.Manager"
|
||||
#define KYLIN_MOBILE_INTERFACE "com.kylinos.Multiterminal.Manager"
|
||||
#define KYLIN_CONNECTIVITY_PATH "/"
|
||||
#define KYLIN_CONNECTIVITY_SERVICE "com.kylinos.Multiterminal.Manager"
|
||||
#define KYLIN_CONNECTIVITY_INTERFACE "com.kylinos.Multiterminal.Manager"
|
||||
|
||||
MultVfsDbusInterface *MultVfsDbusInterface::getInstance()
|
||||
{
|
||||
|
@ -56,8 +56,8 @@ MultVfsDbusInterface::~MultVfsDbusInterface()
|
|||
|
||||
void MultVfsDbusInterface::initDbusData()
|
||||
{
|
||||
m_sessionBusInterface = new QDBusInterface(KYLIN_MOBILE_SERVICE, KYLIN_MOBILE_PATH, KYLIN_MOBILE_INTERFACE,
|
||||
QDBusConnection::sessionBus());
|
||||
m_sessionBusInterface = new QDBusInterface(KYLIN_CONNECTIVITY_SERVICE, KYLIN_CONNECTIVITY_PATH,
|
||||
KYLIN_CONNECTIVITY_INTERFACE, QDBusConnection::sessionBus());
|
||||
|
||||
QObject::connect(m_sessionBusInterface, SIGNAL(sigFileInfoList(FileInfoList)), this,
|
||||
SLOT(slotFileInfoList(FileInfoList)));
|
||||
|
|
|
@ -17,16 +17,16 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
|||
|
||||
!system($$PWD/translations/generate_translations_pm.sh): error("Failed to generate pm")
|
||||
|
||||
TRANSLATIONS += $$PWD/translations/kylin-mobile-assistant_en.ts \
|
||||
TRANSLATIONS += $$PWD/translations/kylin-connectivity_en.ts \
|
||||
translations/peony-vfs-kylin-multiterminal_zh_CN.ts
|
||||
QM_FILES_INSTALL_PATH = /usr/share/kylin-mobile-assistant/translations/
|
||||
QM_FILES_INSTALL_PATH = /usr/share/kylin-connectivity/translations/
|
||||
|
||||
target.source += $$TARGET
|
||||
#target.path = /usr/lib/peony-qt-extensions
|
||||
target.path = $$[QT_INSTALL_LIBS]/peony-extensions
|
||||
|
||||
translationsFiles.files += $$PWD/translations/*.qm
|
||||
translationsFiles.path = /usr/share/kylin-mobile-assistant/translations/
|
||||
translationsFiles.path = /usr/share/kylin-connectivity/translations/
|
||||
|
||||
INSTALLS += target \
|
||||
translationsFiles
|
||||
|
|
|
@ -32,7 +32,7 @@ Peony::MultVFSInternalPlugin *global_instance = nullptr;
|
|||
PeonyVFSMult::PeonyVFSMult(QObject *parent) : QObject(parent)
|
||||
{
|
||||
QTranslator *t = new QTranslator(this);
|
||||
t->load("/usr/share/kylin-mobile-assistant/translations/peony-vfs-kylin-multiterminal_" + QLocale::system().name());
|
||||
t->load("/usr/share/kylin-connectivity/translations/peony-vfs-kylin-multiterminal_" + QLocale::system().name());
|
||||
QApplication::installTranslator(t);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
#! /bin/bash
|
||||
pwd
|
||||
ts_file_list=(`ls $1/translations/*.ts`)
|
||||
|
||||
for ts in "${ts_file_list[@]}"
|
||||
do
|
||||
lrelease "${ts}"
|
||||
done
|
Before Width: | Height: | Size: 289 KiB After Width: | Height: | Size: 289 KiB |
|
@ -20,7 +20,7 @@
|
|||
<file>icon/refresh.png</file>
|
||||
<file>icon/videoIcon.png</file>
|
||||
<file>icon/weChatIcon.png</file>
|
||||
<file>icon/kylin-mobile-assistant.png</file>
|
||||
<file>icon/kylin-connectivity.png</file>
|
||||
<file>loadicon/1.png</file>
|
||||
<file>loadicon/2.png</file>
|
||||
<file>loadicon/3.png</file>
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
<context>
|
||||
<name>Peony::SendToMobileAssistant</name>
|
||||
<message>
|
||||
<location filename="../send-to-mobile-assistant.cpp" line="84"/>
|
||||
<source>send to mobile assistant</source>
|
||||
<location filename="../send-to-connectivity.cpp" line="84"/>
|
||||
<source>send to connectivity</source>
|
||||
<translation>发送到多端协同</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../send-to-mobile-assistant.h" line="45"/>
|
||||
<source>Send to a mobile assistant</source>
|
||||
<location filename="../send-to-connectivity.h" line="45"/>
|
||||
<source>Send to a connectivity</source>
|
||||
<translation>发送到多端协同</translation>
|
||||
</message>
|
||||
</context>
|
|
@ -13,14 +13,14 @@
|
|||
#include "generatetools.h"
|
||||
#include "config.h"
|
||||
|
||||
#define KYLIN_MOBILE_MOUNTFTP_PATH "/"
|
||||
#define KYLIN_MOBILE_MOUNTFTP_SERVICE "com.kylin.mobile.assistant.mountftp"
|
||||
#define KYLIN_MOBILE_MOUNTFTP_INTERFACE "com.kylin.mobile.assistant.mountftp"
|
||||
const QString DISC_SERVER_PATH = "/opt/kylin-mobile-assistant/mobile_softbus_server";
|
||||
const QString DISC_CLIENT_PATH = "/opt/kylin-mobile-assistant/mobile_softbus_client";
|
||||
const QString FILE_DOWN_PATH = getenv("HOME") + QString("/.mobilecache/cache/");
|
||||
#define KYLIN_CONNECTIVITY_MANAGER_PATH "/"
|
||||
#define KYLIN_CONNECTIVITY_MANAGER_SERVICE "com.kylin.connectivity.manager"
|
||||
#define KYLIN_CONNECTIVITY_MANAGER_INTERFACE "com.kylin.connectivity.manager"
|
||||
const QString DISC_SERVER_PATH = "/opt/kylin-connectivity/mobile_softbus_server";
|
||||
const QString DISC_CLIENT_PATH = "/opt/kylin-connectivity/mobile_softbus_client";
|
||||
const QString FILE_DOWN_PATH = getenv("HOME") + QString("/.connectivitycache/cache/");
|
||||
const QString TEMP_DOWN_PATH = "/temp/";
|
||||
const QString FILE_PATH_PCSEARCH = QString("/.mobilecache/pcsearchInfo.db");
|
||||
const QString FILE_PATH_PCSEARCH = QString("/.connectivitycache/pcsearchInfo.db");
|
||||
|
||||
const int USBPORT = 27183;
|
||||
const int WIFIPORT = 27186;
|
||||
|
@ -163,8 +163,8 @@ void MainWindow::initService()
|
|||
m_pcScreen = new PcScreenManage;
|
||||
connect(m_pcScreen, &PcScreenManage::sigRequestReceived, this, &MainWindow::slotRequestReceived);
|
||||
|
||||
m_dbusInterface = new QDBusInterface(KYLIN_MOBILE_MOUNTFTP_SERVICE, KYLIN_MOBILE_MOUNTFTP_PATH,
|
||||
KYLIN_MOBILE_MOUNTFTP_INTERFACE, QDBusConnection::systemBus(), this);
|
||||
m_dbusInterface = new QDBusInterface(KYLIN_CONNECTIVITY_MANAGER_SERVICE, KYLIN_CONNECTIVITY_MANAGER_PATH,
|
||||
KYLIN_CONNECTIVITY_MANAGER_INTERFACE, QDBusConnection::systemBus(), this);
|
||||
QObject::connect(m_dbusInterface, SIGNAL(sigMountError(bool, QString)), this, SLOT(slotMountError(bool, QString)));
|
||||
QObject::connect(m_dbusInterface, SIGNAL(sigInitDiscServer(bool)), this, SLOT(slotInitDiscServerResult(bool)));
|
||||
}
|
||||
|
@ -193,11 +193,11 @@ void MainWindow::initGsetting(void)
|
|||
void MainWindow::initDbus()
|
||||
{
|
||||
QDBusConnection sessionBus = QDBusConnection::sessionBus();
|
||||
if (!sessionBus.registerService(KYLIN_MOBILE_ASSISTANT_DBUS_SERVICE)) {
|
||||
if (!sessionBus.registerService(KYLIN_CONNECTIVITY_SEND_SERVICE)) {
|
||||
qInfo() << "init dbus fail...";
|
||||
return;
|
||||
}
|
||||
sessionBus.registerObject(KYLIN_MOBILE_ASSISTANT_DBUS_PATH, this, QDBusConnection::ExportAllSlots);
|
||||
sessionBus.registerObject(KYLIN_CONNECTIVITY_SEND_PATH, this, QDBusConnection::ExportAllSlots);
|
||||
}
|
||||
|
||||
void MainWindow::disconnectScreen()
|
||||
|
@ -448,8 +448,8 @@ void MainWindow::updateResult()
|
|||
QList<FileInfo> list;
|
||||
m_fileSyncManage->getClassifiedFileList(m_downFileType, list);
|
||||
if (m_downFileType == FileSyncManage::LIST_TYPE::TYPE_MUSIC
|
||||
|| m_downFileType == FileSyncManage::LIST_TYPE::TYPE_QQ_MUSIC
|
||||
|| m_downFileType == FileSyncManage::LIST_TYPE::TYPE_WECHAT_MUSIC) {
|
||||
|| m_downFileType == FileSyncManage::LIST_TYPE::TYPE_QQ_MUSIC
|
||||
|| m_downFileType == FileSyncManage::LIST_TYPE::TYPE_WECHAT_MUSIC) {
|
||||
m_listItemWidget->setMusicData(list);
|
||||
} else if (m_downFileType == FileSyncManage::LIST_TYPE::TYPE_DOCUMENT
|
||||
|| m_downFileType == FileSyncManage::LIST_TYPE::TYPE_QQ_DOCUMENT
|
||||
|
@ -927,7 +927,7 @@ void MainWindow::slotMountError(bool isMount, QString error)
|
|||
|
||||
void MainWindow::slotAboutWinShow()
|
||||
{
|
||||
// kylin-mobile-assistant Version:
|
||||
// kylin-connectivity Version:
|
||||
m_aboutWindow =
|
||||
new kdk::KAboutDialog(this, QIcon::fromTheme("kylin-multi-collaboration"), QString(tr("kylin-connectivity")),
|
||||
tr("Version:") + qApp->applicationVersion());
|
||||
|
@ -1293,7 +1293,7 @@ void MainWindow::slotItemButtonClicked(int text)
|
|||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantQQFileList);
|
||||
}
|
||||
m_downFileType = FileSyncManage::LIST_TYPE::TYPE_FILE_NUM;
|
||||
// m_winFlage = WIN_FLAGE::WIN_INIT_QQWECHAT;
|
||||
// m_winFlage = WIN_FLAGE::WIN_INIT_QQWECHAT;
|
||||
m_mobileFileSecondWidget = new MobileFileSecondWidget(text);
|
||||
//设置图片时间线的数据
|
||||
m_stackedMobileFileListWin->addWidget(m_mobileFileSecondWidget);
|
||||
|
@ -1436,15 +1436,15 @@ void MainWindow::slotShowMobileFileSecondWidget(int indexPath)
|
|||
|
||||
void MainWindow::slotShowMobileStorage()
|
||||
{
|
||||
deleteMobileListWidget();
|
||||
m_currentPath = "Home page";
|
||||
if (m_connectInfo.deviceType == ConnectionService::DeviceType::ANDROID) {
|
||||
m_stackedMobileFileListWin->setCurrentIndex(0);
|
||||
} else {
|
||||
int index = m_mainStackedWin->currentIndex();
|
||||
m_mainStackedWin->setCurrentIndex(index - 1);
|
||||
m_mainStackedWin->removeWidget(m_mainStackedWin->widget(index));
|
||||
}
|
||||
deleteMobileListWidget();
|
||||
m_currentPath = "Home page";
|
||||
if (m_connectInfo.deviceType == ConnectionService::DeviceType::ANDROID) {
|
||||
m_stackedMobileFileListWin->setCurrentIndex(0);
|
||||
} else {
|
||||
int index = m_mainStackedWin->currentIndex();
|
||||
m_mainStackedWin->setCurrentIndex(index - 1);
|
||||
m_mainStackedWin->removeWidget(m_mainStackedWin->widget(index));
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::slotChooseFilePath(QString chooseFilePath, const QList<FileInfo> &selectFileNameList)
|
||||
|
|
|
@ -46,9 +46,9 @@
|
|||
#include "dirmanager.h"
|
||||
#include "publicattributes.hpp"
|
||||
|
||||
#define KYLIN_MOBILE_ASSISTANT_DBUS_SERVICE "com.kylin.mobile_assistant"
|
||||
#define KYLIN_MOBILE_ASSISTANT_DBUS_PATH "/com/kylin/mobile_assistant"
|
||||
#define KYLIN_MOBILE_ASSISTANT_DBUS_INTERFACE "com.kylin.mobile_assistant"
|
||||
#define KYLIN_CONNECTIVITY_SEND_SERVICE "com.kylin.connectivity.send"
|
||||
#define KYLIN_CONNECTIVITY_SEND_PATH "/com/kylin/connectivity"
|
||||
#define KYLIN_CONNECTIVITY_SEND_INTERFACE "com.kylin.connectivity.send"
|
||||
|
||||
const QString MOUNT_DIR = "/var/lib/mult";
|
||||
|
||||
|
@ -58,7 +58,7 @@ using namespace fineftp;
|
|||
class MainWindow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", KYLIN_MOBILE_ASSISTANT_DBUS_INTERFACE)
|
||||
Q_CLASSINFO("D-Bus Interface", KYLIN_CONNECTIVITY_SEND_INTERFACE)
|
||||
public:
|
||||
static MainWindow *getInstance();
|
||||
|
||||
|
|