Mercurial > hg > forks > UniversalIndentGUI
annotate src/UpdateCheckDialog.h @ 751:ac165b6ae67e
Done some refactoring:
- Moved includes into the cpp files where possible and using class pre-declarations if possible
- Made class member variable names begin with an underscore
- Made by uic created header files be used as class members instead of inherting them
- Renamed some variables to reflect their purpose better
- Added some NULL initializations and added some comments
- Rearranged some include and declaration code parts to be consistent and better readable
- Updated for QScintilla 2.4.5
- Made UiGuiSettings be accessed via a shared pointer only
git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@1028 59b1889a-e5ac-428c-b0c7-476e01d41282
author | thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282> |
---|---|
date | Thu, 14 Oct 2010 19:52:47 +0000 |
parents | d1493c2ffca1 |
children | f3631db17328 |
rev | line source |
---|---|
638
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
1 /*************************************************************************** |
728
d1493c2ffca1
Big code parts of UiGuiSettings rewritten to handle connection to widgets and other slots easier, specially when adding new settings.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
725
diff
changeset
|
2 * Copyright (C) 2006-2010 by Thomas Schweitzer * |
638
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
3 * thomas-schweitzer(at)arcor.de * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
4 * * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
6 * it under the terms of the GNU General Public License version 2.0 as * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
8 * * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
12 * GNU General Public License for more details. * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
13 * * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
14 * You should have received a copy of the GNU General Public License * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
15 * along with this program in the file LICENSE.GPL; if not, write to the * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
16 * Free Software Foundation, Inc., * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
18 ***************************************************************************/ |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
19 |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
20 #ifndef UPDATECHECKDIALOG_H |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
21 #define UPDATECHECKDIALOG_H |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
22 |
751
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
23 #include <QDialog> |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
24 #include <QDialogButtonBox> |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
25 |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
26 class UiGuiSettings; |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
27 namespace Ui { |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
28 class UpdateCheckDialog; |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
29 } |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
30 |
725
fc850ee753bd
[fix] Bug ID 2135872: A zombie process kept on running if UiGUI was quit during the update check in background if no internet connection is available.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
652
diff
changeset
|
31 class QTimer; |
fc850ee753bd
[fix] Bug ID 2135872: A zombie process kept on running if UiGUI was quit during the update check in background if no internet connection is available.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
652
diff
changeset
|
32 class QDesktopServices; |
fc850ee753bd
[fix] Bug ID 2135872: A zombie process kept on running if UiGUI was quit during the update check in background if no internet connection is available.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
652
diff
changeset
|
33 class QNetworkAccessManager; |
fc850ee753bd
[fix] Bug ID 2135872: A zombie process kept on running if UiGUI was quit during the update check in background if no internet connection is available.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
652
diff
changeset
|
34 class QNetworkReply; |
638
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
35 |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
36 |
751
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
37 class UpdateCheckDialog : public QDialog |
638
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
38 { |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
39 Q_OBJECT |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
40 |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
41 public: |
751
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
42 UpdateCheckDialog(QSharedPointer<UiGuiSettings> settings, QWidget *parent = NULL); |
725
fc850ee753bd
[fix] Bug ID 2135872: A zombie process kept on running if UiGUI was quit during the update check in background if no internet connection is available.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
652
diff
changeset
|
43 ~UpdateCheckDialog(); |
638
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
44 |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
45 public slots: |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
46 void checkForUpdateAndShowDialog(); |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
47 void checkForUpdate(); |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
48 |
751
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
49 private slots: |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
50 void checkResultsOfFetchedPadXMLFile(QNetworkReply *networkReply); |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
51 void handleUpdateCheckDialogButtonClicked(QAbstractButton *clickedButton); |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
52 void updateUpdateCheckProgressBar(); |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
53 |
638
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
54 private: |
751
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
55 Ui::UpdateCheckDialog *_updateCheckDialogForm; |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
56 |
638
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
57 void getPadXMLFile(); |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
58 void showCheckingForUpdateDialog(); |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
59 void showNewVersionAvailableDialog(QString newVersion); |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
60 void showNoNewVersionAvailableDialog(); |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
61 int convertVersionStringToNumber(QString versionString); |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
62 |
751
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
63 QSharedPointer<UiGuiSettings> _settings; |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
64 bool _manualUpdateRequested; |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
65 QNetworkAccessManager *_networkAccessManager; |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
66 QNetworkReply *_currentNetworkReply; |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
67 QDialogButtonBox::ButtonRole _roleOfClickedButton; |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
68 QTimer *_updateCheckProgressTimer; |
ac165b6ae67e
Done some refactoring:
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
728
diff
changeset
|
69 int _updateCheckProgressCounter; |
638
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
70 }; |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
71 |
94734b9eb54f
Renamed the source files and some classes to have consistent names. What a nice kind of work.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
diff
changeset
|
72 #endif // UPDATECHECKDIALOG_H |