Merge branch 'upstream' into openkylin/yangtze
This commit is contained in:
commit
a41a989e5e
|
@ -115,15 +115,11 @@ void ConnectionService::setConnectionRespond(bool isAgree)
|
|||
file.close();
|
||||
}
|
||||
m_androidConnType = AndroidConnType::ADB;
|
||||
sendDeviceInfo();
|
||||
Q_EMIT sigConnectInfo(m_connectInfo);
|
||||
connectHeartbeat();
|
||||
handleConnected();
|
||||
}
|
||||
} else {
|
||||
// 已同意连接,向客户端发送设备信息
|
||||
sendDeviceInfo();
|
||||
Q_EMIT sigConnectInfo(m_connectInfo);
|
||||
connectHeartbeat();
|
||||
handleConnected();
|
||||
}
|
||||
} else {
|
||||
// 拒绝
|
||||
|
@ -556,6 +552,9 @@ void ConnectionService::onHeartbeatReadyRead()
|
|||
sendHeartbeat(true);
|
||||
} else {
|
||||
// 当前为服务端端,收到客户端心跳回复,重置标志位
|
||||
#ifdef NDEBUG
|
||||
qDebug() << "receive heartbeat<<<<<<<<<<<<<<<<<<<<<<<<<<<";
|
||||
#endif // !NDEBUG
|
||||
m_isAgainSendHeartbeat = true;
|
||||
m_isSurvival = true;
|
||||
}
|
||||
|
@ -627,9 +626,7 @@ void ConnectionService::onAdbExec(AdbProcess::ADB_EXEC_RESULT processResult)
|
|||
qInfo() << "Currently, there are multiple wired devices, and WiFi anti control is not supported "
|
||||
"temporarily!";
|
||||
m_androidConnType = AndroidConnType::CONNECTWIFI;
|
||||
sendDeviceInfo();
|
||||
Q_EMIT sigConnectInfo(m_connectInfo);
|
||||
connectHeartbeat();
|
||||
handleConnected();
|
||||
} else {
|
||||
// 不存在连接,当前有多个adb设备连接,暂时不处理
|
||||
Q_EMIT sigDeviceRedundancy();
|
||||
|
@ -648,9 +645,7 @@ void ConnectionService::onAdbExec(AdbProcess::ADB_EXEC_RESULT processResult)
|
|||
m_isSupportADB = false;
|
||||
m_androidConnType = AndroidConnType::CONNECTWIFI;
|
||||
}
|
||||
sendDeviceInfo();
|
||||
Q_EMIT sigConnectInfo(m_connectInfo);
|
||||
connectHeartbeat();
|
||||
handleConnected();
|
||||
} else {
|
||||
// 当前为有线设备连接
|
||||
m_connectInfo.connectType = ConnectType::USB;
|
||||
|
@ -935,9 +930,15 @@ void ConnectionService::sendHeartbeat(bool isServer)
|
|||
ReplyMessage replyMessage;
|
||||
std::string str = "";
|
||||
if (isServer) {
|
||||
#ifdef NDEBUG
|
||||
qDebug() << "URGENTSERVER>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
|
||||
#endif // !NDEBUG
|
||||
replyMessage.set_status(ReplyMessage::URGENTSERVER);
|
||||
replyMessage.SerializeToString(&str);
|
||||
} else {
|
||||
#ifdef NDEBUG
|
||||
qDebug() << "URGENTCLIENT>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
|
||||
#endif // !NDEBUG
|
||||
replyMessage.set_status(ReplyMessage::URGENTCLIENT);
|
||||
replyMessage.SerializeToString(&str);
|
||||
}
|
||||
|
@ -955,6 +956,7 @@ void ConnectionService::updateSocketState()
|
|||
if (m_isAgainSendHeartbeat) {
|
||||
// 第一次未收到重发一次
|
||||
m_isAgainSendHeartbeat = false;
|
||||
qInfo() << "No heartbeat was received, and the resend";
|
||||
// 重发一次
|
||||
if (m_heartbeatSocket != nullptr) {
|
||||
sendHeartbeat(!m_isClient);
|
||||
|
@ -975,6 +977,7 @@ void ConnectionService::updateSocketState()
|
|||
|
||||
void ConnectionService::slotHeartbeatConnection()
|
||||
{
|
||||
qInfo() << "The heartbeat channel is already connected";
|
||||
m_heartbeatSocket = m_heartTcpServer->nextPendingConnection();
|
||||
connect(m_heartbeatSocket, &QTcpSocket::readyRead, this, &ConnectionService::onHeartbeatReadyRead);
|
||||
sendHeartbeat(false);
|
||||
|
@ -1102,8 +1105,13 @@ void ConnectionService::handleWifiConnection()
|
|||
qInfo() << "Currently, there is no wired device, and WiFi anti control is not supported temporarily!";
|
||||
m_isSupportADB = false;
|
||||
m_androidConnType = AndroidConnType::CONNECTWIFI;
|
||||
sendDeviceInfo();
|
||||
Q_EMIT sigConnectInfo(m_connectInfo);
|
||||
connectHeartbeat();
|
||||
handleConnected();
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectionService::handleConnected()
|
||||
{
|
||||
sendDeviceInfo();
|
||||
Q_EMIT sigConnectInfo(m_connectInfo);
|
||||
connectHeartbeat();
|
||||
}
|
||||
|
|
|
@ -147,6 +147,7 @@ private:
|
|||
void connectHeartbeat();
|
||||
QString getSocketAddress();
|
||||
void sendHeartbeat(bool isServer);
|
||||
void handleConnected();
|
||||
|
||||
private:
|
||||
// wifi
|
||||
|
|
|
@ -13,8 +13,9 @@
|
|||
|
||||
WifiManager::~WifiManager() {}
|
||||
|
||||
void WifiManager::onPropertiesChanged(QVariantMap map)
|
||||
void WifiManager::onPropertiesChanged(QString str, QVariantMap map)
|
||||
{
|
||||
Q_UNUSED(str);
|
||||
Q_UNUSED(map);
|
||||
QString wifiIP = checkWifiConnectivity();
|
||||
if (!m_wifiIP.isEmpty()) {
|
||||
|
@ -137,6 +138,6 @@ void WifiManager::startWifiInfo()
|
|||
Q_EMIT sigWifiDisconnected();
|
||||
}
|
||||
QDBusConnection::systemBus().connect("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager",
|
||||
"org.freedesktop.NetworkManager", "PropertiesChanged", this,
|
||||
SLOT(onPropertiesChanged(QVariantMap)));
|
||||
"org.freedesktop.DBus.Properties", "PropertiesChanged", this,
|
||||
SLOT(onPropertiesChanged(QString, QVariantMap)));
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public Q_SLOTS:
|
|||
|
||||
void startWifiInfo();
|
||||
|
||||
void onPropertiesChanged(QVariantMap map);
|
||||
void onPropertiesChanged(QString str, QVariantMap map);
|
||||
|
||||
private:
|
||||
QString m_wifiIP = "";
|
||||
|
|
|
@ -51,7 +51,13 @@ FileDataBase::FileDataBase(QString name, QObject *parent) : QObject(parent)
|
|||
}
|
||||
}
|
||||
|
||||
FileDataBase::~FileDataBase() {}
|
||||
FileDataBase::~FileDataBase()
|
||||
{
|
||||
if (m_DataBase.open()) {
|
||||
//关闭数据库
|
||||
m_DataBase.close();
|
||||
}
|
||||
}
|
||||
|
||||
int FileDataBase::insertData(const QList<FileInfo> &fileinfoList)
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ void DirManager::run()
|
|||
list.append(QString(DOCUMENT));
|
||||
list.append(QString(DOWNLOAD));
|
||||
|
||||
qDebug() << "Start updating search database ...";
|
||||
qInfo() << "Start updating search database ...";
|
||||
handleDir(PATH, list);
|
||||
int dataNum = m_dataBase->removeData(m_filePathList);
|
||||
qInfo() << "Deleted " << dataNum << " pieces of data";
|
||||
|
|
|
@ -125,6 +125,7 @@ void FileParSer::getFileInfoList(QString path, QList<FileInfo> &list, QString fl
|
|||
}
|
||||
list.append(fileInfo);
|
||||
}
|
||||
qInfo() << "In total, " << list.size() << " pieces of information were obtained.";
|
||||
file->close();
|
||||
file->deleteLater();
|
||||
file = nullptr;
|
||||
|
|
|
@ -62,6 +62,11 @@ asio::ip::tcp::socket &FtpSession::getSocket()
|
|||
return command_socket_;
|
||||
}
|
||||
|
||||
asio::ip::tcp::acceptor &FtpSession::getAcceptor()
|
||||
{
|
||||
return data_acceptor_;
|
||||
}
|
||||
|
||||
void FtpSession::sendFtpMessage(const FtpMessage &message)
|
||||
{
|
||||
sendRawFtpMessage(message.str());
|
||||
|
@ -322,6 +327,7 @@ void FtpSession::handleFtpCommandPASV(const std::string & /*param*/)
|
|||
}
|
||||
|
||||
if (data_acceptor_.is_open()) {
|
||||
std::cout << "acceptor is open" << std::endl;
|
||||
asio::error_code ec;
|
||||
data_acceptor_.close(ec);
|
||||
if (ec) {
|
||||
|
@ -343,7 +349,13 @@ void FtpSession::handleFtpCommandPASV(const std::string & /*param*/)
|
|||
return;
|
||||
}
|
||||
}
|
||||
data_acceptor_.set_option(asio::ip::tcp::acceptor::reuse_address(true));
|
||||
asio::error_code ec;
|
||||
data_acceptor_.set_option(asio::ip::tcp::acceptor::reuse_address(true), ec);
|
||||
if (ec) {
|
||||
std::cerr << "Error setting reuse_address option: " << ec.message() << std::endl;
|
||||
sendFtpMessage(FtpReplyCode::SERVICE_NOT_AVAILABLE, "Failed to enter passive mode.");
|
||||
return;
|
||||
}
|
||||
{
|
||||
asio::error_code ec;
|
||||
data_acceptor_.bind(endpoint);
|
||||
|
@ -1115,6 +1127,14 @@ void FtpSession::writeDataToSocket(std::shared_ptr<asio::ip::tcp::socket> data_s
|
|||
me->sendFtpMessage(FtpReplyCode::CLOSING_DATA_CONNECTION, "Done");
|
||||
s_freePorts.push(port);
|
||||
data_socket->close();
|
||||
if (me->getAcceptor().is_open()) {
|
||||
std::cout << "acceptor is open" << std::endl;
|
||||
asio::error_code ec;
|
||||
me->getAcceptor().close(ec);
|
||||
if (ec) {
|
||||
std::cerr << "Error closing data acceptor: " << ec.message() << std::endl;
|
||||
}
|
||||
}
|
||||
// delete data_socket;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -48,6 +48,8 @@ public:
|
|||
|
||||
asio::ip::tcp::socket &getSocket();
|
||||
|
||||
asio::ip::tcp::acceptor &getAcceptor();
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
// FTP command-socket
|
||||
////////////////////////////////////////////////////////
|
||||
|
|
|
@ -8,149 +8,145 @@
|
|||
namespace fineftp
|
||||
{
|
||||
|
||||
FtpServerImpl::FtpServerImpl(const std::string& address, uint16_t port)
|
||||
: port_ (port)
|
||||
, address_ (address)
|
||||
, acceptor_ (io_service_)
|
||||
, open_connection_count_(0)
|
||||
{}
|
||||
FtpServerImpl::FtpServerImpl(const std::string &address, uint16_t port)
|
||||
: port_(port), address_(address), acceptor_(io_service_), open_connection_count_(0)
|
||||
{}
|
||||
|
||||
FtpServerImpl::~FtpServerImpl()
|
||||
{
|
||||
FtpServerImpl::~FtpServerImpl()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
||||
bool FtpServerImpl::addUser(const std::string& username, const std::string& password, const std::string& local_root_path, const Permission permissions)
|
||||
{
|
||||
bool FtpServerImpl::addUser(const std::string &username, const std::string &password,
|
||||
const std::string &local_root_path, const Permission permissions)
|
||||
{
|
||||
return ftp_users_.addUser(username, password, local_root_path, permissions);
|
||||
}
|
||||
}
|
||||
|
||||
bool FtpServerImpl::addUserAnonymous(const std::string& local_root_path, const Permission permissions)
|
||||
{
|
||||
bool FtpServerImpl::addUserAnonymous(const std::string &local_root_path, const Permission permissions)
|
||||
{
|
||||
return ftp_users_.addUser("anonymous", "", local_root_path, permissions);
|
||||
}
|
||||
}
|
||||
|
||||
bool FtpServerImpl::start(size_t thread_count)
|
||||
{
|
||||
auto ftp_session = std::make_shared<FtpSession>(io_service_, ftp_users_, [this]() { open_connection_count_--; });
|
||||
bool FtpServerImpl::start(size_t thread_count)
|
||||
{
|
||||
auto ftp_session = std::make_shared<FtpSession>(io_service_, ftp_users_, [this]() {
|
||||
open_connection_count_--;
|
||||
});
|
||||
|
||||
// set up the acceptor to listen on the tcp port
|
||||
asio::error_code make_address_ec;
|
||||
asio::ip::tcp::endpoint endpoint(asio::ip::make_address(address_, make_address_ec), port_);
|
||||
if (make_address_ec)
|
||||
{
|
||||
std::cerr << "Error creating address from string \"" << address_<< "\": " << make_address_ec.message() << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
asio::error_code ec;
|
||||
acceptor_.open(endpoint.protocol(), ec);
|
||||
if (ec)
|
||||
{
|
||||
std::cerr << "Error opening acceptor: " << ec.message() << std::endl;
|
||||
if (make_address_ec) {
|
||||
std::cerr << "Error creating address from string \"" << address_ << "\": " << make_address_ec.message()
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
asio::error_code ec;
|
||||
acceptor_.set_option(asio::ip::tcp::acceptor::reuse_address(true), ec);
|
||||
if (ec)
|
||||
{
|
||||
std::cerr << "Error setting reuse_address option: " << ec.message() << std::endl;
|
||||
return false;
|
||||
}
|
||||
asio::error_code ec;
|
||||
acceptor_.open(endpoint.protocol(), ec);
|
||||
if (ec) {
|
||||
std::cerr << "Error opening acceptor: " << ec.message() << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
asio::error_code ec;
|
||||
acceptor_.bind(endpoint, ec);
|
||||
if (ec)
|
||||
{
|
||||
std::cerr << "Error binding acceptor: " << ec.message() << std::endl;
|
||||
return false;
|
||||
}
|
||||
asio::error_code ec;
|
||||
acceptor_.set_option(asio::ip::tcp::acceptor::reuse_address(true), ec);
|
||||
if (ec) {
|
||||
std::cerr << "Error setting reuse_address option: " << ec.message() << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
asio::error_code ec;
|
||||
acceptor_.listen(asio::socket_base::max_listen_connections, ec);
|
||||
if (ec)
|
||||
{
|
||||
std::cerr << "Error listening on acceptor: " << ec.message() << std::endl;
|
||||
return false;
|
||||
}
|
||||
asio::error_code ec;
|
||||
acceptor_.bind(endpoint, ec);
|
||||
if (ec) {
|
||||
std::cerr << "Error binding acceptor: " << ec.message() << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
asio::error_code ec;
|
||||
acceptor_.listen(asio::socket_base::max_listen_connections, ec);
|
||||
if (ec) {
|
||||
std::cerr << "Error listening on acceptor: " << ec.message() << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
std::cout << "FTP Server created." << std::endl << "Listening at address " << acceptor_.local_endpoint().address() << " on port " << acceptor_.local_endpoint().port() << ":" << std::endl;
|
||||
std::cout << "FTP Server created." << std::endl
|
||||
<< "Listening at address " << acceptor_.local_endpoint().address() << " on port "
|
||||
<< acceptor_.local_endpoint().port() << ":" << std::endl;
|
||||
#endif // NDEBUG
|
||||
|
||||
acceptor_.async_accept(ftp_session->getSocket()
|
||||
, [=](auto ec)
|
||||
{
|
||||
open_connection_count_++;
|
||||
acceptor_.async_accept(ftp_session->getSocket(), [=](auto ec) {
|
||||
open_connection_count_++;
|
||||
|
||||
this->acceptFtpSession(ftp_session, ec);
|
||||
});
|
||||
this->acceptFtpSession(ftp_session, ec);
|
||||
});
|
||||
|
||||
for (size_t i = 0; i < thread_count; i++)
|
||||
{
|
||||
thread_pool_.emplace_back([=] {io_service_.run(); });
|
||||
for (size_t i = 0; i < thread_count; i++) {
|
||||
thread_pool_.emplace_back([=] {
|
||||
io_service_.run();
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void FtpServerImpl::stop()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void FtpServerImpl::stop()
|
||||
{
|
||||
io_service_.stop();
|
||||
for (std::thread& thread : thread_pool_)
|
||||
{
|
||||
thread.join();
|
||||
for (std::thread &thread : thread_pool_) {
|
||||
thread.join();
|
||||
}
|
||||
thread_pool_.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void FtpServerImpl::acceptFtpSession(std::shared_ptr<FtpSession> ftp_session, asio::error_code const& error)
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
void FtpServerImpl::acceptFtpSession(std::shared_ptr<FtpSession> ftp_session, asio::error_code const &error)
|
||||
{
|
||||
if (error) {
|
||||
#ifndef NDEBUG
|
||||
std::cerr << "Error handling connection: " << error.message() << std::endl;
|
||||
std::cerr << "Error handling connection: " << error.message() << std::endl;
|
||||
#endif
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
std::cout << "FTP Client connected: " << ftp_session->getSocket().remote_endpoint().address().to_string() << ":" << ftp_session->getSocket().remote_endpoint().port() << std::endl;
|
||||
std::cout << "FTP Client connected: " << ftp_session->getSocket().remote_endpoint().address().to_string() << ":"
|
||||
<< ftp_session->getSocket().remote_endpoint().port() << std::endl;
|
||||
#endif
|
||||
|
||||
ftp_session->start();
|
||||
|
||||
auto new_session = std::make_shared<FtpSession>(io_service_, ftp_users_, [this]() { open_connection_count_--; });
|
||||
auto new_session = std::make_shared<FtpSession>(io_service_, ftp_users_, [this]() {
|
||||
open_connection_count_--;
|
||||
});
|
||||
|
||||
acceptor_.async_accept(new_session->getSocket()
|
||||
, [=](auto ec)
|
||||
{
|
||||
open_connection_count_++;
|
||||
this->acceptFtpSession(new_session, ec);
|
||||
});
|
||||
}
|
||||
|
||||
int FtpServerImpl::getOpenConnectionCount()
|
||||
{
|
||||
return open_connection_count_;
|
||||
}
|
||||
|
||||
uint16_t FtpServerImpl::getPort()
|
||||
{
|
||||
return acceptor_.local_endpoint().port();
|
||||
}
|
||||
|
||||
std::string FtpServerImpl::getAddress()
|
||||
{
|
||||
return acceptor_.local_endpoint().address().to_string();
|
||||
}
|
||||
acceptor_.async_accept(new_session->getSocket(), [=](auto ec) {
|
||||
open_connection_count_++;
|
||||
this->acceptFtpSession(new_session, ec);
|
||||
});
|
||||
}
|
||||
|
||||
int FtpServerImpl::getOpenConnectionCount()
|
||||
{
|
||||
return open_connection_count_;
|
||||
}
|
||||
|
||||
uint16_t FtpServerImpl::getPort()
|
||||
{
|
||||
return acceptor_.local_endpoint().port();
|
||||
}
|
||||
|
||||
std::string FtpServerImpl::getAddress()
|
||||
{
|
||||
return acceptor_.local_endpoint().address().to_string();
|
||||
}
|
||||
} // namespace fineftp
|
||||
|
|
|
@ -17,19 +17,18 @@ ConnectivityManager::~ConnectivityManager() = default;
|
|||
|
||||
void ConnectivityManager::mountFtp(QString urlStr, QString userName, QString pwd, QString path)
|
||||
{
|
||||
umountFtp(path);
|
||||
m_isMount = true;
|
||||
killMountProcess();
|
||||
QUrl url(urlStr);
|
||||
int uid = getuid();
|
||||
QString common = "curlftpfs -o rw,allow_other,uid=" + QString::number(uid) + " " + url.scheme() + "://" + userName
|
||||
+ ":" + pwd + "@" + url.host() + ":" + QString::number(url.port()) + " " + path;
|
||||
QString common = "curlftpfs -o rw,allow_other,uid=" + QString::number(uid) + " -o nonempty " + url.scheme() + "://"
|
||||
+ userName + ":" + pwd + "@" + url.host() + ":" + QString::number(url.port()) + " " + path;
|
||||
startCommand(common);
|
||||
}
|
||||
|
||||
void ConnectivityManager::umountFtp(QString path)
|
||||
{
|
||||
m_isMount = false;
|
||||
killMountProcess();
|
||||
QString common = "umount -f " + path;
|
||||
startCommand(common);
|
||||
}
|
||||
|
@ -86,11 +85,6 @@ void ConnectivityManager::killProcess(const char *cmd)
|
|||
pclose(fp);
|
||||
}
|
||||
|
||||
void ConnectivityManager::killMountProcess()
|
||||
{
|
||||
killProcess("ps -aux | /var/lib/mult/");
|
||||
}
|
||||
|
||||
void ConnectivityManager::startDiscServer(QString cmd)
|
||||
{
|
||||
qInfo() << "disc softbus init";
|
||||
|
@ -128,5 +122,5 @@ void ConnectivityManager::stopDiscServer()
|
|||
void ConnectivityManager::killServerPortProcess()
|
||||
{
|
||||
killProcess("lsof -i:27189");
|
||||
killProcess("ps -aux | grep mobile_softbus_server");
|
||||
killProcess("ps -aux | grep mobile_softbus");
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ public:
|
|||
private:
|
||||
void startCommand(QString common);
|
||||
void killProcess(const char *cmd);
|
||||
void killMountProcess();
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigMountError(bool, QString);
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.3 KiB |
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="36px" height="36px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>icon/ 36/ 视频</title>
|
||||
<g id="icon/-36/-视频" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<circle id="椭圆形" stroke="#F7F7F7" fill-opacity="0.1" fill="#262626" cx="18" cy="18" r="17.5"></circle>
|
||||
<path d="M15.5547002,11.0364668 L24.7519246,17.1679497 C25.2114532,17.4743022 25.3356271,18.0951715 25.0292747,18.5547002 C24.9560398,18.6645525 24.8617768,18.7588154 24.7519246,18.8320503 L15.5547002,24.9635332 C15.0951715,25.2698857 14.4743022,25.1457118 14.1679497,24.6861831 C14.058438,24.5219156 14,24.3289079 14,24.1314829 L14,11.8685171 C14,11.3162323 14.4477153,10.8685171 15,10.8685171 C15.197425,10.8685171 15.3904327,10.9269551 15.5547002,11.0364668 Z" id="矩形" fill-opacity="0.96" fill="#FFFFFF"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 972 B |
|
@ -65,7 +65,7 @@
|
|||
<file>filemanageview/weChatIcon.png</file>
|
||||
<file>filemanageview/videoIcon.png</file>
|
||||
<file>filemanageview/qqIcon.png</file>
|
||||
<file>filemanageview/play.png</file>
|
||||
<file>filemanageview/play.svg</file>
|
||||
<file>filemanageview/pictureIcon.png</file>
|
||||
<file>filemanageview/musicIcon.png</file>
|
||||
<file>filemanageview/mobileLightIcon.png</file>
|
||||
|
|
|
@ -1,20 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="bo_CN">
|
||||
<context>
|
||||
<name>AddDeviceItem</name>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/adddeviceitem.cpp" line="20"/>
|
||||
<source>continue search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AndroidHomePage</name>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/androidhomepage.cpp" line="14"/>
|
||||
<source>Mobile Storage</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཁ་པར་གསོག་འཇོག</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -22,47 +14,47 @@
|
|||
<message>
|
||||
<location filename="../ui/filemanageview/androiditem.cpp" line="64"/>
|
||||
<source>Picture</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>པར་རིས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/androiditem.cpp" line="67"/>
|
||||
<source>Video</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བརྙན་ལམ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/androiditem.cpp" line="70"/>
|
||||
<source>Music</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རོལ་དབྱངས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/androiditem.cpp" line="73"/>
|
||||
<source>Document</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡིག་ཆ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/androiditem.cpp" line="76"/>
|
||||
<source>WeChat</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྐད་འཕྲིན་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/androiditem.cpp" line="79"/>
|
||||
<source>QQ</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>QQ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/androiditem.cpp" line="82"/>
|
||||
<source>Mobile</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ལག་ཁྱེར་ཁ་པར་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/androiditem.cpp" line="95"/>
|
||||
<source>All File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡིག་ཆ་ཡོད་ཚད་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/androiditem.cpp" line="97"/>
|
||||
<source>items</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཚན།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -70,12 +62,12 @@
|
|||
<message>
|
||||
<location filename="../projection/device/basedevice.cpp" line="405"/>
|
||||
<source>Control Devices Supported</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རྒྱབ་སྐྱོར་གྱི་ཚོད་འཛིན་སྒྲིག་ཆས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/device/basedevice.cpp" line="409"/>
|
||||
<source>Control device not supported</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རྒྱབ་སྐྱོར་མི་བྱེད་པའི་ཚོད་འཛིན་སྒྲིག་ཆས་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -83,22 +75,22 @@
|
|||
<message>
|
||||
<location filename="../ui/connectinterface/connectinterface.cpp" line="21"/>
|
||||
<source>Back</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཕྱིར་ལོག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/connectinterface.cpp" line="35"/>
|
||||
<source>Nearby device</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཉེ་འགྲམ་སྒྲིག་ཆས་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/connectinterface.cpp" line="36"/>
|
||||
<source>Connect Phone</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཁ་པར་འབྲེལ་མཐུད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/connectinterface.cpp" line="37"/>
|
||||
<source>Device Code</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྒྲིག་ཆས་ཨང་།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -106,22 +98,22 @@
|
|||
<message>
|
||||
<location filename="../ui/view/connectedwin.cpp" line="38"/>
|
||||
<source>CONNECTED</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>མཐུད་ཟིན་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/connectedwin.cpp" line="120"/>
|
||||
<source>ComputerScreen</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡོལ་བ་འབྱེད་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/connectedwin.cpp" line="125"/>
|
||||
<source>MobileScreen</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡོལ་བ་འབྱེད་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/connectedwin.cpp" line="164"/>
|
||||
<source>ExitScreen</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ངོས་ནས་ཕྱིར་འཐེན་དགོས།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -129,17 +121,17 @@
|
|||
<message>
|
||||
<location filename="../ui/connectinterface/devicecodewidget.cpp" line="28"/>
|
||||
<source>Please enter the connection code of the other device</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རོགས་།སྒྲིག་ཆས་གཞན་དག་གི་འབྲེལ་མཐུད་ཚབ་ཨང་ནང་འཇུག་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/devicecodewidget.cpp" line="37"/>
|
||||
<source>The connection code of the device can be obtained on the homepage of the other party's 'multi terminal collaboration' application</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྒྲིག་ཆས་ཀྱི་འབྲེལ་མཐུད་ཨང་གྲངས་དེ་ཕ་རོལ་པོའི“མཐའ་སྣེ་མང་པོའི་མཉམ་རོགས”བཀོལ་སྤྱོད་གཙོ་ངོས་ཐོབ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/devicecodewidget.cpp" line="62"/>
|
||||
<source>Connection</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྦྲེལ་བ་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -147,40 +139,40 @@
|
|||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="22"/>
|
||||
<source>Go Back</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>མདུན་དུ་སྐྱོད་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="33"/>
|
||||
<source>Go Forward</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཕྱིར་བཤོལ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="53"/>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="370"/>
|
||||
<source>Search File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བཤེར་འཚོལ་ཡིག་ཆ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="80"/>
|
||||
<source>Select</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རྩོམ་སྒྲིག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="100"/>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="450"/>
|
||||
<source>List Mode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རེའུ་མིག་རྣམ་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="111"/>
|
||||
<source>Refresh</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>གསར་འདོན་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="117"/>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="312"/>
|
||||
<source>Select File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡིག་ཆ་འདེམས་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="126"/>
|
||||
|
@ -189,12 +181,12 @@
|
|||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="472"/>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="480"/>
|
||||
<source>Select All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡོངས་འདེམས་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="135"/>
|
||||
<source>Finish</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>གྲུབ་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="203"/>
|
||||
|
@ -202,52 +194,52 @@
|
|||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="471"/>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="479"/>
|
||||
<source>Deselect All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡོངས་འདེམས་མེད་པར་བཟོས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.cpp" line="455"/>
|
||||
<source>Icon Mode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རིས་རྟགས་རྣམ་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.h" line="87"/>
|
||||
<source>List of Mobile Files</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ལག་ཐོགས་ཁ་པར་གྱི་ཡིག་ཆའི་རེའུ་མིག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.h" line="88"/>
|
||||
<source>Picture</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>པར་རིས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.h" line="89"/>
|
||||
<source>Video</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བརྙན་ལམ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.h" line="90"/>
|
||||
<source>Music</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རོལ་དབྱངས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.h" line="91"/>
|
||||
<source>Doc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡིག་ཆ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.h" line="92"/>
|
||||
<source>QQ</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>QQ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.h" line="93"/>
|
||||
<source>WeChat</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྐད་འཕྲིན་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/filemanagewin.h" line="94"/>
|
||||
<source>Mobile Storage</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཁ་པར་གསོག་འཇོག</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -256,17 +248,17 @@
|
|||
<location filename="../ui/filemanageview/fileview.cpp" line="132"/>
|
||||
<location filename="../ui/filemanageview/fileview.cpp" line="492"/>
|
||||
<source>Download</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཕབ་འཇུག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/fileview.cpp" line="363"/>
|
||||
<source>Choose folder</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡིག་ཆ་འདེམས་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/fileview.cpp" line="490"/>
|
||||
<source>Open</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཁ་འབྱེད་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -274,42 +266,42 @@
|
|||
<message>
|
||||
<location filename="../ui/view/homepage.cpp" line="42"/>
|
||||
<source>Multiterminal</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྣེ་མང་མཐུན་སྦྱོར་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/homepage.cpp" line="47"/>
|
||||
<source>Cross equipment and cross system collaboration. It is more convenient to share resources and screens, and more convenient and efficient to work!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྒྲིག་ཆས་དང་མ་ལག་ལས་བརྒལ་བའི་བར་མཉམ་ལས་བྱ། ཐོན་ཁུངས་དང་བརྙན་ཡོལ་མཉམ་སྤྱོད་བྱས་ན་དེ་བས་སྟབས་བདེ་བ་དང་།ལས་ཀ་དེ་བས་སྟབས་བདེ་དང་ལས་ཕྱོད་ཆེ་བ་ཡོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/homepage.cpp" line="54"/>
|
||||
<source>Device Code:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྒྲིག་ཆས་ཨང་།:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/homepage.cpp" line="65"/>
|
||||
<source>Folder</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡིག་ཆ་མཉམ་སྤྱོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/homepage.cpp" line="69"/>
|
||||
<source>Share</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བརྙན་ཡོལ་མཉམ་སྤྱོད་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/homepage.cpp" line="73"/>
|
||||
<source>Cross</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡོལ་བརྒལ་ཚོད་འཛིན།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/homepage.cpp" line="76"/>
|
||||
<source>Connect Now</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>འཕྲལ་མཐུད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/homepage.cpp" line="172"/>
|
||||
<source>No network</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>དྲ་རྒྱ་མེད་པ་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -318,27 +310,27 @@
|
|||
<location filename="../ui/mainwindow.cpp" line="362"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1195"/>
|
||||
<source>kylin-connectivity</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྣེ་མང་མཐུན་སྦྱོར་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="454"/>
|
||||
<source>Agreed to connect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>མོས་མཐུན་འབྲེལ་མཐུད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="456"/>
|
||||
<source>Peer has agreed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ལས་རིགས་གཅིག་པའི་མོས་མཐུན་བྱས་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="458"/>
|
||||
<source>Establishing connection, please wait...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ད་ལྟ་འབྲེལ་མཐུད་འཛུགས་བཞིན་ཡོད།ཏོག་ཙམ་སྒུག་རོགས།...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="462"/>
|
||||
<source>CANCEL</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>མེད་པར་བཟོ་བ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1263"/>
|
||||
|
@ -347,195 +339,195 @@
|
|||
<location filename="../ui/mainwindow.cpp" line="1756"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1772"/>
|
||||
<source>OK</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡ་ཡ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="819"/>
|
||||
<source>Not currently connected, please connect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>མིག་སྔར་འབྲེལ་མཐུད་མ་དང་།འབྲེལ་མཐུད་གནང་རོགས་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="642"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1177"/>
|
||||
<source>file download failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡིག་ཆ་ཕབ་ལེན་ཕམ་སོང་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="911"/>
|
||||
<source>Connection request received from"</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྡུད་ལེན་གྱི་འབྲེལ་མཐུད་རེ་ཞུ། "</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="911"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1222"/>
|
||||
<source>"</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>"</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="912"/>
|
||||
<source>After consent, the other party can view and download all the files on the device, and can share the other party's desktop to this screen.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>འཐད་པ་བྱུང་རྗེས།ཕ་རོལ་པོས་སྒྲིག་ཆས་སྟེང་གི་ཡིག་ཆ་ཡོད་ཚད་ལ་ལྟ་ཞིབ་དང་ཕབ་ལེན་བྱས་ཆོག་པར་མ་ཟད།ཕ་རོལ་བོའི་ཅོག་ངོས་དེ་ཡོལ་ངོས་དེར་མཉམ་སྤྱོད་བྱས་ཆོག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="917"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1228"/>
|
||||
<source>NO</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>མེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="918"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1227"/>
|
||||
<source>YES</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="933"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1241"/>
|
||||
<source>The other party has refused your screen projection request!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཕ་རོལ་བོས་ཁྱོད་ཀྱི་བརྙན་ཡོལ་བརྙན་ཕབ་ཀྱི་རེ་བ་དང་ལེན་མ་བྱས།!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="934"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1242"/>
|
||||
<source>Failed to cast the screen. Please contact the other party and try again.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>འཆར་ཤེལ་ལ་ཕོག་མི་ཐུབ། རོགས་།ཕ་རོལ་བར་འབྲེལ་གཏུག་དང་།དེ་ནས་ཡང་བསྐྱར་ཚོད་ལྟ་ཞིག་རེད་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="938"/>
|
||||
<source>RECONNECT</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བསྐྱར་སྦྲེལ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="939"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1294"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1564"/>
|
||||
<source>CLOSE</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྒོ་རྒྱག་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1027"/>
|
||||
<source>Please install kylin-assistant on the Android terminal!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཨན་ཀྲོའི་མཐའ་སྣེ་ཐོག་ཆི་ལིན་ལས་རོགས་སྒྲིག་རོགས།!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1037"/>
|
||||
<source>Please use the USB to connect your phone device!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>USBཁྱེད་རང་གི་ཁ་པར་སྒྲིག་ཆས་བེད་སྤྱོད་གཏོང་རོགས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1047"/>
|
||||
<source>Connection error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>འབྲེལ་མཐུད་ནོར་འཁྲུལ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1050"/>
|
||||
<source>Connection timed out</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>འབྲེལ་མཐུད་དུས་བརྒལ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1185"/>
|
||||
<source>Peony access can be error-prone</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>པད་མ་འཚམས་འདྲི་ནོར་སླ་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1187"/>
|
||||
<source>Umount failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བཤིག་འདོན་ཕམ་པ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1196"/>
|
||||
<source>Version:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>པར་གཞི།:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1198"/>
|
||||
<source>Mobile Assistant is an interconnection tool of Android device and Kirin operating system, which supports Android file synchronization, file transfer, screen mirroring and other functions, which is simple and fast to operate</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྣེ་མང་མཐུན་སྦྱོར་ནི་ཆི་ལིན་བཀོལ་སྤྱོད་མ་ལག་དབར་གྱི་ཕན་ཚུན་འབྲེལ་མཐུད་ཀྱི་དྲ་སྦྲེལ་ཡོ་བྱད་ཅིག་ཡིན་པ་དང་ཆབས་ཅིག་Andridཡིག་ཆ་དུས་མཉམ་དང་།ཡིག་ཆ་བརྒྱུད་འདྲེན།བརྙན་ཡོལ་སྣང་བརྙན་སོགས་ཀྱི་ནུས་པར་རྒྱབ་སྐྱོར་བྱས་ནས་སྟབས་བདེ་ལ་མྱུར་པོ་ཡོད་པ་རེད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1222"/>
|
||||
<source>Received screen projection request from "</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བསྡུ་ལེན་ནས་ཡོང་བའི་བརྙན་ཡོལ་བརྙན་ཕབ་རེ་ཞུ་། "</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1223"/>
|
||||
<source>After consent, the other party can share the device desktop to this screen.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>འཐད་པ་བྱུང་རྗེས།ཕྱོགས་ཅིག་ཤོས་ཀྱིས་སྒྲིག་ཆས་ཀྱི་ཅོག་ངོས་བརྙན་ཡོལ་འདི་མཉམ་སྤྱོད་བྱས་ཆོག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1246"/>
|
||||
<source>Again</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡང་བསྐྱར་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1247"/>
|
||||
<source>Close</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྒོ་རྒྱག་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1258"/>
|
||||
<source>The other party agreed to your screen projection request!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཕ་རོལ་བོས་ཁྱོད་ཀྱི་བརྙན་ཡོལ་བརྙན་ཕབ་ཀྱི་རེ་བ་ལ་འཐད།!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1259"/>
|
||||
<source>The screen is being cast, please wait...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བརྙན་ཡོལ་ཕོག་བཞིན་འདུགཅུང་ཙམ་སྒུག...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1278"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1301"/>
|
||||
<source>End of screen projection</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བརྙན་ཡོལ་བརྙན་ཕབ་མཇུག་རྫོགས་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1279"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1302"/>
|
||||
<source>The other party has finished the screen projection function.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཕ་རོལ་བས་འཆར་ཤེལ་བརྙན་ཕབ་ཀྱི་ནུས་པ་འགྲུབ་ཡོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1288"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1558"/>
|
||||
<source>Screen projection loading error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བརྙན་ཡོལ་བརྙན་ཕབ་ཁུར་སྣོན་ཧེ་བག་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1290"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1560"/>
|
||||
<source>Please check whether to install the projection expansion package [kylin connectivity tools]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཞིབ་བཤེར་བྱེད་མིན་།སྒྲིག་སྦྱོར་བརྙན་ཕབ་རྒྱ་སྐྱེད་ཁུག་མ་[kylin-connectttity-tools]</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1550"/>
|
||||
<source>Uploaded to</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡར་འཕངས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1526"/>
|
||||
<source>Downloaded to</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Uploaded to</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1367"/>
|
||||
<source>Search data loading failed!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བཤེར་འཚོལ་གཞི་གྲངས་ནང་འཇུག་ཕམ་སོང་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1750"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1765"/>
|
||||
<source>Request sent successfully!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྐུར་ཐུབ་པར་ཞུ།!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1751"/>
|
||||
<source>The connection request has been sent to the selected device. Please click [YES] in the opposite pop-up window</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>འབྲེལ་མཐུད་རེ་བར་བདམས་པའི་སྒྲིག་ཆས་ལ་སྐུར་རོགས། ཁ་སྤྲོད་ཀྱི་སྒེའུ་ཁུང་ནང་ནས་གནོན་རོགས།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1767"/>
|
||||
<source>The screen projection request has been sent to the connected device. Please click [Agree] in the opposite pop-up window</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བརྙན་ཡོལ་བརྙན་ཕབ་ཀྱི་རེ་བ་དེ་སྦྲེལ་མཐུད་ཀྱི་སྒྲིག་ཆས་ལ་བསྐུར། མདུན་གྱི་སྒེའུ་ཁུང་ནང་གི་“མོས་མཐུན་ལ་གནོན་།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -543,47 +535,47 @@
|
|||
<message>
|
||||
<location filename="../ui/connectinterface/mobileconnectwin.cpp" line="23"/>
|
||||
<source>ScanCode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བཤེར་ཨང་འབྲེལ་མཐུད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileconnectwin.cpp" line="24"/>
|
||||
<source>USBConnect</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>USBའབྲེལ་མཐུད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileconnectwin.cpp" line="37"/>
|
||||
<source>Your phone model: </source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཁྱེད་ཀྱི་ཁ་པར་གྱི་བཟོ་དབྱིབས་ནི།:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileconnectwin.h" line="48"/>
|
||||
<source>vivo</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileconnectwin.h" line="49"/>
|
||||
<source>HUAWEI</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileconnectwin.h" line="50"/>
|
||||
<source>Xiaomi</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileconnectwin.h" line="51"/>
|
||||
<source>SAMSUNG</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileconnectwin.h" line="52"/>
|
||||
<source>OPPO</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileconnectwin.h" line="53"/>
|
||||
<source>Other</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>གཞན་དག</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -591,32 +583,32 @@
|
|||
<message>
|
||||
<location filename="../ui/connectinterface/mobileqrcode.cpp" line="27"/>
|
||||
<source>No network</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>དྲ་རྒྱ་མེད་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileqrcode.cpp" line="55"/>
|
||||
<source>Connect the mobile phone and computer to the same network,open the mobile phone app and scan the QR code.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ལག་ཐོགས་ཁ་པར་དང་གློག་ཀླད་འབྲེལ་མཐུད་དྲ་རྒྱ་གཅིག་དང་།ཁ་ཕྱེ་།ལག་ཐོགས་ཁ་པར་གྱི་རྩ་གཉིས་འདི་བཤར་འབེབས་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileqrcode.cpp" line="58"/>
|
||||
<source>Use the mobile app to scan this code</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྒུལ་བདེའི་ཉེར་སྤྱོད་བྱ་རིམ་བཤར་འབེབས་ཚབ་ཨང་འདི་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileqrcode.cpp" line="65"/>
|
||||
<source>No app installed? Install Now</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཉེར་སྤྱོད་བྱ་རིམ་སྒྲིག་སྦྱོར་བྱས་མེད་དམ།? འཕྲལ་བསྒྲིགས་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileqrcode.cpp" line="134"/>
|
||||
<source>view supported phone types>></source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རྒྱབ་སྐྱོར་གྱི་ཁ་པར་རིགས་ལ་ལྟ་ཞིབ་།>></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileqrcode.cpp" line="140"/>
|
||||
<source>Please scan this QR code with your mobile browser to download the app</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རོགས་།ཁྱེད་རང་གི་ཁ་པར་བཤར་ཆས་བཤར་འབེབས་འདི་བཀོལ་ནས་རྩ་གཉིས་ཨང་རྟགས་ཕབ་ལེན་ཉེར་སྤྱོད་བྱ་རིམ་།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -624,7 +616,7 @@
|
|||
<message>
|
||||
<location filename="../main.cpp" line="97"/>
|
||||
<source>In order to ensure the normal operation of the program, please install the VLC program first!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>གོ་རིམ་རྒྱུན་ལྡན་ངང་འཁོར་སྐྱོད་བྱེད་པར་ཁག་ཐེག་བྱེད་ཆེད།སྔོན་ལ་VLCགོ་རིམ་སྒྲིག་སྦྱོར་བྱེད་དགོས།!</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -632,27 +624,27 @@
|
|||
<message>
|
||||
<location filename="../projection/uibase/scrollsettingwidget.cpp" line="22"/>
|
||||
<source>Mouse sensitivity</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བྱི་ཕྲུག་ཚོར་སྐྱེན་རང་བཞིན་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/scrollsettingwidget.cpp" line="34"/>
|
||||
<source>slow</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>དལ་པོ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/scrollsettingwidget.cpp" line="35"/>
|
||||
<source>quick</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>མགྱོགས་མྱུར་ཅན།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/scrollsettingwidget.cpp" line="40"/>
|
||||
<source>ok</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡ་ཡ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/scrollsettingwidget.cpp" line="41"/>
|
||||
<source>cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>མེད་པར་བཟོ་བ་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -660,12 +652,12 @@
|
|||
<message>
|
||||
<location filename="../ui/connectinterface/searchdevicewin.cpp" line="51"/>
|
||||
<source>Searching for nearby available devices...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བཤེར་འཚོལ་ཉེ་འགྲམ་གྱི་སྤྱོད་རུང་སྒྲིག་ཆས་བཞིན་ཡོད་།...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/searchdevicewin.cpp" line="140"/>
|
||||
<source>Search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བཤེར་འཚོལ་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -674,24 +666,24 @@
|
|||
<location filename="../pcscreenmanage/suspendtabbar.cpp" line="101"/>
|
||||
<location filename="../pcscreenmanage/suspendtabbar.cpp" line="176"/>
|
||||
<source>Back to the desktop</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཕྱིར་ལོག་སྒྲོག་ཙེ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../pcscreenmanage/suspendtabbar.cpp" line="105"/>
|
||||
<source>Resume screen projection</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བརྙན་ཡོལ་བརྙན་ཕབ་སླར་གསོ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../pcscreenmanage/suspendtabbar.cpp" line="175"/>
|
||||
<location filename="../pcscreenmanage/suspendtabbar.cpp" line="213"/>
|
||||
<source>Counter control (activate Ctrl+H, cancel Ctrl+G)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>བགྲང་ཆས་ཚོད་འཛིན། (གྲུང་སྐུལ་ Ctrl+H,མེད་པར་བཟོ་བ་ Ctrl+G)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../pcscreenmanage/suspendtabbar.cpp" line="177"/>
|
||||
<location filename="../pcscreenmanage/suspendtabbar.cpp" line="214"/>
|
||||
<source>End screen projection</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྣེ་ཡོལ་བརྙན་ཕབ་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -700,12 +692,12 @@
|
|||
<location filename="../ui/filemanageview/timelineitem.cpp" line="16"/>
|
||||
<location filename="../ui/filemanageview/timelineitem.cpp" line="106"/>
|
||||
<source>pack up</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཐུམ་རྒྱག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/timelineitem.cpp" line="100"/>
|
||||
<source>lay down</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>འཇོག་པ་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -713,12 +705,12 @@
|
|||
<message>
|
||||
<location filename="../ui/filemanageview/timelinelistwidget.cpp" line="243"/>
|
||||
<source>Download</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཕབ་འཇུག</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/filemanageview/timelinelistwidget.cpp" line="263"/>
|
||||
<source>Choose folder</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡིག་ཆ་འདེམས་པ།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -726,40 +718,40 @@
|
|||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="35"/>
|
||||
<source>Menu</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཚལ་ཐོ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="40"/>
|
||||
<source>kylin-connectivity</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྣེ་མང་མཐུན་སྦྱོར་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="55"/>
|
||||
<source>Minimize</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཆེས་ཆུང་ཅན་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="73"/>
|
||||
<source>Close</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྒོ་རྒྱག་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="179"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="216"/>
|
||||
<source>Help</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རོགས་རམ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="180"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="218"/>
|
||||
<source>About</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྐོར་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="181"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="220"/>
|
||||
<source>Quit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཕྱིར་འབུད་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -767,7 +759,7 @@
|
|||
<message>
|
||||
<location filename="../ui/basewidget/transmissiondialog.cpp" line="16"/>
|
||||
<source>Current progress</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>མིག་སྔའི་སྒྲུབ་ཚད་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -775,12 +767,12 @@
|
|||
<message>
|
||||
<location filename="../ui/connectinterface/usbconnectwin.cpp" line="74"/>
|
||||
<source>Connect now</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྒྲིག་འགོད་བྱས་ཚར་།འཕྲལ་མར་འབྲེལ་མཐུད་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/usbconnectwin.cpp" line="119"/>
|
||||
<source>No tutorial</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སློབ་ཚན་མི་འདུག</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -788,7 +780,7 @@
|
|||
<message>
|
||||
<location filename="../projection/device/deviceui/videoform.cpp" line="838"/>
|
||||
<source>Control device not supported</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>མིག་སྔའི་འབྲེལ་མཐུད་ལ་རྒྱབ་སྐྱོར་མི་བྱེད་པ་ཚོད་འཛིན་སྒྲིག་ཆས་</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -796,54 +788,54 @@
|
|||
<message>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="42"/>
|
||||
<source>kylin-connectivity</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྣེ་མང་མཐུན་སྦྱོར་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="123"/>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="166"/>
|
||||
<source>Hide Navigation Button</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཕྱོགས་སྟོན་སྡེ་སྦས་ཡོད།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="124"/>
|
||||
<source>Stay on top</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རྩེ་ལ་འཇོག་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="125"/>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="190"/>
|
||||
<source>FullScreen</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཡོལ་བ་ཆ་ཚང་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="126"/>
|
||||
<source>Mouse sensitivity</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>འགྲིལ་འཁོར་སྐྱེན་ཚད་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="127"/>
|
||||
<source>Quit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཕྱིར་འབུད་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="163"/>
|
||||
<source>Show Navigation Button</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ལས་མངོན་པར་གཞིགས་ན་།ཕྱོགས་སྟོན་སྡེ་།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="176"/>
|
||||
<source>Stay On Top</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>རྩེ་ལ་འཇོག་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="180"/>
|
||||
<source>Cancel Stay On Top</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>ཀླད་འཇོག་མེད་པར་བཟོ་བ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../projection/uibase/videotitle.cpp" line="193"/>
|
||||
<source>Cancel FullScreen</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>འཆར་ངོས་ཚང་མ་མེད་པར་བཟོས།</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
@ -851,7 +843,7 @@
|
|||
<message>
|
||||
<location filename="../projection/device/deviceui/videoform.ui" line="17"/>
|
||||
<source>kylin-connectivity</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>སྣེ་མང་མཐུན་སྦྱོར་</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="en_US">
|
||||
<context>
|
||||
<name>AddDeviceItem</name>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/adddeviceitem.cpp" line="20"/>
|
||||
<source>continue search</source>
|
||||
<translation>continue search</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AndroidHomePage</name>
|
||||
<message>
|
||||
|
@ -368,7 +360,7 @@
|
|||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="462"/>
|
||||
<source>CANCEL</source>
|
||||
<translation>CANCEL</translation>
|
||||
<translation>Cancel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>USB connection device succeeded!</source>
|
||||
|
@ -409,13 +401,13 @@
|
|||
<location filename="../ui/mainwindow.cpp" line="917"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1228"/>
|
||||
<source>NO</source>
|
||||
<translation>NO</translation>
|
||||
<translation>No</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="918"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1227"/>
|
||||
<source>YES</source>
|
||||
<translation>YES</translation>
|
||||
<translation>Yes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="933"/>
|
||||
|
@ -432,14 +424,14 @@
|
|||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="938"/>
|
||||
<source>RECONNECT</source>
|
||||
<translation>RECONNECT</translation>
|
||||
<translation>Reconnect</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="939"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1294"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1564"/>
|
||||
<source>CLOSE</source>
|
||||
<translation>CLOSE</translation>
|
||||
<translation>Close</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1027"/>
|
||||
|
@ -544,7 +536,7 @@
|
|||
<location filename="../ui/mainwindow.cpp" line="1756"/>
|
||||
<location filename="../ui/mainwindow.cpp" line="1772"/>
|
||||
<source>OK</source>
|
||||
<translation>OK</translation>
|
||||
<translation>Ok</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/mainwindow.cpp" line="1288"/>
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="zh_CN">
|
||||
<context>
|
||||
<name>AddDeviceItem</name>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/adddeviceitem.cpp" line="20"/>
|
||||
<source>continue search</source>
|
||||
<translation>继续搜索</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AndroidHomePage</name>
|
||||
<message>
|
||||
|
@ -632,7 +624,7 @@
|
|||
<message>
|
||||
<location filename="../ui/connectinterface/mobileconnectwin.cpp" line="37"/>
|
||||
<source>Your phone model: </source>
|
||||
<translation>您的手机型号</translation>
|
||||
<translation>您的手机型号:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/connectinterface/mobileconnectwin.h" line="48"/>
|
||||
|
|
|
@ -7,6 +7,8 @@ set(UI_BASE_WIDGET
|
|||
basewidget/backgroundwin.h
|
||||
basewidget/levitationbutton.cpp
|
||||
basewidget/levitationbutton.h
|
||||
basewidget/messagedialog.h
|
||||
basewidget/messagedialog.cpp
|
||||
)
|
||||
source_group(basewidget FILES ${UI_BASE_WIDGET})
|
||||
|
||||
|
@ -43,8 +45,6 @@ set(MOBILE_UI_INITCONNECTWIN_SOURCES
|
|||
connectinterface/searchdevicewin.cpp
|
||||
connectinterface/searchdeviceitem.h
|
||||
connectinterface/searchdeviceitem.cpp
|
||||
connectinterface/adddeviceitem.h
|
||||
connectinterface/adddeviceitem.cpp
|
||||
connectinterface/connectinterface.h
|
||||
connectinterface/connectinterface.cpp
|
||||
connectinterface/devicecodewidget.h
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
HEADERS += \
|
||||
$$PWD/backgroundwin.h \
|
||||
$$PWD/messagedialog.h \
|
||||
$$PWD/transmissiondialog.h\
|
||||
$$PWD/loaddialog.h \
|
||||
$$PWD/levitationbutton.h
|
||||
$$PWD/levitationbutton.h \
|
||||
$$PWD/messagedialog.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/backgroundwin.cpp \
|
||||
$$PWD/messagedialog.cpp \
|
||||
$$PWD/transmissiondialog.cpp \
|
||||
$$PWD/loaddialog.cpp\
|
||||
$$PWD/levitationbutton.cpp
|
||||
$$PWD/levitationbutton.cpp \
|
||||
$$PWD/messagedialog.cpp
|
||||
|
|
|
@ -4,14 +4,11 @@
|
|||
#include <QBitmap>
|
||||
#include <QHBoxLayout>
|
||||
|
||||
const int WIN_W = 135;
|
||||
const int WIN_H = 48;
|
||||
const int ICON_W = 16;
|
||||
const int ICON_H = 16;
|
||||
|
||||
LevitationButton::LevitationButton(QWidget *parent) : QPushButton(parent)
|
||||
{
|
||||
setFixedSize(WIN_W, WIN_H);
|
||||
setAttribute(Qt::WA_TranslucentBackground, true);
|
||||
setWindowFlags(Qt::FramelessWindowHint);
|
||||
m_icon = new QLabel(this);
|
||||
|
@ -34,14 +31,35 @@ LevitationButton::LevitationButton(QWidget *parent) : QPushButton(parent)
|
|||
"QPushButton:Hover"
|
||||
"{border:1px;border-radius:24px;background-color:#5F5F5F;}"
|
||||
"QPushButton:Pressed"
|
||||
"{border:1px;border-radius:24px;background-coloe:#414141;}");
|
||||
"{border:1px;border-radius:24px;background-color:#414141;}");
|
||||
}
|
||||
|
||||
void LevitationButton::setIcon(QString iconName)
|
||||
{
|
||||
m_icon->setPixmap(QPixmap(iconName));
|
||||
}
|
||||
|
||||
void LevitationButton::setText(QString text)
|
||||
{
|
||||
m_text->setText(text);
|
||||
}
|
||||
|
||||
void LevitationButton::changeFontSize(double fontSize)
|
||||
{
|
||||
QFont font;
|
||||
font.setPointSizeF(fontSize);
|
||||
|
||||
m_text->setFont(font);
|
||||
QFontMetrics fontmts = QFontMetrics(font);
|
||||
int width = fontmts.width(m_text->text()) + ICON_W + 8 + 32;
|
||||
int height = fontmts.height() + 28;
|
||||
setFixedSize(width, height);
|
||||
QString sizeStr = QString::number(height / 2);
|
||||
setStyleSheet(QString("QPushButton"
|
||||
"{border:1px;border-radius:%1px;background-color:#373737;}"
|
||||
"QPushButton:Hover"
|
||||
"{border:1px;border-radius:%2px;background-color:#5F5F5F;}"
|
||||
"QPushButton:Pressed"
|
||||
"{border:1px;border-radius:%3px;background-color:#414141;}")
|
||||
.arg(sizeStr, sizeStr, sizeStr));
|
||||
}
|
|
@ -15,8 +15,8 @@ public:
|
|||
|
||||
void setIcon(QString iconName);
|
||||
void setText(QString text);
|
||||
void changeFontSize(double fontSize);
|
||||
|
||||
protected:
|
||||
private:
|
||||
QLabel *m_icon = nullptr;
|
||||
QLabel *m_text = nullptr;
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
#include "messagedialog.h"
|
||||
|
||||
const int ICON_SIZE = 24;
|
||||
const int BTN_W = 88;
|
||||
const int BTN_H = 48;
|
||||
const int WIN_W = 510;
|
||||
const int WIN_H = 202;
|
||||
|
||||
MessageDialog::MessageDialog(QWidget *parent) : kdk::KDialog(parent)
|
||||
{
|
||||
setWindowModality(Qt::WindowModal);
|
||||
setWindowModality(Qt::ApplicationModal);
|
||||
|
||||
m_icon = new QLabel(this);
|
||||
m_icon->resize(ICON_SIZE, ICON_SIZE);
|
||||
|
||||
m_textLayout = new QVBoxLayout;
|
||||
m_textLayout->setMargin(0);
|
||||
m_textLayout->setSpacing(0);
|
||||
m_textLayout->addStretch();
|
||||
|
||||
QHBoxLayout *hLayout = new QHBoxLayout;
|
||||
hLayout->setMargin(0);
|
||||
hLayout->setSpacing(0);
|
||||
hLayout->addWidget(m_icon);
|
||||
hLayout->addSpacing(8);
|
||||
hLayout->addLayout(m_textLayout);
|
||||
hLayout->addStretch();
|
||||
|
||||
m_btnLayout = new QHBoxLayout;
|
||||
m_btnLayout->setMargin(0);
|
||||
m_btnLayout->setSpacing(14);
|
||||
m_btnLayout->addStretch();
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout;
|
||||
layout->setMargin(24);
|
||||
layout->setSpacing(0);
|
||||
layout->addLayout(hLayout);
|
||||
layout->addStretch();
|
||||
layout->addLayout(m_btnLayout);
|
||||
|
||||
mainWidget()->setLayout(layout);
|
||||
}
|
||||
|
||||
void MessageDialog::setText(QString title, QString text)
|
||||
{
|
||||
m_titleLab = new QLabel(this);
|
||||
m_titleLab->setAlignment(Qt::AlignLeft);
|
||||
m_titleLab->setText(title);
|
||||
m_textLayout->addWidget(m_titleLab);
|
||||
if (text.isEmpty()) {
|
||||
setFixedSize(WIN_W, WIN_H);
|
||||
} else {
|
||||
setFixedSize(WIN_W, WIN_H + 20);
|
||||
QFont font;
|
||||
font.setBold(true);
|
||||
m_titleLab->setFont(font);
|
||||
|
||||
m_textLab = new QLabel(this);
|
||||
m_textLab->setAlignment(Qt::AlignLeft);
|
||||
m_textLab->setWordWrap(true);
|
||||
m_textLab->setFixedWidth(400);
|
||||
m_textLab->setText(text);
|
||||
m_textLayout->addSpacing(8);
|
||||
m_textLayout->addWidget(m_textLab);
|
||||
}
|
||||
m_textLayout->addStretch();
|
||||
}
|
||||
|
||||
void MessageDialog::setIconPixmap(QIcon icon)
|
||||
{
|
||||
m_icon->setPixmap(icon.pixmap(QSize(ICON_SIZE, ICON_SIZE)));
|
||||
}
|
||||
|
||||
QPushButton *MessageDialog::addButton(QString text)
|
||||
{
|
||||
QPushButton *btn = new QPushButton(this);
|
||||
btn->setText(text);
|
||||
connect(btn, &QPushButton::clicked, this, [=]() {
|
||||
Q_EMIT buttonClicked(btn);
|
||||
close();
|
||||
});
|
||||
m_btnLayout->addWidget(btn);
|
||||
|
||||
return btn;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef MESSAGEDIALOG_H
|
||||
#define MESSAGEDIALOG_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <QIcon>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QHBoxLayout>
|
||||
#include <kdialog.h>
|
||||
|
||||
class MessageDialog : public kdk::KDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MessageDialog(QWidget *parent = nullptr);
|
||||
|
||||
void setText(QString title, QString text = "");
|
||||
void setIconPixmap(QIcon icon);
|
||||
QPushButton *addButton(QString text);
|
||||
|
||||
Q_SIGNALS:
|
||||
void buttonClicked(QPushButton *);
|
||||
|
||||
private:
|
||||
QLabel *m_icon = nullptr;
|
||||
QLabel *m_titleLab = nullptr;
|
||||
QLabel *m_textLab = nullptr;
|
||||
QVBoxLayout *m_textLayout = nullptr;
|
||||
QHBoxLayout *m_btnLayout = nullptr;
|
||||
};
|
||||
|
||||
#endif // MESSAGEDIALOG_H
|
|
@ -1,31 +0,0 @@
|
|||
#include "adddeviceitem.h"
|
||||
|
||||
AddDeviceItem::AddDeviceItem(QPushButton *parent) : QPushButton(parent)
|
||||
{
|
||||
initUI();
|
||||
}
|
||||
|
||||
AddDeviceItem::~AddDeviceItem() {}
|
||||
|
||||
void AddDeviceItem::initUI()
|
||||
{
|
||||
QHBoxLayout *mainHLayout = new QHBoxLayout();
|
||||
|
||||
//项按钮
|
||||
m_itemIconLabel = new QLabel(this);
|
||||
m_itemIconLabel->setFixedSize(20, 20);
|
||||
m_itemIconLabel->setPixmap(QIcon(":/icon/add.png").pixmap(20, 20));
|
||||
//继续搜索
|
||||
m_continueSearchLabel = new QLabel(this);
|
||||
m_continueSearchLabel->setText(tr("continue search")); // Continue search
|
||||
|
||||
|
||||
mainHLayout->addSpacing(14);
|
||||
mainHLayout->addWidget(m_itemIconLabel);
|
||||
mainHLayout->addSpacing(14);
|
||||
mainHLayout->addWidget(m_continueSearchLabel);
|
||||
mainHLayout->addStretch();
|
||||
mainHLayout->setSpacing(0);
|
||||
mainHLayout->setContentsMargins(0, 0, 0, 0);
|
||||
this->setLayout(mainHLayout);
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
#ifndef ADDDEVICEITEM_H
|
||||
#define ADDDEVICEITEM_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QListWidget>
|
||||
|
||||
class AddDeviceItem : public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AddDeviceItem(QPushButton *parent = nullptr);
|
||||
~AddDeviceItem();
|
||||
|
||||
private:
|
||||
void initUI();
|
||||
private:
|
||||
//项按钮
|
||||
QLabel *m_itemIconLabel = nullptr;
|
||||
//用户名
|
||||
QLabel *m_continueSearchLabel = nullptr;
|
||||
};
|
||||
|
||||
#endif // ADDDEVICEITEM_H
|
|
@ -6,8 +6,6 @@ const int BUTTON_W = 80;
|
|||
const int BUTTON_H = 30;
|
||||
const int TABBAR_W = 314;
|
||||
const int TABBAR_H = 48;
|
||||
const int STACKENWIN_W = 992;
|
||||
const int STACKENWIN_H = 556;
|
||||
|
||||
ConnectInterface::ConnectInterface(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
|
@ -17,7 +15,7 @@ ConnectInterface::ConnectInterface(QWidget *parent) : QWidget(parent)
|
|||
void ConnectInterface::initUI()
|
||||
{
|
||||
m_backBtn = new QPushButton(this);
|
||||
m_backBtn->setFixedSize(BUTTON_W, BUTTON_H);
|
||||
// m_backBtn->setFixedSize(BUTTON_W, BUTTON_H);
|
||||
m_backBtn->setText(tr("Back")); // Back
|
||||
m_backBtn->setIcon(QIcon(":/connectinterface/back.svg"));
|
||||
m_backBtn->setFlat(true);
|
||||
|
@ -37,7 +35,6 @@ void ConnectInterface::initUI()
|
|||
m_tabBar->addTab(tr("Device Code"));
|
||||
|
||||
m_searchWin = new SearchDeviceWin(this);
|
||||
m_searchWin->setMinimumSize(STACKENWIN_W, STACKENWIN_H);
|
||||
connect(m_searchWin, &SearchDeviceWin::sigContinueSearch, this, &ConnectInterface::sigContinueSearch);
|
||||
connect(m_searchWin, &SearchDeviceWin::sigItemInfo, this, &ConnectInterface::sigConnectAddress);
|
||||
m_mobileConnectWin = new MobileConnectWin(this);
|
||||
|
@ -49,7 +46,6 @@ void ConnectInterface::initUI()
|
|||
});
|
||||
|
||||
m_stackedWin = new QStackedWidget(this);
|
||||
m_stackedWin->setMinimumSize(STACKENWIN_W, STACKENWIN_H);
|
||||
m_stackedWin->addWidget(m_searchWin);
|
||||
m_stackedWin->addWidget(m_mobileConnectWin);
|
||||
m_stackedWin->addWidget(m_deviceCodeWidget);
|
||||
|
@ -73,7 +69,7 @@ void ConnectInterface::initUI()
|
|||
|
||||
QVBoxLayout *mainVLayout = new QVBoxLayout;
|
||||
mainVLayout->setSpacing(0);
|
||||
mainVLayout->setContentsMargins(16, 8, 16, 16);
|
||||
mainVLayout->setContentsMargins(8, 8, 8, 8);
|
||||
mainVLayout->addLayout(hLayout);
|
||||
mainVLayout->addSpacing(12);
|
||||
mainVLayout->addWidget(m_backgroundWin);
|
||||
|
@ -132,4 +128,9 @@ void ConnectInterface::setSearchBtnState(bool state)
|
|||
} else {
|
||||
m_searchWin->setSearchBtnState(false);
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectInterface::changeFontSize(double fontSize)
|
||||
{
|
||||
m_searchWin->changeFontSize(fontSize);
|
||||
}
|
|
@ -26,6 +26,7 @@ public:
|
|||
void setItemInfo(const QMap<QString, KMobileCommon::DiscoveryDeviceInfo> &map);
|
||||
void showLoad();
|
||||
void setSearchBtnState(bool state);
|
||||
void changeFontSize(double fontSize);
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigBackBtnClicked();
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
HEADERS += \
|
||||
$$PWD/adddeviceitem.h \
|
||||
$$PWD/connectinterface.h \
|
||||
$$PWD/interface_win.h \
|
||||
$$PWD/rotationchart.h \
|
||||
|
@ -14,7 +13,6 @@ HEADERS += \
|
|||
&&PWD/devicecodeitem.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/adddeviceitem.cpp \
|
||||
$$PWD/connectinterface.cpp \
|
||||
$$PWD/interface_win.cpp \
|
||||
$$PWD/rotationchart.cpp \
|
||||
|
|
|
@ -13,7 +13,7 @@ DeviceCodeWidget::DeviceCodeWidget(QWidget *parent) : QWidget(parent)
|
|||
void DeviceCodeWidget::initUI()
|
||||
{
|
||||
QVBoxLayout *mainVLayout = new QVBoxLayout();
|
||||
mainVLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mainVLayout->setMargin(0);
|
||||
this->setLayout(mainVLayout);
|
||||
|
||||
QHBoxLayout *connectCodeHLayout = new QHBoxLayout();
|
||||
|
@ -39,6 +39,9 @@ void DeviceCodeWidget::initUI()
|
|||
QPalette palette = describeLab->palette();
|
||||
palette.setColor(QPalette::Text, QColor("#67676C"));
|
||||
describeLab->setPalette(palette);
|
||||
describeLab->setMinimumWidth(950);
|
||||
describeLab->setWordWrap(true);
|
||||
describeLab->setAlignment(Qt::AlignCenter);
|
||||
|
||||
describeHLayout->addStretch();
|
||||
describeHLayout->addWidget(describeLab);
|
||||
|
|
|
@ -19,6 +19,7 @@ QStringList OTHERLIST;
|
|||
MobileConnectWin::MobileConnectWin(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
m_tabBar = new KTabBar(KTabBarStyle::Sliding, this);
|
||||
m_tabBar->setFixedHeight(40);
|
||||
m_tabBar->setMinimumWidth(TABBAR_W);
|
||||
m_tabBar->addTab(tr("ScanCode"));
|
||||
m_tabBar->addTab(tr("USBConnect"));
|
||||
|
@ -40,6 +41,7 @@ MobileConnectWin::MobileConnectWin(QWidget *parent) : QWidget(parent)
|
|||
phoneIconLab->setPixmap(QIcon(":/connectinterface/phoneicon.svg").pixmap(16, 16));
|
||||
|
||||
QComboBox *modelBox = new QComboBox(m_comboBoxWin);
|
||||
modelBox->setFixedHeight(40);
|
||||
modelBox->setMinimumWidth(100);
|
||||
QStringList modelist;
|
||||
modelist << m_vvstr << m_hwstr << m_xmstr << m_oppostr << m_sxstr << m_otherstr;
|
||||
|
@ -136,14 +138,10 @@ void MobileConnectWin::slotTabBarClicked(int index)
|
|||
m_stackedWin->setCurrentIndex(index);
|
||||
switch (index) {
|
||||
case TabBarIndex::MobileQRcodeWin:
|
||||
// WFIF扫码埋点
|
||||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantWifiConn);
|
||||
m_comboBoxWin->hide();
|
||||
m_spaceLab->hide();
|
||||
break;
|
||||
case TabBarIndex::UsbConnWin:
|
||||
// USB连接埋点
|
||||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantUsbConn);
|
||||
m_comboBoxWin->show();
|
||||
m_spaceLab->show();
|
||||
break;
|
||||
|
|
|
@ -8,9 +8,7 @@ SearchDeviceItem::SearchDeviceItem(QPushButton *parent) : QPushButton(parent)
|
|||
initUI();
|
||||
}
|
||||
|
||||
SearchDeviceItem::~SearchDeviceItem()
|
||||
{
|
||||
}
|
||||
SearchDeviceItem::~SearchDeviceItem() {}
|
||||
|
||||
void SearchDeviceItem::initUI()
|
||||
{
|
||||
|
@ -20,16 +18,21 @@ void SearchDeviceItem::initUI()
|
|||
QVBoxLayout *labelVLayout = new QVBoxLayout();
|
||||
//项按钮
|
||||
m_itemIconLabel = new QLabel(this);
|
||||
m_itemIconLabel->setStyleSheet("background:transparent");
|
||||
m_itemIconLabel->setFixedSize(48, 48);
|
||||
m_itemIconLabel->setMargin(0);
|
||||
//用户名
|
||||
m_itemNameLabel = new QLabel(this);
|
||||
m_itemNameLabel->setFixedWidth(142);
|
||||
m_itemNameLabel->setStyleSheet("background:transparent");
|
||||
m_itemNameLabel->setMargin(0);
|
||||
//手机型号
|
||||
// m_itemModelLabel = new QLabel(this);
|
||||
// m_itemModelLabel->setStyleSheet("color:#8F9399;font-size:12px");
|
||||
// m_itemModelLabel = new QLabel(this);
|
||||
// m_itemModelLabel->setStyleSheet("color:#8F9399;font-size:12px");
|
||||
|
||||
labelVLayout->addStretch();
|
||||
labelVLayout->addWidget(m_itemNameLabel);
|
||||
// labelVLayout->addWidget(m_itemModelLabel);
|
||||
// labelVLayout->addWidget(m_itemModelLabel);
|
||||
labelVLayout->addStretch();
|
||||
|
||||
mainHLayout->addSpacing(16);
|
||||
|
@ -41,10 +44,6 @@ void SearchDeviceItem::initUI()
|
|||
mainHLayout->setMargin(0);
|
||||
this->setLayout(mainHLayout);
|
||||
|
||||
QPalette palette = this->palette();
|
||||
palette.setColor(QPalette::Button, QColor("#FFFFFF"));
|
||||
this->setPalette(palette);
|
||||
|
||||
this->setProperty("useButtonPalette", true);
|
||||
}
|
||||
|
||||
|
@ -70,6 +69,49 @@ void SearchDeviceItem::setItemIP(QString ip)
|
|||
m_itemIP = ip;
|
||||
}
|
||||
|
||||
void SearchDeviceItem::setTheme(PublicAttributes::Theme theme)
|
||||
{
|
||||
switch (theme) {
|
||||
case PublicAttributes::Theme::Light: {
|
||||
setStyleSheet("QPushButton "
|
||||
"{border:0px;border-radius:8px;background-color:#FFFFFF;}"
|
||||
"QPushButton:Hover"
|
||||
"{border:0px;border-radius:8px;background-color:#E6F1FE;}"
|
||||
"QPushButton:Pressed "
|
||||
"{border:0px;border-radius:8px;background-color:#C4DEFD;}");
|
||||
break;
|
||||
}
|
||||
case PublicAttributes::Theme::Dark: {
|
||||
setStyleSheet("QPushButton "
|
||||
"{border:0px;border-radius:8px;background-color:#5B636E;}"
|
||||
"QPushButton:Hover"
|
||||
"{border:0px;border-radius:8px;background-color:#373737;}"
|
||||
"QPushButton:Pressed "
|
||||
"{border:0px;border-radius:8px;background-color:#404953;}");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SearchDeviceItem::changeFontSize(double fontSize)
|
||||
{
|
||||
QFont font;
|
||||
font.setPointSizeF(fontSize);
|
||||
|
||||
m_itemNameLabel->setFont(font);
|
||||
QFontMetrics fontmts = QFontMetrics(font);
|
||||
int dif = fontmts.width(m_name) - m_itemNameLabel->width();
|
||||
if (dif > 0) {
|
||||
// 文本比Label宽,省略处理
|
||||
m_itemNameLabel->setToolTip(m_name); // 设置悬浮提示
|
||||
m_itemNameLabel->setToolTipDuration(2000); // 提示时间
|
||||
m_itemNameLabel->setText(fontmts.elidedText(m_name, Qt::ElideRight, m_itemNameLabel->width()));
|
||||
} else {
|
||||
m_itemNameLabel->setToolTip("");
|
||||
m_itemNameLabel->setText(m_name);
|
||||
}
|
||||
}
|
||||
|
||||
QString SearchDeviceItem::getItemName()
|
||||
{
|
||||
return m_name;
|
||||
|
@ -84,19 +126,3 @@ QString SearchDeviceItem::getItemIp()
|
|||
{
|
||||
return m_itemIP;
|
||||
}
|
||||
|
||||
bool SearchDeviceItem::eventFilter(QObject *watch, QEvent *event)
|
||||
{
|
||||
if (watch == this) {
|
||||
if (event->type() == QEvent::Enter) {
|
||||
QPalette palette = this->palette();
|
||||
palette.setColor(QPalette::Button, QColor("#E6F1FE"));
|
||||
this->setPalette(palette);
|
||||
} else if (event->type() == QEvent::Leave) {
|
||||
QPalette palette = this->palette();
|
||||
palette.setColor(QPalette::Button, QColor("#FFFFFF"));
|
||||
this->setPalette(palette);
|
||||
}
|
||||
}
|
||||
return QObject::eventFilter(watch, event);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <QListWidget>
|
||||
|
||||
#include "util.h"
|
||||
#include "publicattributes.hpp"
|
||||
|
||||
class SearchDeviceItem : public QPushButton
|
||||
{
|
||||
|
@ -28,6 +29,9 @@ public:
|
|||
|
||||
//设置项IP
|
||||
void setItemIP(QString ip);
|
||||
// 设置主题
|
||||
void setTheme(PublicAttributes::Theme theme);
|
||||
void changeFontSize(double fontSize);
|
||||
|
||||
//获取项的名称
|
||||
QString getItemName();
|
||||
|
@ -37,8 +41,7 @@ public:
|
|||
|
||||
//获取项的IP
|
||||
QString getItemIp();
|
||||
protected:
|
||||
bool eventFilter(QObject *watch, QEvent *event) override;
|
||||
|
||||
private:
|
||||
void initUI();
|
||||
|
||||
|
@ -48,7 +51,7 @@ private:
|
|||
//用户名
|
||||
QLabel *m_itemNameLabel = nullptr;
|
||||
//手机型号
|
||||
// QLabel *m_itemModelLabel = nullptr;
|
||||
// QLabel *m_itemModelLabel = nullptr;
|
||||
|
||||
QString m_name;
|
||||
KMobileCommon::DiscoveryDeviceInfo m_deviceInfo;
|
||||
|
|
|
@ -23,10 +23,13 @@ void SearchDeviceWin::initUI()
|
|||
m_stackedWidget = new QStackedWidget(this);
|
||||
|
||||
QHBoxLayout *listWidgetHLayout = new QHBoxLayout();
|
||||
listWidgetHLayout->setContentsMargins(8, 8, 0, 8);
|
||||
listWidgetHLayout->setMargin(0);
|
||||
listWidgetHLayout->setSpacing(0);
|
||||
listWidgetHLayout->addWidget(m_stackedWidget);
|
||||
|
||||
m_listWidget = new QListWidget(this);
|
||||
m_listWidget->setContentsMargins(0, 0, 0, 0);
|
||||
m_listWidget->setSpacing(8);
|
||||
//设置显示图标模式
|
||||
m_listWidget->setViewMode(QListView::IconMode);
|
||||
//自适应布局
|
||||
|
@ -36,12 +39,6 @@ void SearchDeviceWin::initUI()
|
|||
//去边框
|
||||
m_listWidget->setFrameShape(QListWidget::NoFrame);
|
||||
|
||||
// m_listWidgetItem = new QListWidgetItem(m_listWidget);
|
||||
// m_continueSearchDeviceItem = new AddDeviceItem();
|
||||
// m_listWidget->setItemWidget(m_listWidgetItem, m_continueSearchDeviceItem);
|
||||
// m_listWidgetItem->setSizeHint(QSize(234, 80));
|
||||
// m_continueSearchDeviceItem->setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
m_stackedWidget->addWidget(m_listWidget);
|
||||
|
||||
m_loadAnimation = new LoadAnimation;
|
||||
|
@ -51,13 +48,14 @@ void SearchDeviceWin::initUI()
|
|||
loadLab->setText(tr("Searching for nearby available devices..."));
|
||||
|
||||
QHBoxLayout *loadHLayout = new QHBoxLayout();
|
||||
loadHLayout->setContentsMargins(0, 0, 0, 0);
|
||||
loadHLayout->setMargin(0);
|
||||
loadHLayout->setSpacing(0);
|
||||
loadHLayout->addStretch();
|
||||
loadHLayout->addWidget(loadLab);
|
||||
loadHLayout->addStretch();
|
||||
|
||||
QVBoxLayout *loadVLayout = new QVBoxLayout();
|
||||
loadVLayout->setContentsMargins(0, 0, 0, 0);
|
||||
loadVLayout->setMargin(0);
|
||||
loadVLayout->setSpacing(0);
|
||||
loadVLayout->addStretch();
|
||||
loadVLayout->addWidget(m_loadAnimation);
|
||||
|
@ -67,10 +65,9 @@ void SearchDeviceWin::initUI()
|
|||
m_stackedWidget->addWidget(loadWid);
|
||||
m_stackedWidget->setCurrentIndex(1);
|
||||
|
||||
m_listWidget->setSpacing(8);
|
||||
|
||||
QVBoxLayout *mainVLayout = new QVBoxLayout();
|
||||
mainVLayout->setContentsMargins(0, 0, 0, 0);
|
||||
mainVLayout->setMargin(0);
|
||||
mainVLayout->setSpacing(0);
|
||||
mainVLayout->addWidget(m_stackedWidget);
|
||||
this->setLayout(mainVLayout);
|
||||
}
|
||||
|
@ -92,6 +89,27 @@ void SearchDeviceWin::setSearchBtnState(bool isShow)
|
|||
}
|
||||
}
|
||||
|
||||
void SearchDeviceWin::changeFontSize(double fontSize)
|
||||
{
|
||||
m_fontSize = fontSize;
|
||||
if (m_searchBtn != nullptr) {
|
||||
m_searchBtn->changeFontSize(m_fontSize);
|
||||
}
|
||||
for (int i = 0; i < m_listWidget->count(); i++) {
|
||||
SearchDeviceItem *itemWin = qobject_cast<SearchDeviceItem *>(m_listWidget->itemWidget(m_listWidget->item(i)));
|
||||
itemWin->changeFontSize(m_fontSize);
|
||||
}
|
||||
}
|
||||
|
||||
void SearchDeviceWin::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
if (m_searchBtn != nullptr) {
|
||||
m_searchBtn->move(
|
||||
QPoint(this->width() / 2 - m_searchBtn->width() / 2, this->height() - 16 - m_searchBtn->height()));
|
||||
}
|
||||
QWidget::resizeEvent(event);
|
||||
}
|
||||
|
||||
void SearchDeviceWin::setItemInfo(const QMap<QString, KMobileCommon::DiscoveryDeviceInfo> &map)
|
||||
{
|
||||
qInfo() << "device count" << map.size();
|
||||
|
@ -117,6 +135,8 @@ void SearchDeviceWin::setItemInfo(const QMap<QString, KMobileCommon::DiscoveryDe
|
|||
searchDeviceItem->setItemName(it.value().deviceName);
|
||||
//设备信息
|
||||
searchDeviceItem->setItemDeviceInfo(it.value());
|
||||
searchDeviceItem->setTheme(m_theme);
|
||||
searchDeviceItem->changeFontSize(m_fontSize);
|
||||
connect(searchDeviceItem, &SearchDeviceItem::clicked, this, [=]() {
|
||||
QString itemIP = searchDeviceItem->getItemIp();
|
||||
KMobileCommon::DiscoveryDeviceInfo itemDeviceInfo = searchDeviceItem->getItemDeviceInfo();
|
||||
|
@ -138,6 +158,7 @@ void SearchDeviceWin::showSearchBtn(bool isShow)
|
|||
m_searchBtn = new LevitationButton(this);
|
||||
m_searchBtn->setIcon(":/connectinterface/searchrefresh.svg");
|
||||
m_searchBtn->setText(tr("Search"));
|
||||
m_searchBtn->changeFontSize(m_fontSize);
|
||||
connect(m_searchBtn, &LevitationButton::clicked, this, [=]() {
|
||||
qInfo() << "continue search clicked";
|
||||
Q_EMIT sigContinueSearch();
|
||||
|
@ -155,12 +176,17 @@ void SearchDeviceWin::showSearchBtn(bool isShow)
|
|||
|
||||
void SearchDeviceWin::setTheme(PublicAttributes::Theme theme)
|
||||
{
|
||||
switch (theme) {
|
||||
m_theme = theme;
|
||||
switch (m_theme) {
|
||||
case PublicAttributes::Theme::Light: {
|
||||
m_listWidget->setStyleSheet("background: #F6F6F6;");
|
||||
m_listWidget->setStyleSheet("border:1px;border-radius:8px;background: #F6F6F6;");
|
||||
} break;
|
||||
case PublicAttributes::Theme::Dark: {
|
||||
m_listWidget->setStyleSheet("background: #232426;");
|
||||
m_listWidget->setStyleSheet("border:1px;border-radius:8px;background: #232426;");
|
||||
} break;
|
||||
}
|
||||
for (int i = 0; i < m_listWidget->count(); i++) {
|
||||
SearchDeviceItem *itemWin = qobject_cast<SearchDeviceItem *>(m_listWidget->itemWidget(m_listWidget->item(i)));
|
||||
itemWin->setTheme(m_theme);
|
||||
}
|
||||
}
|
|
@ -9,7 +9,6 @@
|
|||
#include <QStackedWidget>
|
||||
|
||||
#include "searchdeviceitem.h"
|
||||
#include "adddeviceitem.h"
|
||||
#include "util.h"
|
||||
#include "loadanimation.h"
|
||||
#include "devicecodewidget.h"
|
||||
|
@ -31,6 +30,11 @@ public:
|
|||
|
||||
void setSearchBtnState(bool isShow);
|
||||
|
||||
void changeFontSize(double fontSize);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigItemInfo(QString);
|
||||
void sigContinueSearch();
|
||||
|
@ -44,12 +48,13 @@ private:
|
|||
private:
|
||||
QListWidget *m_listWidget = nullptr;
|
||||
|
||||
AddDeviceItem *m_continueSearchDeviceItem = nullptr;
|
||||
LoadAnimation *m_loadAnimation = nullptr;
|
||||
QStackedWidget *m_stackedWidget = nullptr;
|
||||
LevitationButton *m_searchBtn = nullptr;
|
||||
bool isShowSearchBtn = false;
|
||||
bool isSearchInitFinish = false;
|
||||
PublicAttributes::Theme m_theme = PublicAttributes::Theme::Light; // 当前主题
|
||||
double m_fontSize = 10;
|
||||
|
||||
Q_SIGNALS:
|
||||
};
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
int UsbConnectWin::ROLLING_WIN_W = 772;
|
||||
int UsbConnectWin::ROLLING_WIN_H = 400;
|
||||
const int CONNECT_BTN_W = 160;
|
||||
const int CONNECT_BTN_H = 48;
|
||||
|
||||
UsbConnectWin::UsbConnectWin(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
|
@ -70,7 +68,6 @@ UsbConnectWin::UsbConnectWin(QWidget *parent) : QWidget(parent)
|
|||
|
||||
m_connectBtn = new QPushButton(this);
|
||||
connect(m_connectBtn, &QPushButton::clicked, this, &UsbConnectWin::sigUSBconnectBtnClicked);
|
||||
m_connectBtn->setFixedSize(CONNECT_BTN_W, CONNECT_BTN_H);
|
||||
m_connectBtn->setText(tr("Connect now"));
|
||||
m_connectBtn->setProperty("isImportant", true);
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@ AndroidHomePage::AndroidHomePage(QWidget *parent) : QWidget(parent)
|
|||
connect(m_multiMediaWin, &MultiMediaWin::sigBtnClicked, this, &AndroidHomePage::sigBtnClicked);
|
||||
m_multiMediaWin->setAppItem();
|
||||
|
||||
title = new QLabel(this);
|
||||
title->setText(tr("Mobile Storage"));
|
||||
m_title = new QLabel(this);
|
||||
m_title->setText(tr("Mobile Storage"));
|
||||
QFont font;
|
||||
font.setBold(true);
|
||||
title->setFont(font);
|
||||
m_title->setFont(font);
|
||||
|
||||
m_storageItem = new AndroidItem(AndroidItem::Type::File, this);
|
||||
connect(m_storageItem, &AndroidItem::sigBtnClicked, this, &AndroidHomePage::sigBtnClicked);
|
||||
|
@ -22,8 +22,8 @@ AndroidHomePage::AndroidHomePage(QWidget *parent) : QWidget(parent)
|
|||
QHBoxLayout *titleHLayout = new QHBoxLayout;
|
||||
titleHLayout->setSpacing(0);
|
||||
titleHLayout->setMargin(0);
|
||||
titleHLayout->addSpacing(18);
|
||||
titleHLayout->addWidget(title);
|
||||
titleHLayout->addSpacing(26);
|
||||
titleHLayout->addWidget(m_title);
|
||||
titleHLayout->addStretch();
|
||||
|
||||
QHBoxLayout *itemHLayout = new QHBoxLayout;
|
||||
|
@ -53,4 +53,14 @@ void AndroidHomePage::setTheme(PublicAttributes::Theme theme)
|
|||
{
|
||||
m_multiMediaWin->setTheme(theme);
|
||||
m_storageItem->setTheme(theme);
|
||||
}
|
||||
|
||||
void AndroidHomePage::changeFontSize(double fontSize)
|
||||
{
|
||||
m_multiMediaWin->changeFontSize(fontSize);
|
||||
m_storageItem->changeFontSize(fontSize);
|
||||
QFont font;
|
||||
font.setPointSizeF(fontSize);
|
||||
font.setBold(true);
|
||||
m_title->setFont(font);
|
||||
}
|
|
@ -15,13 +15,14 @@ public:
|
|||
|
||||
void setItemCount(AndroidItem::Type type, int num);
|
||||
void setTheme(PublicAttributes::Theme theme);
|
||||
void changeFontSize(double fontSize);
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigBtnClicked(AndroidItem::Type);
|
||||
|
||||
private:
|
||||
MultiMediaWin *m_multiMediaWin = nullptr;
|
||||
QLabel *title = nullptr;
|
||||
QLabel *m_title = nullptr;
|
||||
AndroidItem *m_storageItem = nullptr;
|
||||
};
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
const int ITEM_ICON_WIDTH = 42;
|
||||
const int ITEM_ICON_HEIGHT = 42;
|
||||
const int ITEM_W = 208;
|
||||
const int ITEM_W = 205;
|
||||
const int ITEM_H = 80;
|
||||
const QString ITEM_ICON_PATH = ":/filemanageview/";
|
||||
const QStringList ICON_LIST = {"pictureIcon.png", "videoIcon.png", "musicIcon.png", "documentIcon.png",
|
||||
|
@ -30,12 +30,17 @@ AndroidItem::AndroidItem(AndroidItem::Type type, QWidget *parent) : QPushButton(
|
|||
font.setBold(true);
|
||||
m_itemNameLabel->setFont(font);
|
||||
m_itemNameLabel->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
|
||||
m_itemNameLabel->setMinimumHeight(30);
|
||||
m_itemNameLabel->setStyleSheet("background-color:transparent;");
|
||||
|
||||
// 每一项总数
|
||||
m_itemCountLabel = new QLabel(this);
|
||||
m_itemCountLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
||||
m_itemCountLabel->setStyleSheet("background-color:transparent;color:#8F9399;font-size:12px");
|
||||
m_itemNameLabel->setMinimumHeight(30);
|
||||
font.setBold(false);
|
||||
font.setPointSizeF(12);
|
||||
m_itemCountLabel->setFont(font);
|
||||
m_itemCountLabel->setStyleSheet("background-color:transparent;color:#8F9399;");
|
||||
|
||||
QVBoxLayout *labelVLayout = new QVBoxLayout();
|
||||
labelVLayout->setSpacing(0);
|
||||
|
@ -47,7 +52,7 @@ AndroidItem::AndroidItem(AndroidItem::Type type, QWidget *parent) : QPushButton(
|
|||
labelVLayout->addStretch();
|
||||
|
||||
QHBoxLayout *mainHLayout = new QHBoxLayout();
|
||||
mainHLayout->setMargin(19);
|
||||
mainHLayout->setContentsMargins(19, 10, 19, 10);
|
||||
mainHLayout->setSpacing(0);
|
||||
mainHLayout->addWidget(m_itemIconLabel);
|
||||
mainHLayout->addSpacing(11);
|
||||
|
@ -122,3 +127,13 @@ void AndroidItem::setTheme(PublicAttributes::Theme theme)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AndroidItem::changeFontSize(double fontSize)
|
||||
{
|
||||
QFont font;
|
||||
font.setPointSizeF(fontSize - 2);
|
||||
m_itemCountLabel->setFont(font);
|
||||
font.setPointSizeF(fontSize);
|
||||
font.setBold(true);
|
||||
m_itemNameLabel->setFont(font);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@ public:
|
|||
// 设置主题
|
||||
void setTheme(PublicAttributes::Theme theme);
|
||||
|
||||
void changeFontSize(double fontSize);
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigBtnClicked(AndroidItem::Type);
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
#include <QScrollBar>
|
||||
#include <QDebug>
|
||||
|
||||
const int BUTTON_WIDTH = 16;
|
||||
const int BUTTON_HEIGHT = 16;
|
||||
const int ICON_SIZE = 16;
|
||||
const int BTN_SIZE = 40;
|
||||
const int SEARCHLINE_WIDTH = 200;
|
||||
|
||||
FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
||||
|
@ -18,7 +18,8 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
m_retreatBtn = new kdk::KToolButton(this);
|
||||
connect(m_retreatBtn, &kdk::KToolButton::clicked, this, &FileManageWin::slotKdkBtnClicked);
|
||||
m_retreatBtn->setIcon(QIcon::fromTheme("go-next-rtl-symbolic"));
|
||||
m_retreatBtn->setIconSize(QSize(BUTTON_WIDTH, BUTTON_HEIGHT));
|
||||
m_retreatBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
m_retreatBtn->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
|
||||
m_retreatBtn->setToolTip(tr("Go Back"));
|
||||
m_retreatBtn->setType(kdk::KToolButtonType::Flat);
|
||||
m_retreatBtn->setCursor(Qt::PointingHandCursor);
|
||||
|
@ -29,7 +30,8 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
m_forwardBtn = new kdk::KToolButton(this);
|
||||
connect(m_forwardBtn, &kdk::KToolButton::clicked, this, &FileManageWin::slotKdkBtnClicked);
|
||||
m_forwardBtn->setIcon(QIcon::fromTheme("go-next-symbolic"));
|
||||
m_forwardBtn->setIconSize(QSize(BUTTON_WIDTH, BUTTON_HEIGHT));
|
||||
m_forwardBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
m_forwardBtn->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
|
||||
m_forwardBtn->setToolTip(tr("Go Forward"));
|
||||
m_forwardBtn->setType(kdk::KToolButtonType::Flat);
|
||||
m_forwardBtn->setCursor(Qt::PointingHandCursor);
|
||||
|
@ -49,7 +51,8 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
m_searchBtn = new kdk::KToolButton(this);
|
||||
connect(m_searchBtn, &kdk::KToolButton::clicked, this, &FileManageWin::slotKdkBtnClicked);
|
||||
m_searchBtn->setIcon(QIcon::fromTheme("system-search-symbolic"));
|
||||
m_searchBtn->setIconSize(QSize(BUTTON_WIDTH, BUTTON_HEIGHT));
|
||||
m_searchBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
m_searchBtn->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
|
||||
m_searchBtn->setToolTip(tr("Search File"));
|
||||
m_searchBtn->setType(kdk::KToolButtonType::Flat);
|
||||
m_searchBtn->setFocusPolicy(Qt::NoFocus);
|
||||
|
@ -58,7 +61,7 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
|
||||
m_searchLine = new kdk::KSearchLineEdit(this);
|
||||
connect(m_searchLine, &kdk::KSearchLineEdit::textChanged, this, &FileManageWin::slotSearchTextChanged);
|
||||
m_searchLine->setFixedHeight(40);
|
||||
m_searchLine->setFixedHeight(BTN_SIZE);
|
||||
m_searchLine->setFixedWidth(0);
|
||||
m_searchLine->setFocusPolicy(Qt::NoFocus);
|
||||
m_searchLine->setClearButtonEnabled(true);
|
||||
|
@ -76,7 +79,8 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
m_editBtn = new kdk::KToolButton(this);
|
||||
connect(m_editBtn, &kdk::KToolButton::clicked, this, &FileManageWin::slotKdkBtnClicked);
|
||||
m_editBtn->setIcon(QIcon::fromTheme("document-edit-symbolic"));
|
||||
m_editBtn->setIconSize(QSize(BUTTON_WIDTH, BUTTON_HEIGHT));
|
||||
m_editBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
m_editBtn->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
|
||||
m_editBtn->setToolTip(tr("Select"));
|
||||
m_editBtn->setType(kdk::KToolButtonType::Flat);
|
||||
m_editBtn->setFocusPolicy(Qt::NoFocus);
|
||||
|
@ -95,7 +99,8 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
m_modeBtn = new kdk::KToolButton(this);
|
||||
connect(m_modeBtn, &kdk::KToolButton::clicked, this, &FileManageWin::slotKdkBtnClicked);
|
||||
m_modeBtn->setIcon(QIcon::fromTheme("view-grid-symbolic"));
|
||||
m_modeBtn->setIconSize(QSize(BUTTON_WIDTH, BUTTON_HEIGHT));
|
||||
m_modeBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
m_modeBtn->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
|
||||
m_modeBtn->setType(kdk::KToolButtonType::Flat);
|
||||
m_modeBtn->setToolTip(tr("List Mode"));
|
||||
m_modeBtn->setFocusPolicy(Qt::NoFocus);
|
||||
|
@ -106,7 +111,8 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
m_refreshBtn = new kdk::KToolButton(this);
|
||||
connect(m_refreshBtn, &kdk::KToolButton::clicked, this, &FileManageWin::slotKdkBtnClicked);
|
||||
m_refreshBtn->setIcon(QIcon::fromTheme("view-refresh-symbolic"));
|
||||
m_refreshBtn->setIconSize(QSize(BUTTON_WIDTH, BUTTON_HEIGHT));
|
||||
m_refreshBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
m_refreshBtn->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
|
||||
m_refreshBtn->setType(kdk::KToolButtonType::Flat);
|
||||
m_refreshBtn->setToolTip(tr("Refresh"));
|
||||
m_refreshBtn->setFocusPolicy(Qt::NoFocus);
|
||||
|
@ -117,7 +123,7 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
m_statusLab->setText(tr("Select File"));
|
||||
m_statusLab->setFont(font);
|
||||
m_statusLab->setContentsMargins(8, 0, 0, 0);
|
||||
m_statusLab->setFixedHeight(40);
|
||||
m_statusLab->setFixedHeight(BTN_SIZE);
|
||||
m_statusLab->setFocusPolicy(Qt::NoFocus);
|
||||
m_statusLab->hide();
|
||||
|
||||
|
@ -126,7 +132,7 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
m_selectBtn->setText(tr("Select All"));
|
||||
m_selectBtn->setStyleSheet("color:#3790FA;");
|
||||
m_selectBtn->setCursor(Qt::PointingHandCursor);
|
||||
m_selectBtn->setFixedHeight(20);
|
||||
m_selectBtn->setFixedHeight(BTN_SIZE);
|
||||
m_selectBtn->setFocusPolicy(Qt::NoFocus);
|
||||
m_selectBtn->hide();
|
||||
|
||||
|
@ -135,27 +141,27 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
m_finishBtn->setText(tr("Finish"));
|
||||
m_finishBtn->setStyleSheet("color:#3790FA;");
|
||||
m_finishBtn->setCursor(Qt::PointingHandCursor);
|
||||
m_finishBtn->setFixedHeight(20);
|
||||
m_finishBtn->setFixedHeight(BTN_SIZE);
|
||||
m_finishBtn->setFocusPolicy(Qt::NoFocus);
|
||||
m_finishBtn->hide();
|
||||
|
||||
m_lab1 = new QLabel(this);
|
||||
m_lab1->setFixedSize(16, 40);
|
||||
m_lab1->setFixedSize(16, BTN_SIZE);
|
||||
m_lab1->setStyleSheet("background:transparent");
|
||||
m_lab2 = new QLabel(this);
|
||||
m_lab2->setFixedSize(28, 40);
|
||||
m_lab2->setFixedSize(28, BTN_SIZE);
|
||||
m_lab2->setStyleSheet("background:transparent");
|
||||
m_lab3 = new QLabel(this);
|
||||
m_lab3->setFixedSize(12, 40);
|
||||
m_lab3->setFixedSize(12, BTN_SIZE);
|
||||
m_lab3->setStyleSheet("background:transparent");
|
||||
m_lab4 = new QLabel(this);
|
||||
m_lab4->setFixedSize(12, 40);
|
||||
m_lab4->setFixedSize(12, BTN_SIZE);
|
||||
m_lab4->setStyleSheet("background:transparent");
|
||||
m_lab5 = new QLabel(this);
|
||||
m_lab5->setFixedSize(12, 40);
|
||||
m_lab5->setFixedSize(12, BTN_SIZE);
|
||||
m_lab5->setStyleSheet("background:transparent");
|
||||
m_lab6 = new QLabel(this);
|
||||
m_lab6->setFixedSize(12, 40);
|
||||
m_lab6->setFixedSize(12, BTN_SIZE);
|
||||
m_lab6->setStyleSheet("background:transparent");
|
||||
|
||||
QHBoxLayout *hLayout = new QHBoxLayout;
|
||||
|
@ -185,7 +191,7 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
m_loadAnimation = new LoadAnimation(this);
|
||||
|
||||
m_stackedWin = new QStackedWidget(this);
|
||||
m_stackedWin->setContentsMargins(0, 5, 0, 0);
|
||||
m_stackedWin->setContentsMargins(0, 0, 0, 0);
|
||||
m_stackedWin->addWidget(m_loadAnimation);
|
||||
m_stackedWin->setCurrentIndex(FileManageWin::PageIndex::LoadPage);
|
||||
|
||||
|
@ -283,6 +289,18 @@ QString FileManageWin::crumbText(CrumbTag type)
|
|||
case CrumbTag::Storage:
|
||||
return m_storageTag;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
void FileManageWin::changeFontSize(double fontSize)
|
||||
{
|
||||
QFont font;
|
||||
font.setPointSizeF(fontSize);
|
||||
m_selectBtn->setFont(font);
|
||||
m_finishBtn->setFont(font);
|
||||
font.setBold(true);
|
||||
m_statusLab->setFont(font);
|
||||
m_crumb->setFont(font);
|
||||
}
|
||||
|
||||
bool FileManageWin::eventFilter(QObject *obj, QEvent *event)
|
||||
|
|
|
@ -62,6 +62,7 @@ public:
|
|||
void setGoForwardEnabled(bool isEnabled);
|
||||
QStringList getPathList();
|
||||
QString crumbText(CrumbTag type);
|
||||
void changeFontSize(double fontSize);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
|
|
@ -24,8 +24,7 @@ const QString DEFAULT_DOWNLOAD_PATH = getenv("HOME") + QString("/下载");
|
|||
|
||||
FileView::FileView(QWidget *parent) : QListView(parent)
|
||||
{
|
||||
setMinimumWidth(920);
|
||||
setContentsMargins(0, 16, 0, 0);
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
setStyleSheet("QListView{background:transparent;}");
|
||||
// 自适应布局
|
||||
setResizeMode(QListView::Adjust);
|
||||
|
@ -63,7 +62,6 @@ FileView::FileView(QWidget *parent) : QListView(parent)
|
|||
void FileView::setViewMode(QListView::ViewMode mode)
|
||||
{
|
||||
m_viewModel = mode;
|
||||
QListView::setViewMode(m_viewModel);
|
||||
setIconSize(getIconSize());
|
||||
if (m_viewModel == QListView::IconMode) {
|
||||
setSpacing(ICON_MODE_SPACING);
|
||||
|
@ -71,6 +69,13 @@ void FileView::setViewMode(QListView::ViewMode mode)
|
|||
setSpacing(LIST_MODE_SPACING);
|
||||
}
|
||||
updateViewMode();
|
||||
QListView::setViewMode(m_viewModel);
|
||||
update();
|
||||
}
|
||||
|
||||
QListView::ViewMode FileView::getViewMode() const
|
||||
{
|
||||
return m_viewModel;
|
||||
}
|
||||
|
||||
void FileView::setModelFlag(PublicAttributes::Model model)
|
||||
|
@ -131,7 +136,8 @@ void FileView::setDownloadBtn(bool isShow)
|
|||
m_downloadBtn->setIcon(":/filemanageview/download.svg");
|
||||
m_downloadBtn->setText(tr("Download"));
|
||||
m_downloadBtn->move(
|
||||
QPoint(this->width() / 2 - m_downloadBtn->width() / 2, this->height() - 16 - m_downloadBtn->height()));
|
||||
QPoint(this->width() / 2 - m_downloadBtn->width() / 2, this->height() - 30 - m_downloadBtn->height()));
|
||||
m_downloadBtn->changeFontSize(m_fontSize);
|
||||
m_downloadBtn->show();
|
||||
} else {
|
||||
if (m_downloadBtn != nullptr) {
|
||||
|
@ -152,17 +158,31 @@ PublicAttributes::Theme FileView::getTheme() const
|
|||
return m_theme;
|
||||
}
|
||||
|
||||
void FileView::changeFontSize(double fontSize)
|
||||
{
|
||||
m_fontSize = fontSize;
|
||||
if (m_downloadBtn != nullptr) {
|
||||
m_downloadBtn->changeFontSize(m_fontSize);
|
||||
}
|
||||
QFont font;
|
||||
font.setPointSizeF(fontSize);
|
||||
setFont(font);
|
||||
update();
|
||||
}
|
||||
|
||||
void FileView::setItemMode(FileView::ItemSelectMode mode, bool isClear)
|
||||
{
|
||||
m_itemMode = mode;
|
||||
if (isClear) {
|
||||
clearSelection();
|
||||
}
|
||||
setDownloadBtn(false);
|
||||
if (m_itemMode == ItemSelectMode::Default) {
|
||||
QListView::setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
} else {
|
||||
QListView::setSelectionMode(QAbstractItemView::MultiSelection);
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
FileView::ItemSelectMode FileView::getItemMode() const
|
||||
|
@ -183,7 +203,6 @@ void FileView::setNoDownloadBtn()
|
|||
void FileView::setAdaptiveHeight()
|
||||
{
|
||||
m_isAdaptiveHeight = true;
|
||||
setMinimumWidth(890);
|
||||
verticalScrollBar()->setDisabled(true);
|
||||
horizontalScrollBar()->setDisabled(true);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
@ -381,10 +400,17 @@ void FileView::setAdjustHeight(int count)
|
|||
if (m_isAdaptiveHeight) {
|
||||
if (m_viewModel == QListView::IconMode) {
|
||||
int column = (size().width() - ICON_MODE_SPACING) / (ICON_MODE_SPACING + ICON_MODE_ITEM_WIDTH);
|
||||
if (column == 0) {
|
||||
column = 1;
|
||||
}
|
||||
int row = count / column;
|
||||
setFixedHeight(((row + 1) * (ICON_MODE_ITEM_HEIGHT + ICON_MODE_SPACING)) + 32);
|
||||
if (row == 0 || (count % column) != 0) {
|
||||
row = row + 1;
|
||||
}
|
||||
setFixedHeight((row * (ICON_MODE_ITEM_HEIGHT + ICON_MODE_SPACING)) + ICON_MODE_SPACING);
|
||||
} else {
|
||||
setFixedHeight(((LIST_MODE_ITEM_HEIGHT + LIST_MODE_SPACING) * count) + 32);
|
||||
setFixedHeight(((LIST_MODE_ITEM_HEIGHT + LIST_MODE_SPACING + LIST_MODE_SPACING) * count)
|
||||
+ LIST_MODE_SPACING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -428,12 +454,13 @@ QIcon FileView::getPictureIcon(QString path)
|
|||
if (path.isEmpty()) {
|
||||
return QIcon::fromTheme("image-x-generic");
|
||||
} else {
|
||||
QPixmap thumbnail = QIcon(path).pixmap(getIconSize());
|
||||
if (thumbnail.isNull()) {
|
||||
QFileInfo info(path);
|
||||
if (!info.exists()) {
|
||||
return QIcon::fromTheme("image-x-generic");
|
||||
} else {
|
||||
return QIcon(thumbnail);
|
||||
}
|
||||
QPixmap thumbnail = QPixmap(path);
|
||||
thumbnail = thumbnail.scaled(getIconSize(), Qt::KeepAspectRatio);
|
||||
return QIcon(thumbnail);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -442,23 +469,24 @@ QIcon FileView::getVideoIcon(QString path)
|
|||
if (path.isEmpty()) {
|
||||
return QIcon::fromTheme("video");
|
||||
} else {
|
||||
QPixmap thumbnail = QIcon(path).pixmap(getIconSize());
|
||||
if (thumbnail.isNull()) {
|
||||
QFileInfo info(path);
|
||||
if (!info.exists()) {
|
||||
return QIcon(":/filemanageview/videodefault.svg");
|
||||
} else {
|
||||
QPixmap playPixmap(":/filemanageview/play.png");
|
||||
if (m_viewModel == QListView::IconMode) {
|
||||
playPixmap = playPixmap.scaled(QSize(36, 36), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
} else {
|
||||
playPixmap = playPixmap.scaled(QSize(20, 20), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
}
|
||||
QPainter imagepainter(&thumbnail); //新建画板
|
||||
imagepainter.setCompositionMode(QPainter::CompositionMode_SourceOver); //设置重叠效果
|
||||
imagepainter.drawPixmap((thumbnail.width() - playPixmap.width()) / 2,
|
||||
(thumbnail.height() - playPixmap.height()) / 2, playPixmap);
|
||||
imagepainter.end();
|
||||
return QIcon(thumbnail);
|
||||
}
|
||||
QPixmap thumbnail = QPixmap(path);
|
||||
thumbnail = thumbnail.scaled(getIconSize(), Qt::KeepAspectRatio);
|
||||
QPixmap playPixmap(":/filemanageview/play.svg");
|
||||
if (m_viewModel == QListView::IconMode) {
|
||||
playPixmap = playPixmap.scaled(QSize(36, 36), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
} else {
|
||||
playPixmap = playPixmap.scaled(QSize(24, 24), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
}
|
||||
QPainter imagepainter(&thumbnail); //新建画板
|
||||
imagepainter.setCompositionMode(QPainter::CompositionMode_SourceOver); //设置重叠效果
|
||||
imagepainter.drawPixmap((thumbnail.width() - playPixmap.width()) / 2,
|
||||
(thumbnail.height() - playPixmap.height()) / 2, playPixmap);
|
||||
imagepainter.end();
|
||||
return QIcon(thumbnail);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -469,7 +497,7 @@ void FileView::slotDoubleClicked(const QModelIndex &index)
|
|||
|
||||
void FileView::slotClicked(const QModelIndex &index)
|
||||
{
|
||||
if (m_model == PublicAttributes::Model::Table) {
|
||||
if (m_model == PublicAttributes::Model::Table && m_itemMode == ItemSelectMode::Default) {
|
||||
openFile(index);
|
||||
} else {
|
||||
setDownloadBtn(true);
|
||||
|
|
|
@ -27,13 +27,16 @@ public:
|
|||
};
|
||||
|
||||
void setViewMode(QListView::ViewMode mode);
|
||||
QListView::ViewMode getViewMode() const;
|
||||
void setModelFlag(PublicAttributes::Model model);
|
||||
QMap<QString, QStandardItem *> setViewInfo(const QMap<QString, FileInfo> &map);
|
||||
QMap<QString, QStandardItem *> setViewInfo(const QList<FileInfo> &list);
|
||||
void setTheme(PublicAttributes::Theme theme);
|
||||
PublicAttributes::Theme getTheme() const;
|
||||
void changeFontSize(double fontSize);
|
||||
void setItemMode(FileView::ItemSelectMode mode, bool isClear = false);
|
||||
FileView::ItemSelectMode getItemMode() const;
|
||||
void setDownloadBtn(bool isShow);
|
||||
void setAllowDrag(bool isAllowDrag);
|
||||
void setNoDownloadBtn();
|
||||
void setAdaptiveHeight();
|
||||
|
@ -52,7 +55,6 @@ private:
|
|||
void setInfo(const QMap<QString, FileInfo> &map);
|
||||
void setInfo(const QList<FileInfo> &list);
|
||||
void openFile(const QModelIndex &index);
|
||||
void setDownloadBtn(bool isShow);
|
||||
void sendDownloadInfo();
|
||||
void setAdjustHeight(int count);
|
||||
void updateViewMode();
|
||||
|
@ -81,10 +83,11 @@ private:
|
|||
QStandardItemModel *m_listModel = nullptr;
|
||||
LevitationButton *m_downloadBtn = nullptr; // 下载悬浮按钮
|
||||
|
||||
QMap<QString, QStandardItem *> m_itemMap; // 用于设置缩略图
|
||||
PublicAttributes::Model m_model = PublicAttributes::Model::PcModel; // 当前设备模式
|
||||
QListView::ViewMode m_viewModel = QListView::IconMode; // 当前视图模式
|
||||
PublicAttributes::Theme m_theme = PublicAttributes::Theme::Light; // 当前主题
|
||||
QMap<QString, QStandardItem *> m_itemMap; // 用于设置缩略图
|
||||
PublicAttributes::Model m_model = PublicAttributes::Model::PcModel; // 当前设备模式
|
||||
QListView::ViewMode m_viewModel = QListView::IconMode; // 当前视图模式
|
||||
PublicAttributes::Theme m_theme = PublicAttributes::Theme::Light; // 当前主题
|
||||
double m_fontSize = 10;
|
||||
FileView::ItemSelectMode m_itemMode = FileView::ItemSelectMode::Default; // 当前item视图模式
|
||||
bool m_isAllowDrag = true;
|
||||
bool m_isShowDownloadBtn = true; // 是否需要下载按钮
|
||||
|
|
|
@ -21,7 +21,7 @@ const int ICON_MODE_ITEM_WIDTH = 96;
|
|||
const int ICON_MODE_ITEM_HEIGHT = 104;
|
||||
const int LIST_MODE_ITEM_HEIGHT = 56;
|
||||
|
||||
FileViewDelegate::FileViewDelegate(QAbstractItemView *parent) : QStyledItemDelegate(parent) {}
|
||||
FileViewDelegate::FileViewDelegate(QAbstractItemView *parent) : kdk::KListViewDelegate(parent) {}
|
||||
|
||||
FileViewDelegate::~FileViewDelegate() {}
|
||||
|
||||
|
@ -29,7 +29,7 @@ void FileViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
|||
{
|
||||
auto *view = qobject_cast<const FileView *>(option.widget);
|
||||
if (view->getItemMode() == FileView::ItemSelectMode::Default) {
|
||||
defaultPaint(painter, option, index);
|
||||
kdk::KListViewDelegate::paint(painter, option, index);
|
||||
} else {
|
||||
editModePaint(painter, option, index);
|
||||
}
|
||||
|
@ -37,9 +37,9 @@ void FileViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
|||
|
||||
QSize FileViewDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
auto *listView = qobject_cast<const QListView *>(option.widget);
|
||||
auto *listView = qobject_cast<const FileView *>(option.widget);
|
||||
|
||||
if (listView->viewMode() == QListView::IconMode) {
|
||||
if (listView->getViewMode() == QListView::IconMode) {
|
||||
return QSize(ICON_MODE_ITEM_WIDTH, ICON_MODE_ITEM_HEIGHT);
|
||||
} else {
|
||||
auto size = QStyledItemDelegate::sizeHint(option, index);
|
||||
|
@ -47,229 +47,32 @@ QSize FileViewDelegate::sizeHint(const QStyleOptionViewItem &option, const QMode
|
|||
}
|
||||
}
|
||||
|
||||
void FileViewDelegate::defaultPaint(QPainter *painter, const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const
|
||||
{
|
||||
QFont font;
|
||||
font = QApplication::font();
|
||||
QFontMetrics fm(font);
|
||||
int height = fm.height();
|
||||
|
||||
if (index.isValid()) {
|
||||
auto *view = qobject_cast<const FileView *>(option.widget);
|
||||
if (!view)
|
||||
return;
|
||||
if (view->viewMode() == QListView::ListMode) {
|
||||
QRectF rect;
|
||||
rect.setX(option.rect.x());
|
||||
rect.setY(option.rect.y());
|
||||
rect.setWidth(option.rect.width());
|
||||
rect.setHeight(option.rect.height());
|
||||
// QPainterPath画圆角矩形
|
||||
const qreal radius = 4;
|
||||
QPainterPath path;
|
||||
path.moveTo(rect.topRight() - QPointF(radius, 0));
|
||||
path.lineTo(rect.topLeft() + QPointF(radius, 0));
|
||||
path.quadTo(rect.topLeft(), rect.topLeft() + QPointF(0, radius));
|
||||
path.lineTo(rect.bottomLeft() + QPointF(0, -radius));
|
||||
path.quadTo(rect.bottomLeft(), rect.bottomLeft() + QPointF(radius, 0));
|
||||
path.lineTo(rect.bottomRight() - QPointF(radius, 0));
|
||||
path.quadTo(rect.bottomRight(), rect.bottomRight() + QPointF(0, -radius));
|
||||
path.lineTo(rect.topRight() + QPointF(0, radius));
|
||||
path.quadTo(rect.topRight(), rect.topRight() + QPointF(-radius, -0));
|
||||
|
||||
QString mainText = index.data(Qt::DisplayRole).toString(); //获取主文本和副文本
|
||||
QString subText = index.data(Qt::UserRole).toString();
|
||||
|
||||
auto *model =
|
||||
dynamic_cast<QStandardItemModel *>(const_cast<QAbstractItemModel *>(index.model())); //获取图标
|
||||
QIcon icon = model->item(index.row())->icon();
|
||||
QRect iconRect = QRect(rect.left() + 8, rect.top() + 10, view->iconSize().width() + (height - 23) * 2,
|
||||
view->iconSize().height() + (height - 23) * 2); // 绘制图标的位置;
|
||||
QRect MainText, SubText;
|
||||
if (subText.isNull()) {
|
||||
MainText = QRect(iconRect.right() + 8, rect.top() + 10 + iconRect.height() / 2 - height / 2,
|
||||
rect.width(), height); // 绘制文本的位置
|
||||
} else {
|
||||
MainText = QRect(iconRect.right() + 8, rect.top() + 10, rect.width(), height); // 绘制两个文本的位置
|
||||
SubText = QRect(iconRect.right() + 8, rect.bottom() - 10 - height, rect.width(), height);
|
||||
}
|
||||
|
||||
painter->save();
|
||||
|
||||
// item可选中 (单选)
|
||||
QColor color;
|
||||
if (option.state.testFlag(QStyle::State_MouseOver) && !(option.state.testFlag(QStyle::State_Selected))) {
|
||||
if (view->getTheme() == PublicAttributes::Theme::Light) {
|
||||
color = option.palette.windowText().color();
|
||||
color.setAlphaF(0.25);
|
||||
} else {
|
||||
color = option.palette.highlight().color().lighter(120);
|
||||
color.setAlphaF(0.5);
|
||||
}
|
||||
painter->setPen(QPen(Qt::NoPen));
|
||||
painter->setBrush(color);
|
||||
painter->drawPath(path);
|
||||
} else if (option.state.testFlag(QStyle::State_Selected)) {
|
||||
color = option.palette.highlight().color();
|
||||
painter->setPen(QPen(Qt::NoPen));
|
||||
painter->setBrush(color);
|
||||
painter->drawPath(path);
|
||||
}
|
||||
|
||||
// icon.paint(painter,iconRect);
|
||||
QPixmap pixmap =
|
||||
icon.pixmap(view->iconSize().width() + (height - 23) * 2, view->iconSize().width() + (height - 23) * 2);
|
||||
painter->drawPixmap(iconRect, pixmap);
|
||||
|
||||
// 点击反白效果,画icon和text
|
||||
if (view->getTheme() == PublicAttributes::Theme::Light) {
|
||||
if (option.state.testFlag(QStyle::State_Selected)) {
|
||||
painter->setPen(QColor(230, 230, 230));
|
||||
painter->drawText(MainText, mainText);
|
||||
} else {
|
||||
painter->setPen(QColor(38, 38, 38));
|
||||
painter->drawText(MainText, mainText);
|
||||
}
|
||||
} else {
|
||||
painter->setPen(QColor(230, 230, 230));
|
||||
painter->drawText(MainText, mainText);
|
||||
}
|
||||
if (!subText.isNull()) {
|
||||
painter->setPen(QColor(169, 169, 169));
|
||||
painter->drawText(SubText, subText);
|
||||
}
|
||||
painter->restore();
|
||||
} else if (view->viewMode() == QListView::IconMode) {
|
||||
QStyleOptionViewItem styleOptionViewItem(option); // 定义
|
||||
initStyleOption(&styleOptionViewItem, index); // 初始化
|
||||
QStyle *pStyle = styleOptionViewItem.widget->style();
|
||||
pStyle->drawControl(QStyle::CE_ItemViewItem, &styleOptionViewItem, painter, styleOptionViewItem.widget);
|
||||
}
|
||||
}
|
||||
}
|
||||
void FileViewDelegate::editModePaint(QPainter *painter, const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const
|
||||
{
|
||||
QFont font;
|
||||
font = QApplication::font();
|
||||
QFontMetrics fm(font);
|
||||
int height = fm.height();
|
||||
|
||||
if (index.isValid()) {
|
||||
auto *view = qobject_cast<const FileView *>(option.widget);
|
||||
if (!view)
|
||||
return;
|
||||
if (view->viewMode() == QListView::ListMode) {
|
||||
QRectF rect;
|
||||
rect.setX(option.rect.x());
|
||||
rect.setY(option.rect.y());
|
||||
rect.setWidth(option.rect.width());
|
||||
rect.setHeight(option.rect.height());
|
||||
// QPainterPath画圆角矩形
|
||||
const qreal radius = 4;
|
||||
QPainterPath path;
|
||||
path.moveTo(rect.topRight() - QPointF(radius, 0));
|
||||
path.lineTo(rect.topLeft() + QPointF(radius, 0));
|
||||
path.quadTo(rect.topLeft(), rect.topLeft() + QPointF(0, radius));
|
||||
path.lineTo(rect.bottomLeft() + QPointF(0, -radius));
|
||||
path.quadTo(rect.bottomLeft(), rect.bottomLeft() + QPointF(radius, 0));
|
||||
path.lineTo(rect.bottomRight() - QPointF(radius, 0));
|
||||
path.quadTo(rect.bottomRight(), rect.bottomRight() + QPointF(0, -radius));
|
||||
path.lineTo(rect.topRight() + QPointF(0, radius));
|
||||
path.quadTo(rect.topRight(), rect.topRight() + QPointF(-radius, -0));
|
||||
|
||||
QString mainText = index.data(Qt::DisplayRole).toString(); //获取主文本和副文本
|
||||
QString subText = index.data(Qt::UserRole).toString();
|
||||
|
||||
auto *model =
|
||||
dynamic_cast<QStandardItemModel *>(const_cast<QAbstractItemModel *>(index.model())); //获取图标
|
||||
QIcon icon = model->item(index.row())->icon();
|
||||
QRect iconRect = QRect(rect.left() + 12, rect.top() + 12, view->iconSize().width() + (height - 23) * 2,
|
||||
view->iconSize().width() + (height - 23) * 2); // 绘制图标的位置;
|
||||
QRect MainText, SubText;
|
||||
if (subText.isNull()) {
|
||||
MainText = QRect(iconRect.right() + 8, rect.top() + 10 + iconRect.height() / 2 - height / 2,
|
||||
rect.width(), height); // 绘制文本的位置
|
||||
} else {
|
||||
MainText = QRect(iconRect.right() + 8, rect.top() + 10, rect.width(), height); // 绘制两个文本的位置
|
||||
SubText = QRect(iconRect.right() + 8, rect.bottom() - 10 - height, rect.width(), height);
|
||||
}
|
||||
painter->save();
|
||||
|
||||
// item可选中 (单选)
|
||||
QColor color;
|
||||
if (option.state.testFlag(QStyle::State_MouseOver) && !(option.state.testFlag(QStyle::State_Selected))) {
|
||||
if (view->getTheme() == PublicAttributes::Theme::Light) {
|
||||
color = option.palette.windowText().color();
|
||||
color.setAlphaF(0.25);
|
||||
} else {
|
||||
color = option.palette.highlight().color().lighter(120);
|
||||
color.setAlphaF(0.5);
|
||||
}
|
||||
painter->setPen(QPen(Qt::NoPen));
|
||||
painter->setBrush(color);
|
||||
painter->drawPath(path);
|
||||
} else if (option.state.testFlag(QStyle::State_Selected)) {
|
||||
color = option.palette.highlight().color();
|
||||
painter->setPen(QPen(Qt::NoPen));
|
||||
painter->setBrush(color);
|
||||
painter->drawPath(path);
|
||||
}
|
||||
|
||||
// icon.paint(painter,iconRect);
|
||||
QPixmap pixmap =
|
||||
icon.pixmap(view->iconSize().width() + (height - 23) * 2, view->iconSize().width() + (height - 23) * 2);
|
||||
painter->drawPixmap(iconRect, pixmap);
|
||||
|
||||
// 点击反白效果,画icon和text
|
||||
if (view->getTheme() == PublicAttributes::Theme::Light) {
|
||||
if (option.state.testFlag(QStyle::State_Selected)) {
|
||||
painter->setPen(QColor(230, 230, 230));
|
||||
painter->drawText(MainText, mainText);
|
||||
} else {
|
||||
painter->setPen(QColor(38, 38, 38));
|
||||
painter->drawText(MainText, mainText);
|
||||
}
|
||||
} else {
|
||||
painter->setPen(QColor(230, 230, 230));
|
||||
painter->drawText(MainText, mainText);
|
||||
}
|
||||
if (!subText.isNull()) {
|
||||
painter->setPen(QColor(169, 169, 169));
|
||||
painter->drawText(SubText, subText);
|
||||
}
|
||||
|
||||
QRect selectIconRect = QRect(rect.right() - 24, rect.top() + 21, 14, 14); // 绘制可选图标的位置;
|
||||
QIcon selectIcon;
|
||||
if (option.state.testFlag(QStyle::State_Selected)) {
|
||||
selectIcon = QIcon(":/filemanageview/select.svg");
|
||||
} else {
|
||||
selectIcon = QIcon(":/filemanageview/rectangle.svg");
|
||||
}
|
||||
QPixmap selectPixmap = selectIcon.pixmap(14, 14);
|
||||
painter->drawPixmap(selectIconRect, selectPixmap);
|
||||
|
||||
painter->restore();
|
||||
} else if (view->viewMode() == QListView::IconMode) {
|
||||
QStyleOptionViewItem styleOptionViewItem(option); //定义
|
||||
initStyleOption(&styleOptionViewItem, index); //初始化
|
||||
QStyle *pStyle = styleOptionViewItem.widget->style();
|
||||
QRectF rect;
|
||||
rect.setX(option.rect.x());
|
||||
rect.setY(option.rect.y());
|
||||
rect.setWidth(option.rect.width());
|
||||
rect.setHeight(option.rect.height());
|
||||
QRect selectIconRect = QRect(rect.right() - 15, rect.top(), 14, 14); // 绘制可选图标的位置;
|
||||
QIcon selectIcon;
|
||||
if (option.state.testFlag(QStyle::State_Selected)) {
|
||||
selectIcon = QIcon(":/filemanageview/select.svg");
|
||||
} else {
|
||||
selectIcon = QIcon(":/filemanageview/rectangle.svg");
|
||||
}
|
||||
QPixmap selectPixmap = selectIcon.pixmap(14, 14);
|
||||
painter->drawPixmap(selectIconRect, selectPixmap);
|
||||
pStyle->drawControl(QStyle::CE_ItemViewItem, &styleOptionViewItem, painter, styleOptionViewItem.widget);
|
||||
}
|
||||
kdk::KListViewDelegate::paint(painter, option, index);
|
||||
auto *view = qobject_cast<const FileView *>(option.widget);
|
||||
if (!view) {
|
||||
return;
|
||||
}
|
||||
QRectF rect;
|
||||
rect.setX(option.rect.x());
|
||||
rect.setY(option.rect.y());
|
||||
rect.setWidth(option.rect.width());
|
||||
rect.setHeight(option.rect.height());
|
||||
QRect selectIconRect;
|
||||
// 绘制可选图标的位置
|
||||
if (view->viewMode() == QListView::ListMode) {
|
||||
selectIconRect = QRect(rect.right() - 24, rect.top() + 21, 14, 14);
|
||||
} else if (view->viewMode() == QListView::IconMode) {
|
||||
selectIconRect = QRect(rect.right() - 15, rect.top(), 14, 14);
|
||||
}
|
||||
QIcon selectIcon;
|
||||
if (option.state.testFlag(QStyle::State_Selected)) {
|
||||
selectIcon = QIcon(":/filemanageview/select.svg");
|
||||
} else {
|
||||
selectIcon = QIcon(":/filemanageview/rectangle.svg");
|
||||
}
|
||||
QPixmap selectPixmap = selectIcon.pixmap(14, 14);
|
||||
painter->drawPixmap(selectIconRect, selectPixmap);
|
||||
}
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
#define FILEVIEWDELEGATE_H
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
#include <kysdk/applications/klistviewdelegate.h>
|
||||
|
||||
class FileViewDelegate : public QStyledItemDelegate
|
||||
class FileViewDelegate : public kdk::KListViewDelegate
|
||||
{
|
||||
public:
|
||||
explicit FileViewDelegate(QAbstractItemView *parent = nullptr);
|
||||
|
@ -15,7 +16,6 @@ protected:
|
|||
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
|
||||
private:
|
||||
void defaultPaint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
void editModePaint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
||||
};
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ MultiMediaWin::MultiMediaWin(QWidget *parent) : QListWidget(parent)
|
|||
setViewMode(QListView::IconMode);
|
||||
// 自适应布局
|
||||
setResizeMode(QListView::Adjust);
|
||||
setMinimumWidth(920);
|
||||
// 列表中的图标不可拖动
|
||||
setMovement(QListView::Static);
|
||||
// 去边框
|
||||
|
@ -55,13 +54,29 @@ void MultiMediaWin::setItemCount(AndroidItem::Type type, int num)
|
|||
|
||||
void MultiMediaWin::setTheme(PublicAttributes::Theme theme)
|
||||
{
|
||||
QMap<AndroidItem::Type, AndroidItem *>::iterator itemIt = m_itemMap.begin();
|
||||
while (m_itemMap.end() != itemIt) {
|
||||
itemIt.value()->setTheme(theme);
|
||||
itemIt++;
|
||||
for (AndroidItem *item : m_itemMap) {
|
||||
item->setTheme(theme);
|
||||
}
|
||||
}
|
||||
|
||||
void MultiMediaWin::changeFontSize(double fontSize)
|
||||
{
|
||||
for (AndroidItem *item : m_itemMap) {
|
||||
item->changeFontSize(fontSize);
|
||||
}
|
||||
}
|
||||
|
||||
void MultiMediaWin::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
int column = (size().width() - 16) / 219;
|
||||
int row = m_itemMap.size() / column;
|
||||
if (row == 0 || (m_itemMap.size() % column) != 0) {
|
||||
row = row + 1;
|
||||
}
|
||||
setFixedHeight(row * 96);
|
||||
QListWidget::resizeEvent(event);
|
||||
}
|
||||
|
||||
void MultiMediaWin::addMultiMediaItem(AndroidItem::Type type)
|
||||
{
|
||||
m_maxItemIndex++;
|
||||
|
|
|
@ -21,6 +21,10 @@ public:
|
|||
void setAppItem();
|
||||
void setItemCount(AndroidItem::Type type, int num);
|
||||
void setTheme(PublicAttributes::Theme theme);
|
||||
void changeFontSize(double fontSize);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigBtnClicked(AndroidItem::Type);
|
||||
|
|
|
@ -32,7 +32,7 @@ TimeLineItem::TimeLineItem(QWidget *parent) : QWidget(parent)
|
|||
QHBoxLayout *hLayout = new QHBoxLayout;
|
||||
hLayout->setMargin(0);
|
||||
hLayout->setSpacing(0);
|
||||
hLayout->addSpacing(5);
|
||||
hLayout->addSpacing(15);
|
||||
hLayout->addWidget(m_timeTitle);
|
||||
hLayout->addStretch();
|
||||
hLayout->addWidget(m_dropDownBtn);
|
||||
|
@ -73,6 +73,14 @@ void TimeLineItem::setTheme(PublicAttributes::Theme theme)
|
|||
m_fileView->setTheme(theme);
|
||||
}
|
||||
|
||||
void TimeLineItem::changeFontSize(double fontSize)
|
||||
{
|
||||
m_fileView->changeFontSize(fontSize);
|
||||
QFont font;
|
||||
font.setPointSizeF(fontSize);
|
||||
m_timeTitle->setFont(font);
|
||||
}
|
||||
|
||||
void TimeLineItem::setItemMode(FileView::ItemSelectMode mode, bool isClear)
|
||||
{
|
||||
m_fileView->setItemMode(mode, isClear);
|
||||
|
@ -99,7 +107,7 @@ void TimeLineItem::slotDropDownBtnClicked()
|
|||
m_dropDownBtn->setIcon(QIcon::fromTheme("ukui-up-symbolic"));
|
||||
m_dropDownBtn->setToolTip(tr("pack up"));
|
||||
m_fileView->show();
|
||||
setFixedHeight(m_fileView->height());
|
||||
setFixedHeight(m_fileView->height() + HEIGHT);
|
||||
Q_EMIT sigSizeChanged(size());
|
||||
} else {
|
||||
m_dropDownBtn->setIcon(QIcon::fromTheme("ukui-down-symbolic"));
|
||||
|
@ -110,8 +118,8 @@ void TimeLineItem::slotDropDownBtnClicked()
|
|||
}
|
||||
}
|
||||
|
||||
void TimeLineItem::slotSizeChanged(QSize size)
|
||||
void TimeLineItem::slotSizeChanged(QSize viewSize)
|
||||
{
|
||||
setFixedHeight(size.height());
|
||||
Q_EMIT sigSizeChanged(size);
|
||||
setFixedHeight(viewSize.height() + HEIGHT);
|
||||
Q_EMIT sigSizeChanged(size());
|
||||
}
|
|
@ -16,6 +16,7 @@ public:
|
|||
void setModelFlag(PublicAttributes::Model model);
|
||||
QMap<QString, QStandardItem *> setViewInfo(const QList<FileInfo> &list);
|
||||
void setTheme(PublicAttributes::Theme theme);
|
||||
void changeFontSize(double fontSize);
|
||||
void setItemMode(FileView::ItemSelectMode mode, bool isClear = false);
|
||||
void selectAll();
|
||||
void clearSelection();
|
||||
|
@ -29,7 +30,7 @@ Q_SIGNALS:
|
|||
void sigCtrlAClicked();
|
||||
private Q_SLOTS:
|
||||
void slotDropDownBtnClicked();
|
||||
void slotSizeChanged(QSize size);
|
||||
void slotSizeChanged(QSize viewSize);
|
||||
|
||||
private:
|
||||
QLabel *m_timeTitle = nullptr; // 时间显示
|
||||
|
|
|
@ -14,7 +14,6 @@ TimeLineListWidget::TimeLineListWidget(QWidget *parent) : QListWidget(parent)
|
|||
setViewMode(QListView::ListMode);
|
||||
// 自适应布局
|
||||
setResizeMode(QListView::Adjust);
|
||||
setMinimumWidth(920);
|
||||
// 列表中的图标不可拖动
|
||||
setMovement(QListView::Static);
|
||||
// 去边框
|
||||
|
@ -49,7 +48,7 @@ void TimeLineListWidget::setModelFlag(PublicAttributes::Model model)
|
|||
void TimeLineListWidget::setViewInfo(const QList<FileInfo> &list)
|
||||
{
|
||||
m_fileInfos = list;
|
||||
loadItem(4);
|
||||
loadItem(6);
|
||||
}
|
||||
|
||||
void TimeLineListWidget::setTheme(PublicAttributes::Theme theme)
|
||||
|
@ -60,6 +59,17 @@ void TimeLineListWidget::setTheme(PublicAttributes::Theme theme)
|
|||
}
|
||||
}
|
||||
|
||||
void TimeLineListWidget::changeFontSize(double fontSize)
|
||||
{
|
||||
m_fontSize = fontSize;
|
||||
for (int i = 0; i < m_timeLineItems.size(); i++) {
|
||||
m_timeLineItems.value(i)->changeFontSize(fontSize);
|
||||
}
|
||||
if (m_downloadBtn != nullptr) {
|
||||
m_downloadBtn->changeFontSize(m_fontSize);
|
||||
}
|
||||
}
|
||||
|
||||
void TimeLineListWidget::setItemMode(FileView::ItemSelectMode mode, bool isClear)
|
||||
{
|
||||
m_itemMode = mode;
|
||||
|
@ -79,9 +89,10 @@ void TimeLineListWidget::setThumbnailType(ThumbnailType type)
|
|||
void TimeLineListWidget::setItemThumbnail(QString filePath)
|
||||
{
|
||||
if (m_itemMap.contains(filePath)) {
|
||||
QPixmap thumbnail = QPixmap(filePath);
|
||||
thumbnail = thumbnail.scaled(getIconSize(), Qt::KeepAspectRatio);
|
||||
if (m_thumbnailType == ThumbnailType::Image) {
|
||||
QIcon icon;
|
||||
QPixmap thumbnail = QIcon(filePath).pixmap(getIconSize());
|
||||
if (thumbnail.isNull()) {
|
||||
icon = QIcon::fromTheme("image-x-generic");
|
||||
} else {
|
||||
|
@ -90,17 +101,16 @@ void TimeLineListWidget::setItemThumbnail(QString filePath)
|
|||
m_itemMap.find(filePath).value()->setIcon(icon);
|
||||
} else if (m_thumbnailType == ThumbnailType::Video) {
|
||||
QIcon icon;
|
||||
QPixmap thumbnail = QIcon(filePath).pixmap(getIconSize());
|
||||
if (thumbnail.isNull()) {
|
||||
icon = QIcon(":/filemanageview/videodefault.svg");
|
||||
} else {
|
||||
QPixmap playPixmap(":/filemanageview/play.png");
|
||||
QPixmap playPixmap(":/filemanageview/play.svg");
|
||||
if (m_viewModel == QListView::IconMode) {
|
||||
playPixmap = playPixmap.scaled(QSize(36, 36), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
} else {
|
||||
playPixmap = playPixmap.scaled(QSize(20, 20), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
playPixmap = playPixmap.scaled(QSize(24, 24), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
}
|
||||
QPainter imagepainter(&thumbnail); //新建画板
|
||||
QPainter imagepainter(&thumbnail);
|
||||
imagepainter.setCompositionMode(QPainter::CompositionMode_SourceOver); //设置重叠效果
|
||||
imagepainter.drawPixmap((thumbnail.width() - playPixmap.width()) / 2,
|
||||
(thumbnail.height() - playPixmap.height()) / 2, playPixmap);
|
||||
|
@ -117,12 +127,14 @@ void TimeLineListWidget::selectAll()
|
|||
for (int i = 0; i < m_timeLineItems.size(); i++) {
|
||||
m_timeLineItems.value(i)->selectAll();
|
||||
}
|
||||
setDownloadBtn(true);
|
||||
}
|
||||
void TimeLineListWidget::clearSelection()
|
||||
{
|
||||
for (int i = 0; i < m_timeLineItems.size(); i++) {
|
||||
m_timeLineItems.value(i)->clearSelection();
|
||||
}
|
||||
setDownloadBtn(false);
|
||||
}
|
||||
|
||||
void TimeLineListWidget::mousePressEvent(QMouseEvent *event)
|
||||
|
@ -160,14 +172,15 @@ void TimeLineListWidget::loadItem(int num)
|
|||
if (m_currentTimeLineIndex >= m_fileInfos.size()) {
|
||||
return;
|
||||
}
|
||||
int i = 0;
|
||||
int i = 1;
|
||||
QList<FileInfo> list; // 临时存储
|
||||
for (; m_currentTimeLineIndex < m_fileInfos.size(); m_currentTimeLineIndex++) {
|
||||
QString dateTime = m_fileInfos.value(m_currentTimeLineIndex).getDate();
|
||||
if (m_currentTime != dateTime) {
|
||||
if (!list.isEmpty()) {
|
||||
setItem(list);
|
||||
if (++i > num) {
|
||||
i++;
|
||||
if (i >= num) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -178,6 +191,9 @@ void TimeLineListWidget::loadItem(int num)
|
|||
list.append(m_fileInfos.value(m_currentTimeLineIndex));
|
||||
}
|
||||
}
|
||||
if (!list.isEmpty()) {
|
||||
setItem(list);
|
||||
}
|
||||
}
|
||||
|
||||
void TimeLineListWidget::setItem(QList<FileInfo> list)
|
||||
|
@ -202,6 +218,7 @@ void TimeLineListWidget::setItem(QList<FileInfo> list)
|
|||
connect(itemWin, &TimeLineItem::sigItemSelectAll, this, &TimeLineListWidget::slotItemSelecAll);
|
||||
connect(itemWin, &TimeLineItem::sigSizeChanged, this, [=](QSize size) {
|
||||
item->setSizeHint(size);
|
||||
autoload();
|
||||
});
|
||||
connect(itemWin, &TimeLineItem::sigCtrlAClicked, this, [=]() {
|
||||
selectAll();
|
||||
|
@ -242,7 +259,8 @@ void TimeLineListWidget::setDownloadBtn(bool isShow)
|
|||
m_downloadBtn->setIcon(":/filemanageview/download.svg");
|
||||
m_downloadBtn->setText(tr("Download"));
|
||||
m_downloadBtn->move(
|
||||
QPoint(this->width() / 2 - m_downloadBtn->width() / 2, this->height() - 16 - m_downloadBtn->height()));
|
||||
QPoint(this->width() / 2 - m_downloadBtn->width() / 2, this->height() - 30 - m_downloadBtn->height()));
|
||||
m_downloadBtn->changeFontSize(m_fontSize);
|
||||
m_downloadBtn->show();
|
||||
} else {
|
||||
if (m_downloadBtn != nullptr) {
|
||||
|
@ -277,6 +295,17 @@ void TimeLineListWidget::sendDownloadInfo()
|
|||
Q_EMIT sigDownFileInfo(filePath, fileList);
|
||||
}
|
||||
|
||||
void TimeLineListWidget::autoload()
|
||||
{
|
||||
int currentHeight = 0;
|
||||
for (int i = 0; i < count(); i++) {
|
||||
currentHeight += item(i)->sizeHint().height();
|
||||
}
|
||||
if (currentHeight <= height()) {
|
||||
loadItem(2);
|
||||
}
|
||||
}
|
||||
|
||||
void TimeLineListWidget::slotValueChanged(int value)
|
||||
{
|
||||
if (value > (verticalScrollBar()->maximum() * 2 / 3)) {
|
||||
|
|
|
@ -27,6 +27,7 @@ public:
|
|||
void setModelFlag(PublicAttributes::Model model);
|
||||
void setViewInfo(const QList<FileInfo> &list);
|
||||
void setTheme(PublicAttributes::Theme theme);
|
||||
void changeFontSize(double fontSize);
|
||||
void setItemMode(FileView::ItemSelectMode mode, bool isClear = false);
|
||||
void setThumbnailType(ThumbnailType type);
|
||||
void setItemThumbnail(QString filePath);
|
||||
|
@ -44,6 +45,7 @@ private:
|
|||
QSize getIconSize();
|
||||
void setDownloadBtn(bool isShow);
|
||||
void sendDownloadInfo();
|
||||
void autoload();
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigOpenFile(FileInfo::FileType, QString);
|
||||
|
@ -59,11 +61,12 @@ private:
|
|||
LevitationButton *m_downloadBtn = nullptr; // 下载悬浮按钮
|
||||
QList<TimeLineItem *> m_timeLineItems;
|
||||
QList<FileInfo> m_fileInfos;
|
||||
QMap<QString, QStandardItem *> m_itemMap; // 用于缩略图
|
||||
ThumbnailType m_thumbnailType = ThumbnailType::None; // 当前缩略图类型
|
||||
PublicAttributes::Model m_model = PublicAttributes::Model::PcModel; // 当前设备模式
|
||||
QListView::ViewMode m_viewModel = QListView::IconMode; // 当前视图模式
|
||||
PublicAttributes::Theme m_theme = PublicAttributes::Theme::Light; // 当前主题
|
||||
QMap<QString, QStandardItem *> m_itemMap; // 用于缩略图
|
||||
ThumbnailType m_thumbnailType = ThumbnailType::None; // 当前缩略图类型
|
||||
PublicAttributes::Model m_model = PublicAttributes::Model::PcModel; // 当前设备模式
|
||||
QListView::ViewMode m_viewModel = QListView::IconMode; // 当前视图模式
|
||||
PublicAttributes::Theme m_theme = PublicAttributes::Theme::Light; // 当前主题
|
||||
double m_fontSize = 10;
|
||||
FileView::ItemSelectMode m_itemMode = FileView::ItemSelectMode::Default; // 当前item视图模式
|
||||
QString m_currentTime = "";
|
||||
int m_currentTimeLineIndex = 0;
|
||||
|
|
|
@ -80,11 +80,11 @@ void MainWindow::downFile(const QList<FileInfo> &fileList, QString downloadPath)
|
|||
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->hide();
|
||||
if (m_isConnect) {
|
||||
slotDisconnect();
|
||||
}
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
void MainWindow::keyPressEvent(QKeyEvent *event)
|
||||
|
@ -95,11 +95,6 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
|
|||
QWidget::keyPressEvent(event);
|
||||
}
|
||||
|
||||
void MainWindow::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
}
|
||||
|
||||
void MainWindow::changeEvent(QEvent *event)
|
||||
{
|
||||
if (QEvent::WindowStateChange == event->type()) {
|
||||
|
@ -156,13 +151,16 @@ void MainWindow::initService()
|
|||
|
||||
m_wifiManagerThread = new QThread;
|
||||
m_wifiManager->moveToThread(m_wifiManagerThread);
|
||||
|
||||
connect(m_wifiManagerThread, &QThread::started, m_wifiManager, &WifiManager::startWifiInfo);
|
||||
|
||||
m_wifiManagerThread->start();
|
||||
|
||||
m_dirManager = new DirManager;
|
||||
connect(m_dirManager, &DirManager::finish, m_dirManager, &DirManager::deleteLater);
|
||||
connect(m_dirManager, &DirManager::finish, m_dirManager, [=]() {
|
||||
if (m_dirManager != nullptr) {
|
||||
m_dirManager->deleteLater();
|
||||
m_dirManager = nullptr;
|
||||
}
|
||||
});
|
||||
m_dirManager->start();
|
||||
|
||||
// 启动ftp服务端
|
||||
|
@ -187,6 +185,9 @@ void MainWindow::initGsetting()
|
|||
changeTheme();
|
||||
connect(kdk::GsettingMonitor::getInstance(), &kdk::GsettingMonitor::systemThemeChange, this,
|
||||
&MainWindow::changeTheme);
|
||||
changeFontSize();
|
||||
connect(kdk::GsettingMonitor::getInstance(), &kdk::GsettingMonitor::systemFontSizeChange, this,
|
||||
&MainWindow::changeFontSize);
|
||||
}
|
||||
|
||||
void MainWindow::initDbus()
|
||||
|
@ -240,6 +241,10 @@ void MainWindow::disconnectScreen()
|
|||
if (m_pcScreen != nullptr) {
|
||||
m_pcScreen->disconnected();
|
||||
}
|
||||
if (m_suspendTabBar != nullptr) {
|
||||
m_suspendTabBar->deleteLater();
|
||||
m_suspendTabBar = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::disconnectFtp()
|
||||
|
@ -308,6 +313,10 @@ void MainWindow::deleterService()
|
|||
delete m_ftpServer;
|
||||
m_ftpServer = nullptr;
|
||||
}
|
||||
if (m_dirManager != nullptr) {
|
||||
m_dirManager->deleteLater();
|
||||
m_dirManager = nullptr;
|
||||
}
|
||||
if (m_pcScreen != nullptr) {
|
||||
m_pcScreen->deleteLater();
|
||||
m_pcScreen = nullptr;
|
||||
|
@ -358,7 +367,6 @@ void MainWindow::clearConnectionInfo()
|
|||
|
||||
void MainWindow::initUI()
|
||||
{
|
||||
setMinimumSize(1024, 680);
|
||||
setWindowTitle(tr("kylin-connectivity"));
|
||||
|
||||
m_titlebar = new Titlebar(this);
|
||||
|
@ -408,6 +416,7 @@ void MainWindow::connectUI()
|
|||
connect(m_fileManageWin, &FileManageWin::sigBtnCliked, this, &MainWindow::slotFileManageBtnClicked);
|
||||
connect(m_fileManageWin, &FileManageWin::sigSearchTextChanged, this, &MainWindow::slotSearchTextChanged);
|
||||
m_fileManageWin->load();
|
||||
m_fileManageWin->changeFontSize(m_fontSize);
|
||||
m_connectedWin = new ConnectedWin();
|
||||
connect(m_connectedWin, &ConnectedWin::sigBtnClicked, this, &MainWindow::slotConnectedWinBtnClicked);
|
||||
m_connectedWin->setTheme(m_theme);
|
||||
|
@ -429,6 +438,7 @@ void MainWindow::connectUI()
|
|||
m_fileManageWin->pushCrumb(m_fileManageWin->crumbText(FileManageWin::CrumbTag::FileList));
|
||||
m_isFileViewPage = false;
|
||||
}
|
||||
m_connectedWin->changeFontSize(m_fontSize);
|
||||
m_mainStackedWin->addWidget(m_connectedWin);
|
||||
m_mainStackedWin->setCurrentIndex(WinIndex::WinConnected);
|
||||
|
||||
|
@ -441,11 +451,11 @@ void MainWindow::connectUI()
|
|||
// QString str2 = QString(
|
||||
// tr("If you need to input Chinese on the mobile phone screen on the computer, please download the "
|
||||
// "extension tool in the personal information input method on the mobile phone."));
|
||||
// m_messageBox = new QMessageBox(this);
|
||||
// m_messageBox->setText(str1 + "\n" + str2);
|
||||
// m_messageBox = new MessageDialog(this);
|
||||
// m_messageBox->setText(str1, str2);
|
||||
// m_messageBox->setIconPixmap(QIcon::fromTheme("ukui-dialog-success").pixmap(MSGICON_W, MSGICON_H));
|
||||
// m_messageBox->addButton(tr("OK"), QMessageBox::RejectRole);
|
||||
// m_messageBox->show();
|
||||
// m_messageBox->addButton(tr("OK"));
|
||||
// moveMessageBox();
|
||||
// }
|
||||
m_discovery->stopDiscovery();
|
||||
|
||||
|
@ -456,15 +466,14 @@ void MainWindow::connectUI()
|
|||
str1 = QString(tr("Peer has agreed"));
|
||||
}
|
||||
QString str2 = QString(tr("Establishing connection, please wait..."));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("ukui-dialog-success").pixmap(MSGICON_W, MSGICON_H));
|
||||
m_messageBox->addButton(tr("CANCEL"), QMessageBox::RejectRole);
|
||||
connect(m_messageBox, &QMessageBox::buttonClicked, this, [=](QAbstractButton *) {
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("ukui-dialog-success"));
|
||||
m_messageBox->addButton(tr("CANCEL"));
|
||||
connect(m_messageBox, &MessageDialog::buttonClicked, this, [=](QPushButton *) {
|
||||
slotDisconnect();
|
||||
deleterDialog();
|
||||
});
|
||||
m_messageBox->show();
|
||||
moveMessageBox();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -484,6 +493,7 @@ void MainWindow::updateResult()
|
|||
m_androidHomePage->setItemCount(AndroidItem::Type(it.key()), it.value());
|
||||
it++;
|
||||
}
|
||||
m_androidHomePage->changeFontSize(m_fontSize);
|
||||
m_fileManageWin->setWidget(m_androidHomePage, FileManageWin::TabType::AndroidHomePage);
|
||||
} break;
|
||||
case FileSyncManage::FileKey::WeChat: {
|
||||
|
@ -507,6 +517,7 @@ void MainWindow::updateResult()
|
|||
m_timeLineView->setModelFlag(m_model);
|
||||
m_timeLineView->setTheme(m_theme);
|
||||
m_timeLineView->setItemMode(FileView::ItemSelectMode::Default, true);
|
||||
m_timeLineView->changeFontSize(m_fontSize);
|
||||
m_fileManageWin->setWidget(m_timeLineView, FileManageWin::TabType::Default);
|
||||
if (m_downFileType == FileSyncManage::FileType::Picture) {
|
||||
m_timeLineView->setThumbnailType(TimeLineListWidget::ThumbnailType::Image);
|
||||
|
@ -530,6 +541,7 @@ void MainWindow::initMultiMediaWin(QMap<int, int> &map)
|
|||
m_multiMediaWin->setItemCount(AndroidItem::Type(it.key()), it.value());
|
||||
it++;
|
||||
}
|
||||
m_multiMediaWin->changeFontSize(m_fontSize);
|
||||
m_fileManageWin->setWidget(m_multiMediaWin, FileManageWin::TabType::AppHomePage);
|
||||
}
|
||||
|
||||
|
@ -580,6 +592,7 @@ void MainWindow::setToolTipWin(QString msg, kdk::TipType type)
|
|||
m_tipWin->setTipTime(2000);
|
||||
m_tipWin->setContentsMargins(4, 4, 8, 4);
|
||||
m_tipWin->move(((this->width() - m_tipWin->width()) >> 1) - 50, ((this->height() - m_tipWin->height()) >> 1) + 250);
|
||||
m_tipWin->activateWindow();
|
||||
m_tipWin->showInfo();
|
||||
}
|
||||
|
||||
|
@ -597,23 +610,40 @@ void MainWindow::deleterUI()
|
|||
m_homepage->deleteLater();
|
||||
m_homepage = nullptr;
|
||||
}
|
||||
deleterDialog();
|
||||
if (m_tipWin != nullptr) {
|
||||
m_tipWin->deleteLater();
|
||||
m_tipWin = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::startTimer()
|
||||
{
|
||||
deleterDialog();
|
||||
m_timer = new QTimer(this);
|
||||
m_timer->setSingleShot(true);
|
||||
connect(m_timer, &QTimer::timeout, this, &MainWindow::slotConnectFailed, Qt::DirectConnection);
|
||||
m_timer->start(20000);
|
||||
}
|
||||
|
||||
void MainWindow::initSearchServer(QString searchPath)
|
||||
{
|
||||
qInfo() << "searchInfo install...";
|
||||
m_searchServer = new SearchServer(searchPath);
|
||||
connect(m_searchServer, &SearchServer::sigLoadFail, this, &MainWindow::slotSearchLoadFail);
|
||||
connect(m_searchServer, &SearchServer::sigSearchResult, this, &MainWindow::slotSearchResult);
|
||||
|
||||
m_searchThread = new QThread;
|
||||
m_searchServer->moveToThread(m_searchThread);
|
||||
m_searchThread->start();
|
||||
Q_EMIT m_searchServer->sigInitSearch();
|
||||
}
|
||||
|
||||
void MainWindow::startLoadUI()
|
||||
{
|
||||
startTimer();
|
||||
m_loadDialog = new LoadDialog(this);
|
||||
m_loadDialog->move((this->width() - m_loadDialog->width()) >> 1, ((this->height() - m_loadDialog->height()) >> 1));
|
||||
m_loadDialog->show();
|
||||
startTimer();
|
||||
}
|
||||
|
||||
void MainWindow::deleterDialog()
|
||||
|
@ -627,10 +657,6 @@ void MainWindow::deleterDialog()
|
|||
m_loadDialog->deleteLater();
|
||||
m_loadDialog = nullptr;
|
||||
}
|
||||
if (m_tipWin != nullptr) {
|
||||
delete m_tipWin;
|
||||
m_tipWin = nullptr;
|
||||
}
|
||||
if (m_messageBox != nullptr) {
|
||||
m_messageBox->hide();
|
||||
m_messageBox->deleteLater();
|
||||
|
@ -781,44 +807,60 @@ void MainWindow::crumbTagToAndroidItemType(QString tag)
|
|||
void MainWindow::checkPage(QStringList crumbPathList)
|
||||
{
|
||||
m_fileManageWin->clearCrumb();
|
||||
m_fileManageWin->pushCrumb(m_fileManageWin->crumbText(FileManageWin::CrumbTag::FileList));
|
||||
if (crumbPathList.size() == 1) {
|
||||
checkAndroidHomePage();
|
||||
} else {
|
||||
if (m_isFileViewPage) {
|
||||
for (int i = 1; i < crumbPathList.size(); i++) {
|
||||
m_fileManageWin->pushCrumb(crumbPathList.value(i));
|
||||
}
|
||||
checkFileView(crumbPathList);
|
||||
if (m_connectInfo.deviceType == ConnectionService::DeviceType::ANDROID) {
|
||||
m_fileManageWin->pushCrumb(m_fileManageWin->crumbText(FileManageWin::CrumbTag::FileList));
|
||||
if (crumbPathList.size() == 1) {
|
||||
checkAndroidHomePage();
|
||||
} else {
|
||||
switch (crumbPathList.size()) {
|
||||
case 2: {
|
||||
crumbTagToAndroidItemType(crumbPathList.value(1));
|
||||
} break;
|
||||
case 3: {
|
||||
if (crumbPathList.value(1) == m_fileManageWin->crumbText(FileManageWin::CrumbTag::QQ)) {
|
||||
m_fileKey = FileSyncManage::FileKey::QQ;
|
||||
m_fileManageWin->pushCrumb(m_fileManageWin->crumbText(FileManageWin::CrumbTag::QQ));
|
||||
} else {
|
||||
m_fileKey = FileSyncManage::FileKey::WeChat;
|
||||
m_fileManageWin->pushCrumb(m_fileManageWin->crumbText(FileManageWin::CrumbTag::WeChat));
|
||||
if (m_isFileViewPage) {
|
||||
for (int i = 1; i < crumbPathList.size(); i++) {
|
||||
m_fileManageWin->pushCrumb(crumbPathList.value(i));
|
||||
}
|
||||
checkFileView(crumbPathList);
|
||||
} else {
|
||||
switch (crumbPathList.size()) {
|
||||
case 2: {
|
||||
crumbTagToAndroidItemType(crumbPathList.value(1));
|
||||
} break;
|
||||
case 3: {
|
||||
if (crumbPathList.value(1) == m_fileManageWin->crumbText(FileManageWin::CrumbTag::QQ)) {
|
||||
m_fileKey = FileSyncManage::FileKey::QQ;
|
||||
m_fileManageWin->pushCrumb(m_fileManageWin->crumbText(FileManageWin::CrumbTag::QQ));
|
||||
} else {
|
||||
m_fileKey = FileSyncManage::FileKey::WeChat;
|
||||
m_fileManageWin->pushCrumb(m_fileManageWin->crumbText(FileManageWin::CrumbTag::WeChat));
|
||||
}
|
||||
crumbTagToAndroidItemType(crumbPathList.value(2));
|
||||
} break;
|
||||
}
|
||||
crumbTagToAndroidItemType(crumbPathList.value(2));
|
||||
} break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m_fileManageWin->pushCrumb(m_connectInfo.deviceName);
|
||||
for (int i = 1; i < crumbPathList.size(); i++) {
|
||||
m_fileManageWin->pushCrumb(crumbPathList.value(i));
|
||||
}
|
||||
checkFileView(crumbPathList);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::moveMessageBox()
|
||||
{
|
||||
QRect availableGeometry = geometry();
|
||||
m_messageBox->move(availableGeometry.center() - m_messageBox->rect().center());
|
||||
m_messageBox->show();
|
||||
}
|
||||
|
||||
void MainWindow::setLocalPathList(const QStringList &list)
|
||||
{
|
||||
qInfo() << "get local peony menu send path list" << list;
|
||||
if (!m_isConnect) {
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setAttribute(Qt::WA_DeleteOnClose);
|
||||
deleterDialog();
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(tr("Not currently connected, please connect"));
|
||||
m_messageBox->setIcon(QMessageBox::Critical);
|
||||
m_messageBox->exec();
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error"));
|
||||
m_messageBox->addButton(tr("OK"));
|
||||
moveMessageBox();
|
||||
qInfo() << "peony menu send: not current connect";
|
||||
return;
|
||||
}
|
||||
|
@ -867,6 +909,38 @@ void MainWindow::changeTheme()
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::changeFontSize()
|
||||
{
|
||||
m_fontSize = kdk::GsettingMonitor::getSystemFontSize().toDouble();
|
||||
if (m_homepage != nullptr) {
|
||||
m_homepage->changeFontSize(m_fontSize);
|
||||
}
|
||||
if (m_titlebar != nullptr) {
|
||||
m_titlebar->changeFontSize(m_fontSize);
|
||||
}
|
||||
if (m_connectInterfaceWin != nullptr) {
|
||||
m_connectInterfaceWin->changeFontSize(m_fontSize);
|
||||
}
|
||||
if (m_connectedWin != nullptr) {
|
||||
m_connectedWin->changeFontSize(m_fontSize);
|
||||
}
|
||||
if (m_androidHomePage != nullptr) {
|
||||
m_androidHomePage->changeFontSize(m_fontSize);
|
||||
}
|
||||
if (m_multiMediaWin != nullptr) {
|
||||
m_multiMediaWin->changeFontSize(m_fontSize);
|
||||
}
|
||||
if (m_fileManageWin != nullptr) {
|
||||
m_fileManageWin->changeFontSize(m_fontSize);
|
||||
}
|
||||
if (m_fileView != nullptr) {
|
||||
m_fileView->changeFontSize(m_fontSize);
|
||||
}
|
||||
if (m_timeLineView != nullptr) {
|
||||
m_timeLineView->changeFontSize(m_fontSize);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::slotVolumeConnected(QString volumeName)
|
||||
{
|
||||
// todo
|
||||
|
@ -911,20 +985,19 @@ void MainWindow::slotConnectRequest(QString deviceName)
|
|||
QString str1 = QString(tr("Connection request received from\"")) + deviceName + QString(tr("\""));
|
||||
QString str2 = QString(tr("After consent, the other party can view and download all the files on the device, "
|
||||
"and can share the other party's desktop to this screen."));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-warning").pixmap(MSGICON_W, MSGICON_H));
|
||||
QPushButton *noBtn = m_messageBox->addButton(QString(tr("NO")), QMessageBox::RejectRole);
|
||||
QPushButton *yesBtn = m_messageBox->addButton(QString(tr("YES")), QMessageBox::AcceptRole);
|
||||
connect(m_messageBox, &QMessageBox::buttonClicked, this, [=](QAbstractButton *btn) {
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-warning"));
|
||||
QPushButton *yesBtn = m_messageBox->addButton(QString(tr("YES")));
|
||||
QPushButton *noBtn = m_messageBox->addButton(QString(tr("NO")));
|
||||
connect(m_messageBox, &MessageDialog::buttonClicked, this, [=](QPushButton *btn) {
|
||||
if (yesBtn == btn) {
|
||||
m_connectionService->setConnectionRespond(true);
|
||||
} else {
|
||||
m_connectionService->setConnectionRespond(false);
|
||||
}
|
||||
deleterDialog();
|
||||
});
|
||||
m_messageBox->show();
|
||||
moveMessageBox();
|
||||
}
|
||||
|
||||
void MainWindow::slotConnectDenied()
|
||||
|
@ -932,24 +1005,22 @@ void MainWindow::slotConnectDenied()
|
|||
deleterDialog();
|
||||
QString str1 = QString(tr("The other party has refused your screen projection request!"));
|
||||
QString str2 = QString(tr("Failed to cast the screen. Please contact the other party and try again."));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error").pixmap(MSGICON_W, MSGICON_H));
|
||||
QPushButton *reconnectBtn = m_messageBox->addButton(QString(tr("RECONNECT")), QMessageBox::AcceptRole);
|
||||
QPushButton *closeBtn = m_messageBox->addButton(QString(tr("CLOSE")), QMessageBox::RejectRole);
|
||||
connect(m_messageBox, &QMessageBox::buttonClicked, this, [=](QAbstractButton *btn) {
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error"));
|
||||
QPushButton *reconnectBtn = m_messageBox->addButton(QString(tr("RECONNECT")));
|
||||
QPushButton *closeBtn = m_messageBox->addButton(QString(tr("CLOSE")));
|
||||
connect(m_messageBox, &MessageDialog::buttonClicked, this, [=](QPushButton *btn) {
|
||||
if (reconnectBtn == btn) {
|
||||
m_connectionService->startClient(m_reconnectAddress);
|
||||
startTimer();
|
||||
}
|
||||
deleterDialog();
|
||||
});
|
||||
m_messageBox->show();
|
||||
moveMessageBox();
|
||||
}
|
||||
|
||||
void MainWindow::slotConnect(const ConnectionService::ConnectionInfo &connectInfo)
|
||||
{
|
||||
deleterDialog();
|
||||
m_connectInfo = connectInfo;
|
||||
m_url.setUserName(m_connectInfo.usernamePwd.username);
|
||||
m_url.setPassword(m_connectInfo.usernamePwd.pwd);
|
||||
|
@ -975,9 +1046,13 @@ void MainWindow::slotConnect(const ConnectionService::ConnectionInfo &connectInf
|
|||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantAndroidConn);
|
||||
|
||||
if (m_connectInfo.connectType == ConnectionService::ConnectType::WIFI) {
|
||||
// WFIF连接埋点
|
||||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantWifiConn);
|
||||
m_ftpClient->setTransferMode(QFtp::Active);
|
||||
m_url.setUrl("ftp://" + m_connectInfo.address + ":" + QString::number(WIFI_FTP_PORT));
|
||||
} else {
|
||||
// USB连接埋点
|
||||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantUsbConn);
|
||||
m_ftpClient->setTransferMode(QFtp::Passive);
|
||||
m_url.setUrl("ftp://" + m_connectInfo.address + ":" + QString::number(USB_FTP_PORT));
|
||||
}
|
||||
|
@ -994,18 +1069,10 @@ void MainWindow::slotConnect(const ConnectionService::ConnectionInfo &connectInf
|
|||
|
||||
void MainWindow::slotDisconnect()
|
||||
{
|
||||
clearConnectionInfo();
|
||||
// 断开连接埋点
|
||||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantDisconnect);
|
||||
|
||||
Q_EMIT sigDisconnect();
|
||||
if (m_suspendTabBar != nullptr) {
|
||||
m_suspendTabBar->deleteLater();
|
||||
m_suspendTabBar = nullptr;
|
||||
}
|
||||
m_searchLoadNum = 0;
|
||||
m_lastPathList.clear();
|
||||
m_isConnect = false;
|
||||
m_isDownloadingThumbanil = false;
|
||||
m_uploadPath = "";
|
||||
m_downFileType = FileSyncManage::FileType::FileNum;
|
||||
m_titlebar->setBackground(true);
|
||||
m_mainStackedWin->setCurrentIndex(WinIndex::WinHomePage);
|
||||
clearView();
|
||||
|
@ -1013,6 +1080,25 @@ void MainWindow::slotDisconnect()
|
|||
deleteTransmissionDialog();
|
||||
deleterDialog();
|
||||
slotContinueSearch();
|
||||
m_isConnect = false;
|
||||
m_downFileType = FileSyncManage::FileType::FileNum;
|
||||
m_fileKey = FileSyncManage::FileKey::Default;
|
||||
m_url.clear();
|
||||
clearConnectionInfo();
|
||||
m_isDbusOperation = false;
|
||||
m_isMountFtp = false;
|
||||
m_isPcSearchInfo = false;
|
||||
m_searchLoadNum = 0;
|
||||
m_reconnectAddress.clear();
|
||||
m_backList.clear();
|
||||
m_forwardList.clear();
|
||||
m_isFileViewPage = true;
|
||||
m_lastPathList.clear();
|
||||
m_viewMode = QListView::IconMode;
|
||||
m_tipMesseage.clear();
|
||||
m_isDownloadingThumbanil = false;
|
||||
m_uploadPath = "";
|
||||
m_isFileViewPage = false;
|
||||
if (m_isServerConnect) {
|
||||
disconnectService();
|
||||
}
|
||||
|
@ -1022,21 +1108,23 @@ void MainWindow::slotNotFountApk()
|
|||
{
|
||||
deleterDialog();
|
||||
qCritical() << "kylin-assistant not installed!";
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setAttribute(Qt::WA_DeleteOnClose);
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(tr("Please install kylin-assistant on the Android terminal!"));
|
||||
m_messageBox->setIcon(QMessageBox::Critical);
|
||||
m_messageBox->exec();
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error"));
|
||||
m_messageBox->addButton(tr("OK"));
|
||||
moveMessageBox();
|
||||
deleterDialog();
|
||||
}
|
||||
|
||||
void MainWindow::slotNoUsbDevice()
|
||||
{
|
||||
deleterDialog();
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setAttribute(Qt::WA_DeleteOnClose);
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(tr("Please use the USB to connect your phone device!"));
|
||||
m_messageBox->setIcon(QMessageBox::Critical);
|
||||
m_messageBox->exec();
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error"));
|
||||
m_messageBox->addButton(tr("OK"));
|
||||
moveMessageBox();
|
||||
deleterDialog();
|
||||
}
|
||||
|
||||
void MainWindow::slotConnectFailed()
|
||||
|
@ -1044,8 +1132,8 @@ void MainWindow::slotConnectFailed()
|
|||
deleterDialog();
|
||||
qInfo() << "Failed to connect device!";
|
||||
if (m_isConnect) {
|
||||
setToolTipWin(tr("Connection error"), kdk::TipType::Error);
|
||||
slotDisconnect();
|
||||
setToolTipWin(tr("Connection error"), kdk::TipType::Error);
|
||||
} else {
|
||||
setToolTipWin(tr("Connection timed out"), kdk::TipType::Error);
|
||||
}
|
||||
|
@ -1085,6 +1173,7 @@ void MainWindow::slotCurrentDirectoryList(const QMap<QString, FileInfo> &map)
|
|||
m_fileView->setModelFlag(m_model);
|
||||
m_fileView->setTheme(m_theme);
|
||||
m_fileView->setItemMode(FileView::ItemSelectMode::Default, true);
|
||||
m_fileView->changeFontSize(m_fontSize);
|
||||
m_fileManageWin->setWidget(m_fileView, FileManageWin::TabType::Default);
|
||||
}
|
||||
}
|
||||
|
@ -1098,7 +1187,12 @@ void MainWindow::slotTransferProgress(qint64 readBytes, qint64 totalBytes)
|
|||
if (readBytes == totalBytes) {
|
||||
deleteTransmissionDialog();
|
||||
deleterDialog();
|
||||
setToolTipWin(m_tipMesseage, kdk::TipType::Normal);
|
||||
// setToolTipWin(m_tipMesseage, kdk::TipType::Normal);
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(m_tipMesseage);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("ukui-dialog-success"));
|
||||
m_messageBox->addButton(tr("OK"));
|
||||
moveMessageBox();
|
||||
if (!m_uploadPath.isEmpty()) {
|
||||
m_fileManageWin->clearCrumb();
|
||||
if (m_connectInfo.deviceType == ConnectionService::DeviceType::ANDROID) {
|
||||
|
@ -1151,7 +1245,7 @@ void MainWindow::slotDownTempFileFinish(QString filePath)
|
|||
deleterDialog();
|
||||
if (m_isPcSearchInfo) {
|
||||
m_isPcSearchInfo = false;
|
||||
m_searchInfoPath = filePath;
|
||||
initSearchServer(filePath);
|
||||
} else if (!filePath.isEmpty()) {
|
||||
FileInfo::fileOpen(filePath);
|
||||
} else {
|
||||
|
@ -1179,13 +1273,7 @@ void MainWindow::slotDownFileFail(QString fileName)
|
|||
|
||||
void MainWindow::slotMountError(bool isMount, QString error)
|
||||
{
|
||||
deleterDialog();
|
||||
qInfo() << "mountFtpError:" << error;
|
||||
if (isMount) {
|
||||
setToolTipWin(tr("Peony access can be error-prone"), kdk::TipType::Warning);
|
||||
} else {
|
||||
setToolTipWin(tr("Umount failed"), kdk::TipType::Warning);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::slotAboutWinShow()
|
||||
|
@ -1210,6 +1298,7 @@ void MainWindow::slotAllDeviceInfo(const QMap<QString, KMobileCommon::DiscoveryD
|
|||
{
|
||||
m_connectInterfaceWin->showLoad();
|
||||
m_connectInterfaceWin->setItemInfo(map);
|
||||
m_connectInterfaceWin->changeFontSize(m_fontSize);
|
||||
}
|
||||
|
||||
void MainWindow::slotRequestReceived(PcScreenManage::ScreenMsg msg)
|
||||
|
@ -1221,47 +1310,46 @@ void MainWindow::slotRequestReceived(PcScreenManage::ScreenMsg msg)
|
|||
QString str1 =
|
||||
QString(tr("Received screen projection request from \"")) + m_connectInfo.deviceName + QString(tr("\""));
|
||||
QString str2 = QString(tr("After consent, the other party can share the device desktop to this screen."));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-warning").pixmap(MSGICON_W, MSGICON_H));
|
||||
QPushButton *yesBtn = m_messageBox->addButton(QString(tr("YES")), QMessageBox::AcceptRole);
|
||||
QPushButton *noBtn = m_messageBox->addButton(QString(tr("NO")), QMessageBox::RejectRole);
|
||||
connect(m_messageBox, &QMessageBox::buttonClicked, this, [=](QAbstractButton *btn) {
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-warning"));
|
||||
QPushButton *yesBtn = m_messageBox->addButton(QString(tr("YES")));
|
||||
QPushButton *noBtn = m_messageBox->addButton(QString(tr("NO")));
|
||||
connect(m_messageBox, &MessageDialog::buttonClicked, this, [=](QPushButton *btn) {
|
||||
if (yesBtn == btn) {
|
||||
m_pcScreen->setConnectionRespond(true);
|
||||
} else {
|
||||
m_pcScreen->setConnectionRespond(false);
|
||||
}
|
||||
deleterDialog();
|
||||
});
|
||||
m_messageBox->show();
|
||||
moveMessageBox();
|
||||
} break;
|
||||
case PcScreenManage::ScreenMsg::RemoteRejection: {
|
||||
// 请求被拒绝
|
||||
QString str1 = QString(tr("The other party has refused your screen projection request!"));
|
||||
QString str2 = QString(tr("Failed to cast the screen. Please contact the other party and try again."));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error").pixmap(MSGICON_W, MSGICON_H));
|
||||
QPushButton *againBtn = m_messageBox->addButton(QString(tr("Again")), QMessageBox::AcceptRole);
|
||||
QPushButton *closeBtn = m_messageBox->addButton(QString(tr("Close")), QMessageBox::RejectRole);
|
||||
connect(m_messageBox, &QMessageBox::buttonClicked, this, [=](QAbstractButton *btn) {
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error"));
|
||||
QPushButton *againBtn = m_messageBox->addButton(QString(tr("Again")));
|
||||
QPushButton *closeBtn = m_messageBox->addButton(QString(tr("Close")));
|
||||
connect(m_messageBox, &MessageDialog::buttonClicked, this, [=](QPushButton *btn) {
|
||||
if (againBtn == btn) {
|
||||
// 重新连接
|
||||
m_pcScreen->connectService(m_connectInfo.address);
|
||||
}
|
||||
});
|
||||
m_messageBox->show();
|
||||
moveMessageBox();
|
||||
} break;
|
||||
case PcScreenManage::ScreenMsg::Successfully: {
|
||||
// 请求成功
|
||||
QString str1 = QString(tr("The other party agreed to your screen projection request!"));
|
||||
QString str2 = QString(tr("The screen is being cast, please wait..."));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("ukui-dialog-success").pixmap(MSGICON_W, MSGICON_H));
|
||||
m_messageBox->addButton(QString(tr("OK")), QMessageBox::AcceptRole);
|
||||
m_messageBox->show();
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("ukui-dialog-success"));
|
||||
m_messageBox->addButton(QString(tr("OK")));
|
||||
moveMessageBox();
|
||||
} break;
|
||||
case PcScreenManage::ScreenMsg::StartedScreen: {
|
||||
// 投屏启动
|
||||
|
@ -1274,25 +1362,26 @@ void MainWindow::slotRequestReceived(PcScreenManage::ScreenMsg msg)
|
|||
show();
|
||||
if (m_connectInfo.deviceRole == ConnectionService::DeviceRole::RECIPIENT && m_connectedWin != nullptr) {
|
||||
m_connectedWin->restoreScreenButton();
|
||||
m_connectedWin->changeFontSize(m_fontSize);
|
||||
}
|
||||
QString str1 = QString(tr("End of screen projection"));
|
||||
QString str2 = QString(tr("The other party has finished the screen projection function."));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error").pixmap(MSGICON_W, MSGICON_H));
|
||||
m_messageBox->addButton(QString(tr("OK")), QMessageBox::AcceptRole);
|
||||
m_messageBox->show();
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error"));
|
||||
m_messageBox->addButton(QString(tr("OK")));
|
||||
moveMessageBox();
|
||||
} break;
|
||||
case PcScreenManage::ScreenMsg::ScreenError: {
|
||||
// 投屏错误
|
||||
QString str1 = QString(tr("Screen projection loading error"));
|
||||
QString str2 =
|
||||
QString(tr("Please check whether to install the projection expansion package [kylin connectivity tools]"));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error").pixmap(MSGICON_W, MSGICON_H));
|
||||
m_messageBox->addButton(QString(tr("CLOSE")), QMessageBox::AcceptRole);
|
||||
m_messageBox->show();
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error"));
|
||||
m_messageBox->addButton(QString(tr("CLOSE")));
|
||||
moveMessageBox();
|
||||
} break;
|
||||
case PcScreenManage::ScreenMsg::Disconnect: {
|
||||
// 投屏断开
|
||||
|
@ -1300,11 +1389,11 @@ void MainWindow::slotRequestReceived(PcScreenManage::ScreenMsg msg)
|
|||
show();
|
||||
QString str1 = QString(tr("End of screen projection"));
|
||||
QString str2 = QString(tr("The other party has finished the screen projection function."));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error").pixmap(MSGICON_W, MSGICON_H));
|
||||
m_messageBox->addButton(QString(tr("OK")), QMessageBox::AcceptRole);
|
||||
m_messageBox->show();
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error"));
|
||||
m_messageBox->addButton(QString(tr("OK")));
|
||||
moveMessageBox();
|
||||
} break;
|
||||
case PcScreenManage::ScreenMsg::StartedControl: {
|
||||
m_suspendTabBar = new SuspendTabBar(SuspendTabBar::Display::Part, true, this);
|
||||
|
@ -1343,8 +1432,10 @@ void MainWindow::slotModeChanged(bool isTable)
|
|||
qInfo() << "mode changed ---- is table:" << isTable;
|
||||
if (isTable) {
|
||||
m_model = PublicAttributes::Model::Table;
|
||||
setMinimumSize(0, 0);
|
||||
} else {
|
||||
m_model = PublicAttributes::Model::PcModel;
|
||||
setMinimumSize(1024, 680);
|
||||
}
|
||||
if (m_titlebar != nullptr) {
|
||||
m_titlebar->changeMode(m_model);
|
||||
|
@ -1362,11 +1453,11 @@ void MainWindow::slotSearchLoadFail()
|
|||
deleterDialog();
|
||||
if (m_searchLoadNum > SEARCH_LOAD_MAX_NUM) {
|
||||
qWarning() << "Search data loading failed, over loads";
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setAttribute(Qt::WA_DeleteOnClose);
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(tr("Search data loading failed!"));
|
||||
m_messageBox->setIcon(QMessageBox::Warning);
|
||||
m_messageBox->exec();
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-warning"));
|
||||
m_messageBox->addButton(QString(tr("OK")));
|
||||
moveMessageBox();
|
||||
return;
|
||||
}
|
||||
m_searchLoadNum++;
|
||||
|
@ -1387,6 +1478,7 @@ void MainWindow::slotSearchResult(const QMap<QString, FileInfo> &searchResult)
|
|||
m_fileView->setModelFlag(m_model);
|
||||
m_fileView->setTheme(m_theme);
|
||||
m_fileView->setItemMode(FileView::ItemSelectMode::Default, true);
|
||||
m_fileView->changeFontSize(m_fontSize);
|
||||
m_fileManageWin->setWidget(m_fileView, FileManageWin::TabType::SearchResultsPage);
|
||||
m_fileView->setAllowDrag(false);
|
||||
}
|
||||
|
@ -1461,6 +1553,8 @@ void MainWindow::slotFileManageBtnClicked(FileManageWin::BtnType type)
|
|||
}
|
||||
} break;
|
||||
case FileManageWin::BtnType::ListModeBtn: {
|
||||
// 切换视图埋点
|
||||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantSwitchView);
|
||||
m_viewMode = QListView::ListMode;
|
||||
if (m_fileView != nullptr) {
|
||||
m_fileView->setViewMode(m_viewMode);
|
||||
|
@ -1470,6 +1564,8 @@ void MainWindow::slotFileManageBtnClicked(FileManageWin::BtnType type)
|
|||
}
|
||||
} break;
|
||||
case FileManageWin::BtnType::IconModeBtn: {
|
||||
// 切换视图埋点
|
||||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantSwitchView);
|
||||
m_viewMode = QListView::IconMode;
|
||||
if (m_fileView != nullptr) {
|
||||
m_fileView->setViewMode(m_viewMode);
|
||||
|
@ -1479,12 +1575,15 @@ void MainWindow::slotFileManageBtnClicked(FileManageWin::BtnType type)
|
|||
}
|
||||
} break;
|
||||
case FileManageWin::BtnType::RefreshBtn: {
|
||||
// 刷新列表埋点
|
||||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantRefreshList);
|
||||
QStringList list = m_fileManageWin->getPathList();
|
||||
checkPage(list);
|
||||
} break;
|
||||
case FileManageWin::BtnType::SelectBtn: {
|
||||
if (m_fileView != nullptr) {
|
||||
m_fileView->selectAll();
|
||||
m_fileView->setDownloadBtn(true);
|
||||
}
|
||||
if (m_timeLineView != nullptr) {
|
||||
m_timeLineView->selectAll();
|
||||
|
@ -1493,6 +1592,7 @@ void MainWindow::slotFileManageBtnClicked(FileManageWin::BtnType type)
|
|||
case FileManageWin::BtnType::CancelSelectBtn: {
|
||||
if (m_fileView != nullptr) {
|
||||
m_fileView->clearSelection();
|
||||
m_fileView->setDownloadBtn(false);
|
||||
}
|
||||
if (m_timeLineView != nullptr) {
|
||||
m_timeLineView->clearSelection();
|
||||
|
@ -1514,7 +1614,9 @@ void MainWindow::slotSearchTextChanged(QString text)
|
|||
if (m_lastPathList.isEmpty()) {
|
||||
m_lastPathList = m_fileManageWin->getPathList();
|
||||
}
|
||||
Q_EMIT m_searchServer->sigSearchFile(text);
|
||||
if (m_searchServer != nullptr) {
|
||||
Q_EMIT m_searchServer->sigSearchFile(text);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::slotDownFile(QString path, QList<FileInfo> &fileList)
|
||||
|
@ -1554,15 +1656,17 @@ void MainWindow::slotUploadFile(QString dirName, const QStringList &localPathLis
|
|||
bool MainWindow::setScreenOption()
|
||||
{
|
||||
if (m_connectInfo.deviceRole == ConnectionService::DeviceRole::RECIPIENT) {
|
||||
// PC投屏埋点
|
||||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantPcScreen);
|
||||
if (!m_pcScreen->isSupport()) {
|
||||
QString str1 = QString(tr("Screen projection loading error"));
|
||||
QString str2 = QString(
|
||||
tr("Please check whether to install the projection expansion package [kylin connectivity tools]"));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error").pixmap(MSGICON_W, MSGICON_H));
|
||||
m_messageBox->addButton(QString(tr("CLOSE")), QMessageBox::AcceptRole);
|
||||
m_messageBox->show();
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-error"));
|
||||
m_messageBox->addButton(QString(tr("CLOSE")));
|
||||
moveMessageBox();
|
||||
return false;
|
||||
}
|
||||
if (m_connectInfo.deviceType == ConnectionService::DeviceType::ANDROID) {
|
||||
|
@ -1572,6 +1676,8 @@ bool MainWindow::setScreenOption()
|
|||
}
|
||||
} else {
|
||||
if (m_connectInfo.deviceType == ConnectionService::DeviceType::ANDROID) {
|
||||
// 手机投屏埋点
|
||||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantMobileScreen);
|
||||
if (m_deviceManage == nullptr) {
|
||||
m_deviceManage = new DeviceManage();
|
||||
connect(m_deviceManage, &DeviceManage::sigScreenConnected, this, [=]() {
|
||||
|
@ -1686,6 +1792,8 @@ void MainWindow::slotFileItemSelecAll(bool isSelectAll)
|
|||
|
||||
void MainWindow::slotContinueSearch()
|
||||
{
|
||||
// 设备发现埋点
|
||||
GenerateTools::buriedPoint(kabase::BuriedPoint::PT::KylinMobileAssistantDeviceDiscovery);
|
||||
m_connectInterfaceWin->showLoad();
|
||||
m_discovery->stopDiscovery();
|
||||
m_discovery->startDiscovery();
|
||||
|
@ -1700,15 +1808,7 @@ void MainWindow::slotAbortTransmission()
|
|||
|
||||
void MainWindow::slotSearchInfoFinish(QString searchInfoPath)
|
||||
{
|
||||
qInfo() << "searchInfo install...";
|
||||
m_searchServer = new SearchServer(searchInfoPath);
|
||||
connect(m_searchServer, &SearchServer::sigLoadFail, this, &MainWindow::slotSearchLoadFail);
|
||||
connect(m_searchServer, &SearchServer::sigSearchResult, this, &MainWindow::slotSearchResult);
|
||||
|
||||
m_searchThread = new QThread;
|
||||
m_searchServer->moveToThread(m_searchThread);
|
||||
m_searchThread->start();
|
||||
Q_EMIT m_searchServer->sigInitSearch();
|
||||
initSearchServer(searchInfoPath);
|
||||
}
|
||||
|
||||
void MainWindow::slotConnectBtnClicked()
|
||||
|
@ -1750,11 +1850,11 @@ void MainWindow::slotConnectServiceUI(QString address)
|
|||
QString str1 = QString(tr("Request sent successfully!"));
|
||||
QString str2 = QString(tr("The connection request has been sent to the selected device. Please click [YES] in "
|
||||
"the opposite pop-up window"));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("ukui-dialog-success").pixmap(MSGICON_W, MSGICON_H));
|
||||
m_messageBox->addButton(QString(tr("OK")), QMessageBox::AcceptRole);
|
||||
m_messageBox->show();
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("ukui-dialog-success"));
|
||||
m_messageBox->addButton(QString(tr("OK")));
|
||||
moveMessageBox();
|
||||
}
|
||||
|
||||
void MainWindow::slotConnectedWinBtnClicked(ConnectedWin::BtnType type)
|
||||
|
@ -1766,11 +1866,11 @@ void MainWindow::slotConnectedWinBtnClicked(ConnectedWin::BtnType type)
|
|||
QString str2 =
|
||||
QString(tr("The screen projection request has been sent to the connected device. Please click "
|
||||
"[Agree] in the opposite pop-up window"));
|
||||
m_messageBox = new QMessageBox(this);
|
||||
m_messageBox->setText(str1 + "\n" + str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("ukui-dialog-success").pixmap(MSGICON_W, MSGICON_H));
|
||||
m_messageBox->addButton(QString(tr("OK")), QMessageBox::AcceptRole);
|
||||
m_messageBox->show();
|
||||
m_messageBox = new MessageDialog(this);
|
||||
m_messageBox->setText(str1, str2);
|
||||
m_messageBox->setIconPixmap(QIcon::fromTheme("ukui-dialog-success"));
|
||||
m_messageBox->addButton(QString(tr("OK")));
|
||||
moveMessageBox();
|
||||
}
|
||||
} break;
|
||||
case ConnectedWin::BtnType::ExitScreen: {
|
||||
|
@ -1795,6 +1895,7 @@ void MainWindow::slotExitMobileScreen()
|
|||
{
|
||||
if (m_connectedWin != nullptr) {
|
||||
m_connectedWin->restoreScreenButton();
|
||||
m_connectedWin->changeFontSize(m_fontSize);
|
||||
}
|
||||
if (m_connectionService != nullptr) {
|
||||
m_connectionService->closeAbility();
|
||||
|
@ -1809,6 +1910,7 @@ void MainWindow::slotExitPcScreen()
|
|||
{
|
||||
if (m_connectedWin != nullptr) {
|
||||
m_connectedWin->restoreScreenButton();
|
||||
m_connectedWin->changeFontSize(m_fontSize);
|
||||
}
|
||||
if (m_pcScreen != nullptr) {
|
||||
m_pcScreen->disconnected();
|
||||
|
@ -1852,6 +1954,7 @@ void MainWindow::slotTabBtnClicked(SuspendTabBar::BtnType type)
|
|||
m_suspendTabBar = nullptr;
|
||||
}
|
||||
m_connectedWin->restoreScreenButton();
|
||||
m_connectedWin->changeFontSize(m_fontSize);
|
||||
m_pcScreen->disconnected();
|
||||
} break;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <QApplication>
|
||||
#include <QScreen>
|
||||
#include <QMetaType>
|
||||
#include <QMessageBox>
|
||||
#include <QMutex>
|
||||
#include <kballontip.h>
|
||||
|
||||
|
@ -46,6 +45,7 @@
|
|||
#include "androidhomepage.h"
|
||||
#include "fileview.h"
|
||||
#include "timelinelistwidget.h"
|
||||
#include "messagedialog.h"
|
||||
|
||||
#define KYLIN_CONNECTIVITY_SEND_SERVICE "com.kylin.connectivity.send"
|
||||
#define KYLIN_CONNECTIVITY_SEND_PATH "/com/kylin/connectivity"
|
||||
|
@ -74,7 +74,6 @@ public:
|
|||
protected:
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void changeEvent(QEvent *event) override;
|
||||
|
||||
private:
|
||||
|
@ -106,6 +105,7 @@ private:
|
|||
bool umountFtp(QString path);
|
||||
void clearConnectionInfo();
|
||||
void startTimer();
|
||||
void initSearchServer(QString searchPath);
|
||||
void startLoadUI();
|
||||
void initUI();
|
||||
void connectUI();
|
||||
|
@ -131,6 +131,7 @@ private:
|
|||
void checkFileView(QStringList &pathList);
|
||||
void crumbTagToAndroidItemType(QString tag);
|
||||
void checkPage(QStringList crumbPathList);
|
||||
void moveMessageBox();
|
||||
|
||||
Q_SIGNALS:
|
||||
// 提供dbus服务
|
||||
|
@ -171,6 +172,7 @@ public Q_SLOTS:
|
|||
|
||||
// UI
|
||||
void changeTheme();
|
||||
void changeFontSize();
|
||||
void slotAboutWinShow();
|
||||
void slotSearchResult(const QMap<QString, FileInfo> &searchResult);
|
||||
void slotUSBConnectOnClicked();
|
||||
|
@ -229,7 +231,7 @@ private:
|
|||
FileView *m_fileView = nullptr; // 文件信息列表
|
||||
kdk::KAboutDialog *m_aboutWindow = nullptr; // 关于窗口
|
||||
TransmissionDialog *m_transmissionDialog = nullptr; // 传输进度窗口
|
||||
QMessageBox *m_messageBox = nullptr; // 请求提示框
|
||||
MessageDialog *m_messageBox = nullptr; // 请求提示框
|
||||
SuspendTabBar *m_suspendTabBar = nullptr; // 投屏控制
|
||||
kdk::KBallonTip *m_tipWin; // 消息提示
|
||||
LoadDialog *m_loadDialog = nullptr; // 加载等待
|
||||
|
@ -249,6 +251,7 @@ private:
|
|||
QString m_reconnectAddress = ""; // 重连ip
|
||||
quint32 m_inhibitValue = 0; // 熄屏参数
|
||||
PublicAttributes::Model m_model = PublicAttributes::Model::PcModel; // 当前模式
|
||||
double m_fontSize = 10; // 系统字号
|
||||
QList<QStringList> m_backList; // 回退列表
|
||||
QList<QStringList> m_forwardList; // 前进列表
|
||||
bool m_isFileViewPage = true; // 当前是否为文件视图
|
||||
|
@ -256,11 +259,6 @@ private:
|
|||
QListView::ViewMode m_viewMode = QListView::IconMode; // 手机存储当前视图模式
|
||||
QString m_tipMesseage = ""; // 提示消息
|
||||
PublicAttributes::Theme m_theme = PublicAttributes::Theme::Light; // 主题
|
||||
bool m_bLeftClick = false;
|
||||
bool m_isTable = false; //当前模式
|
||||
QString m_searchInfoPath;
|
||||
QString m_searchKeyword;
|
||||
QStringList m_saveListPath;
|
||||
bool m_isDownloadingThumbanil = false;
|
||||
};
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ ConnectedWin::ConnectedWin(QWidget *parent) : QWidget(parent)
|
|||
|
||||
m_layout = new QHBoxLayout;
|
||||
m_layout->setSpacing(0);
|
||||
m_layout->setContentsMargins(54, 15, 54, 0);
|
||||
m_layout->setContentsMargins(24, 10, 24, 10);
|
||||
m_backgroundWin->setLayout(m_layout);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
|
@ -150,6 +150,19 @@ void ConnectedWin::changeScreenButton(bool isShow)
|
|||
}
|
||||
}
|
||||
|
||||
void ConnectedWin::changeFontSize(double fontSize)
|
||||
{
|
||||
QFont font;
|
||||
font.setPointSizeF(fontSize + 14);
|
||||
font.setBold(true);
|
||||
m_deviceName->setFont(font);
|
||||
|
||||
font.setPointSizeF(fontSize);
|
||||
font.setBold(false);
|
||||
m_connectState->setFont(font);
|
||||
m_screenBtn->setFont(font);
|
||||
}
|
||||
|
||||
void ConnectedWin::onClicked()
|
||||
{
|
||||
QPushButton *btn = qobject_cast<QPushButton *>(sender());
|
||||
|
@ -166,4 +179,4 @@ void ConnectedWin::onClicked()
|
|||
} else if (btn == m_disconnectBtn) {
|
||||
Q_EMIT sigBtnClicked(ConnectedWin::BtnType::Disconnect);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -25,10 +25,14 @@ public:
|
|||
void addWidget(QWidget *win);
|
||||
void restoreScreenButton();
|
||||
void changeScreenButton(bool isShow);
|
||||
void changeFontSize(double fontSize);
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigBtnClicked(ConnectedWin::BtnType type);
|
||||
|
||||
public Q_SLOTS:
|
||||
void onClicked();
|
||||
|
||||
private:
|
||||
QLabel *m_deviceIcon = nullptr;
|
||||
QLabel *m_deviceName = nullptr;
|
||||
|
@ -41,9 +45,6 @@ private:
|
|||
|
||||
bool m_isScreenBtnClicked = false;
|
||||
QString m_ScreenText = "";
|
||||
|
||||
public Q_SLOTS:
|
||||
void onClicked();
|
||||
};
|
||||
|
||||
#endif // CONNECTEDWIN_H
|
||||
|
|
|
@ -43,6 +43,7 @@ HomePage::HomePage(QWidget *parent) : QWidget(parent)
|
|||
|
||||
QFont fonts;
|
||||
fonts.setBold(true);
|
||||
m_describeLab->setAlignment(Qt::AlignTop);
|
||||
m_describeLab->setText(
|
||||
tr("Cross equipment and cross system collaboration. "
|
||||
"It is more convenient to share resources and screens, "
|
||||
|
@ -88,6 +89,7 @@ HomePage::HomePage(QWidget *parent) : QWidget(parent)
|
|||
describeHLayout->setMargin(0);
|
||||
describeHLayout->setSpacing(0);
|
||||
describeHLayout->addWidget(m_describeLab);
|
||||
describeHLayout->addStretch();
|
||||
|
||||
QHBoxLayout *deviceCodeHLayout = new QHBoxLayout;
|
||||
deviceCodeHLayout->setMargin(0);
|
||||
|
@ -165,7 +167,6 @@ HomePage::HomePage(QWidget *parent) : QWidget(parent)
|
|||
this->setLayout(mainVLayout);
|
||||
}
|
||||
|
||||
|
||||
void HomePage::setDeviceCode(QString code)
|
||||
{
|
||||
if (code.isEmpty()) {
|
||||
|
@ -174,3 +175,12 @@ void HomePage::setDeviceCode(QString code)
|
|||
}
|
||||
m_codeLab->setText(code);
|
||||
}
|
||||
|
||||
void HomePage::changeFontSize(double fontSize)
|
||||
{
|
||||
QFont font;
|
||||
font.setPointSizeF(fontSize + 14);
|
||||
font.setBold(true);
|
||||
|
||||
m_titleLab->setFont(font);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ public:
|
|||
HomePage(QWidget *parent = nullptr);
|
||||
|
||||
void setDeviceCode(QString code = "");
|
||||
void changeFontSize(double fontSize);
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigConnectBtnClicked();
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
#include "searchedit.h"
|
||||
|
||||
SearchEdit::SearchEdit(QWidget *parent) : KSearchLineEdit(parent)
|
||||
{
|
||||
this->setFixedSize(200, 40);
|
||||
this->setClearButtonEnabled(true);
|
||||
this->setFocusPolicy(Qt::ClickFocus);
|
||||
this->setContextMenuPolicy(Qt::DefaultContextMenu);
|
||||
|
||||
connect(this, &KSearchLineEdit::textChanged, this, &SearchEdit::onTextChanged);
|
||||
connect(this, &KSearchLineEdit::returnPressed, this, &SearchEdit::onReturnPressed);
|
||||
}
|
||||
|
||||
SearchEdit::~SearchEdit()
|
||||
{
|
||||
if (m_searchServer != nullptr) {
|
||||
delete m_searchServer;
|
||||
m_searchServer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void SearchEdit::setInitText(QString text)
|
||||
{
|
||||
m_isInit = false;
|
||||
setText(text);
|
||||
}
|
||||
|
||||
void SearchEdit::focusInEvent(QFocusEvent *event)
|
||||
{
|
||||
Q_EMIT sigEditFocusIn();
|
||||
return QLineEdit::focusInEvent(event);
|
||||
}
|
||||
|
||||
void SearchEdit::focusOutEvent(QFocusEvent *event)
|
||||
{
|
||||
Q_EMIT sigEditFocusOut();
|
||||
return QLineEdit::focusOutEvent(event);
|
||||
}
|
||||
|
||||
void SearchEdit::onTextChanged()
|
||||
{
|
||||
if (!m_isInit) {
|
||||
m_isInit = true;
|
||||
return;
|
||||
}
|
||||
if (!m_mutex.try_lock()) {
|
||||
return;
|
||||
}
|
||||
if (m_searchServer == nullptr) {
|
||||
qWarning() << "search server is not ready!";
|
||||
return;
|
||||
}
|
||||
m_query = this->text().trimmed();
|
||||
m_mutex.unlock();
|
||||
if (m_query.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto search = [this]() {
|
||||
if (!m_mutex.try_lock()) {
|
||||
return;
|
||||
}
|
||||
m_resultMap.clear();
|
||||
m_searchServer->search(m_resultMap, m_query);
|
||||
Q_EMIT sigSearchKeyword(m_query);
|
||||
Q_EMIT sigSearchResult(m_resultMap);
|
||||
m_mutex.unlock();
|
||||
};
|
||||
std::thread searchThread(search);
|
||||
searchThread.detach();
|
||||
}
|
||||
|
||||
void SearchEdit::onReturnPressed()
|
||||
{
|
||||
onTextChanged();
|
||||
}
|
||||
|
||||
void SearchEdit::onSearchInstalled(bool isUpdated, QString searchInfoPath)
|
||||
{
|
||||
qInfo() << "searchInfo installed";
|
||||
|
||||
if (!m_mutex.try_lock()) {
|
||||
return;
|
||||
}
|
||||
if (m_searchServer != nullptr) {
|
||||
this->clear();
|
||||
delete m_searchServer;
|
||||
m_searchServer = nullptr;
|
||||
}
|
||||
m_searchServer = new SearchServer();
|
||||
m_searchServer->setSearchDbPath(searchInfoPath);
|
||||
if (m_searchServer) {
|
||||
if (m_searchServer->init() < 0) {
|
||||
qWarning() << "load search server fail";
|
||||
Q_EMIT sigSearchInitFail();
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_mutex.unlock();
|
||||
|
||||
if (!isUpdated) {
|
||||
qInfo() << "use old searchInfo";
|
||||
Q_EMIT sigSearchLineShow();
|
||||
} else {
|
||||
if (m_searchServer) {
|
||||
qInfo() << "use new searchInfo";
|
||||
auto searchInit = [this]() {
|
||||
m_mutex.lock();
|
||||
if (m_searchServer->createIndex() >= 0) {
|
||||
Q_EMIT sigSearchLineShow();
|
||||
} else {
|
||||
qWarning() << "search server init fail";
|
||||
Q_EMIT sigSearchInitFail();
|
||||
}
|
||||
m_mutex.unlock();
|
||||
};
|
||||
std::thread searchInitThread(searchInit);
|
||||
searchInitThread.detach();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
#ifndef SEARCHEDIT_H
|
||||
#define SEARCHEDIT_H
|
||||
|
||||
#include <QEvent>
|
||||
#include <QLineEdit>
|
||||
#include <QMutex>
|
||||
#include "ksearchlineedit.h"
|
||||
#include "searchserver.h"
|
||||
#include "fileinfo.h"
|
||||
|
||||
using namespace kdk;
|
||||
|
||||
class SearchEdit : public KSearchLineEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SearchEdit(QWidget *parent = nullptr);
|
||||
~SearchEdit();
|
||||
void setInitText(QString text);
|
||||
|
||||
public Q_SLOTS:
|
||||
void onSearchInstalled(bool isUpdated, QString searchInfoPath);
|
||||
void onReturnPressed();
|
||||
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent *event);
|
||||
void focusOutEvent(QFocusEvent *event);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onTextChanged();
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigEditFocusIn();
|
||||
void sigEditFocusOut();
|
||||
void sigSearchLineShow();
|
||||
void sigSearchInitFail();
|
||||
void sigSearchResult(const QMap<QString, FileInfo> &searchResult);
|
||||
void sigSearchKeyword(QString query);
|
||||
|
||||
private:
|
||||
SearchServer *m_searchServer = nullptr;
|
||||
QString m_query = "";
|
||||
QMap<QString, FileInfo> m_resultMap;
|
||||
QMutex m_mutex;
|
||||
bool m_isInit = true;
|
||||
};
|
||||
|
||||
#endif // SEARCHEDIT_H
|
|
@ -6,10 +6,15 @@
|
|||
#include <QDBusConnection>
|
||||
#include <usermanual.h>
|
||||
|
||||
const int DEFAULT_HEIGHT = 40;
|
||||
const int TABLET_HEIGHT = 52;
|
||||
const int ICON_SIZE = 16;
|
||||
const int BTN_SIZE = 36;
|
||||
|
||||
Titlebar::Titlebar(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
initUI();
|
||||
initMenu();
|
||||
initUI();
|
||||
connectInit();
|
||||
}
|
||||
|
||||
|
@ -19,9 +24,9 @@ void Titlebar::initUI()
|
|||
{
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
setObjectName("titlebar");
|
||||
setFixedHeight(DEFAULT_HEIGHT);
|
||||
m_titleNameLab = new QLabel(this);
|
||||
m_titleIcon = new QPushButton(this);
|
||||
m_titleIcon->setFixedSize(24, 24);
|
||||
m_titleIcon->setIconSize(QSize(24, 24));
|
||||
QString m_titleIconStyle = "QPushButton{border:0px;border-radius:4px;background:transparent;}"
|
||||
"QPushButton:Hover{border:0px;border-radius:4px;background:transparent;}"
|
||||
|
@ -30,23 +35,17 @@ void Titlebar::initUI()
|
|||
m_titleIcon->setIcon(QIcon::fromTheme("kylin-multi-collaboration"));
|
||||
m_titleIcon->setContentsMargins(8, 8, 8, 8);
|
||||
|
||||
m_menuBtn = new QToolButton(this);
|
||||
m_menu = new QMenu();
|
||||
m_menuBtn->setToolTip(tr("Menu"));
|
||||
m_minBtn = new QPushButton(this);
|
||||
m_maxBtn = new QPushButton();
|
||||
m_closeBtn = new QPushButton(this);
|
||||
|
||||
m_titleNameLab->setText(tr("kylin-connectivity"));
|
||||
// 固定高度
|
||||
setFixedHeight(40);
|
||||
setAutoFillBackground(true);
|
||||
|
||||
m_menuBtn->setFocusPolicy(Qt::NoFocus);
|
||||
// 最小化按钮
|
||||
m_minBtn->setFixedSize(30, 30);
|
||||
m_minBtn->setIcon(QIcon::fromTheme("window-minimize-symbolic"));
|
||||
m_minBtn->setIconSize(QSize(16, 16));
|
||||
m_minBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
m_minBtn->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
|
||||
m_minBtn->setProperty("isWindowButton", 0x1);
|
||||
m_minBtn->setProperty("useIconHighlightEffect", 0x2);
|
||||
m_minBtn->setFlat(true);
|
||||
|
@ -54,17 +53,17 @@ void Titlebar::initUI()
|
|||
m_minBtn->setFocusPolicy(Qt::NoFocus);
|
||||
m_minBtn->setToolTip(tr("Minimize"));
|
||||
// 最大化按钮
|
||||
m_maxBtn->setFixedSize(30, 30);
|
||||
m_maxBtn->setIcon(QIcon::fromTheme("window-maximize-symbolic"));
|
||||
m_maxBtn->setIconSize(QSize(16, 16));
|
||||
m_maxBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
m_maxBtn->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
|
||||
m_maxBtn->setProperty("isWindowButton", 0x1);
|
||||
m_maxBtn->setProperty("useIconHighlightEffect", 0x2);
|
||||
m_maxBtn->setFlat(true);
|
||||
m_maxBtn->setContentsMargins(4, 0, 4, 0);
|
||||
// 关闭按钮
|
||||
m_closeBtn->setFixedSize(30, 30);
|
||||
m_closeBtn->setIcon(QIcon::fromTheme("window-close-symbolic"));
|
||||
m_closeBtn->setIconSize(QSize(16, 16));
|
||||
m_closeBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
m_closeBtn->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
|
||||
m_closeBtn->setProperty("isWindowButton", 0x2);
|
||||
m_closeBtn->setProperty("useIconHighlightEffect", 0x8);
|
||||
m_closeBtn->setFlat(true);
|
||||
|
@ -139,6 +138,14 @@ void Titlebar::setBackground(bool isDefault)
|
|||
}
|
||||
}
|
||||
|
||||
void Titlebar::changeFontSize(double fontSize)
|
||||
{
|
||||
QFont font;
|
||||
font.setPointSizeF(fontSize);
|
||||
|
||||
m_titleNameLab->setFont(font);
|
||||
}
|
||||
|
||||
void Titlebar::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
{
|
||||
if (window()->isMaximized()) {
|
||||
|
@ -162,16 +169,21 @@ void Titlebar::connectInit()
|
|||
// 设置菜单按钮
|
||||
void Titlebar::initMenu()
|
||||
{
|
||||
m_menuBtn = new QToolButton(this);
|
||||
m_menuBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
m_menuBtn->setToolTip(tr("Menu"));
|
||||
// 菜单按钮
|
||||
m_menuBtn->setFixedSize(30, 30);
|
||||
m_menuBtn->setIcon(QIcon::fromTheme("open-menu-symbolic"));
|
||||
m_menuBtn->setIconSize(QSize(16, 16));
|
||||
m_menuBtn->setIconSize(QSize(ICON_SIZE, ICON_SIZE));
|
||||
m_menuBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
m_menuBtn->setProperty("isWindowButton", 0x1);
|
||||
m_menuBtn->setProperty("useIconHighlightEffect", 0x2);
|
||||
m_menuBtn->setPopupMode(QToolButton::InstantPopup);
|
||||
m_menuBtn->setFocusPolicy(Qt::NoFocus);
|
||||
m_menuBtn->setAutoRaise(true);
|
||||
m_menuBtn->setContentsMargins(4, 0, 4, 0);
|
||||
|
||||
m_menu = new QMenu();
|
||||
// 创建Action
|
||||
QAction *actionHelp = new QAction(m_menu);
|
||||
QAction *actionAbout = new QAction(m_menu);
|
||||
|
|
|
@ -27,6 +27,7 @@ public:
|
|||
void initHelp(); // 设置帮助Action
|
||||
void setTheme(PublicAttributes::Theme theme);
|
||||
void setBackground(bool isDefault = true);
|
||||
void changeFontSize(double fontSize);
|
||||
|
||||
protected:
|
||||
void mouseDoubleClickEvent(QMouseEvent *event);
|
||||
|
|
Loading…
Reference in New Issue