aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/simplewidgets.cpp
AgeCommit message (Collapse)Author
2014-08-16Selective copy: forgot tags in the UIGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16Don't always clear the dive before selectively copyingGravatar Dirk Hohndel
This will be needed when pasting the data back into a (set of) dive(s). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-16Cut'n'paste for dive data: implement copy sideGravatar Dirk Hohndel
Admittedly not very useful without working paste, but it's progress. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-11Misc UI capitalisation consitencies and other text changesGravatar Tim Wootton
Capitalisation consitencies A typo correction A readability improvement (IMHO) Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30Selects the dive date before showing it up.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30Added a shortcut 'ESC' to close the calendar widgetGravatar Tomaz Canabrava
This hides the calendar widget when the user press esc when it's running. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-30Calendar widget should hide when clicking somewhere elseGravatar Tomaz Canabrava
This patch adds a event filter to hide the calendar widget when it loses focus Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-28Calendar Widget: make it modalGravatar Dirk Hohndel
Also fix the setWindowFlags calls - those are not incremental, so you need to call the method once and combine the flags. I would also like ESC to close the calendar widget, but haven't figured out how to do that... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-28Calendar Widget: get rid of week numberGravatar Dirk Hohndel
It puzzles me that this is the default. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-28Calendar Widget: set the locale appropriate first day of the weekGravatar Dirk Hohndel
Also adjust the minimum size, given I changed this in commit 26855234acef ("Make date widget easier to read"). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-28Make calendar stay on topGravatar Joakim Bygdell
This patch makes tha calendar stay on top at all times. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-27Open picture manager when clicking on the picture at the profileGravatar Tomaz Canabrava
This patch makes the click on pic == open picture browser works also on the profile instead of only on the list view.. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26Make date widget easier to readGravatar Dirk Hohndel
At least on my screen this is much better. 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-20Listen to EnabledChange to gray out the DatePickerGravatar Tomaz Canabrava
This small patch listens to EnabledChange to gray out the date picker when the widget is in disabled mode, and to paint the widget colored when it's on enabled state. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Change the Star Widget to use QImage instead of QPixmapGravatar Tomaz Canabrava
Also, clean a few calls, this should make the widget a tiny bit faster. This patch also moves the grayImage function from the star widget to the global scope, so I can use it on the Calendar widget. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Better focus painting for Date WidgetGravatar Tomaz Canabrava
This uses the system focus painging. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Added keyboard navigation to the calendar date picker.Gravatar Tomaz Canabrava
Wee. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Added focus handling to the Date Picker.Gravatar Tomaz Canabrava
Added focus handling for the date picker, this way the user can use the keyboard to change the date. ( still not implemented ) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Added the calendar widget to change the calendar date.Gravatar Tomaz Canabrava
Added a popup widget to change the calendar date, just like the old QDateTimeEdit. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Correctly sets the minimum size of the calendar widget.Gravatar Tomaz Canabrava
The old code cutted the calendar by half. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20Added a Partly Functional Date Picker widget.Gravatar Tomaz Canabrava
This widget shows a date in a better way that it was done in the old widget, much more elegantly. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-02Break picture handling code from C++ to C.Gravatar Tomaz Canabrava
This commit breaks the loading of images that were done in the divelist into smaller bits. A bit of code refactor was done in order to correct the placement of a few methods. ShiftTimesDialog::EpochFromExiv got moved to Exif::epoch dive_add_picture is now used instead of add_event picture_load_exif_data got implemented using the old listview code. dive_set_geodata_from_picture got implemented using the old listview code. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-01Override the MinMaxAvgWidget tool tips for the depth instance.Gravatar Tim Wootton
Add new methods to the MinMaxAvgWidget class to allow us to override the default tooltips of its min and max icons, and then uses these methods to make the tooltips for the Stats tab Depth instance more descriptive. See #521 Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22Gratuitous whitespace changesGravatar Dirk Hohndel
I keep trying to get to consistenct. Completely hopeless. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-20Dive list: add context menu function to renumber dive(s)Gravatar Dirk Hohndel
No attempt is made to ensure that what the user does is sane. So this can result in duplicate numbers, non-consecutive numbers, non-monotonous numbers, whatever floats the users boat. You can renumber a single dive or all selected dives (with a starting number given that is applied to the oldest selected dive and then for each newer selected dive that number is incremented by one). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05Correct check for existence of DateTimeOriginal exif tagGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-26Use original time if available on image loadingGravatar Miika Turkia
DateTimeOriginal should be used as first option when loading images. When images are modified, the original time should be retained, but the DateTime will change to the edit time. See #495 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-25Fixing Hotkeys inconsistency for divecomputer/pref/numbering windowsGravatar Gehad
Fixing the Hotkeys inconsistencies in subsurface, All the popups should react to 'esc' and 'ctrl-w'/'cmd-w' as 'cancel'. also 'ctrl-q'/'cmd-q' should quit subsurface. Fixes #489 Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-25Closing shortcuts for shift times windowsGravatar Gehad elrobey
Adding the ability to close the shift times window, also Quit subsurface with this window in front. See #489 Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-17Mark a lot of TODO's where I think it should be moved to C code.Gravatar Tomaz Canabrava
This marks a lot of todo's where I think there's core stuff being mangled on the interface - we should remove this from the interface to make testing and maintenability easier. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-21Add current time and adjusted time to gui when adjusting dive's timestampGravatar Gehad
This patch adds the current dive time and the adjusted time to the time shift window. I added a function to dive.c to get the timestamp of the first selected dive. This will view the time of the first selected dive only even when multi dives are selected but it does change the times for multiple dives properly. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Massive automated whitespace cleanupGravatar Dirk Hohndel
I know everyone will hate it. Go ahead. Complain. Call me names. At least now things are consistent and reproducible. If you want changes, have your complaint come with a patch to scripts/whitespace.pl so that we can automate it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-19Convert more TRUE/FALSE to stdbools true/falseGravatar Anton Lundin
In Qt5, Qt doesn't define TRUE/FALSE anymore, so we need to stick to stdbools to have Qt5 builds working. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-18Make lastUsedImageDir static to prevent a crashGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-18Use DateTimeOriginal on image importGravatar Miika Turkia
Some digital cameras do not set the DateTime exif field bat use DateTimeOriginal. If the first option is not found, use the second one to try to detect the moment when the image was shot. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-18Fix compile errorGravatar Miika Turkia
I get compile errors from these lines. Removing the class name from the calls allow me to compile the current master. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-17Compute dive computer/camera time offset from sample pictureGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-17Store camera time offset in preferencesGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12Replace mainWindow() with MainWindow::instance()Gravatar Boris Barbulovski
C++ style of accessing single instance class object. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09ShiftImageTimesDialog class cleanup.Gravatar Boris Barbulovski
* Remove static ShiftImageTimesDialog::instance() method * Add ShiftImageTimesDialog::amount() member Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-06Include images in profileGravatar Robert C. Helling
This adds an entry to the dive list context menu to load images. The user can select image files and set a time offset to align camera and dive computer clocks. Using the exif time stamp the images are tried to match to the times of the selected dives (with a grace period of an hour before and after the dive). Upon success an event of type 123 is created per image with the string value being the path to the image. Those images are displayed as thumbnails in the profile. If the matching dive does not yet have a geo location specified but the image provides one it is copied to the dive (making the camera a poor man's companion app). This patch includes easyexif https://code.google.com/p/easyexif/ which is originally under a New BSD License to parse the image meta data. This commit includes a new test dive dives/test31.xml with a matching image wreck.jpg to try out the functionallity. Obvious to do's: Have images on the map Have the images clickable Have a proper picture viewer Give visual reference for image time shifting. Use the new profile Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Whitespace and coding style updatesGravatar Dirk Hohndel
Another futile attempt to cleanup the code and make coding style and whitespace consistent. I tried to add a file that describes the key points of our coding style. I have no illusions that this will help the least bit... This commit should ONLY change whitespace Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15Convert to TRUE/FALSE to stdbools true/falseGravatar Anton Lundin
I had problems with this one on Qt5. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Fix all leak-at-exit from singletons in SubsurfaceGravatar Thiago Macieira
Subsurface creates a lot of singleton instances on demand, but nothing ever deleted them. Since they are singletons, these memory allocations are technically not leaks. However, they clutter the output in valgrind and other memory analysers, hiding the real issues. The solution is to delete these items at exit. For the models and for gettextFromC, the solution is to use a QScopedPointer, which will delete its payload when it gets destroyed. For the dialogs and other widgets, we can't do that: they need to be deleted before QApplication exits, so we just set the parent in all of them to the main window. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30Fix memory leak of the MinMaxAvgWidgetPrivateGravatar Thiago Macieira
Found by Dr. Memory, run by Lubomir: Error #63: LEAK 24 direct bytes 0x344f42e8-0x344f4300 + 0 indirect bytes # 0 replace_operator_new [d:\drmemory_package\common\alloc_replace.c:2421] # 1 MinMaxAvgWidget::MinMaxAvgWidget() [qt-ui/simplewidgets.cpp:64] Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Improve shift time functionalityGravatar Dirk Hohndel
In commit 85fab31c71fc ("Shift times of selected dives") we added a dialog that didn't align its content very well. This change improves the layout (I hope) and makes the labels in the layout clearer (earlier and later seem easier to correlate with the direction of the shift). The original commit also forgets to deal with the consequences of shifting the dives. The dive list needs to be re-sorted (as the relative order of dives could have changed) and be marked as changed. And we should try to maintain the selection across these operations. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-18Shift times of selected divesGravatar Robert Helling
This patch adds the possibility to shift the times of all selected dives by a fixed amount to correct for time zone problems or mis-set dive computer clocks. Select the dives and right click in the dive list. [Dirk Hohndel: added .ui file to FORMS and fixed some whitespace damage] Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11Good deal of whitespace fixes and code cleanup.Gravatar Tomaz Canabrava
I just went thru all of subsurface code removing some whitespaces issues and trying to make the code prettyer, I also removed a few QString issues.d Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-03Make the classes generated by uic be real members of our classesGravatar Thiago Macieira
This means we don't have to new/delete them, which is a waste of overhead. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>