Skip to content

Commit e0eb3bb

Browse files
wjyrichBLumia
authored andcommitted
feat: add F1 key help support for launcher
1. Added showHelp() method in LauncherController to open manual via DBus 2. Implemented F1 key handling in both fullscreen and windowed modes 3. The help system specifically targets "启动器" (Launcher) section 4. Uses DBus interface com.deepin.Manual.Open to launch documentation 5. Added necessary DBus headers to launchercontroller.cpp The change was made to provide quick access to launcher documentation through standard F1 help key, improving user experience and discoverability of launcher features. feat: 为启动器添加F1键帮助支持 1. 在LauncherController中添加showHelp()方法通过DBus打开手册 2. 在全屏和窗口模式下实现F1键处理 3. 帮助系统专门针对"启动器"部分 4. 使用DBus接口com.deepin.Manual.Open启动文档 5. 在launchercontroller.cpp中添加必要的DBus头文件 此变更为用户提供通过标准F1帮助键快速访问启动器文档的功能,提升用户体验和 启动器功能的可发现性。 Pms: BUG-315751
1 parent e5aae6d commit e0eb3bb

4 files changed

Lines changed: 29 additions & 1 deletion

File tree

launchercontroller.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <DGuiApplicationHelper>
1212
#include <QCommandLineParser>
1313
#include <launcher1adaptor.h>
14+
#include <QDBusMessage>
15+
#include <QDBusConnection>
1416

1517
#include <private/qguiapplication_p.h>
1618

@@ -188,4 +190,15 @@ void LauncherController::closeAllPopups()
188190
void LauncherController::setAvoidHide(bool avoidHide)
189191
{
190192
m_avoidHide = avoidHide;
191-
}
193+
}
194+
195+
void LauncherController::showHelp()
196+
{
197+
// 由于当前只有调用 “启动器”,才能跳转到帮助文档的启动器目录。使用launcher 以及launchpad等字段,无法跳转到启动器目录。
198+
QString helpTitle = "启动器";
199+
200+
const QString &dmanInterface = "com.deepin.Manual.Open";
201+
QDBusMessage message = QDBusMessage::createMethodCall(dmanInterface, "/com/deepin/Manual/Open", dmanInterface, "OpenTitle");
202+
message << "dde" << helpTitle;
203+
QDBusConnection::sessionBus().asyncCall(message);
204+
}

launchercontroller.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class LauncherController : public QObject
5252
Q_INVOKABLE QFont adjustFontWeight(const QFont& f, QFont::Weight weight);
5353

5454
Q_INVOKABLE void closeAllPopups();
55+
Q_INVOKABLE void showHelp();
5556

5657
signals:
5758
void currentFrameChanged();

qml/FullscreenFrame.qml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ InputEventItem {
6868
focus: true
6969
objectName: "FullscreenFrame-BaseLayer"
7070

71+
Shortcut {
72+
context: Qt.ApplicationShortcut
73+
sequences: [StandardKey.HelpContents, "F1"]
74+
onActivated: LauncherController.showHelp()
75+
onActivatedAmbiguously: LauncherController.showHelp()
76+
}
77+
7178
readonly property bool isHorizontalDock: DesktopIntegration.dockPosition === Qt.UpArrow || DesktopIntegration.dockPosition === Qt.DownArrow
7279
readonly property int dockSpacing: (isHorizontalDock ? DesktopIntegration.dockGeometry.height : DesktopIntegration.dockGeometry.width) / Screen.devicePixelRatio
7380

qml/windowed/WindowedFrame.qml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ InputEventItem {
2222

2323
KeyNavigation.tab: appGridLoader.item
2424

25+
Shortcut {
26+
context: Qt.ApplicationShortcut
27+
sequences: [StandardKey.HelpContents, "F1"]
28+
onActivated: LauncherController.showHelp()
29+
onActivatedAmbiguously: LauncherController.showHelp()
30+
}
31+
2532
function getHorizontalCoordinatesOfSideBar()
2633
{
2734
return sideBar.x + sideBar.width / 2

0 commit comments

Comments
 (0)