UniversalIndentGUI 1.2.0
Public Slots | Public Member Functions | Private Slots | Private Member Functions | Private Attributes
UpdateCheckDialog Class Reference

UpdateCheckDialog is a dialog widget that contains functions for online checking for a new version of UniversalIndentGUI. More...

#include <UpdateCheckDialog.h>

Inheritance diagram for UpdateCheckDialog:
Inheritance graph
[legend]

List of all members.

Public Slots

void checkForUpdate ()
 This slot should be called, if an update check is automatically invoked.
void checkForUpdateAndShowDialog ()
 This slot should be called, if an update check is manually invoked.

Public Member Functions

 UpdateCheckDialog (QSharedPointer< UiGuiSettings > settings, QWidget *parent=NULL)
 Initializes member variables and stores the version of UiGui and a pointer to the _settings object.
 ~UpdateCheckDialog ()
 On destroy cancels any currently running network request.

Private Slots

void checkResultsOfFetchedPadXMLFile (QNetworkReply *networkReply)
 This slot is called after the update check has returned, either by successfully retrieving the pad file, or on any kind of network error.
void handleUpdateCheckDialogButtonClicked (QAbstractButton *clickedButton)
 This slot is called, when a button in the dialog is clicked.
void initProxySettings ()
void updateUpdateCheckProgressBar ()
 This slot is responsible for the animation of the update check progress bar.

Private Member Functions

int convertVersionStringToNumber (QString versionString)
 Converts the as string given version versionString to an integer number.
void getPadXMLFile ()
 This function tries to download the UniversalIndentGui pad file from the SourceForge server.
void showCheckingForUpdateDialog ()
 Displays the progress bar during update check.
void showNewVersionAvailableDialog (QString newVersion)
 Displays the dialog with info about the new available version.
void showNoNewVersionAvailableDialog ()
 Displays the dialog, that no new version is available.

Private Attributes

QNetworkReply * _currentNetworkReply
bool _manualUpdateRequested
QNetworkAccessManager * _networkAccessManager
QDialogButtonBox::ButtonRole _roleOfClickedButton
QSharedPointer< UiGuiSettings_settings
Ui::UpdateCheckDialog * _updateCheckDialogForm
int _updateCheckProgressCounter
QTimer * _updateCheckProgressTimer

Detailed Description

UpdateCheckDialog is a dialog widget that contains functions for online checking for a new version of UniversalIndentGUI.

Definition at line 37 of file UpdateCheckDialog.h.


Constructor & Destructor Documentation

UpdateCheckDialog::UpdateCheckDialog ( QSharedPointer< UiGuiSettings settings,
QWidget parent = NULL 
)

Initializes member variables and stores the version of UiGui and a pointer to the _settings object.

Definition at line 47 of file UpdateCheckDialog.cpp.

References _networkAccessManager, _settings, _updateCheckDialogForm, _updateCheckProgressCounter, _updateCheckProgressTimer, checkResultsOfFetchedPadXMLFile(), handleUpdateCheckDialogButtonClicked(), initProxySettings(), and updateUpdateCheckProgressBar().

Here is the call graph for this function:

UpdateCheckDialog::~UpdateCheckDialog ( )

On destroy cancels any currently running network request.

Definition at line 86 of file UpdateCheckDialog.cpp.

References _currentNetworkReply, _networkAccessManager, and checkResultsOfFetchedPadXMLFile().

Here is the call graph for this function:


Member Function Documentation

void UpdateCheckDialog::checkForUpdate ( ) [slot]

This slot should be called, if an update check is automatically invoked.

An automatic invoked update check should run in background, so the user gets not interrupted by a dialog box.

Definition at line 112 of file UpdateCheckDialog.cpp.

References _manualUpdateRequested, and getPadXMLFile().

Referenced by MainWindow::MainWindow().

Here is the call graph for this function:

Here is the caller graph for this function:

void UpdateCheckDialog::checkForUpdateAndShowDialog ( ) [slot]

This slot should be called, if an update check is manually invoked.

In difference to the automatic update check, during manual update check request a modal progress indicator dialog will be shown.

Definition at line 99 of file UpdateCheckDialog.cpp.

References _manualUpdateRequested, getPadXMLFile(), and showCheckingForUpdateDialog().

Here is the call graph for this function:

void UpdateCheckDialog::checkResultsOfFetchedPadXMLFile ( QNetworkReply *  networkReply) [private, slot]

This slot is called after the update check has returned, either by successfully retrieving the pad file, or on any kind of network error.

