[PATCH] Add a QProgressDialog to auto-ostc3-firmware

Anton Lundin glance at acc.umu.se
Tue Jan 20 22:56:08 PST 2015


On 21 January, 2015 - Dirk Hohndel wrote:

> 
> So in my state of limited mental capacity due to too much N₂ I've taken
> this series. I bet I'm going to hate myself for this in the near future.
> 
> Tomaz, can you look through these, please?
> 

This code probably leaks some memory, but it ain't that much worse than
the previous code. Just/maybe a QProgressDialog, but i really don't know
how to fix that due to your previous comments about wierd crashes in
4559a26e ("Fix ConfigureDiveComputer class").


//Anton


> On Tue, Jan 20, 2015 at 10:49:56PM +0100, Anton Lundin wrote:
> > Signed-off-by: Anton Lundin <glance at acc.umu.se>
> > ---
> >  qt-ui/configuredivecomputerdialog.cpp | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp
> > index 182bf76..2c2814d 100644
> > --- a/qt-ui/configuredivecomputerdialog.cpp
> > +++ b/qt-ui/configuredivecomputerdialog.cpp
> > @@ -6,6 +6,7 @@
> >  #include <QMessageBox>
> >  #include <QSettings>
> >  #include <QNetworkReply>
> > +#include <QProgressDialog>
> >  
> >  struct product {
> >  	const char *product;
> > @@ -281,7 +282,13 @@ void OstcFirmwareCheck::saveOstcFirmware(QNetworkReply *reply)
> >  	file.open(QIODevice::WriteOnly);
> >  	file.write(firmwareData);
> >  	file.close();
> > +	QProgressDialog *dialog = new QProgressDialog("Updating firmware", "", 0, 100);
> > +	dialog->setCancelButton(0);
> > +	dialog->setAutoClose(true);
> >  	ConfigureDiveComputer *config = new ConfigureDiveComputer();
> > +	connect(config, SIGNAL(message(QString)), dialog, SLOT(setLabelText(QString)));
> > +	connect(config, SIGNAL(error(QString)), dialog, SLOT(setLabelText(QString)));
> > +	connect(config, SIGNAL(progress(int)), dialog, SLOT(setValue(int)));
> >  	config->startFirmwareUpdate(storeFirmware, &devData);
> >  }
> >  
> > -- 
> > 2.1.0
> > 
> > _______________________________________________
> > subsurface mailing list
> > subsurface at subsurface-divelog.org
> > http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

-- 
Anton Lundin	+46702-161604


More information about the subsurface mailing list