aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.h
AgeCommit message (Collapse)Author
2014-03-02Spelling fix, Its called NdlGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-02Revert "Switch profile button events, clicked to toggled"Gravatar Dirk Hohndel
This reverts commit 63f7f37e4617b15af9bbd1894d529da2c22a34f1. For odd reasons this appears to make the mean depth line disappear. This will require some further analysis, but for now I'll just revert it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-28Remove failed parses from recent files menuGravatar Joshua Wambua
This patch will remove all files that fail to parse from the recent files menu. Signed-off-by: Joshua Wambua <joshua@megvel.me.ke> 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-27Switch profile button events, clicked to toggledGravatar Anton Lundin
This is needed so the underlaying struct preferences prefs, will be updated when we set the buttons to there previous state after we loaded the settings. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27Store zoomed plot in preferencesGravatar Tomaz Canabrava
This patch makes the 'Zoomed Plot' a preference that can be stored and retrieved, this way if the user sets the plot to be 'zoomed', this information will persist even if they closed or opened subsurface again. Also, added the 'Scale' button on the new profile, but didn't did the glue code yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-13Add recent files to main menu.Gravatar Boris Barbulovski
Add(up to four) recent files to File main menu. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> 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-11Put include guard to every headerGravatar Boris Barbulovski
* ensure include guard to every header * comment endif guard block Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-06Save the old pref system when changing the new oneGravatar Tomaz Canabrava
Since we have now a mix of old / new prefs, remember to change both when we alter something. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-06Create a toolbox on the left side of the new profileGravatar Tomaz Canabrava
For quick acess of preferences the show / hide stuff from the Settings dialog is now in that toolbox and in the future we can put a few more, like 'Show Notifications Panel' and 'Enable Legend' Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16Added debug code to help understand the ProfileGravatar Tomaz Canabrava
This commit adds a QTableView if built in debug mode. This is very userful to understand the Profile that will be drawn by the graphics classes and fix the possible errors. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-15Add-main-window-full-screen-featureGravatar Boris Barbulovski
This patch enables main window full screen mode by menu toggle or pressing F11. [Dirk Hohndel: whitespace cleanup] Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-10Switch to new UserManual implementationGravatar Sergey Starosek
This enables search within user manual by pressing Ctrl-F. Esc key closes search panel. Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-03Refactoring import to DiveLogImportDialogGravatar Miika Turkia
Changing the import stuff to DiveLogImport. Now we should have one import function/dialog for importing divelogs instead of multiple menu entries. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-05Open external links in default browserGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-15Good deal of code Cleanup.Gravatar Tomaz Canabrava
Rewrite of the way we handle the last used directory for the loading / saving of files. we didn't reuse anything for the code, and that's error prone and also dumb =p. Reworked that so we have a nice method to help us out on that. lastUsedDir and updateLastUsedDir Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-14Maintain the selection when aborting "dive add"Gravatar Dirk Hohndel
We remember what was selected before and restore it. Maybe there's a more "Qt way" of doing this, but my implementation appears to work :-) Also remove unconditional debug output that snuck into an earlier commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-09Fix inconsistent position of screen splittersGravatar Tomaz Canabrava
I basically rewrote the way we handled the splitters. It now uses a state to know what it's doing, and will only update the value of the saved-to-disk splitter size if the state shows the splitters (currently only VIEWALL), where all the other states should hide the splitters, and the values of the splitters don't matter. Fixes #225 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-01Enable editing a dive that was manually entered.Gravatar Tomaz Canabrava
This patch enables editing a dive that was manually entered, it doesn't cover dive plans yet because on the plan I need to figure out what are the 'user-entered' points, and what are the algorithm point. and I feel lazy. =p One last thing that's missing is to revert the dive to the previous condition if the user cancels the edition, currently canceling and applying ok is the same thing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2013-10-24code cleanup: removed unused function from mainwindow.hGravatar Tomaz Canabrava
The setupSplitters method was created quite a while ago to deal with the splitters when I didn't used a more sane approach. I forgot to delete it back them, removing now. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-24Minimum hooking-up done, divelogs.de shows on menu-activation.Gravatar Tomaz Canabrava
This patch does the hooking up to show the dialog of the divelogs.de window when the user selects it on the menu.: Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-16GUI for CSV importGravatar Miika Turkia
This patch implements GUI for importing CSV log files. One is able to configure what columns contain time, depth and temperature fields. Pre-configured log applications currently included are ADP log viewer and XP5. (Both of these use actually tab as separator, so the field separator currently hard-coded.) [Dirk Hohndel: minor fixes] Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15Random white space cleanupGravatar Dirk Hohndel
Because I can. Signed-off-by: Dirk Hohndel <dirk@hohndel.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-09-26Code Cleanup, less magic indexes.Gravatar Tomaz Canabrava
This patch removes the magic indexes used to control the mainwindow display of the profile and planner by an enum. a bit more verbose but hard to miss. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-22Correctly handle empty dive list after deleteGravatar Dirk Hohndel
Things need to be cleared out and disabled. But fixing this bug leaves another issue - while the newly selected dive after a delete acts as if it was selected, it doesn't show up as selected in the dive list. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Add a Warning icon on the changed tabs, for edition of dives.Gravatar Tomaz Canabrava
Adds a Warning icon on the changed tabs, this is important as usability, for you could change something on the 'notes' tab, change the tab and did't realized that something was changed ( by forgotting or something ), then clicking on the cancel button. so now there's a friendly reminder that you actually changed something. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Use the same code for command line and gui for file handling.Gravatar Tomaz Canabrava
The Command line execution of Subsurface happened before the GUI was created, this leaded to various bugs by me(tm) over time. This patch seems to fix all of those, by reusing the same code for GUI interaction and CommandLine interaction. I had to rework how the main.c worked, it used to be C code calling C++ code, and this is non desirable, since C doesn't really understand C++. I Moved all of C-related code to 'subsurfacestartup.c/h' and created a tiny wrapper to call it, so all of the C code is still C code, and the new main.cpp calls the mainwindow->loadFiles and mainWindow->importFiles to get rid of the bugs that happened before. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-25use QWebView to show the user manualGravatar Danilo Cesar Lemes de Paula
Looks like the QTextBrowser can't render the manual correctly. Also, QWebView provides a better way to find contents on a webpage, which is an important feature for an user manual (to be implemented). Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-07-05Profile: prevent a bug when switching viewsGravatar Lubomir I. Ivanov
While in zoomed mode and when resizing the splitters or switching views the profile tooltip can end up being at the wrong location and also the zoom state becomes corrupt, so perhaps the entire transformation needs to be reset. To prevent the bug we listen for relevent to the profile splitter resize event, view changes and clear()/plot() the entire profile graphics. This is an slow/expensive solution and perhaps there are cheaper alternatives e.g. updating only the scene rectangle and tooltip, somehow. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-04Added the left / right shortcuts for moving the handlers around in time.Gravatar Tomaz Canabrava
Added the left / right shortcuts for moving the handlers around in time, this also made me wonder why we have the 'previous dc' on the menu, it got actually to broke my code on the shortcuts for the planner because they are active everytime - should they be active only when the profile's visible or they serve any other purpose? If they serve only for the profile, I'll get them out of the menu and put them in their proper place - the profile view. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-27Moved the DivePlanner to the MainWindow.Gravatar Tomaz Canabrava
Now, activating the dive planner will hide the profile and show the planner on the same place. we still need a way to 'cancel' or 'accept' the profile created. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-27Better positioning of the plus sign icons in the Equip. tabGravatar Lubomir I. Ivanov
There are a couple of problems with said icons: - When the Equip. tab is first seen, no relative event is monitored so that the correct position is updated and the icons are positioned. To solve that we connect the signal MainTab::currentChanged(int) and call MainTab::equipmentPlusUpdate(). - When the info-profile QSplitter resizes with a snap towards/from the edges of the main window, no resize handler is called such as MainTab::resizeEvent(). A solution is to monitor the resize of the info-profile splitter with MainWindow::on_infoProfileSplitter_splitterMoved() and again call MainTab::equipmentPlusUpdate() Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-27Update main window title depending of current file stateGravatar Lubomir I. Ivanov
If a file has been opened from the command line or via the File menu the main window title becomes "Subsurface: filename.ext". Title also updates if 'File->Save As' is called. "Subsurface" only is displayed when no active file is present or post 'File->New' or 'File->Close'. To make this work a new public method is added - MainWindow::setTitle() and also an enum type MainWindowTitleFormat, which should allow more complicated formatting, such as showing the selected dives or the total number of dives (e.g. MWTF_FILENAME_N_DIVES). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-20Added back the menu entry 'Dive Planner'Gravatar Tomaz Canabrava
Added back the menu entry Dive Planner, and removed the calee code from the Print action. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-19Consistently use slots / signalsGravatar Dirk Hohndel
We started out using Q_SLOTS and Q_SIGNALS but then changed our mind. Let's make this consistent again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-12Fixed the show / hide dialog shortcuts to take the splitter into considerationGravatar Tomaz Canabrava
Fixed the show / hide dialog shortcuts to take the splitter into consideration, So, here's the deal. We have a few QSplitters that takes care of helping us with the size of a few widgets, they are ok, and we should continue using them to manage the visibility of them too. But the way that we did before was to widget->hide(); something, and if you hided something using the splitter, by holding it's handle and collapsing the widget, then you used the 'ctrl+number' shortcut to show it, it whould only show a gray panel. This patch makes everything behave using the splitters. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-04Rewrite readSettings to do what it should have done from the startGravatar Dirk Hohndel
This function was supposed to take the default_prefs into account but clearly wasn't. Now it should be much more readable and maintainable. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-31Added preliminary support for a Manual Display Widget.Gravatar Tomaz Canabrava
Added a preliminary support for a manual display widget, it's a very basic HTML text-browser, so it can have hyperlinks, images and everything that a 1995 browser has. The long term plan is to subsittute this manual by a more modern 'help' using QGraphicsView, that will interact on the application level. See #121 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-30Hook up the Download dialogGravatar Dirk Hohndel
The download already worked, but we didn't display the new dives. This introduces a new slot for MainWindow that updates what is displayed in Subsurface after files were imported. With this change we can successfully download ONCE - but when trying to download a second dive the dialog doesn't appear to get refreshed the right way - the OK button doesn't appear to work anymore (Cancel however does). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-26Hook up most of the Preferences dialogGravatar Dirk Hohndel
The imperial/metric super setting doesn't have any effect. But changing the individual units now works and is tracked. And causes the display to change after clicking "OK" (but not yet when clicking "Apply"). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-21Replace GError handling with a kMessageWidget based approachGravatar Dirk Hohndel
Instead of passing pointers to GError around we pass just pointers to error message texts around and use kMessageWidget to show those. Problem is that right now the close button on that doesn't do a thing - so the error stays around indefinitely. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-19Implenent file_save and file_save_asGravatar Dirk Hohndel
This allows us to do the right thing at exit (and also connects to more of the menu actions to actually do something). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-18Make impossible to change dives while editing one.Gravatar Tomaz Canabrava
This is to prevent loss of data, so if the user is editing something, either cancel the edition or save it, to continue moving around on the Dive List. - Only the dive list is affected, user can still play with the globe and the profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-16Fix loading a second dive, after the first file was loaded.Gravatar Tomaz Canabrava
This patch fixes loading a second dive-file after the first one had been loaded. it simply clears some information and makes sure that the current selected dive is invalid when the file closes. I also did a bit of code cleanup on this one to make things simpler in the future. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-14code to show profile againGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-13Trying to make the DiveList selection behave correctlyGravatar Tomaz Canabrava
And rip out all the code that Dirk put there to do that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-13Fix segfault on mouseOver at the Profile with an invalid dive selected ( trip )Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>