-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: Implement interactive welcome page (fixes #323)
- Loading branch information
Showing
10 changed files
with
208 additions
and
75 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2018 Oleg Shparber | ||
** Contact: https://go.zealdocs.org/l/contact | ||
** | ||
** This file is part of Zeal. | ||
** | ||
** Zeal is free software: you can redistribute it and/or modify | ||
** it under the terms of the GNU General Public License as published by | ||
** the Free Software Foundation, either version 3 of the License, or | ||
** (at your option) any later version. | ||
** | ||
** Zeal is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
** GNU General Public License for more details. | ||
** | ||
** You should have received a copy of the GNU General Public License | ||
** along with Zeal. If not, see <https://www.gnu.org/licenses/>. | ||
** | ||
****************************************************************************/ | ||
|
||
#include "webbridge.h" | ||
|
||
#include <QCoreApplication> | ||
#include <QDesktopServices> | ||
#include <QUrl> | ||
|
||
using namespace Zeal::WidgetUi; | ||
|
||
WebBridge::WebBridge(QObject *parent) | ||
: QObject(parent) | ||
{ | ||
} | ||
|
||
void WebBridge::openShortUrl(const QString &key) | ||
{ | ||
QDesktopServices::openUrl(QUrl(QStringLiteral("https://go.zealdocs.org/l/") + key)); | ||
} | ||
|
||
void WebBridge::triggerAction(const QString &action) | ||
{ | ||
emit actionTriggered(action); | ||
} | ||
|
||
QString WebBridge::appVersion() const | ||
{ | ||
return QCoreApplication::applicationVersion(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2018 Oleg Shparber | ||
** Contact: https://go.zealdocs.org/l/contact | ||
** | ||
** This file is part of Zeal. | ||
** | ||
** Zeal is free software: you can redistribute it and/or modify | ||
** it under the terms of the GNU General Public License as published by | ||
** the Free Software Foundation, either version 3 of the License, or | ||
** (at your option) any later version. | ||
** | ||
** Zeal is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
** GNU General Public License for more details. | ||
** | ||
** You should have received a copy of the GNU General Public License | ||
** along with Zeal. If not, see <https://www.gnu.org/licenses/>. | ||
** | ||
****************************************************************************/ | ||
|
||
#ifndef ZEAL_WIDGETUI_WEBBRIDGE_H | ||
#define ZEAL_WIDGETUI_WEBBRIDGE_H | ||
|
||
#include <QObject> | ||
|
||
namespace Zeal { | ||
namespace WidgetUi { | ||
|
||
class WebBridge : public QObject | ||
{ | ||
Q_OBJECT | ||
Q_PROPERTY(QString AppVersion READ appVersion CONSTANT) | ||
public: | ||
explicit WebBridge(QObject *parent = nullptr); | ||
|
||
signals: | ||
void actionTriggered(const QString &action); | ||
|
||
public slots: | ||
Q_INVOKABLE void openShortUrl(const QString &key); | ||
Q_INVOKABLE void triggerAction(const QString &action); | ||
|
||
private: | ||
QString appVersion() const; | ||
}; | ||
|
||
} // namespace WidgetUi | ||
} // namespace Zeal | ||
|
||
#endif // ZEAL_WIDGETUI_WEBBRIDGE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.