Skip to content

Commit

Permalink
Add: help btn
Browse files Browse the repository at this point in the history
Signed-off-by: datyuesh <[email protected]>
  • Loading branch information
datyuesh committed Apr 14, 2021
1 parent e33735b commit b6b37b6
Show file tree
Hide file tree
Showing 4 changed files with 293 additions and 260 deletions.
22 changes: 22 additions & 0 deletions src/plugins/ukui-clock/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,20 @@ void Clock::settingsStyle()
setWindowIcon(QIcon::fromTheme("kylin-alarm-clock",QIcon(":/image/kylin-alarm-clock.svg")));
}
});

// 用户手册
QString serviceName = "com.kylinUserGuide.hotel"
+ QString("%1%2").arg("_").arg(QString::number(getuid()));
userGuideInterface = new QDBusInterface(serviceName,
"/",
"com.guide.hotel",
QDBusConnection::sessionBus());
qDebug() << "connect to kylinUserGuide" << userGuideInterface->isValid();
if (!userGuideInterface->isValid()) {
qDebug() << "fail to connect to kylinUserGuide";
qDebug() << qPrintable(QDBusConnection::sessionBus().lastError().message());
return;
}
}

/*
Expand Down Expand Up @@ -460,19 +474,27 @@ void Clock::clockInit()
m_menu = new QMenu(ui->pushButton_12);
m_menu->setProperty("fillIconSymbolicColor", true);
m_menuAction = new QAction(m_menu);
QAction *m_helpAction = new QAction(m_menu);
QAction *m_aboutAction = new QAction(m_menu);
QAction *m_closeAction = new QAction(m_menu);

m_menuAction->setText(tr("Set Up"));
m_helpAction->setText(tr("Help"));
m_aboutAction->setText(tr("About"));
m_closeAction->setText(tr("Close"));

m_menu->addAction(m_menuAction);
m_menu->addAction(m_helpAction);
m_menu->addAction(m_aboutAction);
m_menu->addAction(m_closeAction);

ui->pushButton_12->setMenu(m_menu);

connect(m_helpAction, &QAction::triggered, this, [=](){
qDebug() << "help clicked";
userGuideInterface->call(QString("showGuide"), "tools/ukui-clock");
});

connect(m_aboutAction, &QAction::triggered, this, [=](){
About *dialog = new About();
dialog->exec();
Expand Down
Loading

0 comments on commit b6b37b6

Please sign in to comment.