Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
926ad668
Commit
926ad668
authored
May 31, 2016
by
Jan Möbius
Browse files
Fix Progress Dialog popping up in Options widget
closes #52
parent
9e60f06f
Changes
3
Hide whitespace changes
Inline
Side-by-side
widgets/optionsWidget/downloader.cc
View file @
926ad668
...
...
@@ -86,9 +86,13 @@ void OptionsWidget::startDownload( QString _url ) {
statusLabel
->
setText
(
tr
(
"Getting Versions file from Server"
));
progressDialog
->
setWindowTitle
(
tr
(
"HTTP"
));
progressDialog
->
setLabelText
(
tr
(
"Downloading %1."
).
arg
(
fileName
));
progressDialog
->
show
();
if
(
!
progressDialog_
)
{
progressDialog_
=
new
QProgressDialog
(
this
);
connect
(
progressDialog_
,
SIGNAL
(
canceled
()),
this
,
SLOT
(
cancelDownload
()));
}
progressDialog_
->
setWindowTitle
(
tr
(
"HTTP"
));
progressDialog_
->
setLabelText
(
tr
(
"Downloading %1."
).
arg
(
fileName
));
progressDialog_
->
show
();
downloadRep_
=
networkMan_
->
get
(
req
);
...
...
@@ -126,14 +130,17 @@ void OptionsWidget::httpRequestFinished(QNetworkReply* _qnr)
file
=
0
;
}
progressDialog
->
hide
();
progressDialog
_
->
hide
();
checkUpdateButton
->
setEnabled
(
true
);
return
;
}
progressDialog
->
hide
();
progressDialog
_
->
hide
();
file
->
close
();
delete
(
progressDialog_
);
progressDialog_
=
0
;
if
(
error
!=
QNetworkReply
::
NoError
)
{
file
->
remove
();
}
else
{
...
...
@@ -167,8 +174,10 @@ void OptionsWidget::updateDataReadProgress(qint64 _bytesReceived, qint64 _bytesT
if
(
httpRequestAborted
)
return
;
progressDialog
->
setMaximum
(
_bytesTotal
);
progressDialog
->
setValue
(
_bytesReceived
);
if
(
progressDialog_
)
{
progressDialog_
->
setMaximum
(
_bytesTotal
);
progressDialog_
->
setValue
(
_bytesReceived
);
}
}
void
OptionsWidget
::
showError
(
QNetworkReply
::
NetworkError
_error
)
...
...
widgets/optionsWidget/optionsWidget.cc
View file @
926ad668
...
...
@@ -62,6 +62,7 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
plugins_
(
_plugins
),
coreKeys_
(
_core
),
keys_
(
_invKeys
),
progressDialog_
(
NULL
),
restartRequired_
(
false
),
exitOnClose_
(
false
)
{
...
...
@@ -135,10 +136,6 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
connect
(
networkMan_
,
SIGNAL
(
authenticationRequired
(
QNetworkReply
*
,
QAuthenticator
*
)),
this
,
SLOT
(
authentication
(
QNetworkReply
*
,
QAuthenticator
*
)));
progressDialog
=
new
QProgressDialog
(
this
);
connect
(
progressDialog
,
SIGNAL
(
canceled
()),
this
,
SLOT
(
cancelDownload
()));
//colordialog
connect
(
backgroundButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
getBackgroundColor
())
);
connect
(
defaultColorButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
getDefaultColor
())
);
...
...
widgets/optionsWidget/optionsWidget.hh
View file @
926ad668
...
...
@@ -177,7 +177,7 @@ private:
QFile
*
file
;
// ProgressDialog for Downloads
QProgressDialog
*
progressDialog
;
QProgressDialog
*
progressDialog
_
;
// What type of download is currently active
enum
DOWNLOAD
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment