Skip to content

Commit

Permalink
Add Documentation link in Help menu
Browse files Browse the repository at this point in the history
Because the documentation link in 'About Chewing editor is not easy
to be found, add the documentation link in Help menu make user easier
to use
  • Loading branch information
Billy4195 committed Apr 18, 2017
1 parent 1679266 commit 90aca9b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ui/ChewingEditor.ui
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
</property>
<addaction name="actionAbout"/>
<addaction name="actionAboutQt"/>
<addaction name="actionDocumentation"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuHelp"/>
Expand Down Expand Up @@ -122,6 +123,14 @@
<enum>QAction::AboutQtRole</enum>
</property>
</action>
<action name="actionDocumentation">
<property name="text">
<string>Documentation</string>
</property>
<property name="menuRole">
<enum>QAction::ApplicationSpecificRole</enum>
</property>
</action>
<action name="actionExit">
<property name="text">
<string>E&amp;xit</string>
Expand Down
8 changes: 8 additions & 0 deletions src/view/ChewingEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <QtGui>
#include <QDebug>
#include <QMessageBox>
#include <QDesktopServices>

#include "ChewingImporter.h"
#include "ChewingExporter.h"
Expand Down Expand Up @@ -191,6 +192,10 @@ void ChewingEditor::showAbout()
aboutBox.exec();
}

void ChewingEditor::showDocumentation(){
QDesktopServices::openUrl(QUrl("https://github.com/chewing/chewing-editor/wiki"));
}

void ChewingEditor::showDeleteConfirmWindow()
{
QString text = tr("Do you want to delete this phrase?");
Expand Down Expand Up @@ -355,4 +360,7 @@ void ChewingEditor::setupAboutWidget()
connect(
ui_.get()->actionAbout, SIGNAL(triggered()), this, SLOT(showAbout())
);
connect(
ui_.get()->actionDocumentation, SIGNAL(triggered()), this, SLOT(showDocumentation())
);
}
1 change: 1 addition & 0 deletions src/view/ChewingEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public slots:
void selectExportFile();
void finishFileSelection(const QString& file);
void showAbout();
void showDocumentation();
void showDeleteConfirmWindow();

private:
Expand Down

0 comments on commit 90aca9b

Please sign in to comment.