Adding GitQlient Qt5 git GUI app (#5229)

* Adding GitQlient Qt5 git GUI app
This commit is contained in:
Chris Brunner
2020-08-06 09:46:40 -04:00
committed by GitHub
parent 4f8fc61412
commit 22db39272a
3 changed files with 279 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
resource app_signature "application/x-vnd.qt5-gitqlient";
resource app_flags B_MULTIPLE_LAUNCH;
resource app_version {
major = @MAJOR@,
middle = @MIDDLE@,
minor = @MINOR@,
variety = B_APPV_FINAL,
internal = 0,
short_info = "GitQlient",
long_info = "Multi-platform Git client written with Qt"
};
resource vector_icon {
$"6E63696601050004020CC08FB3A5C08FB3A5C38AB3DDC847B728C634B513CA71"
$"B94FCBD8BF01CBA0BBEECC0CC1E7C943C742CB1FC4D9C8D6C7CDC742C943C7CD"
$"C8D6C47ACB69BDADCBB0C119CC46BA3FCB1BB55AC5FDB728C8FEB30AC223B55A"
$"B97FB30ABD59B657B7DBB97FB55AB7DBB657BB57B43EBFA4B39BBD6CB3A6BFCB"
$"B39AC08FB3A5C034B39FC08FB3A5C08FB3A5C08FB3A5C08FB3A5020EBE86B30E"
$"BE86B30EBC8CB342B8FBB4F2BA9FB3EAB5FBB6D5B339BD5FB3DCB9EFB2B7C023"
$"B451C55DB318C2E3B4FDC6B7B6CBC8C9B5BBC7BDB8CDCAC7BE2CCC65BB42CBFA"
$"BEC4CC7BC156CC64C0B9CC7AC514CBE0CA5BC6C9C849C9E2CB68C536CC65C14F"
$"CC1BC355CC7BC0B9CC65BE2CCC7BBEC3CC02BB76C928B72ACAE2B907C711B4EA"
$"C182B31EC483B390C0E6B307BE86B30EBF21B2FDBE86B30EBE86B30EBE86B30E"
$"BE86B30E0605FF01BA0DBD48BA0DBD48BA09BD4CB9F5BD4AB9FEBD4DB9EBBD46"
$"B9FDBD42B9EFBD42BA0BBD41BA0DBD48BA12BD45BA0DBD48BD480236B880BAF7"
$"B880BAF7B7ECBB03B70ABB4EB78CBB19B674BB8DB5F3BC1EB5E4BBF8B601BC42"
$"B7FABE5DB77DBDE8B953BFA4BCEEC09834C062BD4DC0A2BD9AC0BDBD84C0ADBD"
$"ACC0CABE43C160BDF7C112BE71C18EBECCC1EBBE9EC1BDBECCC37BBECCC69BBE"
$"CCC50BBECCC82BBECCCB4ABECCC9BBBEEACB4ABF25CB4ABF07CB4ABF43CB4ABF"
$"7ECB4ABF60CB4ABF7FCA79BF81C8D7BF80C9A8BF82C806BF85C664BF83C735BF"
$"CBC62EC057C5C1C011C5F8C117C52BC15DC51EC12DC51EC1B1C51EC31BC4CBC2"
$"B3C4EFC45FC45FC67FC23BC548C3AFC745C151C6E9C120C73CC16AC696C0D6C5"
$"7EC067C5F9C086C500C049C391C06EC414C04BC276C0B9C0E3C231C187C156C0"
$"64C2DABFF6C46EC00CC3AEBFF34CBFEDC4BBBFF0C4A1C020C490C085C439C052"
$"C464C14CC38EC2A7C2C0C1FAC315C326C282C3B6C25AC3ABC24FC3B8C25BC363"
$"C280C392C26DC2B0C2C6C09DC492C17EC3AAC06CC4C4BFE0C53AC017C510BFBF"
$"C553BF7DC585BF9EC56CBF7EC48CBF81C298BF7FC392BF82C19EBF85BFABBF83"
$"C0A5BF92BF8FBFACBF58BF9FBF74BFDBBEF2C07BBE63C00CBEBBC0AABE40C0DA"
$"BE19C0D5BE1DC0DFBE14C09FBE17C0C4BE13C079BE19C016BE0EC03CBE16BFFF"
$"BE09BFD2BDFFBFE9BE04BFBCBE15BF8FBE42BFA5BE2CBF0ABEC5BECCC046BECC"
$"BF6ABECCC095BEC2C0D6BEC8C0D6BEBCC0D6BE39C056BE7FC09DBCC9BEE1BA81"
$"BD80BBA4BE01BA4CBD68BA23BD51BA20BD53BA24BD4FBA75BD67BA49BD59BB80"
$"BDBFBDBCBF74BCB8BE83BE01BFB5BE65C00FBE4CBFFBBE73C01DBE90C037BE81"
$"C02ABE8DC015BE88BFD1BE8BBFF3BE73BEB5BD0FBCC3BDF1BDA8BC89BC3BBB63"
$"BB8FBC17BBE9BA51BB08B880BAF7B996BAE1B880BAF7B880BAF7B880BAF7B880"
$"BAF7020A00020001000A0002020300"
};

View File

@@ -0,0 +1,110 @@
SUMMARY="Multi-platform Git client written with Qt"
DESCRIPTION="GitQlient, pronounced as git+client (/gɪtˈklaɪənt/) is a \
multi-platform Git client originally forked from QGit.
Nowadays it goes beyond of just a fork and adds a lot of new functionality.
Some of the major feature you can find are:
New features:
* Easy access to remote actions like: push, pull, submodules management and \
branches
* Branches management
* Tags and stashes management
* Submodules handling
* Allow to open several repositories in the same window
* Better visualization of the commits and the work in progress
* Better visualization of the repository view
* Improved UI experience
* Easy access to the main Git actions
* Better code separation between Views and Models
* Simplification of the different options one can do, keeping it to what a Git \
client is."
HOMEPAGE="https://francescmm.github.io/GitQlient/"
COPYRIGHT="2020 Francesc Martinez"
LICENSE="GNU LGPL v2.1"
REVISION="1"
baseUrl="https://codeload.github.com/francescmm"
bmtCommitHash="44dde32d9e79c075a03190bc86753102b14ac663"
qlCommitHash="049bf73c50ceeadd5de989f76258d94d97b1dce8"
qpwCommitHash="4a9d3af084194b803dc8e2b89640b9a97043dab7"
SOURCE_URI="https://github.com/francescmm/GitQlient/archive/v1.2.0-rc.tar.gz"
CHECKSUM_SHA256="2bfd11994c89961c7af4b5cfd90e7d112c38898e60555fc694f9e057ddf51e5e"
SOURCE_DIR="GitQlient-1.2.0-rc"
SOURCE_URI_2="$baseUrl/BenchmarkTool/zip/$bmtCommitHash"
SOURCE_DIR_2="BenchmarkTool-$bmtCommitHash"
SOURCE_FILE_2="BenchmarkTool.zip"
CHECKSUM_SHA256_2="3ced0371b1380787141eb8e382dc38ccc978891c6f2796a1c92d8d7633d120d2"
SOURCE_URI_3="$baseUrl/QLogger/zip/$qlCommitHash"
SOURCE_DIR_3="QLogger-$qlCommitHash"
SORUCE_FILE_3="QLogger.zip"
CHECKSUM_SHA256_3="170dc02d91e9e17c8b900e4fc693fc38fe9dad1aba4602da821ce8d81f135666"
SOURCE_URI_4="$baseUrl/QPinnableTabWidget/zip/$qpwCommitHash"
SOURCE_DIR_4="QPinnableTabWidget-$qpwCommitHash"
SOURCE_FILE_4="QPinnableTabWidget.zip"
CHECKSUM_SHA256_4="ebde7f5c0ff92050a660b85af02d1aee988b7054e78bc1ba1eb3a70e5dbc4d22"
ADDITIONAL_FILES="gitqlient.rdef.in"
PATCHES="gitqlient-1.2.0.patchset"
ARCHITECTURES="!x86_gcc2 x86_64 ?arm ?ppc"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
gitqlient$secondaryArchSuffix = $portVersion
app:GitQlient
"
REQUIRES="
haiku$secondaryArchSuffix
cmd:file
cmd:git
lib:libGL$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5Widgets$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libQt5Core$secondaryArchSuffix
devel:libQt5Gui$secondaryArchSuffix
devel:libQt5Widgets$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:sed
cmd:pkg_config$secondaryArchSuffix
cmd:qmake$secondaryArchSuffix >= 5
"
defineDebugInfoPackage gitqlient$secondaryArchSuffix \
$appsDir/GitQlient
BUILD()
{
cd $sourceDir
cp -rf /$sourceDir2/* $sourceDir/BenchmarkTool
cp -rf /$sourceDir3/* $sourceDir/QLogger
cp -rf /$sourceDir4/* $sourceDir/QPinnableTabWidget
qmake GitQlient.pro
make $jobArgs
}
INSTALL()
{
mkdir -p $appsDir
cp GitQlient $appsDir
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3 | cut -d~ -f1`"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
$portDir/additional-files/gitqlient.rdef.in > gitqlient.rdef
addResourcesToBinaries gitqlient.rdef $appsDir/GitQlient
addAppDeskbarSymlink $appsDir/GitQlient
}

View File

@@ -0,0 +1,117 @@
From d211437ffb404f24d7ed19b82b3afaa1bffd6afe Mon Sep 17 00:00:00 2001
From: cyrusbuilt <cyrusbuilt@gmail.com>
Date: Fri, 31 Jul 2020 19:31:45 -0400
Subject: Adding Haiku OS support
diff --git a/src/big_widgets/Controls.cpp b/src/big_widgets/Controls.cpp
index 14e11d8..6e92312 100644
--- a/src/big_widgets/Controls.cpp
+++ b/src/big_widgets/Controls.cpp
@@ -319,14 +319,19 @@ void Controls::pullCurrentBranch()
const auto ret = git->pull();
QApplication::restoreOverrideCursor();
+ const auto msg = ret.output.toString();
+
if (ret.success)
- emit signalRepositoryUpdated();
+ {
+ if (msg.toLower().contains("merge conflict"))
+ emit signalPullConflict();
+ else
+ emit signalRepositoryUpdated();
+ }
else
{
- const auto errorMsg = ret.output.toString();
-
- if (errorMsg.contains("error: could not apply", Qt::CaseInsensitive)
- && errorMsg.contains("causing a conflict", Qt::CaseInsensitive))
+ if (msg.contains("error: could not apply", Qt::CaseInsensitive)
+ && msg.contains("causing a conflict", Qt::CaseInsensitive))
{
emit signalPullConflict();
}
@@ -336,7 +341,7 @@ void Controls::pullCurrentBranch()
QString("There were problems during the pull operation. Please, see the detailed "
"description for more information."),
QMessageBox::Ok, this);
- msgBox.setDetailedText(errorMsg);
+ msgBox.setDetailedText(msg);
msgBox.setStyleSheet(GitQlientStyles::getStyles());
msgBox.exec();
}
@@ -515,16 +520,19 @@ void Controls::processUpdateFile()
mLatestGitQlient = json["latest-version"].toString();
const auto changeLogUrl = json["changelog"].toString();
+ QJsonObject os;
+ auto platformSupported = true;
#if defined(Q_OS_WIN)
- const auto os = json["windows"].toObject();
+ os = json["windows"].toObject();
#elif defined(Q_OS_LINUX)
- const auto os = json["linux"].toObject();
+ os = json["linux"].toObject();
#elif defined(Q_OS_OSX)
- const auto os = json["osx"].toObject();
+ os = json["osx"].toObject();
+#else
+ platformSupported = false;
+ QLog_Error("Ui", QString("Platform not supported for updates"));
#endif
- mGitQlientDownloadUrl = os["download-url"].toString();
-
const auto newVersion = mLatestGitQlient.split(".");
const auto nv = newVersion.at(0).toInt() * 10000 + newVersion.at(1).toInt() * 100 + newVersion.at(2).toInt();
const auto curVersion = QString("%1").arg(VER).split(".");
@@ -532,20 +540,33 @@ void Controls::processUpdateFile()
if (nv > cv)
{
- mVersionCheck->setVisible(true);
+ if (!platformSupported)
+ {
+ QMessageBox::information(
+ this, tr("New version available!"),
+ tr("There is a new version of GitQlient available but your OS doesn't have a binary built. If you want to "
+ "get the latest version, pleas <a href='https://github.com/francescmm/GitQlient/releases/tag/v%1'>get "
+ "the source code from GitHub</a>.")
+ .arg(mLatestGitQlient));
+ }
+ else
+ {
+ mGitQlientDownloadUrl = os["download-url"].toString();
+ mVersionCheck->setVisible(true);
- QTimer::singleShot(200, this, [this, changeLogUrl] {
- QNetworkRequest request;
- request.setRawHeader("User-Agent", "GitQlient");
- request.setRawHeader("X-Custom-User-Agent", "GitQlient");
- request.setRawHeader("Content-Type", "application/json");
- request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
- request.setUrl(QUrl(changeLogUrl));
+ QTimer::singleShot(200, this, [this, changeLogUrl] {
+ QNetworkRequest request;
+ request.setRawHeader("User-Agent", "GitQlient");
+ request.setRawHeader("X-Custom-User-Agent", "GitQlient");
+ request.setRawHeader("Content-Type", "application/json");
+ request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
+ request.setUrl(QUrl(changeLogUrl));
- const auto reply = mManager->get(request);
+ const auto reply = mManager->get(request);
- connect(reply, &QNetworkReply::finished, this, &Controls::processChangeLog);
- });
+ connect(reply, &QNetworkReply::finished, this, &Controls::processChangeLog);
+ });
+ }
}
}
--
2.27.0