mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Undo: make dive-import undoable
On desktop, replace all add_imported_dives() calls by a new undo-command. This was rather straight forward, as all the preparation work was done in previous commits. By using an undo-command, a full UI-reset can be avoided, making the UI react smoother. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
0249e12589
commit
82c47bdd79
9 changed files with 122 additions and 25 deletions
|
@ -4,6 +4,7 @@
|
|||
#include "core/webservice.h"
|
||||
#include "core/settings/qPrefCloudStorage.h"
|
||||
#include "desktop-widgets/mainwindow.h"
|
||||
#include "desktop-widgets/command.h"
|
||||
#include "desktop-widgets/usersurvey.h"
|
||||
#include "core/divelist.h"
|
||||
#include "desktop-widgets/mapwidget.h"
|
||||
|
@ -771,8 +772,7 @@ void DivelogsDeWebServices::buttonClicked(QAbstractButton *button)
|
|||
struct dive_table table = { 0 };
|
||||
struct trip_table trips = { 0 };
|
||||
parse_file(QFile::encodeName(zipFile.fileName()), &table, &trips);
|
||||
add_imported_dives(&table, &trips, false, false, true);
|
||||
MainWindow::instance()->refreshDisplay();
|
||||
Command::importDives(&table, &trips, false, false, true, QStringLiteral("divelogs.de"));
|
||||
|
||||
/* store last entered user/pass in config */
|
||||
QSettings s;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue