Skip to content

Commit 6d42eb6

Browse files
committed
added : check for updates
1 parent 530be11 commit 6d42eb6

5 files changed

Lines changed: 21 additions & 5 deletions

File tree

src/common.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <QIcon>
1010
#include <cmath>
1111

12+
1213
// resize to fit if W and H is larger than max_w and max_h keeping aspect ratio
1314
void fitToSize(int W, int H, int max_w, int max_h, int &out_w, int &out_h)
1415
{
@@ -96,8 +97,9 @@ int getJpgFileSize(QImage image, int quality)
9697
}
9798

9899

99-
Notifier:: Notifier(QObject *parent): QSystemTrayIcon(QIcon(":/icons/photoquick.png"), parent)
100+
Notifier:: Notifier(QObject *parent)
100101
{
102+
QSystemTrayIcon(QIcon(":/icons/photoquick.png"), parent);
101103
}
102104

103105
void

src/common.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
#include <QDebug>
55

66
#define PROG_NAME "PhotoQuick"
7-
#define PROG_VERSION "4.5.3"
7+
#define PROG_VERSION "4.5.4"
88
#define COPYRIGHT_YEAR "2017-2021"
99
#define AUTHOR_NAME "Arindam Chaudhuri"
1010
#define AUTHOR_EMAIL "ksharindam@gmail.com"
11+
#define PROJ_RELEASE "https://github.com/ksharindam/photoquick/releases"
1112

1213

1314
#define MIN(a,b) ({ __typeof__ (a) _a = (a); \

src/main.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
#include <QBuffer>
4040
#include <cmath>
4141
#include <QImageWriter>
42+
#include <QDesktopServices>
43+
#include <QUrl>
44+
4245

4346
Window:: Window()
4447
{
@@ -241,6 +244,7 @@ Window:: loadPlugins()
241244
}
242245
}
243246
}
247+
menu_dict["Info"]->addAction("Check for Update", this, SLOT(checkForUpdate()));
244248
menu_dict["Info"]->addAction("About PhotoQuick", this, SLOT(showAbout()));
245249
}
246250

@@ -1164,6 +1168,12 @@ Window:: disableButtons(ButtonType type, bool disable)
11641168
}
11651169
}
11661170

1171+
void
1172+
Window:: checkForUpdate()
1173+
{
1174+
QDesktopServices::openUrl(QUrl(PROJ_RELEASE));
1175+
}
1176+
11671177
void
11681178
Window:: closeEvent(QCloseEvent *ev)
11691179
{
@@ -1175,6 +1185,8 @@ Window:: closeEvent(QCloseEvent *ev)
11751185
QMainWindow::closeEvent(ev);
11761186
}
11771187

1188+
1189+
11781190
// other functions
11791191
QString getNextFileName(QString current)
11801192
{

src/main.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public slots:
7474
void lensDistort();
7575
// info menu
7676
void imageInfo();
77+
void checkForUpdate();
7778
void showAbout();
7879
// file and view options
7980
void openPrevImage();

windows/PhotoQuick.nsi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
; HM NIS Edit Wizard helper defines
22
!define PRODUCT_NAME "PhotoQuick"
3-
!define PRODUCT_VERSION "4.4.2"
3+
!define PRODUCT_VERSION "4.5.4"
44
!define PRODUCT_PUBLISHER "Arindamsoft Co."
55
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\photoquick.exe"
66
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
77
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
88

99
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
10-
OutFile "${PRODUCT_NAME} ${PRODUCT_VERSION}.exe"
10+
OutFile "${PRODUCT_NAME}-${PRODUCT_VERSION}.exe"
1111
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
1212
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
1313
ShowInstDetails show
@@ -65,7 +65,7 @@ Section "MainSection" SEC01
6565
SetOutPath "$INSTDIR"
6666
File "${BUILDDIR}\photoquick.exe"
6767
; Install icon and shortcut
68-
File "..\src\images\photoquick.ico"
68+
File "..\data\photoquick.ico"
6969
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}.lnk" "$INSTDIR\photoquick.exe" "" "$INSTDIR\photoquick.ico"
7070
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\photoquick.exe" "" "$INSTDIR\photoquick.ico"
7171
; Update environment variable

0 commit comments

Comments
 (0)