Sponsor button

This commit is contained in:
Jakub Melka 2023-10-22 16:07:55 +02:00
parent 9a951431c4
commit 1631268d08
20 changed files with 447 additions and 2 deletions

View File

@ -90,6 +90,7 @@ MainWindow::MainWindow(QWidget* parent) :
ui->menuView->addAction(m_differencesDockWidget->toggleViewAction());
ui->actionGet_Source->setData(int(Operation::GetSource));
ui->actionBecomeASponsor->setData(int(Operation::BecomeSponsor));
ui->actionAbout->setData(int(Operation::About));
ui->actionOpen_Left->setData(int(Operation::OpenLeft));
ui->actionOpen_Right->setData(int(Operation::OpenRight));
@ -383,6 +384,7 @@ bool MainWindow::canPerformOperation(Operation operation) const
case Operation::Compare:
case Operation::Close:
case Operation::GetSource:
case Operation::BecomeSponsor:
case Operation::About:
return true;
@ -545,6 +547,12 @@ void MainWindow::performOperation(Operation operation)
break;
}
case Operation::BecomeSponsor:
{
QDesktopServices::openUrl(QUrl("https://github.com/sponsors/JakubMelka"));
break;
}
case Operation::About:
{
PDFAboutDialog aboutDialog(this);

View File

@ -61,6 +61,7 @@ public:
Compare,
Close,
GetSource,
BecomeSponsor,
About,
PreviousDifference,
NextDifference,

View File

@ -42,6 +42,7 @@
<string>Help</string>
</property>
<addaction name="actionGet_Source"/>
<addaction name="actionBecomeASponsor"/>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuToolbars">
@ -362,6 +363,15 @@
<string>Display Markers</string>
</property>
</action>
<action name="actionBecomeASponsor">
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/pdfdocdiff/resources/wallet.svg</normaloff>:/pdfdocdiff/resources/wallet.svg</iconset>
</property>
<property name="text">
<string>Become a Sponsor</string>
</property>
</action>
</widget>
<resources>
<include location="resources.qrc"/>

View File

@ -23,5 +23,6 @@
<file>resources/view-right.svg</file>
<file>resources/display-differences.svg</file>
<file>resources/display-markers.svg</file>
<file>resources/wallet.svg</file>
</qresource>
</RCC>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@ -89,6 +89,7 @@ MainWindow::MainWindow(QWidget* parent) :
ui->actionInsert_Empty_Page->setData(int(Operation::InsertEmptyPage));
ui->actionInsert_PDF->setData(int(Operation::InsertPDF));
ui->actionGet_Source->setData(int(Operation::GetSource));
ui->actionBecomeASponsor->setData(int(Operation::BecomeSponsor));
ui->actionAbout->setData(int(Operation::About));
ui->actionInvert_Selection->setData(int(Operation::InvertSelection));
ui->actionRegroup_Even_Odd->setData(int(Operation::RegroupEvenOdd));
@ -121,6 +122,7 @@ MainWindow::MainWindow(QWidget* parent) :
m_iconTheme.registerAction(ui->actionZoom_In, ":/pdfdocpage/resources/zoom-in.svg");
m_iconTheme.registerAction(ui->actionZoom_Out, ":/pdfdocpage/resources/zoom-out.svg");
m_iconTheme.registerAction(ui->actionGet_Source, ":/pdfdocpage/resources/get-source.svg");
m_iconTheme.registerAction(ui->actionBecomeASponsor, ":/pdfdocpage/resources/wallet.svg");
m_iconTheme.registerAction(ui->actionAbout, ":/pdfdocpage/resources/about.svg");
m_iconTheme.registerAction(ui->actionUnited_Document, ":/pdfdocpage/resources/make-united-document.svg");
m_iconTheme.registerAction(ui->actionSeparate_to_Multiple_Documents, ":/pdfdocpage/resources/make-separated-document.svg");
@ -458,6 +460,7 @@ bool MainWindow::canPerformOperation(Operation operation) const
case Operation::InsertEmptyPage:
case Operation::InsertPDF:
case Operation::GetSource:
case Operation::BecomeSponsor:
case Operation::About:
case Operation::PrepareIconTheme:
return true;
@ -650,6 +653,10 @@ void MainWindow::performOperation(Operation operation)
QDesktopServices::openUrl(QUrl("https://github.com/JakubMelka/PDF4QT"));
break;
case Operation::BecomeSponsor:
QDesktopServices::openUrl(QUrl("https://github.com/sponsors/JakubMelka"));
break;
case Operation::InsertEmptyPage:
m_model->insertEmptyPage(ui->documentItemsView->selectionModel()->selection().indexes());
break;

View File

@ -96,6 +96,7 @@ public:
RegroupAlternatingPagesReversed,
GetSource,
BecomeSponsor,
About,
PrepareIconTheme
};

