Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVojtech Kral <vojtech@kral.hk>2018-07-27 12:55:11 +0300
committerbubnikv <bubnikv@gmail.com>2018-08-01 13:18:19 +0300
commitb6d70f5fe8653297c6fa6f23019502101c6d655b (patch)
tree06dbdb6d6e74ec7be835c9541a8ded31eea45533 /xs/src/avrdude/avrdude-slic3r.cpp
parent14c9ff174d25c88fff9593b83e60cdd856ddbcd4 (diff)
FirmwareDialog: UI improvements, bugfixes
Diffstat (limited to 'xs/src/avrdude/avrdude-slic3r.cpp')
-rw-r--r--xs/src/avrdude/avrdude-slic3r.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/xs/src/avrdude/avrdude-slic3r.cpp b/xs/src/avrdude/avrdude-slic3r.cpp
index 4a7f22d6e..0577fe6d0 100644
--- a/xs/src/avrdude/avrdude-slic3r.cpp
+++ b/xs/src/avrdude/avrdude-slic3r.cpp
@@ -35,8 +35,9 @@ struct AvrDude::priv
{
std::string sys_config;
std::deque<std::vector<std::string>> args;
- size_t current_args_set = 0;
bool cancelled = false;
+ int exit_code = 0;
+ size_t current_args_set = 0;
RunFn run_fn;
MessageFn message_fn;
ProgressFn progress_fn;
@@ -146,15 +147,15 @@ AvrDude::Ptr AvrDude::run()
int res = -1;
if (self->p->run_fn) {
- self->p->run_fn(*self);
+ self->p->run_fn();
}
if (! self->p->cancelled) {
- res = self->p->run();
+ self->p->exit_code = self->p->run();
}
if (self->p->complete_fn) {
- self->p->complete_fn(res, self->p->current_args_set);
+ self->p->complete_fn();
}
});
@@ -179,5 +180,20 @@ void AvrDude::join()
}
}
+bool AvrDude::cancelled()
+{
+ return p ? p->cancelled : false;
+}
+
+int AvrDude::exit_code()
+{
+ return p ? p->exit_code : 0;
+}
+
+size_t AvrDude::last_args_set()
+{
+ return p ? p->current_args_set : 0;
+}
+
}