diff --git a/common/fileinfo.cpp b/common/fileinfo.cpp index ec800134df55026b72af55c582009af13f912537..72c57f1512a5c2427c98c5cd7cdf0b41ef300ea3 100644 --- a/common/fileinfo.cpp +++ b/common/fileinfo.cpp @@ -713,12 +713,26 @@ QMap FileInfo::initIconNameMap() { QMap map; map.insert("image", "image-x-generic"); + map.insert("image/x-eps", "application-eps"); map.insert("video", "video-x-generic"); map.insert("audio", "audio-x-generic"); map.insert("text", "text"); - map.insert("application/vnd.rar", "rar"); map.insert("application/vnd.android.package-archive", "application-apk"); map.insert("application/zip", "zip"); + map.insert("application/x-rar", "application-rar"); + map.insert("application/x-7z-compressed", "application-x-7z-compressed"); + map.insert("application/x-gzip", "application-gzip"); + map.insert("application/epub+zip", "application-epub+zip"); + map.insert("application/x-archive", "application-x-archive"); + map.insert("application/x-compress", "application-x-compress"); + map.insert("application/x-tar", "application-x-tar"); + map.insert("application/x-bzip-compressed-tar", "application-x-tar"); + map.insert("application/x-compressed-tar", "application-x-tar"); + map.insert("application/x-lzma-compressed-tar", "application-x-tar"); + map.insert("application/x-tzo", "application-x-tar"); + map.insert("application/x-xz-compressed-tar", "application-x-tar"); + map.insert("application/x-tarz", "application-x-tar"); + map.insert("application/x-xz-compressed-tar", "application-x-tar"); map.insert("application/vnd.debian.binary-package", "application-vnd.debian.binary-package"); map.insert("application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application-vnd.openxmlformats-officedocument.wordprocessingml.document"); @@ -733,7 +747,6 @@ QMap FileInfo::initIconNameMap() map.insert("application/octet-stream", "application-octet-stream"); map.insert("application/java-archive", "application-x-java-archive"); map.insert("application/x-javascript", "application-x-javascript"); - map.insert("application/x-gzip", "application-gzip"); map.insert("application/rtf", "application-rtf"); map.insert("application/x-tar", "application-x-tar"); map.insert("application/x-compressed", "application-x-compress"); @@ -744,43 +757,178 @@ QMap FileInfo::initIconNameMap() map.insert("application/x-smaf", "audio-x-generic"); map.insert("application/x-desktop", "application-x-desktop"); map.insert("inode/directory", "folder"); + map.insert("application/x-cd-image", "application-x-cd-image"); + map.insert("application/xml", "application-xml"); + map.insert("application/x-shellscript", "application-x-shellscript"); + map.insert("application/x-font-otf", "application-font"); + map.insert("application/x-font-ttf", "application-font"); + map.insert("application/x-font-ttx", "application-font"); + map.insert("application/x-font-afm", "application-font"); + map.insert("application/x-font-bdf", "application-font"); + map.insert("application/x-font-type1", "application-font"); + map.insert("application/x-font-pcf", "application-font"); + map.insert("text/html", "html"); + map.insert("text/x-csrc", "text-x-c"); + map.insert("text/x-c++src", "text-x-c++"); + map.insert("text/x-chdr", "text-x-chdr"); + map.insert("text/x-python", "text-x-python"); + map.insert("text/x-java", "application-java"); + map.insert("application/javascript", "application-javascript"); + map.insert("application/json", "application-json"); + map.insert("application/illustrator", "application-illustrator"); + map.insert("application/vnd.ms-access", "application-msaccess"); + map.insert("application/vnd.ms-excel", "application-msexcel"); + map.insert("application/vnd.ms-powerpoint", "application-mspowerpoint"); + map.insert("application/msword", "application-msword"); + map.insert("application/octet-stream", "application-octet-stream"); + map.insert("application/pdf", "application-pdf"); + map.insert("application/pgp-keys", "application-pgp-keys"); + map.insert("image/vnd.adobe.photoshop", "application-photoshop"); + map.insert("application/postscript", "application-postscript"); + map.insert("application/rtf", "application-rtf"); + map.insert("text/x-sql", "application-sql"); + map.insert("application/x-linguist", "application-typescript"); + return map; } QSet FileInfo::initimageSet() { QSet set; - set << "bmp" << "gif" << "jpg" << "jpeg" << "png" << "pbm" << "pgm" << "ppm" << "xbm" << "xpm" << "svg" << "dds" - << "icns" << "jp2" << "mng" << "tga" << "tiff" << "tif" << "wbmp" << "webp" << "sr" << "exr" << "jpe" << "pnm" - << "ras" << "dib" << "ico" << "j2k" << "psd" << "jfi" << "jif" << "apng" << "jng"; + set << "bmp" + << "gif" + << "jpg" + << "jpeg" + << "png" + << "pbm" + << "pgm" + << "ppm" + << "xbm" + << "xpm" + << "svg" + << "dds" + << "icns" + << "jp2" + << "mng" + << "tga" + << "tiff" + << "tif" + << "wbmp" + << "webp" + << "sr" + << "exr" + << "jpe" + << "pnm" + << "ras" + << "dib" + << "ico" + << "j2k" + << "psd" + << "jfi" + << "jif" + << "apng" + << "jng"; return set; } QSet FileInfo::inittextSet() { QSet set; - set << "txt" << "java" << "pot" << "conf" << "cpp" << "c" << "h" << "htm" << "html" << "log" << "prop" << "rc" - << "sh" << "rc" << "xml"; + set << "txt" + << "pot" + << "conf" + << "log" + << "prop" + << "rc"; return set; } QSet FileInfo::initaudioSet() { QSet set; - set << "mp2" << "mp3" << "ogg" << "oga" << "wav" << "wma" << "aac" << "ac3" << "dts" << "ra" << "ape" << "flac" - << "thd" << "mka" << "m4a" << "opus" << "m3u" << "m4b" << "m4p" << "mpga" << "aif" << "mmf" << "amr" << "m4r" - << "mid" << "wv" << "mpa"; + set << "mp2" + << "mp3" + << "ogg" + << "oga" + << "wav" + << "wma" + << "aac" + << "ac3" + << "dts" + << "ra" + << "ape" + << "flac" + << "thd" + << "mka" + << "m4a" + << "opus" + << "m3u" + << "m4b" + << "m4p" + << "mpga" + << "aif" + << "mmf" + << "amr" + << "m4r" + << "mid" + << "wv" + << "mpa"; return set; } QSet FileInfo::initvideoSet() { QSet set; - set << "avi" << "vfw" << "divx" << "mpg" << "mpe" << "mpeg" << "mpg" << "mpg4" << "m1v" << "m2v" << "mpv" << "dv" - << "3gp" << "3g2" << "mov" << "mp4" << "m4v" << "dat" << "vcd" << "ogm" << "ogv" << "ogx" << "asf" << "wmv" - << "iso" << "vob" << "mkv" << "nsv" << "ram" << "flv" << "rm" << "swf" << "ts" << "rmvb" << "dvr-ms" << "m2t" - << "m2ts" << "mts" << "rec" << "wtv" << "f4v" << "hdmov" << "webm" << "vp8" << "bik" << "smk" << "wtv" << "part" - << "m4u" << "h264"; + set << "avi" + << "vfw" + << "divx" + << "mpg" + << "mpe" + << "mpeg" + << "mpg" + << "mpg4" + << "m1v" + << "m2v" + << "mpv" + << "dv" + << "3gp" + << "3g2" + << "mov" + << "mp4" + << "m4v" + << "dat" + << "vcd" + << "ogm" + << "ogv" + << "ogx" + << "asf" + << "wmv" + << "vob" + << "mkv" + << "nsv" + << "ram" + << "flv" + << "rm" + << "swf" + << "ts" + << "rmvb" + << "dvr-ms" + << "m2t" + << "m2ts" + << "mts" + << "rec" + << "wtv" + << "f4v" + << "hdmov" + << "webm" + << "vp8" + << "bik" + << "smk" + << "wtv" + << "part" + << "m4u" + << "h264" + << "MOV"; return set; } FileInfo::FileInfo() diff --git a/connectmanage/connectionservice.cpp b/connectmanage/connectionservice.cpp index ad5a1e8e441e19ff63323a7b29a6de87a15f5b81..3edabc46349402f3d96359819134078f9191ab96 100644 --- a/connectmanage/connectionservice.cpp +++ b/connectmanage/connectionservice.cpp @@ -498,6 +498,7 @@ void ConnectionService::onDataReadyRead() m_data = m_data.mid(index, m_data.size() - index); if (m_writeSize == m_filesInfo.file_info(m_currentFileIndex).size()) { endFile(); + return; } } } diff --git a/data/kylin-connectivity/en_US/index.md b/data/kylin-connectivity/en_US/index.md index 864e2e90dcea79c87c5cb9d8481ee6fbe707b151..c892874fe2df22e804521b6abe39b18e70043f76 100644 --- a/data/kylin-connectivity/en_US/index.md +++ b/data/kylin-connectivity/en_US/index.md @@ -1,4 +1,4 @@ -# kylin-connectivity +# Kylin-connectivity ## Summary kylin-connectivity is a tool that can help users quickly discover and connect kylinos and Android devices under the same LAN, and implements the rapid discovery, device connection, file sharing, screen sharing and reverse control between kylinos and between kylinos and Android devices. diff --git a/debian/changelog b/debian/changelog index 03e9b58defc2c0003b1c8c587a3e3a09bbc44685..f0685bef3ceed4c6e2d49e9b46283e0b7090eff4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +kylin-connectivity (1.1.0.1-ok0.36) nile; urgency=medium + + * BUG: #IA6MNG 手机端多端协同应用-手机文件-文档中选择3个不同日期的文件进行发送,pc端应用会闪退 + * 需求:无 + * 其他改动说明:无 + * 其他改动影响域:无 + + -- Kevin Duan Wed, 13 Nov 2024 11:00:51 +0800 + kylin-connectivity (1.1.0.1-ok0.35) nile; urgency=medium * BUG: 无 diff --git a/kylinconnectivitymanager/CMakeLists.txt b/kylinconnectivitymanager/CMakeLists.txt index ff7b7ae2c281cc90669d31da21db33c8bb6140e8..a26d92531a4fc01ecf35a03dea7920b3479d92fc 100644 --- a/kylinconnectivitymanager/CMakeLists.txt +++ b/kylinconnectivitymanager/CMakeLists.txt @@ -26,4 +26,5 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::DBus) install(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin/) install(FILES ${TOP_DIR}/com.kylin.connectivity.manager.conf DESTINATION /etc/dbus-1/system.d/) -install(FILES ${TOP_DIR}/com.kylin.connectivity.manager.service DESTINATION /usr/share/dbus-1/system-services/) \ No newline at end of file +install(FILES ${TOP_DIR}/com.kylin.connectivity.manager.service DESTINATION /usr/share/dbus-1/system-services/) +install(FILES ${TOP_DIR}/com.kylin.connectivity.manager.yaml DESTINATION /etc/kylin-config/basic/) diff --git a/kylinconnectivitymanager/com.kylin.connectivity.manager.limit b/kylinconnectivitymanager/com.kylin.connectivity.manager.limit new file mode 100644 index 0000000000000000000000000000000000000000..6df136b5b4bc1d3e8227afdb66be5c3cf6529002 --- /dev/null +++ b/kylinconnectivitymanager/com.kylin.connectivity.manager.limit @@ -0,0 +1,2 @@ +[whitelist] +key1 = /usr/bin/kylin-connectivity \ No newline at end of file diff --git a/kylinconnectivitymanager/com.kylin.connectivity.manager.limit.verify b/kylinconnectivitymanager/com.kylin.connectivity.manager.limit.verify new file mode 100644 index 0000000000000000000000000000000000000000..ecb7bbff824978ea2603d5ef193e5f5884935e1d --- /dev/null +++ b/kylinconnectivitymanager/com.kylin.connectivity.manager.limit.verify @@ -0,0 +1 @@ +39cd0f1559f165d1c196401916d77573204a4eb4 \ No newline at end of file diff --git a/kylinconnectivitymanager/com.kylin.connectivity.manager.yaml b/kylinconnectivitymanager/com.kylin.connectivity.manager.yaml new file mode 100644 index 0000000000000000000000000000000000000000..77e5743b2e6e8fda2b345cb24d2d8e077ea7a54e --- /dev/null +++ b/kylinconnectivitymanager/com.kylin.connectivity.manager.yaml @@ -0,0 +1,8 @@ +com:kylin:connectivity:manager: + 1.0.0.1: + audit: + _type: b + _default: false + whitelist: + _type: as + _default: '["/usr/bin/kylin-connectivity"]' diff --git a/translations/kylin-connectivity_zh_HK.ts b/translations/kylin-connectivity_zh_HK.ts index 418a05392ae2276ab9f5fc58df8c48aa8d51aee7..597cbc690da82e5a06df1de2c6dbde38ee88b07d 100644 --- a/translations/kylin-connectivity_zh_HK.ts +++ b/translations/kylin-connectivity_zh_HK.ts @@ -348,13 +348,13 @@ Connection request received from" - 收到來自 ” + 收到來自 " " - 」 的請求 + " 的請求 @@ -456,7 +456,7 @@ Received screen projection request from " - 收到來自 ” + 收到來自 " diff --git a/translations/peony-send-to-connectivity_kk_KZ.ts b/translations/peony-send-to-connectivity_kk_KZ.ts new file mode 100644 index 0000000000000000000000000000000000000000..b333f10c2229f4d4fe621a95b8660feeec69160a --- /dev/null +++ b/translations/peony-send-to-connectivity_kk_KZ.ts @@ -0,0 +1,27 @@ + + + + + Peony::SendToKConnectivity + + + Send to connectivity + Қосылымға жіберу + + + + Warning + Ескерту + + + + Please open kylin-connectivity + Көп терминалды бірлескен әрекеттесуді қосуыңызды сұраймыз + + + + Send to a connectivity + Қосылымға жіберу + + + diff --git a/translations/peony-send-to-connectivity_ky_KG.ts b/translations/peony-send-to-connectivity_ky_KG.ts new file mode 100644 index 0000000000000000000000000000000000000000..e3416e90bc36df0e8563a1b8e4638c3f6f2305f4 --- /dev/null +++ b/translations/peony-send-to-connectivity_ky_KG.ts @@ -0,0 +1,27 @@ + + + + + Peony::SendToKConnectivity + + + Send to connectivity + Туташуу үчүн жөнөтүү + + + + Warning + эскертүү + + + + Please open kylin-connectivity + Сураныч, көп терминалдык кызматташууга мүмкүндүк берет + + + + Send to a connectivity + Туташуу үчүн жөнөтүү + + + diff --git a/translations/peony-send-to-connectivity_ug_CN.ts b/translations/peony-send-to-connectivity_ug_CN.ts new file mode 100644 index 0000000000000000000000000000000000000000..c20747eef431c5e06e48b30597dd297e72795679 --- /dev/null +++ b/translations/peony-send-to-connectivity_ug_CN.ts @@ -0,0 +1,27 @@ + + + + + Peony::SendToKConnectivity + + + Send to connectivity + ئۇلىنىشقا يوللاش + + + + Warning + ئاگاھلاندۇرۇش + + + + Please open kylin-connectivity + كۆپ تەرەپلىك ماسلىشىشنى ئېچىڭ + + + + Send to a connectivity + ئۇلىنىشقا يوللاش + + + diff --git a/translations/peony-send-to-connectivity_zh_HK.ts b/translations/peony-send-to-connectivity_zh_HK.ts index a1068c4249fa5b91fea4fcc1e9d47cb180b5b291..2e5927c445b7234b83ccccd353493d05ed07dd53 100644 --- a/translations/peony-send-to-connectivity_zh_HK.ts +++ b/translations/peony-send-to-connectivity_zh_HK.ts @@ -21,7 +21,7 @@ Send to a connectivity - 發送到連接 + 發送到多端協同 diff --git a/translations/peony-vfs-kylin-multiterminal_zh_HK.ts b/translations/peony-vfs-kylin-multiterminal_zh_HK.ts index f0ed5843d3654651fd171d12f18e2ea30928aaf3..eae0ab1b42448dd8b3ce8c07bf4ef314205d7c25 100644 --- a/translations/peony-vfs-kylin-multiterminal_zh_HK.ts +++ b/translations/peony-vfs-kylin-multiterminal_zh_HK.ts @@ -1,6 +1,6 @@ - + QObject @@ -33,14 +33,14 @@ MULT may not have started - MULT 可能尚未啟動 + 多端協同可能尚未啟動 Multiterminal - 多終端 + 多端協同 @@ -50,7 +50,7 @@ Default multiterminal vfs of peony - 牡丹的預設多終端vfs + 預設多端協同虛擬文件系統 diff --git a/ui/filemanageview/filemanagewin.cpp b/ui/filemanageview/filemanagewin.cpp index cc515b3c30ecae52d075b597b4cce0e4d46dba58..983c889f50f38493c69991d9fd6b4fae8233046f 100644 --- a/ui/filemanageview/filemanagewin.cpp +++ b/ui/filemanageview/filemanagewin.cpp @@ -506,7 +506,6 @@ void FileManageWin::autoResetCrumb() currentWidth = currentWidth - fm.width(str) * 1.2 - CRUMB_SPACE; } } - m_crumb->setFixedWidth(currentWidth); for (int i = m_crumb->count() - 1; i >= 0; i--) { m_crumb->removeTab(i); } diff --git a/ui/filemanageview/fileview.cpp b/ui/filemanageview/fileview.cpp index f34ff5df99d164a09043f8bb7d3b99595c083cd1..e684903727144d0a76057141eec9815e38aca6ed 100644 --- a/ui/filemanageview/fileview.cpp +++ b/ui/filemanageview/fileview.cpp @@ -341,9 +341,9 @@ void FileView::setInfo(const QMap &map) if (info.type() == FileInfo::FileType::Txt) { item->setIcon(QIcon::fromTheme("text")); } else if (info.type() == FileInfo::FileType::Video) { - item->setIcon(getVideoIcon(info.getThumbnailPath())); + item->setIcon(QIcon::fromTheme("video")); } else if (info.type() == FileInfo::FileType::Image) { - item->setIcon(getPictureIcon(info.getThumbnailPath())); + item->setIcon(QIcon::fromTheme("image-x-generic")); } else if (info.type() == FileInfo::FileType::Audio) { item->setIcon(QIcon::fromTheme("audio-x-generic")); } else if (info.type() == FileInfo::FileType::Dir) { @@ -368,9 +368,9 @@ void FileView::setInfo(const QList &list) if (info.type() == FileInfo::FileType::Txt) { item->setIcon(QIcon::fromTheme("text")); } else if (info.type() == FileInfo::FileType::Video) { - item->setIcon(getVideoIcon(info.getThumbnailPath())); + setVideoIcon(item, info.getThumbnailPath()); } else if (info.type() == FileInfo::FileType::Image) { - item->setIcon(getPictureIcon(info.getThumbnailPath())); + setPictureIcon(item, info.getThumbnailPath()); } else if (info.type() == FileInfo::FileType::Audio) { item->setIcon(QIcon::fromTheme("audio-x-generic")); } else if (info.type() == FileInfo::FileType::Dir) { @@ -450,45 +450,60 @@ QSize FileView::getIconSize() } } -QIcon FileView::getPictureIcon(QString path) +void FileView::setPictureIcon(QStandardItem *item, QString path) { + QIcon icon; + QPixmap thumbnail = QPixmap(path); if (path.isEmpty()) { - return QIcon::fromTheme("image-x-generic"); + icon = QIcon::fromTheme("image-x-generic"); } else { QFileInfo info(path); if (!info.exists()) { - return QIcon::fromTheme("image-x-generic"); + icon = QIcon::fromTheme("image-x-generic"); + } else { + thumbnail = thumbnail.scaled(getIconSize(), Qt::KeepAspectRatio); + if (thumbnail.isNull()) { + icon = QIcon::fromTheme("image-x-generic"); + } else { + icon = QIcon(thumbnail); + } } - QPixmap thumbnail = QPixmap(path); - thumbnail = thumbnail.scaled(getIconSize(), Qt::KeepAspectRatio); - return QIcon(thumbnail); } + + item->setIcon(icon); } -QIcon FileView::getVideoIcon(QString path) +void FileView::setVideoIcon(QStandardItem *item, QString path) { + QIcon icon; + QPixmap thumbnail = QPixmap(path); + QPixmap playPixmap(":/filemanageview/play.svg"); if (path.isEmpty()) { - return QIcon::fromTheme("video"); + icon = QIcon::fromTheme(":/filemanageview/videodefault.svg"); } else { QFileInfo info(path); if (!info.exists()) { - return QIcon(":/filemanageview/videodefault.svg"); - } - 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); + icon = QIcon::fromTheme(":/filemanageview/videodefault.svg"); } else { - playPixmap = playPixmap.scaled(QSize(24, 24), Qt::KeepAspectRatio, Qt::SmoothTransformation); + thumbnail = thumbnail.scaled(getIconSize(), Qt::KeepAspectRatio); + if (thumbnail.isNull()) { + icon = QIcon::fromTheme(":/filemanageview/videodefault.svg"); + } else { + 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(); + icon = QIcon(thumbnail); + } } - 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); } + item->setIcon(icon); } void FileView::slotDoubleClicked(const QModelIndex &index) @@ -522,7 +537,7 @@ void FileView::slotContextMenu(const QPoint &pos) QMenu *menu = new QMenu(this); QAction *openAction = new QAction(QIcon::fromTheme("folder-open-symbolic"), tr("Open"), this); connect(openAction, &QAction::triggered, this, &FileView::slotOpenTriggered); - QAction *downloadAction = new QAction(QIcon(":/filemanageview/download.svg"), tr("Download"), this); + QAction *downloadAction = new QAction(QIcon::fromTheme("folder-download-symbolic"), tr("Download"), this); connect(downloadAction, &QAction::triggered, this, &FileView::slotDownloadTriggered); if (list.size() == 1) { menu->addAction(openAction); diff --git a/ui/filemanageview/fileview.h b/ui/filemanageview/fileview.h index ad89c64d08a49347099fc4ddc9c3f7edfd87547c..e3604cf76f46f4bbe7f367bc680d8e83732d4e8e 100644 --- a/ui/filemanageview/fileview.h +++ b/ui/filemanageview/fileview.h @@ -65,8 +65,8 @@ private: void sendDownloadInfo(); void updateViewMode(); QSize getIconSize(); - QIcon getPictureIcon(QString path); - QIcon getVideoIcon(QString path); + void setPictureIcon(QStandardItem *item, QString path); + void setVideoIcon(QStandardItem *item, QString path); Q_SIGNALS: void sigOpenFile(FileInfo::FileType, QString); diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index 1357b05708861a75cb5c20f52b7fa6f681bc182b..80f568122b66d6ac29bf92889be9dfca35dd34c5 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -612,7 +612,7 @@ void MainWindow::setToolTipWin(QString msg, kdk::TipType type) m_tipWin->setTipTime(2000); m_tipWin->setContentsMargins(4, 0, 8, 0); m_tipWin->setFixedHeight(40 + m_fontSize); - m_tipWin->move((this->geometry().x() + ((this->width() - m_tipWin->width()) >> 1)), + m_tipWin->move((this->geometry().x() + ((this->width() - m_tipWin->width()) >> 1) + 215), (this->geometry().y() + ((this->height() - m_tipWin->height()) >> 1) + 250)); m_tipWin->activateWindow(); m_tipWin->showInfo(); @@ -1818,6 +1818,8 @@ bool MainWindow::setScreenOption() m_messageBox->setText(str1, str2); m_messageBox->setIconPixmap(QIcon::fromTheme("dialog-warning")); m_messageBox->addButton(QString(tr("CLOSE"))); + connect(m_messageBox, &MessageDialog::buttonClicked, [=]() { m_connectedWin->restoreScreenButton(); }); + connect(m_messageBox, &MessageDialog::sigClose, [=]() { m_connectedWin->restoreScreenButton(); }); moveMessageBox(); return false; } diff --git a/ui/view/titlebar.cpp b/ui/view/titlebar.cpp index 2d9ec564691b7f39a80bfc7c6551a371c61e3d9b..6ed77825e921a5cf255acbe7a314b08068560dfc 100644 --- a/ui/view/titlebar.cpp +++ b/ui/view/titlebar.cpp @@ -5,6 +5,7 @@ #include #include #include +#include "kmenubutton.h" const int DEFAULT_HEIGHT = 48; const int TABLET_HEIGHT = 64; @@ -212,6 +213,7 @@ void Titlebar::initMenu() m_menuBtn->setAutoRaise(true); m_menuBtn->setContentsMargins(4, 0, 4, 0); + kdk::KMenuButton *menubutton = new kdk::KMenuButton(); m_menu = new QMenu(this); // 创建Action QAction *actionHelp = new QAction(m_menu); @@ -222,7 +224,7 @@ void Titlebar::initMenu() actionQuit->setText(tr("Quit")); // 将Action添加到菜单中 - m_actions << actionHelp << actionAbout << actionQuit; + m_actions << actionHelp << actionAbout << menubutton->feedbackAction() << actionQuit; m_menu->addActions(m_actions); // 为菜单按钮设置菜单