Skip to content

Commit

Permalink
added : check for updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharindam committed Jul 15, 2021
1 parent 530be11 commit 6d42eb6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <QIcon>
#include <cmath>


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


Notifier:: Notifier(QObject *parent): QSystemTrayIcon(QIcon(":/icons/photoquick.png"), parent)
Notifier:: Notifier(QObject *parent)
{
QSystemTrayIcon(QIcon(":/icons/photoquick.png"), parent);
}

void
Expand Down
3 changes: 2 additions & 1 deletion src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
#include <QDebug>

#define PROG_NAME "PhotoQuick"
#define PROG_VERSION "4.5.3"
#define PROG_VERSION "4.5.4"
#define COPYRIGHT_YEAR "2017-2021"
#define AUTHOR_NAME "Arindam Chaudhuri"
#define AUTHOR_EMAIL "[email protected]"
#define PROJ_RELEASE "https://github.com/ksharindam/photoquick/releases"


#define MIN(a,b) ({ __typeof__ (a) _a = (a); \
Expand Down
12 changes: 12 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
#include <QBuffer>
#include <cmath>
#include <QImageWriter>
#include <QDesktopServices>
#include <QUrl>


Window:: Window()
{
Expand Down Expand Up @@ -241,6 +244,7 @@ Window:: loadPlugins()
}
}
}
menu_dict["Info"]->addAction("Check for Update", this, SLOT(checkForUpdate()));
menu_dict["Info"]->addAction("About PhotoQuick", this, SLOT(showAbout()));
}

Expand Down Expand Up @@ -1164,6 +1168,12 @@ Window:: disableButtons(ButtonType type, bool disable)
}
}

void
Window:: checkForUpdate()
{
QDesktopServices::openUrl(QUrl(PROJ_RELEASE));
}

void
Window:: closeEvent(QCloseEvent *ev)
{
Expand All @@ -1175,6 +1185,8 @@ Window:: closeEvent(QCloseEvent *ev)
QMainWindow::closeEvent(ev);
}



// other functions
QString getNextFileName(QString current)
{
Expand Down
1 change: 1 addition & 0 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public slots:
void lensDistort();
// info menu
void imageInfo();
void checkForUpdate();
void showAbout();
// file and view options
void openPrevImage();
Expand Down
6 changes: 3 additions & 3 deletions windows/PhotoQuick.nsi
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "PhotoQuick"
!define PRODUCT_VERSION "4.4.2"
!define PRODUCT_VERSION "4.5.4"
!define PRODUCT_PUBLISHER "Arindamsoft Co."
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\photoquick.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "${PRODUCT_NAME} ${PRODUCT_VERSION}.exe"
OutFile "${PRODUCT_NAME}-${PRODUCT_VERSION}.exe"
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
Expand Down Expand Up @@ -65,7 +65,7 @@ Section "MainSection" SEC01
SetOutPath "$INSTDIR"
File "${BUILDDIR}\photoquick.exe"
; Install icon and shortcut
File "..\src\images\photoquick.ico"
File "..\data\photoquick.ico"
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}.lnk" "$INSTDIR\photoquick.exe" "" "$INSTDIR\photoquick.ico"
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\photoquick.exe" "" "$INSTDIR\photoquick.ico"
; Update environment variable
Expand Down

0 comments on commit 6d42eb6

Please sign in to comment.