View File

@ -123,6 +123,7 @@
<string>Help</string>
</property>
<addaction name="actionGet_Source"/>
<addaction name="actionBecomeASponsor"/>
<addaction name="actionAbout"/>
<addaction name="actionPrepare_Icon_Theme"/>
</widget>
@ -597,6 +598,15 @@
<string>Prepare Icon Theme</string>
</property>
</action>
<action name="actionBecomeASponsor">
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/pdfdocpage/resources/wallet.svg</normaloff>:/pdfdocpage/resources/wallet.svg</iconset>
</property>
<property name="text">
<string>Become a Sponsor</string>
</property>
</action>
</widget>
<resources>
<include location="resources.qrc"/>

View File

@ -39,5 +39,6 @@
<file>resources/undo.svg</file>
<file>resources/redo.svg</file>
<file>resources/bookmark.svg</file>
<file>resources/wallet.svg</file>
</qresource>
</RCC>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@ -99,5 +99,8 @@
<file>resources/sidebar-visibility.png</file>
<file>resources/sidebar-attachment.png</file>
<file>resources/annot-rectangle.svg</file>
<file>resources/book.svg</file>
<file>resources/wallet.svg</file>
<file>resources/web.svg</file>
</qresource>
</RCC>

View File

@ -530,6 +530,10 @@ void PDFProgramController::initialize(Features features,
{
connect(action, &QAction::triggered, this, &PDFProgramController::onActionGetSource);
}
if (QAction* action = m_actionManager->getAction(PDFActionManager::BecomeSponsor))
{
connect(action, &QAction::triggered, this, &PDFProgramController::onActionBecomeSponsor);
}
if (QAction* action = m_actionManager->getAction(PDFActionManager::AutomaticDocumentRefresh))
{
connect(action, &QAction::triggered, this, &PDFProgramController::onActionAutomaticDocumentRefresh);
@ -2460,6 +2464,11 @@ void PDFProgramController::onActionGetSource()
QDesktopServices::openUrl(QUrl("https://github.com/JakubMelka/PDF4QT"));
}
void PDFProgramController::onActionBecomeSponsor()
{
QDesktopServices::openUrl(QUrl("https://github.com/sponsors/JakubMelka"));
}
void PDFProgramController::onActionAutomaticDocumentRefresh()
{
updateFileWatcher();

View File

@ -103,6 +103,7 @@ public:
ResetToFactorySettings,
CertificateManager,
GetSource,
BecomeSponsor,
About,
SendByMail,
RenderToImages,
@ -353,6 +354,7 @@ private:
void onActionCloseTriggered();
void onActionDeveloperCreateInstaller();
void onActionGetSource();
void onActionBecomeSponsor();
void onActionAutomaticDocumentRefresh();
void onDrawSpaceChanged();

View File

@ -158,6 +158,7 @@ PDFViewerMainWindow::PDFViewerMainWindow(QWidget* parent) :
m_actionManager->setAction(PDFActionManager::ResetToFactorySettings, ui->actionResetToFactorySettings);
m_actionManager->setAction(PDFActionManager::CertificateManager, ui->actionCertificateManager);
m_actionManager->setAction(PDFActionManager::GetSource, ui->actionGetSource);
m_actionManager->setAction(PDFActionManager::BecomeSponsor, ui->actionBecomeASponsor);
m_actionManager->setAction(PDFActionManager::About, ui->actionAbout);
m_actionManager->setAction(PDFActionManager::SendByMail, ui->actionSend_by_E_Mail);
m_actionManager->setAction(PDFActionManager::RenderToImages, ui->actionRender_to_Images);

View File

@ -113,6 +113,7 @@
<string>Help</string>
</property>
<addaction name="actionGetSource"/>
<addaction name="actionBecomeASponsor"/>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuDeveloper">
@ -372,6 +373,10 @@
</property>
</action>
<action name="actionAbout">
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/book.svg</normaloff>:/resources/book.svg</iconset>
</property>
<property name="text">
<string>About...</string>
</property>
@ -920,6 +925,10 @@
</property>
</action>
<action name="actionGetSource">
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/web.svg</normaloff>:/resources/web.svg</iconset>
</property>
<property name="text">
<string>Get Source</string>
</property>
@ -961,6 +970,15 @@
<string>Automatically reloads the document if a change made by an external program is detected.</string>
</property>
</action>
<action name="actionBecomeASponsor">
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/wallet.svg</normaloff>:/resources/wallet.svg</iconset>
</property>
<property name="text">
<string>Become a Sponsor</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>

View File

@ -126,6 +126,7 @@ PDFViewerMainWindowLite::PDFViewerMainWindowLite(QWidget* parent) :
m_actionManager->setAction(PDFActionManager::ResetToFactorySettings, ui->actionResetToFactorySettings);
m_actionManager->setAction(PDFActionManager::CertificateManager, ui->actionCertificateManager);
m_actionManager->setAction(PDFActionManager::GetSource, ui->actionGetSource);
m_actionManager->setAction(PDFActionManager::BecomeSponsor, ui->actionBecomeASponsor);
m_actionManager->setAction(PDFActionManager::About, ui->actionAbout);
m_actionManager->setAction(PDFActionManager::SendByMail, ui->actionSend_by_E_Mail);
m_actionManager->setAction(PDFActionManager::FitPage, ui->actionFitPage);

View File

@ -29,7 +29,7 @@
</property>
<addaction name="actionOpen"/>
<addaction name="actionClose"/>
<addaction name="actionAutomaticDocumentRefresh"/>
<addaction name="actionAutomaticDocumentRefresh"/>
<addaction name="separator"/>
<addaction name="actionSend_by_E_Mail"/>
<addaction name="actionPrint"/>
@ -106,6 +106,7 @@
<string>Help</string>
</property>
<addaction name="actionGetSource"/>
<addaction name="actionBecomeASponsor"/>
<addaction name="actionAbout"/>
</widget>
<addaction name="menuFile"/>
@ -289,6 +290,10 @@
</property>
</action>
<action name="actionAbout">
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/book.svg</normaloff>:/resources/book.svg</iconset>
</property>
<property name="text">
<string>About...</string>
</property>
@ -446,6 +451,10 @@
</property>
</action>
<action name="actionGetSource">
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/web.svg</normaloff>:/resources/web.svg</iconset>
</property>
<property name="text">
<string>Get Source</string>
</property>
@ -459,7 +468,7 @@
<string>Certificates...</string>
</property>
</action>
<action name="actionAutomaticDocumentRefresh">
<action name="actionAutomaticDocumentRefresh">
<property name="checkable">
<bool>true</bool>
</property>
@ -470,6 +479,18 @@
<string>Automatically reloads the document if a change made by an external program is detected.</string>
</property>
</action>
<action name="actionBecomeASponsor">
<property name="icon">
<iconset resource="pdf4qtviewer.qrc">
<normaloff>:/resources/wallet.svg</normaloff>:/resources/wallet.svg</iconset>
</property>
<property name="text">
<string>Become a Sponsor</string>
</property>
<property name="toolTip">
<string>Become a Sponsor</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="svg815"
width="1365.3333"
height="1365.3333"
viewBox="0 0 1365.3333 1365.3333"
sodipodi:docname="book.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata821">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs819" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="3840"
inkscape:window-height="2035"
id="namedview817"
showgrid="false"
inkscape:zoom="0.45523454"
inkscape:cx="880.27588"
inkscape:cy="385.67768"
inkscape:window-x="-13"
inkscape:window-y="-13"
inkscape:window-maximized="1"
inkscape:current-layer="svg815" />
<path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:30;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 887.59475,1160.8501 c -26.72293,-4.0778 -27.50822,-4.2448 -77.05227,-16.3894 -48.09016,-11.7882 -196.39813,-46.9068 -301.20433,-71.3237 -106.07404,-24.7123 -137.27126,-32.3054 -139.65725,-33.9911 -3.21806,-2.2737 -3.21806,-809.20503 0,-811.59417 1.20394,-0.89381 38.04455,-4.92282 81.86804,-8.95333 43.82347,-4.03051 126.17309,-11.64043 182.99915,-16.91094 56.82604,-5.27053 111.98847,-10.34685 122.58316,-11.28073 10.59469,-0.93387 37.78187,-3.47985 60.41599,-5.65771 94.77189,-9.11896 119.49401,-6.7052 126.46206,12.34721 0.5538,1.51429 8.2568,1.35807 34.7535,-0.70479 47.1547,-3.67119 58.6644,-0.23726 64.6106,19.2766 3.9606,12.99754 2.3716,896.49356 -1.6252,903.63406 -9.6844,17.3014 -21.1351,18.8127 -64.0542,8.4541 -25.1514,-6.0702 -26.9312,-5.6226 -30.4856,7.6657 -6.709,25.0816 -21.24683,31.2827 -59.61365,25.4282 z m 36.22316,-3.2615 c 6.65343,-2.2976 12.46235,-7.4482 16.50639,-14.6356 3.2838,-5.8364 3.3546,-15.8167 3.3204,-468.0456 -0.035,-462.08203 -0.035,-462.08203 4.9744,-462.08203 9.6565,0 71.2038,6.58602 72.5069,7.75879 0.7241,0.65167 1.1181,200.09696 0.8756,443.21175 -0.441,442.02679 -0.441,442.02679 -10.0725,444.88809 -5.2973,1.5738 -18.2999,5.3116 -28.8946,8.3064 -10.5947,2.9946 -17.6454,5.4778 -15.6682,5.518 1.9772,0.041 11.0395,1.8552 20.1386,4.0333 29.7304,7.1168 42.0003,4.5955 50.2725,-10.3304 6.2539,-11.2841 5.3576,-892.01758 -0.9193,-903.38593 -8.5899,-15.55744 -25.121,-17.49667 -87.0962,-10.2171 -6.7471,0.79252 -7.1851,0.55907 -11.90982,-6.34756 -8.49596,-12.41953 -15.69162,-14.45015 -46.52305,-13.12887 -21.63231,0.92708 -142.48884,11.56393 -328.57966,28.91904 -23.11568,2.1558 -73.94391,6.81748 -112.95163,10.35926 -39.0077,3.5418 -72.69618,6.79807 -74.86327,7.23619 -3.94018,0.79655 -3.94018,0.79655 -3.94018,404.3953 0,403.59867 0,403.59867 13.57171,406.90217 7.46443,1.8169 65.58199,15.489 129.15011,30.3823 63.56813,14.8933 166.40665,39.0981 228.53004,53.7884 62.12339,14.6904 116.49778,27.3407 120.83197,28.1118 32.845,5.8441 52.38469,7.2475 60.73979,4.3623 z M 940.6552,314.97342 c 0,-4.82808 0.3283,-6.80321 0.7295,-4.38918 0.4012,2.41405 0.4012,6.36431 0,8.77836 -0.4012,2.41404 -0.7295,0.43891 -0.7295,-4.38918 z m -0.2863,-95.28622 c -0.7603,-11.19845 -4.35924,-19.82119 -11.2515,-26.95761 -4.51508,-4.67502 -5.86665,-6.84122 -3.56932,-5.72064 9.6955,4.72923 18.03712,21.64789 15.87632,32.20067 -0.7301,3.56537 -0.8424,3.61621 -1.0555,0.47758 z m 94.3257,-3.39909 c 0,-1.02161 -2.9552,-4.87549 -6.567,-8.56417 -5.0016,-5.10801 -5.4543,-5.96514 -1.899,-3.59574 5.2126,3.47396 11.125,11.59388 9.5122,13.06385 -0.5755,0.52445 -1.0462,0.11767 -1.0462,-0.90394 z m -99.61463,-3.73121 c -0.11177,-1.46442 -0.65666,-3.97822 -1.21097,-5.58623 -0.95523,-2.77111 -0.9034,-2.7753 0.99342,-0.0804 1.10068,1.5638 1.64559,4.0776 1.21095,5.58623 -0.71194,2.4711 -0.81039,2.47908 -0.9934,0.0804 z m 69.40663,894.1216 c 12.6961,-3.5607 12.6961,-3.5607 12.6961,-443.91874 0,-375.36082 -0.3601,-440.35801 -2.4398,-440.35801 -3.8276,0 -51.9783,-4.63118 -59.2896,-5.70254 -6.567,-0.96229 -6.567,-0.96229 -6.567,452.26057 0,453.22292 0,453.22292 21.4521,447.25122 11.7986,-3.2845 27.1653,-7.5741 34.1482,-9.5325 z"
id="path825"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.2 KiB