diff options
Diffstat (limited to 'src/gui-wizard-gtk')
-rw-r--r-- | src/gui-wizard-gtk/wizard.c | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c index a8a39a16..66711af6 100644 --- a/src/gui-wizard-gtk/wizard.c +++ b/src/gui-wizard-gtk/wizard.c @@ -74,7 +74,8 @@ static page_obj_t pages[] = { PAGE_BACKTRACE_APPROVAL , "Review the backtrace" , GTK_ASSISTANT_PAGE_CONTENT }, { PAGE_HOWTO , "Provide additional information", GTK_ASSISTANT_PAGE_CONTENT }, { PAGE_REPORT , "Confirm data to report", GTK_ASSISTANT_PAGE_CONFIRM }, - { PAGE_REPORT_PROGRESS , "Reporting" , GTK_ASSISTANT_PAGE_PROGRESS }, + /* Was GTK_ASSISTANT_PAGE_PROGRESS */ + { PAGE_REPORT_PROGRESS , "Reporting" , GTK_ASSISTANT_PAGE_SUMMARY }, { NULL } }; @@ -85,6 +86,41 @@ void on_b_refresh_clicked(GtkButton *button) } +static gint next_page_no(gint current_page_no, gpointer data) +{ + switch (current_page_no) + { + case PAGENO_SUMMARY: + if (!g_analyze_events[0]) + { + //TODO: if (!g_reporter_events[0]) /* no reporters available */ then what? + return PAGENO_REPORTER_SELECTOR; /* skip analyze pages */ + } + break; + + case PAGENO_REPORTER_SELECTOR: + if (get_crash_item_content_or_NULL(g_cd, FILENAME_BACKTRACE)) + break; + current_page_no++; /* no backtrace, skip next page */ + /* fall through */ + +#if 0 + case PAGENO_BACKTRACE_APPROVAL: + if (get_crash_item_content_or_NULL(g_cd, FILENAME_COMMENT) + || get_crash_item_content_or_NULL(g_cd, FILENAME_REPRODUCE) + ) { + break; + } + current_page_no++; /* no comment, skip next page */ + /* fall through */ +#endif + + } + + return current_page_no + 1; +} + + /* "Next page" button handler. So far it only starts analyze event run */ struct analyze_event_data { @@ -129,7 +165,7 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g if (WIFSIGNALED(status)) retval = WTERMSIG(status) + 128; - /* Stop if exitcode is not 0, or no more commands */ + /* Stop if exit code is not 0, or no more commands */ if (retval != 0 || spawn_next_command(evd->run_state, g_dump_dir_name, /*event:*/ g_analyze_label_selected) < 0 ) { @@ -138,7 +174,7 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g close(evd->fd); free_run_event_state(evd->run_state); free(evd); - char *msg = xasprintf(_("Analyze finished with exitcode %d"), retval); + char *msg = xasprintf(_("Analyze finished with exit code %d"), retval); gtk_label_set_text(g_lbl_analyze_log, msg); free(msg); reload_dump_dir(); @@ -298,6 +334,8 @@ void create_assistant() { g_assistant = GTK_ASSISTANT(gtk_assistant_new()); + gtk_assistant_set_forward_page_func(g_assistant, next_page_no, NULL, NULL); + GtkWindow *wnd_assistant = GTK_WINDOW(g_assistant); gtk_window_set_default_size(wnd_assistant, DEFAULT_WIDTH, DEFAULT_HEIGHT); gtk_window_set_title(wnd_assistant, g_dump_dir_name); |