24 changed files with 453 additions and 66 deletions
@ -21,7 +21,7 @@ mkdir -p /usr/share/gta5view && \ |
|||
|
|||
# Starting build |
|||
cd qt5 && \ |
|||
qmake -qt=5 -spec linux-clang GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=gnu++11 ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_QCONF DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" ../../gta5view.pro && \ |
|||
qmake -qt=5 -spec linux-clang GTA5SYNC_PREFIX=/usr QMAKE_CXXFLAGS+=-std=gnu++11 ${QMAKE_FLAGS_QT5} ${QMAKE_BUILD_TYPE} "DEFINES+=GTA5SYNC_BUILDCODE=\\\\\\\"${PACKAGE_CODE}\\\\\\\"" "DEFINES+=GTA5SYNC_APPVER=\\\\\\\"${APPLICATION_VERSION}\\\\\\\"" "DEFINES+=GTA5SYNC_COMMIT=\\\\\\\"${APPLICATION_COMMIT}\\\\\\\"" DEFINES+=GTA5SYNC_QCONF DEFINES+=GTA5SYNC_TELEMETRY "DEFINES+=GTA5SYNC_TELEMETRY_WEBURL=\\\\\\\"https://dev.syping.de/gta5view-userstats/\\\\\\\"" DEFINES+=GTA5SYNC_DONATION "DEFINES+=GTA5SYNC_DONATION_EMAIL=\\\\\\\"paypal/at/syping.de\\\\\\\"" ../../gta5view.pro && \ |
|||
make depend && \ |
|||
make -j 4 && \ |
|||
checkinstall -D --default --nodoc --install=no --pkgname=gta5view-qt5 --pkgversion=${PACKAGE_VERSION} --pkgrelease=${PACKAGE_BUILD} --pkggroup=utility --maintainer="Syping \<[email protected]\>" --requires=libqt5core5a,libqt5gui5,libqt5network5,libqt5widgets5,qttranslations5-l10n --conflicts=gta5view,gta5view-qt4 --replaces=gta5view,gta5view-qt4 --pakdir=${PROJECT_DIR}/assets && \ |
|||
|
@ -0,0 +1,80 @@ |
|||
/*****************************************************************************
|
|||
* gta5view Grand Theft Auto V Profile Viewer |
|||
* Copyright (C) 2018 Syping |
|||
* |
|||
* This program 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. |
|||
* |
|||
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*****************************************************************************/ |
|||
|
|||
#include "TranslationClass.h" |
|||
#include "DonationDialog.h" |
|||
#include "config.h" |
|||
#include <QSettings> |
|||
#include <QDebug> |
|||
|
|||
DonationDialog::DonationDialog(QWidget *parent) : QDialog(parent) |
|||
{ |
|||
setWindowFlags(windowFlags()^Qt::WindowContextHelpButtonHint); |
|||
setWindowTitle(tr("Donate")); |
|||
setLayout(&layout); |
|||
titleLabel.setText(tr("<h4>Hello, thank you for using %1!</h4>").arg(GTA5SYNC_APPSTR)); |
|||
layout.addWidget(&titleLabel); |
|||
informationLabel.setText(tr("When you think %1 is useful for you, you should consider donate for support future development.").arg(GTA5SYNC_APPSTR)); |
|||
informationLabel.setWordWrap(true); |
|||
layout.addWidget(&informationLabel); |
|||
donateLabel.setText(QString("<a href=\"%1\"><img src=\":/img/donate.png\"></a>").arg(donateUrl())); |
|||
donateLabel.setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); |
|||
donateLabel.setOpenExternalLinks(true); |
|||
layout.addWidget(&donateLabel); |
|||
layout.addLayout(&buttomLayout); |
|||
showAgainBox.setChecked(true); |
|||
showAgainBox.setText(tr("Show Again")); |
|||
showAgainBox.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); |
|||
buttomLayout.addWidget(&showAgainBox); |
|||
closeButton.setText(tr("&Close")); |
|||
connect(&closeButton, SIGNAL(clicked()), this, SLOT(close())); |
|||
buttomLayout.addWidget(&closeButton); |
|||
resize(((double)sizeHint().width() * 1.5), sizeHint().height()); |
|||
} |
|||
|
|||
DonationDialog::~DonationDialog() |
|||
{ |
|||
} |
|||
|
|||
void DonationDialog::closeEvent(QCloseEvent *ev) |
|||
{ |
|||
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); |
|||
settings.beginGroup("Startup"); |
|||
settings.setValue("ShowDonation", showAgainBox.isChecked()); |
|||
settings.endGroup(); |
|||
ev->accept(); |
|||
} |
|||
|
|||
QString DonationDialog::donateUrl() |
|||
{ |
|||
QString donationUrl; |
|||
QString currencyCode = QLocale::system().currencySymbol(QLocale::CurrencyIsoCode); |
|||
if (currencyCode == "EUR") |
|||
{ |
|||
donationUrl = QString("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=%1&item_name=Donation+for+%2&item_number=%3+Version¤cy_code=EUR").arg(QString(GTA5SYNC_DONATION_EMAIL).replace("/at/", "@"), QString(GTA5SYNC_APPSTR).replace(" ", "+"), QString(GTA5SYNC_BUILDCODE).replace(" ", "+")); |
|||
} |
|||
else if (currencyCode == "GBP") |
|||
{ |
|||
donationUrl = QString("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=%1&item_name=Donation+for+%2&item_number=%3+Version¤cy_code=GBP").arg(QString(GTA5SYNC_DONATION_EMAIL).replace("/at/", "@"), QString(GTA5SYNC_APPSTR).replace(" ", "+"), QString(GTA5SYNC_BUILDCODE).replace(" ", "+")); |
|||
} |
|||
else |
|||
{ |
|||
donationUrl = QString("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=%1&item_name=Donation+for+%2&item_number=%3+Version¤cy_code=USD").arg(QString(GTA5SYNC_DONATION_EMAIL).replace("/at/", "@"), QString(GTA5SYNC_APPSTR).replace(" ", "+"), QString(GTA5SYNC_BUILDCODE).replace(" ", "+")); |
|||
} |
|||
return donationUrl; |
|||
} |
@ -0,0 +1,57 @@ |
|||
/*****************************************************************************
|
|||
* gta5view Grand Theft Auto V Profile Viewer |
|||
* Copyright (C) 2018 Syping |
|||
* |
|||
* This program 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. |
|||
* |
|||
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*****************************************************************************/ |
|||
|
|||
#ifndef DONATIONDIALOG_H |
|||
#define DONATIONDIALOG_H |
|||
|
|||
#include <QLabel> |
|||
#include <QDialog> |
|||
#include <QString> |
|||
#include <QCheckBox> |
|||
#include <QCloseEvent> |
|||
#include <QHBoxLayout> |
|||
#include <QVBoxLayout> |
|||
#include <QPushButton> |
|||
#include <QSpacerItem> |
|||
|
|||
namespace Ui { |
|||
class DonationDialog; |
|||
} |
|||
|
|||
class DonationDialog : public QDialog |
|||
{ |
|||
Q_OBJECT |
|||
public: |
|||
explicit DonationDialog(QWidget *parent = nullptr); |
|||
~DonationDialog(); |
|||
|
|||
protected: |
|||
void closeEvent(QCloseEvent *ev); |
|||
|
|||
private: |
|||
QString donateUrl(); |
|||
QVBoxLayout layout; |
|||
QLabel titleLabel; |
|||
QLabel informationLabel; |
|||
QLabel donateLabel; |
|||
QCheckBox showAgainBox; |
|||
QHBoxLayout buttomLayout; |
|||
QPushButton closeButton; |
|||
}; |
|||
|
|||
#endif // DONATIONDIALOG_H
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue