Add website button
This commit is contained in:
@@ -147,6 +147,15 @@ Page {
|
|||||||
}
|
}
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
}
|
}
|
||||||
|
MenuItem {
|
||||||
|
id: websiteButton
|
||||||
|
text: qsTr("website")
|
||||||
|
icon.name: "internet-services-symbolic"
|
||||||
|
onTriggered: {
|
||||||
|
Qt.openUrlExternally(addon.getUrl())
|
||||||
|
}
|
||||||
|
hoverEnabled: true
|
||||||
|
}
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
id: repairButton
|
id: repairButton
|
||||||
|
|||||||
@@ -640,6 +640,16 @@ QString Addon::path() const
|
|||||||
return m_path;
|
return m_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QUrl Addon::getUrl() const
|
||||||
|
{
|
||||||
|
git_remote *remote = nullptr;
|
||||||
|
if (git_remote_lookup(&remote, m_repo.get(), m_remote.toLocal8Bit()))
|
||||||
|
return QUrl();
|
||||||
|
auto url = QUrl(git_remote_url(remote));
|
||||||
|
git_remote_free(remote);
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
void Addon::closeRepo()
|
void Addon::closeRepo()
|
||||||
{
|
{
|
||||||
m_repo.reset();
|
m_repo.reset();
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QWaitCondition>
|
#include <QWaitCondition>
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
class git_repository;
|
class git_repository;
|
||||||
class git_reference;
|
class git_reference;
|
||||||
@@ -123,6 +124,8 @@ public:
|
|||||||
|
|
||||||
QString path() const;
|
QString path() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE QUrl getUrl() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Status m_status;
|
Status m_status;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 20 KiB |
Reference in New Issue
Block a user