From d1a113987c89b637a5e426b7b3c6a5bb4b8feb9b Mon Sep 17 00:00:00 2001 From: uncor3 Date: Fri, 7 Nov 2025 19:48:52 +0000 Subject: [PATCH] replace hardcoded url with REPO_URL macro --- src/iDescriptor.h | 2 +- src/mainwindow.cpp | 6 ++---- src/sponsorwidget.cpp | 13 +++++++++++++ src/welcomewidget.cpp | 7 +++---- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/iDescriptor.h b/src/iDescriptor.h index 749c240..5b17814 100644 --- a/src/iDescriptor.h +++ b/src/iDescriptor.h @@ -42,7 +42,7 @@ #define AFC2_SERVICE_NAME "com.apple.afc2" #define RECOVERY_CLIENT_CONNECTION_TRIES 3 #define APPLE_VENDOR_ID 0x05ac - +#define REPO_URL "https://github.com/uncor3/iDescriptor" // This is because afc_read_directory accepts "/var/mobile/Media" as "/" #define POSSIBLE_ROOT "../../../../" diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c6729ac..894723e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -179,10 +179,8 @@ MainWindow::MainWindow(QWidget *parent) QIcon(":/resources/icons/MdiGithub.png"), "iDescriptor on GitHub"); githubButton->setCursor(Qt::PointingHandCursor); githubButton->setFixedSize(24, 24); - connect(githubButton, &ZIconWidget::clicked, this, []() { - QDesktopServices::openUrl( - QUrl("https://github.com/uncor3/iDescriptor")); - }); + connect(githubButton, &ZIconWidget::clicked, this, + []() { QDesktopServices::openUrl(QUrl(REPO_URL)); }); m_connectedDeviceCountLabel = new QLabel("iDescriptor: no devices"); m_connectedDeviceCountLabel->setContentsMargins(5, 0, 5, 0); diff --git a/src/sponsorwidget.cpp b/src/sponsorwidget.cpp index 1754afd..75730e8 100644 --- a/src/sponsorwidget.cpp +++ b/src/sponsorwidget.cpp @@ -18,8 +18,10 @@ */ #include "sponsorwidget.h" +#include "iDescriptor.h" // Include for REPO_URL #include "sponsorappcard.h" #include +#include #include SponsorWidget::SponsorWidget(QWidget *parent) : QWidget(parent) @@ -34,10 +36,21 @@ SponsorWidget::SponsorWidget(QWidget *parent) : QWidget(parent) "And in order to keep it that way, we rely on donations. " "Consider becoming a sponsor to support " "and promote your app/brand here"); + + QLabel *contactDesc = new QLabel(); + contactDesc->setTextFormat(Qt::RichText); + contactDesc->setOpenExternalLinks(true); + contactDesc->setText( + QString( + "You can read more about sponsorships on our " + "github repository.") + .arg(REPO_URL)); + sponsorDesc->setStyleSheet("font-size: 10pt;"); sponsorDesc->setWordWrap(true); layout()->addWidget(sponsorTitle); layout()->addWidget(sponsorDesc); + layout()->addWidget(contactDesc); QLabel *sponsorIconLabel = new QLabel("Example:"); layout()->addWidget(sponsorIconLabel); SponsorAppCard *card = new SponsorAppCard(this); diff --git a/src/welcomewidget.cpp b/src/welcomewidget.cpp index 7bca341..57bb706 100644 --- a/src/welcomewidget.cpp +++ b/src/welcomewidget.cpp @@ -20,6 +20,7 @@ #include "welcomewidget.h" #include "diagnosewidget.h" #include "iDescriptor-ui.h" +#include "iDescriptor.h" #include "responsiveqlabel.h" #include #include @@ -75,10 +76,8 @@ void WelcomeWidget::setupUI() m_githubLabel->setWordWrap(false); m_githubLabel->setMaximumWidth(m_imageLabel->sizeHint().width()); m_githubLabel->setCursor(Qt::PointingHandCursor); - connect(m_githubLabel, &ZLabel::clicked, this, []() { - QDesktopServices::openUrl( - QUrl("https://github.com/uncor3/iDescriptor")); - }); + connect(m_githubLabel, &ZLabel::clicked, this, + []() { QDesktopServices::openUrl(QUrl(REPO_URL)); }); // Make it look like a link QPalette githubPalette = m_githubLabel->palette();