Shows a message if check was successful or not. Offers the user to go to the download page if a newer version exists. In case of an error during update check, a message box with the error will be displayed.

Definition at line 136 of file UpdateCheckDialog.cpp.

References _currentNetworkReply, _manualUpdateRequested, _roleOfClickedButton, _settings, _updateCheckProgressTimer, convertVersionStringToNumber(), PROGRAM_VERSION_STRING, showNewVersionAvailableDialog(), and showNoNewVersionAvailableDialog().

Referenced by UpdateCheckDialog(), and ~UpdateCheckDialog().

Here is the call graph for this function:

Here is the caller graph for this function:

int UpdateCheckDialog::convertVersionStringToNumber ( QString  versionString) [private]

Converts the as string given version versionString to an integer number.

The versionString must have the format x.x.x where each x represents a number of a maximum of 999. If the input format is wrong, -1 will be returned.The first number will be multiplied by 1000000 the second by 1000 and then all three will be summarized.

Thus for example 12.5.170 will result in 12005170.

Definition at line 290 of file UpdateCheckDialog.cpp.

Referenced by checkResultsOfFetchedPadXMLFile().

Here is the caller graph for this function:

void UpdateCheckDialog::getPadXMLFile ( ) [private]

This function tries to download the UniversalIndentGui pad file from the SourceForge server.

Definition at line 121 of file UpdateCheckDialog.cpp.

References _currentNetworkReply, and _networkAccessManager.

Referenced by checkForUpdate(), and checkForUpdateAndShowDialog().

Here is the caller graph for this function:

void UpdateCheckDialog::handleUpdateCheckDialogButtonClicked ( QAbstractButton *  clickedButton) [private, slot]

This slot is called, when a button in the dialog is clicked.

If the clicked button was the cancel button, the user wants to cancel the update check. So the _networkAccessManager request is aborted and the timer for the progress bar animation is stopped.

In any case if a button is clicked, the dialog box will be closed.

Definition at line 244 of file UpdateCheckDialog.cpp.

References _currentNetworkReply, _roleOfClickedButton, _updateCheckDialogForm, and _updateCheckProgressTimer.

Referenced by UpdateCheckDialog().

Here is the caller graph for this function:

void UpdateCheckDialog::initProxySettings ( ) [private, slot]

Definition at line 310 of file UpdateCheckDialog.cpp.

References _networkAccessManager, and _settings.

Referenced by UpdateCheckDialog().

Here is the caller graph for this function:

void UpdateCheckDialog::showCheckingForUpdateDialog ( ) [private]

Displays the progress bar during update check.

For displaying activity during update check, a timer is started to updated the progress bar. The user can press a cancel button to stop the update check.

Definition at line 196 of file UpdateCheckDialog.cpp.

References _updateCheckDialogForm, _updateCheckProgressCounter, and _updateCheckProgressTimer.

Referenced by checkForUpdateAndShowDialog().

Here is the caller graph for this function:

void UpdateCheckDialog::showNewVersionAvailableDialog ( QString  newVersion) [private]

Displays the dialog with info about the new available version.

Definition at line 214 of file UpdateCheckDialog.cpp.

References _updateCheckDialogForm, and PROGRAM_VERSION_STRING.

Referenced by checkResultsOfFetchedPadXMLFile().

Here is the caller graph for this function:

void UpdateCheckDialog::showNoNewVersionAvailableDialog ( ) [private]

Displays the dialog, that no new version is available.

Definition at line 226 of file UpdateCheckDialog.cpp.

References _updateCheckDialogForm.

Referenced by checkResultsOfFetchedPadXMLFile().

Here is the caller graph for this function:

void UpdateCheckDialog::updateUpdateCheckProgressBar ( ) [private, slot]

This slot is responsible for the animation of the update check progress bar.

Definition at line 261 of file UpdateCheckDialog.cpp.

References _updateCheckDialogForm, and _updateCheckProgressCounter.

Referenced by UpdateCheckDialog().

Here is the caller graph for this function:


Member Data Documentation

QNetworkReply* UpdateCheckDialog::_currentNetworkReply [private]
QNetworkAccessManager* UpdateCheckDialog::_networkAccessManager [private]
QDialogButtonBox::ButtonRole UpdateCheckDialog::_roleOfClickedButton [private]
QSharedPointer<UiGuiSettings> UpdateCheckDialog::_settings [private]
Ui::UpdateCheckDialog* UpdateCheckDialog::_updateCheckDialogForm [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines