mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-16 19:03:25 +01:00
Check for updates feature started...
This commit is contained in:
parent
1b1e52ab80
commit
a2a8501ca9
@ -299,6 +299,7 @@ set(APP_SOURCES
|
||||
src/gui/widgetwithstatus.cpp
|
||||
src/gui/labelwithstatus.cpp
|
||||
src/gui/messagebox.cpp
|
||||
src/gui/formupdate.cpp
|
||||
|
||||
# CORE sources.
|
||||
src/core/debugging.cpp
|
||||
@ -367,6 +368,7 @@ set(APP_HEADERS
|
||||
src/gui/widgetwithstatus.h
|
||||
src/gui/labelwithstatus.h
|
||||
src/gui/messagebox.h
|
||||
src/gui/formupdate.h
|
||||
|
||||
# CORE headers.
|
||||
src/core/settings.h
|
||||
@ -386,6 +388,7 @@ set(APP_HEADERS
|
||||
|
||||
# Add form files.
|
||||
set(APP_FORMS
|
||||
src/gui/formupdate.ui
|
||||
src/gui/formmain.ui
|
||||
src/gui/formsettings.ui
|
||||
src/gui/formwelcome.ui
|
||||
|
@ -181,7 +181,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source><b>%8</b><br><b>Version:</b> %1 (build on %2 with CMake %3)<br><b>Revision:</b> %4<br><b>Build date:</b> %5<br><b>Qt:</b> %6 (compiled against %7)<br></source>
|
||||
<translation><b>%8</b><br><b>Verze:</b> %1 (OS při sestavování %2 verze CMake %3)<br><b>Revize:</b> %4<br><b>Datum sestavení:</b> %5<br><b>Qt:</b> %6 (při kompilaci %7)<br></translation>
|
||||
<translation><b>%8</b><br><b>Verze:</b> %1 (při sestavování použit OS %2 a CMake %3)<br><b>Revize:</b> %4<br><b>Datum sestavení:</b> %5<br><b>Qt:</b> %6 (při kompilaci %7)<br></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Thanks to page is available only in English language.</source>
|
||||
|
BIN
resources/graphics/icons/mini-kfaenza/check-for-updates.png
Normal file
BIN
resources/graphics/icons/mini-kfaenza/check-for-updates.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
@ -23,6 +23,7 @@
|
||||
#define APP_VERSION "@APP_VERSION@"
|
||||
#define APP_USERAGENT QString("@APP_NAME@/@APP_VERSION@ (@APP_URL@) on @CMAKE_SYSTEM@; Webkit/") + qWebKitVersion()
|
||||
|
||||
#define RELEASES_LIST "https://bitbucket.org/skunkos/rssguard/raw/master/resources/text/UPDATES?at=master"
|
||||
#define DEFAULT_LOCALE "en_GB"
|
||||
#define DEFAULT_FEED_ENCODING "UTF-8"
|
||||
#define URL_REGEXP "^(http|https|feed|ftp):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&:/~\\+#]*[\\w\\-\\@?^=%&/~\\+#])?$"
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "gui/formabout.h"
|
||||
#include "gui/formsettings.h"
|
||||
#include "gui/feedsview.h"
|
||||
#include "gui/messagebox.h"
|
||||
#include "gui/webbrowser.h"
|
||||
#include "gui/iconthemefactory.h"
|
||||
#include "gui/systemtrayicon.h"
|
||||
@ -15,6 +16,10 @@
|
||||
#include "gui/feedmessageviewer.h"
|
||||
#include "qtsingleapplication/qtsingleapplication.h"
|
||||
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
||||
#include "gui/formupdate.h"
|
||||
#endif
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QSessionManager>
|
||||
#include <QRect>
|
||||
@ -105,6 +110,14 @@ void FormMain::prepareMenus() {
|
||||
m_trayMenu = new QMenu(APP_NAME, this);
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
||||
// Add "check for updates" item on some platforms.
|
||||
m_actionCheckForUpdates = new QAction(tr("Check for updates"), this);
|
||||
m_actionCheckForUpdates->setIcon(IconThemeFactory::instance()->fromTheme("check-for-updates"));
|
||||
m_actionCheckForUpdates->setToolTip(tr("Check if new update for the application is available for download."));
|
||||
m_ui->m_menuHelp->insertAction(m_ui->m_actionAboutGuard, m_actionCheckForUpdates);
|
||||
#endif
|
||||
|
||||
// Add needed items to the menu.
|
||||
m_trayMenu->addAction(m_ui->m_actionSwitchMainWindow);
|
||||
m_trayMenu->addSeparator();
|
||||
@ -328,6 +341,10 @@ void FormMain::createConnections() {
|
||||
// Menu "Help" connections.
|
||||
connect(m_ui->m_actionAboutGuard, SIGNAL(triggered()), this, SLOT(showAbout()));
|
||||
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
||||
connect(m_actionCheckForUpdates, SIGNAL(triggered()), this, SLOT(showUpdates()));
|
||||
#endif
|
||||
|
||||
// General connections.
|
||||
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(onAboutToQuit()));
|
||||
|
||||
@ -384,6 +401,30 @@ void FormMain::showAbout() {
|
||||
delete form_pointer.data();
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
||||
void FormMain::showUpdates() {
|
||||
if (!SystemFactory::instance()->applicationCloseLock()->tryLock()) {
|
||||
if (SystemTrayIcon::isSystemTrayActivated()) {
|
||||
SystemTrayIcon::instance()->showMessage(tr("Cannot check for updates"),
|
||||
tr("You cannot check for updates because feed update is ongoing."),
|
||||
QSystemTrayIcon::Warning);
|
||||
}
|
||||
else {
|
||||
MessageBox::show(this,
|
||||
QMessageBox::Warning,
|
||||
tr("Cannot check for updates"),
|
||||
tr("You cannot check for updates because feed update is ongoing."));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
QPointer<FormUpdate> form_update = new FormUpdate(this);
|
||||
form_update.data()->exec();
|
||||
delete form_update.data();
|
||||
}
|
||||
#endif
|
||||
|
||||
void FormMain::showSettings() {
|
||||
QPointer<FormSettings> form_pointer = new FormSettings(this);
|
||||
form_pointer.data()->exec();
|
||||
|
@ -93,7 +93,15 @@ class FormMain : public QMainWindow {
|
||||
void showSettings();
|
||||
void showAbout();
|
||||
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
||||
void showUpdates();
|
||||
#endif
|
||||
|
||||
private:
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
|
||||
QAction *m_actionCheckForUpdates;
|
||||
#endif
|
||||
|
||||
Ui::FormMain *m_ui;
|
||||
QMenu *m_trayMenu;
|
||||
StatusBar *m_statusBar;
|
||||
|
12
src/gui/formupdate.cpp
Normal file
12
src/gui/formupdate.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include "formupdate.h"
|
||||
|
||||
|
||||
FormUpdate::FormUpdate(QWidget *parent)
|
||||
: QDialog(parent), m_ui(new Ui::FormUpdate) {
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
FormUpdate::~FormUpdate()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
24
src/gui/formupdate.h
Normal file
24
src/gui/formupdate.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef FORMUPDATE_H
|
||||
#define FORMUPDATE_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "ui_formupdate.h"
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class FormUpdate;
|
||||
}
|
||||
|
||||
class FormUpdate : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FormUpdate(QWidget *parent = 0);
|
||||
virtual ~FormUpdate();
|
||||
|
||||
private:
|
||||
Ui::FormUpdate *m_ui;
|
||||
};
|
||||
|
||||
#endif // FORMUPDATE_H
|
71
src/gui/formupdate.ui
Normal file
71
src/gui/formupdate.ui
Normal file
@ -0,0 +1,71 @@
|
||||
<ui version="4.0">
|
||||
<author/>
|
||||
<comment/>
|
||||
<exportmacro/>
|
||||
<class>FormUpdate</class>
|
||||
<widget name="FormUpdate" class="QDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget name="buttonBox" class="QDialogButtonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>240</y>
|
||||
<width>341</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<pixmapfunction/>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>FormUpdate</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>FormUpdate</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
Loading…
Reference in New Issue
Block a user