aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/divecomputermanagementdialog.cpp
AgeCommit message (Collapse)Author
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-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-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>
2013-12-24Don't check if pointer is valid before deleting it.Gravatar Tomaz Canabrava
deleting a null pointer is valid, so we just delete it instead of checking if it exists. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> 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-21Work around QMessageBox not showing its title on MacGravatar Dirk Hohndel
This is a bit hacky and simply adds the title to the message text when compiling on a Mac, but hopefully this will be enough. 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>
2013-10-03Include the ui_*.h headers in the main headers.Gravatar Thiago Macieira
This means we can also remove the forward declarations. This is the first step in removing the memory allocation for the ui sub-classes. Without the second step, this commit is just making the compilation time increase for no good reason :-) Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-28Close child windows and dialogs with main windowGravatar Lubomir I. Ivanov
Most child windows should be closed with the main application window otherwise if left open and if making specific modifictions could potentially cause a SIGSEGV. To solve that we mark all custom windows/dialogs with the Qt::WA_QuitOnClose attribute on instance creation. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-18Converting the device_info list into a Qt data structureGravatar Dirk Hohndel
This data structure was quite fragile and made 'undo' when editing rather hard to implement. So instead I decided to turn this into a QMultiMap which seemed like the ideal data structure for it. This map holds all the dive computer related data indexed by the model. As QMultiMap it allows multiple entries per key (model string) and disambiguates between them with the deviceId. This commit turned out much larger than I wanted. But I didn't manage to find a clean way to break it up and make the pieces make sense. So this brings back the Ok / Cancel button for the dive computer edit dialog. And it makes those two buttons actually do the right thing (which is what started this whole process). For this to work we simply copy the map to a working copy and do all edits on that one - and then copy that over the 'real' map when we accept the changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-17Improve the initial size of the device name editing dialogGravatar Dirk Hohndel
This is not "automagic" as I had hoped but appears to give a good starting point. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-07Remove the dive computer clicking on the trash icon.Gravatar Tomaz Canabrava
This code removes the dive computer clicking on the trash icon, the result is not saved on the XML, this will need a bit of hacking from some of the older guys. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-07Created a new dialog - Edit DiveComputerGravatar Tomaz Canabrava
Created a new dialog, Edit Divecomputer, it will currently only lists the divecomputers that are used on the xml file. I used the same method that the gtk version used, but only 2 divecomputers got visualized in the dirk dive data. I'll assume that it's correct and will fix it in the next couple of commits. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>