aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/divepicturewidget.h
AgeCommit message (Collapse)Author
2014-08-05Picture handling: cleaning up the messGravatar Dirk Hohndel
We had pointers to data structures on the stack which we frequently reallocated. These data structure contain basically a filename and an offset. We then create a hash of the pointers to those datastructures with the filename being the key. And then we passed those pointers around through a Qt model(!!!) only in order to then later look up by filename what the offset might be. I am at a loss for words for the lunacy behind this design. How about we just remember the offsets and pass the integers around? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Implement the functionality of remove_picture.Gravatar Tomaz Canabrava
Added the remove_picture functionality, with code shamelessy stolen from remove_event, and hoock it up with the interface. Fixes #650 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: always display pictures for displayed diveGravatar Dirk Hohndel
The only time this is ever wrong is in print mode, so let's never show pictures in print mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-27Emit signal on photo double-clickGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26Headers cleanup.Gravatar Tomaz Canabrava
Too much noise on the headers, this commit remove uneeded headers when they are uneeded. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Another futile attempt to keep whitespace consistentGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Also hold a pointer to the struct picture on the model.Gravatar Tomaz Canabrava
Changes to hold a pointer to the struct picture on the model, so we can use it to determine the correct positioning of the image on the profile. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Add a static 'instance()' member for the Photos model.Gravatar Tomaz Canabrava
This will make referencing it from a few places more easy. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Change from QPixmap to QImage due to thread issues.Gravatar Tomaz Canabrava
QPixmap cannot be accessed from outside the Main thread, but QImage can. so change that. Also, make the Photo widget display in Icon mode. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03Make the new picture widget display the pictures.Gravatar Tomaz Canabrava
Small changes in the model to display the pictures of the dives. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Add threaded processing of image pixmapsGravatar Tomaz Canabrava
This code adds threaded processing of a batch of images. It uses the QtConcurrent implementations to call a function repeteadly using MAX_THREADS (Qt gets that for us) and returns a list of it. This call is blocking, so while the pixmaps are being scaled in threads, it will wait for all scalling to be done. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Add a method to update the dive pictures on the model.Gravatar Tomaz Canabrava
Call that method from the mainWindow when the dive changes. The updateDivePictures walks around the events of the first dc (since all pictures are distributed allong all dive computers) to get the events of type '123' (I wonder if there's not a better way to save pictures on the dive, like an linked list of char* named pictures.) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Add a new widget on the main tab: Pictures.Gravatar Tomaz Canabrava
Currently this does nothing, but since "dive photos" can also mean photos that were taken during the trip to the dive, some of them will not be visible on the profile. this currently shows nothing, because I didn't work out the Model bits yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Add stub for a widget to show the dive pictures.Gravatar Tomaz Canabrava
This has a few classes: the model is the list of pictures for the current dive, the delegate is how this pictures will be displayed on screen, the widget is the collection of delegates, and the DivePictureThumbnailThread is a worker-thread to generate the thumbnails so the UI will not freeze. [Dirk Hohndel: added the new files to subsurface.pro] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>