summaryrefslogtreecommitdiffstats
path: root/src/gui-wizard-gtk
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui-wizard-gtk')
-rw-r--r--src/gui-wizard-gtk/main.c41
-rw-r--r--src/gui-wizard-gtk/wizard.c275
-rw-r--r--src/gui-wizard-gtk/wizard.glade98
-rw-r--r--src/gui-wizard-gtk/wizard.h2
4 files changed, 287 insertions, 129 deletions
diff --git a/src/gui-wizard-gtk/main.c b/src/gui-wizard-gtk/main.c
index 2d036085..cd100ac8 100644
--- a/src/gui-wizard-gtk/main.c
+++ b/src/gui-wizard-gtk/main.c
@@ -25,13 +25,11 @@
# include <locale.h>
#endif
-#define PROGNAME "bug-reporting-wizard"
-
char *g_glade_file = NULL;
char *g_dump_dir_name = NULL;
char *g_analyze_events = NULL;
-char *g_reanalyze_events = NULL;
char *g_report_events = NULL;
+int g_report_only = false;
problem_data_t *g_cd;
@@ -39,7 +37,6 @@ void reload_problem_data_from_dump_dir(void)
{
free_problem_data(g_cd);
free(g_analyze_events);
- free(g_reanalyze_events);
free(g_report_events);
struct dump_dir *dd = dd_opendir(g_dump_dir_name, DD_OPEN_READONLY);
@@ -50,7 +47,6 @@ void reload_problem_data_from_dump_dir(void)
add_to_problem_data_ext(g_cd, CD_DUMPDIR, g_dump_dir_name, CD_FLAG_TXT + CD_FLAG_ISNOTEDITABLE);
g_analyze_events = list_possible_events(dd, NULL, "analyze");
- g_reanalyze_events = list_possible_events(dd, NULL, "reanalyze");
g_report_events = list_possible_events(dd, NULL, "report");
dd_close(dd);
@@ -62,6 +58,9 @@ void reload_problem_data_from_dump_dir(void)
int main(int argc, char **argv)
{
+ const char *prgname = "abrt";
+ abrt_init(argv);
+
/* I18n */
setlocale(LC_ALL, "");
#if ENABLE_NLS
@@ -69,16 +68,11 @@ int main(int argc, char **argv)
textdomain(PACKAGE);
#endif
- g_set_prgname("abrt");
gtk_init(&argc, &argv);
- char *env_verbose = getenv("ABRT_VERBOSE");
- if (env_verbose)
- g_verbose = atoi(env_verbose);
-
/* Can't keep these strings/structs static: _() doesn't support that */
const char *program_usage_string = _(
- PROGNAME" [-vp] [-g GUI_FILE] DIR\n"
+ "\b [-vp] [-g GUI_FILE] [-o|--report-only] [-n|--prgname] DIR\n"
"\n"
"GUI tool to analyze and report problem saved in specified DIR"
);
@@ -86,28 +80,35 @@ int main(int argc, char **argv)
OPT_v = 1 << 0,
OPT_g = 1 << 1,
OPT_p = 1 << 2,
+ OPT_o = 1 << 3, // report only
+ OPT_n = 1 << 4, // prgname
};
/* Keep enum above and order of options below in sync! */
struct options program_options[] = {
OPT__VERBOSE(&g_verbose),
OPT_STRING('g', NULL, &g_glade_file, "FILE" , _("Alternate GUI file")),
OPT_BOOL( 'p', NULL, NULL , _("Add program names to log")),
+ /* for use from 3rd party apps to show just a reporter selector */
+ OPT_BOOL( 'o', "report-only", &g_report_only , _("Use wizard to report pre-filled problem data")),
+ /* override the default prgname, so it's the same as the application
+ which is calling us
+ */
+ OPT_STRING( 'n', "prgname", &prgname, "NAME" , _("Override the default prgname")),
OPT_END()
};
-
unsigned opts = parse_opts(argc, argv, program_options, program_usage_string);
-
- putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose));
- if (opts & OPT_p)
- {
- msg_prefix = PROGNAME;
- putenv((char*)"ABRT_PROG_PREFIX=1");
- }
-
argv += optind;
if (!argv[0] || argv[1]) /* zero or >1 arguments */
show_usage_and_die(program_usage_string, program_options);
+ /* without this the name is set to argv[0] which confuses
+ * desktops which uses the name to find the corresponding .desktop file
+ * trac#180
+ */
+ g_set_prgname(prgname);
+
+ export_abrt_envvars(opts & OPT_p);
+
g_dump_dir_name = xstrdup(argv[0]);
/* load /etc/abrt/events/foo.{conf,xml} stuff
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index ee6c3c39..23d9141d 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -36,6 +36,7 @@ typedef struct event_gui_data_t
static GtkAssistant *g_assistant;
static char *g_analyze_event_selected;
+static unsigned g_black_event_count = 0;
static GtkBox *g_box_analyzers;
/* List of event_gui_data's */
@@ -55,6 +56,7 @@ static GtkContainer *g_container_details2;
static GtkLabel *g_lbl_cd_reason;
static GtkTextView *g_tv_backtrace;
static GtkTextView *g_tv_comment;
+static GtkEventBox *g_eb_comment;
static GtkTreeView *g_tv_details;
static GtkWidget *g_widget_warnings_area;
static GtkBox *g_box_warning_labels;
@@ -110,10 +112,10 @@ static const gchar PAGE_SUMMARY[] = "page_0";
static const gchar PAGE_COMMENT[] = "page_1";
static const gchar PAGE_ANALYZE_SELECTOR[] = "page_2";
static const gchar PAGE_ANALYZE_PROGRESS[] = "page_3";
-static const gchar PAGE_REPORTER_SELECTOR[] = "page_4";
+static const gchar PAGE_REPORTER_SELECTOR[] = "page_4_report";
static const gchar PAGE_BACKTRACE_APPROVAL[] = "page_5";
-static const gchar PAGE_REPORT[] = "page_6";
-static const gchar PAGE_REPORT_PROGRESS[] = "page_7";
+static const gchar PAGE_REPORT[] = "page_6_report";
+static const gchar PAGE_REPORT_PROGRESS[] = "page_7_report";
static const gchar *const page_names[] =
{
@@ -161,6 +163,8 @@ static page_obj_t pages[] =
{ NULL }
};
+/* hardcoded 10 pages limit */
+page_obj_t *added_pages[10];
/* Utility functions */
@@ -401,11 +405,12 @@ static gint find_by_button(gconstpointer a, gconstpointer button)
static void analyze_rb_was_toggled(GtkButton *button, gpointer user_data)
{
+ free(g_analyze_event_selected);
+ g_analyze_event_selected = NULL;
GList *found = g_list_find_custom(g_list_analyzers, button, find_by_button);
if (found)
{
event_gui_data_t *evdata = found->data;
- free(g_analyze_event_selected);
g_analyze_event_selected = xstrdup(evdata->event_name);
}
}
@@ -443,15 +448,13 @@ static void report_tb_was_toggled(GtkButton *button_unused, gpointer user_data_u
* Add new {radio/check}buttons to GtkBox for each EVENTn (type depends on bool radio).
* Remember them in GList **p_event_list (list of event_gui_data_t's).
* Set "toggled" callback on each button to given GCallback if it's not NULL.
- * If prev_selected == EVENTn, set this button as active. In this case return NULL.
- * Else return 1st button created (or NULL if none created).
+ * Return active button (or NULL if none created).
*/
static event_gui_data_t *add_event_buttons(GtkBox *box,
GList **p_event_list,
char *event_name,
GCallback func,
- bool radio,
- const char *prev_selected)
+ bool radio)
{
//VERB2 log("removing all buttons from box %p", box);
gtk_container_foreach(GTK_CONTAINER(box), &remove_child_widget, NULL);
@@ -459,13 +462,18 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
g_list_free(*p_event_list);
*p_event_list = NULL;
- bool have_activated_btn = false;
+ if (radio)
+ g_black_event_count = 0;
+
event_gui_data_t *first_button = NULL;
+ event_gui_data_t *active_button = NULL;
while (event_name[0])
{
char *event_name_end = strchr(event_name, '\n');
*event_name_end = '\0';
+ event_config_t *cfg = get_event_config(event_name);
+
/* Form a pretty text representation of event */
/* By default, use event name, just strip "foo_" prefix if it exists: */
const char *event_screen_name = strchr(event_name, '_');
@@ -473,15 +481,27 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
event_screen_name++;
else
event_screen_name = event_name;
+
const char *event_description = NULL;
- event_config_t *cfg = get_event_config(event_name);
+ char *tmp_description = NULL;
+ bool green_choice = false;
if (cfg)
{
/* .xml has (presumably) prettier description, use it: */
if (cfg->screen_name)
event_screen_name = cfg->screen_name;
event_description = cfg->description;
+ if (cfg->creates_elements)
+ {
+ if (get_problem_data_item_or_NULL(g_cd, cfg->creates_elements))
+ {
+ green_choice = true;
+ event_description = tmp_description = xasprintf(_("(not needed, '%s' already exists)"), cfg->creates_elements);
+ }
+ }
}
+ if (radio && !green_choice)
+ g_black_event_count++;
//VERB2 log("adding button '%s' to box %p", event_name, box);
char *event_label = xasprintf("%s%s%s",
@@ -489,6 +509,8 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
(event_description ? " - " : ""),
event_description ? event_description : ""
);
+ free(tmp_description);
+
GtkWidget *button = radio
? gtk_radio_button_new_with_label_from_widget(
(first_button ? GTK_RADIO_BUTTON(first_button->toggle_button) : NULL),
@@ -496,33 +518,76 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
)
: gtk_check_button_new_with_label(event_label);
free(event_label);
+
+ if (green_choice)
+ {
+ //static const GdkColor red = { .red = 0xffff };
+ //gtk_widget_modify_text(button, GTK_STATE_NORMAL, &red);
+ GtkWidget *child = gtk_bin_get_child(GTK_BIN(button));
+ if (child)
+ {
+ static const GdkColor green = { .green = 0x7fff };
+ gtk_widget_modify_fg(child, GTK_STATE_NORMAL, &green);
+ gtk_widget_modify_fg(child, GTK_STATE_ACTIVE, &green);
+ gtk_widget_modify_fg(child, GTK_STATE_PRELIGHT, &green);
+ }
+ }
+
if (func)
g_signal_connect(G_OBJECT(button), "toggled", func, NULL);
- if (cfg->long_descr)
+ if (cfg && cfg->long_descr)
gtk_widget_set_tooltip_text(button, cfg->long_descr);
event_gui_data_t *event_gui_data = new_event_gui_data_t();
event_gui_data->event_name = xstrdup(event_name);
event_gui_data->toggle_button = GTK_TOGGLE_BUTTON(button);
- *p_event_list = g_list_append(*p_event_list, event_gui_data);
+ *p_event_list = g_list_append(*p_event_list, event_gui_data);
if (!first_button)
first_button = event_gui_data;
- if (prev_selected && strcmp(prev_selected, event_name) == 0)
+ if (radio && !green_choice && !active_button)
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), true);
- have_activated_btn = true;
- prev_selected = NULL;
+ active_button = event_gui_data;
}
*event_name_end = '\n';
event_name = event_name_end + 1;
gtk_box_pack_start(box, button, /*expand*/ false, /*fill*/ false, /*padding*/ 0);
+ }
+
+ if (radio)
+ {
+ const char *msg_proceed_to_reporting = _("Go to reporting step");
+ GtkWidget *button = radio
+ ? gtk_radio_button_new_with_label_from_widget(
+ (first_button ? GTK_RADIO_BUTTON(first_button->toggle_button) : NULL),
+ msg_proceed_to_reporting
+ )
+ : gtk_check_button_new_with_label(msg_proceed_to_reporting);
+ if (func)
+ g_signal_connect(G_OBJECT(button), "toggled", func, NULL);
+ event_gui_data_t *event_gui_data = new_event_gui_data_t();
+ event_gui_data->event_name = xstrdup("");
+ event_gui_data->toggle_button = GTK_TOGGLE_BUTTON(button);
+ *p_event_list = g_list_append(*p_event_list, event_gui_data);
+
+ //if (!first_button)
+ // first_button = event_gui_data;
+
+ if (!active_button)
+ {
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), true);
+ active_button = event_gui_data;
+ }
+
+ gtk_box_pack_start(box, button, /*expand*/ false, /*fill*/ false, /*padding*/ 0);
}
- return (have_activated_btn ? NULL : first_button);
+
+ return active_button;
}
struct cd_stats {
@@ -596,15 +661,16 @@ void update_gui_state_from_problem_data(void)
load_text_to_text_view(g_tv_comment, FILENAME_COMMENT);
/* Update analyze radio buttons */
- event_gui_data_t *first_rb = add_event_buttons(g_box_analyzers, &g_list_analyzers,
+ event_gui_data_t *active_button = add_event_buttons(g_box_analyzers, &g_list_analyzers,
g_analyze_events, G_CALLBACK(analyze_rb_was_toggled),
- /*radio:*/ true, /*prev:*/ g_analyze_event_selected
+ /*radio:*/ true
);
/* Update the value of currently selected analyzer */
- if (first_rb)
+ if (active_button)
{
free(g_analyze_event_selected);
- g_analyze_event_selected = xstrdup(first_rb->event_name);
+ g_analyze_event_selected = xstrdup(active_button->event_name);
+ VERB2 log("g_analyze_event_selected='%s'", g_analyze_event_selected);
}
/* Update reporter checkboxes */
@@ -623,7 +689,7 @@ void update_gui_state_from_problem_data(void)
/* Delete old checkboxes and create new ones */
add_event_buttons(g_box_reporters, &g_list_reporters,
g_report_events, /*callback:*/ G_CALLBACK(report_tb_was_toggled),
- /*radio:*/ false, /*prev:*/ NULL
+ /*radio:*/ false
);
/* Re-select new reporters which were selected before we deleted them */
GList *li_new = g_list_reporters;
@@ -650,7 +716,7 @@ void update_gui_state_from_problem_data(void)
*/
gtk_widget_show_all(GTK_WIDGET(g_assistant));
- if (g_reanalyze_events[0])
+ if (g_analyze_events[0])
gtk_widget_show(GTK_WIDGET(g_btn_refresh));
else
gtk_widget_hide(GTK_WIDGET(g_btn_refresh));
@@ -829,9 +895,6 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g
}
}
- /* Inform abrt-gui that it is a good idea to rescan the directory */
- kill(getppid(), SIGCHLD);
-
/* Stop if exit code is not 0, or no more commands */
if (retval != 0
|| spawn_next_command_in_evd(evd) < 0
@@ -839,6 +902,9 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g
VERB1 log("done running event on '%s': %d", g_dump_dir_name, retval);
//append_to_textview(evd->tv_log, msg);
+ /* Inform abrt-gui that it is a good idea to rescan the directory */
+ kill(getppid(), SIGCHLD);
+
for (;;)
{
if (!evd->more_events)
@@ -849,9 +915,14 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g
/* Unfreeze assistant
* we can't allow user to continue if analyze action fails
* i.e: if gdb fails to generate backtrace
- */
+//TODO: generic solution instead of special-casing on event name!
+ */
if (retval == 0 || (strncmp(evd->event_name, "analyze", strlen("analyze")) != 0))
+ {
gtk_assistant_set_page_complete(g_assistant, evd->page_widget, true);
+ }
+ /* Enable (un-gray out) navigation buttons */
+ gtk_widget_set_sensitive(GTK_WIDGET(g_assistant), true);
/*g_source_remove(evd->event_source_id);*/
close(evd->fd);
@@ -960,6 +1031,8 @@ static void start_event_run(const char *event_name,
/* Freeze assistant so it can't move away from the page until event run is done */
gtk_assistant_set_page_complete(g_assistant, page, false);
+ /* Disable (gray out) navigation buttons */
+ gtk_widget_set_sensitive(GTK_WIDGET(g_assistant), false);
}
@@ -1033,24 +1106,33 @@ static void on_bt_approve_toggle(GtkToggleButton *togglebutton, gpointer user_da
check_backtrace_and_allow_send();
}
+static void on_comment_changed(GtkTextBuffer *buffer, gpointer user_data)
+{
+ bool good = gtk_text_buffer_get_char_count(buffer) >= 10;
+
+ /* Allow next page only when the comment has at least 10 chars */
+ gtk_assistant_set_page_complete(g_assistant, pages[PAGENO_COMMENT].page_widget, good);
+
+ /* And show the eventbox with label */
+ if (good)
+ gtk_widget_hide(GTK_WIDGET(g_eb_comment));
+ else
+ gtk_widget_show(GTK_WIDGET(g_eb_comment));
+}
+
/* Refresh button handling */
static void on_btn_refresh_clicked(GtkButton *button)
{
- if (g_reanalyze_events[0])
- {
- /* Save backtrace text if changed */
- save_text_from_text_view(g_tv_backtrace, FILENAME_BACKTRACE);
+ /* Save backtrace text if changed */
+ save_text_from_text_view(g_tv_backtrace, FILENAME_BACKTRACE);
- g_analyze_events = append_to_malloced_string(g_analyze_events, g_reanalyze_events);
- g_reanalyze_events[0] = '\0';
- /* Refresh GUI so that we see new analyze+reanalyze buttons */
- update_gui_state_from_problem_data();
+ /* Refresh GUI so that we see new analyze buttons */
+ update_gui_state_from_problem_data();
- /* Change page to analyzer selector - let user play with them */
- gtk_assistant_set_current_page(g_assistant, PAGENO_ANALYZE_SELECTOR);
- }
+ /* Change page to analyzer selector - let user play with them */
+ gtk_assistant_set_current_page(g_assistant, PAGENO_ANALYZE_SELECTOR);
}
@@ -1059,25 +1141,29 @@ static void on_btn_refresh_clicked(GtkButton *button)
static void next_page(GtkAssistant *assistant, gpointer user_data)
{
/* page_no is actually the previous page, because this
- * function is called before assistant goes to the next_page
+ * function is called before assistant goes to the next page
*/
int page_no = gtk_assistant_get_current_page(assistant);
VERB2 log("page_no:%d", page_no);
- if (page_no == PAGENO_ANALYZE_SELECTOR
- && g_analyze_event_selected != NULL
- ) {
- start_event_run(g_analyze_event_selected,
- NULL,
- pages[PAGENO_ANALYZE_PROGRESS].page_widget,
- g_tv_analyze_log,
- g_lbl_analyze_log,
- _("Analyzing..."),
- _("Analyzing finished with exit code %d")
- );
+ if (added_pages[page_no]->name == PAGE_ANALYZE_SELECTOR)
+ {
+ VERB2 log("g_analyze_event_selected:'%s'", g_analyze_event_selected);
+ if (g_analyze_event_selected
+ && g_analyze_event_selected[0]
+ ) {
+ start_event_run(g_analyze_event_selected,
+ NULL,
+ pages[PAGENO_ANALYZE_PROGRESS].page_widget,
+ g_tv_analyze_log,
+ g_lbl_analyze_log,
+ _("Analyzing..."),
+ _("Analyzing finished with exit code %d")
+ );
+ }
}
- if (page_no == PAGENO_REPORT)
+ if (added_pages[page_no]->name == PAGE_REPORT)
{
GList *reporters = NULL;
GList *li = g_list_reporters;
@@ -1133,36 +1219,69 @@ static void on_page_prepare(GtkAssistant *assistant, GtkWidget *page, gpointer u
w
);
}
+
+ if (pages[PAGENO_COMMENT].page_widget == page)
+ on_comment_changed(gtk_text_view_get_buffer(g_tv_comment), NULL);
}
-static gint next_page_no(gint current_page_no, gpointer data)
+static gint select_next_page_no(gint current_page_no, gpointer data)
{
+ /* we don't need any magic here if we're in only-report mode */
+ if (g_report_only)
+ return current_page_no + 1;
+
+ gint prev_page_no = current_page_no;
+
again:
current_page_no++;
+
switch (current_page_no)
{
#if 0
case PAGENO_COMMENT:
if (get_problem_item_content_or_NULL(g_cd, FILENAME_COMMENT))
- break;
- goto again; /* no comment, skip next page */
+ goto again; /* no comment, skip this page */
+ break;
#endif
case PAGENO_BACKTRACE_APPROVAL:
- if (get_problem_item_content_or_NULL(g_cd, FILENAME_BACKTRACE))
- break;
- goto again; /* no backtrace, skip next page */
+ if (!get_problem_item_content_or_NULL(g_cd, FILENAME_BACKTRACE))
+ goto again; /* no backtrace, skip this page */
+ break;
case PAGENO_ANALYZE_SELECTOR:
- if (!g_analyze_events[0])
+ if (!g_analyze_events[0] || g_black_event_count == 0)
{
- //TODO: if (!g_reporter_events[0]) /* no reporters available */ then what?
- return PAGENO_REPORTER_SELECTOR; /* skip analyze pages */
+ /* skip analyze selector page and analyze log page */
+ current_page_no = PAGENO_REPORTER_SELECTOR-1;
+ goto again;
+ }
+ break;
+
+ case PAGENO_ANALYZE_PROGRESS:
+ VERB2 log("%s: ANALYZE_PROGRESS: g_analyze_event_selected:'%s'",
+ __func__, g_analyze_event_selected);
+ if (!g_analyze_event_selected || !g_analyze_event_selected[0])
+ goto again; /* skip this page */
+ break;
+
+ case PAGENO_REPORTER_SELECTOR:
+ VERB2 log("%s: REPORTER_SELECTOR: g_black_event_count:%d",
+ __func__, g_black_event_count);
+ /* if we _did_ run an event (didn't skip it)
+ * and still have analyzers which didn't run
+ */
+ if (prev_page_no == PAGENO_ANALYZE_PROGRESS
+ && g_black_event_count != 0
+ ) {
+ /* Go back to analyzer selectors */
+ current_page_no = PAGENO_ANALYZE_SELECTOR-1;
+ goto again;
}
break;
}
- VERB2 log("next page_no:%d", current_page_no);
+ VERB2 log("%s: selected page #%d", __func__, current_page_no);
return current_page_no;
}
@@ -1246,7 +1365,7 @@ static void create_details_treeview()
/* wizard.glade file as a string WIZARD_GLADE_CONTENTS: */
#include "wizard_glade.c"
-static void add_pages(void)
+static void add_pages()
{
GError *error = NULL;
if (!g_glade_file)
@@ -1268,13 +1387,24 @@ static void add_pages(void)
}
int i;
+ int page_no = 0;
for (i = 0; page_names[i] != NULL; i++)
{
+ char *delim = strrchr(page_names[i], '_');
+ if(delim != NULL)
+ {
+ if (g_report_only && (strncmp(delim+1, "report", strlen("report"))) != 0)
+ {
+ pages[i].page_widget = NULL;
+ continue;
+ }
+ }
GtkWidget *page = GTK_WIDGET(gtk_builder_get_object(builder, page_names[i]));
if (page == NULL)
continue;
pages[i].page_widget = page;
+ added_pages[page_no++] = &pages[i];
gtk_assistant_append_page(g_assistant, page);
/* If we set all pages to complete the wizard thinks there is nothing
@@ -1299,6 +1429,7 @@ static void add_pages(void)
g_tv_report_log = GTK_TEXT_VIEW( gtk_builder_get_object(builder, "tv_report_log"));
g_tv_backtrace = GTK_TEXT_VIEW( gtk_builder_get_object(builder, "tv_backtrace"));
g_tv_comment = GTK_TEXT_VIEW( gtk_builder_get_object(builder, "tv_comment"));
+ g_eb_comment = GTK_EVENT_BOX( gtk_builder_get_object(builder, "eb_comment"));
g_tv_details = GTK_TREE_VIEW( gtk_builder_get_object(builder, "tv_details"));
g_box_warning_labels = GTK_BOX( gtk_builder_get_object(builder, "box_warning_labels"));
g_tb_approve_bt = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "cb_approve_bt"));
@@ -1320,8 +1451,9 @@ static void add_pages(void)
//gtk_widget_hide(g_widget_warnings_area);
//gtk_assistant_set_page_complete(g_assistant, pages[PAGENO_REPORTER_SELECTOR].page_widget, false);
- gtk_assistant_set_page_complete(g_assistant, pages[PAGENO_BACKTRACE_APPROVAL].page_widget,
- gtk_toggle_button_get_active(g_tb_approve_bt));
+ if (pages[PAGENO_BACKTRACE_APPROVAL].page_widget != NULL)
+ gtk_assistant_set_page_complete(g_assistant, pages[PAGENO_BACKTRACE_APPROVAL].page_widget,
+ gtk_toggle_button_get_active(g_tb_approve_bt));
/* configure btn on select analyzers page */
GtkWidget *config_btn = GTK_WIDGET(gtk_builder_get_object(builder, "button_cfg1"));
@@ -1332,9 +1464,14 @@ static void add_pages(void)
config_btn = GTK_WIDGET(gtk_builder_get_object(builder, "button_cfg2"));
if (config_btn)
g_signal_connect(G_OBJECT(config_btn), "clicked", G_CALLBACK(on_show_event_list_cb), NULL);
+
+ /* Set color of the comment evenbox */
+ GdkColor color;
+ gdk_color_parse("#CC3333", &color);
+ gtk_widget_modify_bg(GTK_WIDGET(g_eb_comment), GTK_STATE_NORMAL, &color);
}
-void create_assistant()
+void create_assistant(void)
{
monospace_font = pango_font_description_from_string("monospace");
@@ -1342,7 +1479,7 @@ void create_assistant()
g_assistant = GTK_ASSISTANT(gtk_assistant_new());
- gtk_assistant_set_forward_page_func(g_assistant, next_page_no, NULL, NULL);
+ gtk_assistant_set_forward_page_func(g_assistant, select_next_page_no, NULL, NULL);
GtkWindow *wnd_assistant = GTK_WINDOW(g_assistant);
g_parent_window = wnd_assistant;
@@ -1368,6 +1505,7 @@ void create_assistant()
g_signal_connect(g_tb_approve_bt, "toggled", G_CALLBACK(on_bt_approve_toggle), NULL);
g_signal_connect(g_btn_refresh, "clicked", G_CALLBACK(on_btn_refresh_clicked), NULL);
+ g_signal_connect(gtk_text_view_get_buffer(g_tv_comment), "changed", G_CALLBACK(on_comment_changed), NULL);
g_signal_connect(g_tv_details, "row-activated", G_CALLBACK(tv_details_row_activated), NULL);
/* [Enter] on a row: g_signal_connect(g_tv_details, "select-cursor-row", G_CALLBACK(tv_details_select_cursor_row), NULL); */
g_signal_connect(g_tv_details, "cursor-changed", G_CALLBACK(tv_details_cursor_changed), NULL);
@@ -1378,8 +1516,9 @@ void create_assistant()
gtk_text_buffer_create_tag(backtrace_buf, "search_result_bg", "background", "red", NULL);
g_signal_connect(g_search_entry_bt, "changed", G_CALLBACK(search_timeout), NULL);
- gtk_assistant_set_page_complete(g_assistant,
- pages[PAGENO_BACKTRACE_APPROVAL].page_widget,
- gtk_toggle_button_get_active(g_tb_approve_bt)
+ if (pages[PAGENO_BACKTRACE_APPROVAL].page_widget != NULL)
+ gtk_assistant_set_page_complete(g_assistant,
+ pages[PAGENO_BACKTRACE_APPROVAL].page_widget,
+ gtk_toggle_button_get_active(g_tb_approve_bt)
);
}
diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade
index 301bca68..f79950ee 100644
--- a/src/gui-wizard-gtk/wizard.glade
+++ b/src/gui-wizard-gtk/wizard.glade
@@ -34,9 +34,8 @@
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
- <property name="ypad">0</property>
- <property name="wrap">True</property>
<property name="label" translatable="yes">On the following screens, you will be asked to describe how the problem occurred, to choose how to analyze the problem (if needed), to review collected data, and to choose where the problem should be reported. Click 'Forward' to proceed.</property>
+ <property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -51,8 +50,8 @@
<child>
<object class="GtkScrolledWindow" id="container_details1">
<property name="visible">True</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
<property name="can_focus">True</property>
+ <property name="shadow_type">out</property>
<child>
<object class="GtkTreeView" id="tv_details">
<property name="visible">True</property>
@@ -85,14 +84,15 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">10</property>
+ <property name="spacing">3</property>
<child>
- <object class="GtkLabel" id="label2">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
- <property name="ypad">5</property>
- <property name="label" translatable="yes">How did this problem happen (step-by-step)? How can it be reproduced?</property>
+ <property name="label" translatable="yes">How did this problem happen (step-by-step)? How can it be reproduced? Any additional comments useful for diagnosing the problem?</property>
+ <property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -101,37 +101,52 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="ypad">5</property>
- <property name="label" translatable="yes">Any additional comments useful for diagnosing the problem?</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow4">
- <property name="visible">True</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
- <property name="can_focus">True</property>
<child>
- <object class="GtkTextView" id="tv_comment">
+ <object class="GtkScrolledWindow" id="scrolledwindow4">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="wrap_mode">word</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="shadow_type">GTK_SHADOW_OUT</property>
+ <child>
+ <object class="GtkTextView" id="tv_comment">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="wrap_mode">word</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEventBox" id="eb_comment">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">You need to fill the how to before you can proceed...</property>
+ <property name="single_line_mode">True</property>
+ </object>
+ </child>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
@@ -140,14 +155,14 @@
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
- <property name="ypad">5</property>
<property name="label" translatable="yes">&lt;b&gt;Your comments are not private.&lt;/b&gt; They may be included into publicly visible problem reports.</property>
<property name="use_markup">True</property>
+ <property name="wrap">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
@@ -160,6 +175,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">10</property>
+ <property name="spacing">3</property>
<child>
<object class="GtkLabel" id="lbl_page5">
<property name="visible">True</property>
@@ -199,8 +215,8 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
- <property name="image_position">right</property>
<property name="use_underline">True</property>
+ <property name="image_position">right</property>
</object>
<packing>
<property name="expand">False</property>
@@ -239,12 +255,12 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">10</property>
+ <property name="spacing">3</property>
<child>
<object class="GtkLabel" id="lbl_analyze_log">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="ypad">5</property>
<property name="label" translatable="yes">Analyzing did not start yet</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
@@ -258,8 +274,8 @@
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
<property name="can_focus">True</property>
+ <property name="shadow_type">out</property>
<child>
<object class="GtkTextView" id="tv_analyze_log">
<property name="visible">True</property>
@@ -281,10 +297,11 @@
<object class="GtkWindow" id="window4">
<property name="can_focus">False</property>
<child>
- <object class="GtkVBox" id="page_4">
+ <object class="GtkVBox" id="page_4_report">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">10</property>
+ <property name="spacing">3</property>
<child>
<object class="GtkLabel" id="lbl_page3">
<property name="visible">True</property>
@@ -326,8 +343,8 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
- <property name="image_position">right</property>
<property name="use_underline">True</property>
+ <property name="image_position">right</property>
</object>
<packing>
<property name="expand">False</property>
@@ -367,13 +384,13 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">10</property>
+ <property name="spacing">3</property>
<child>
<object class="GtkLabel" id="lbl_page4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
- <property name="ypad">0</property>
<property name="label" translatable="yes">Backtrace provides developers with details of the crash, helping them track down the source of the problem. Please review it and remove any sensitive data you would rather not share:</property>
<property name="wrap">True</property>
</object>
@@ -386,8 +403,8 @@
<child>
<object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
<property name="can_focus">True</property>
+ <property name="shadow_type">out</property>
<child>
<object class="GtkTextView" id="tv_backtrace">
<property name="visible">True</property>
@@ -561,10 +578,11 @@
<object class="GtkWindow" id="window6">
<property name="can_focus">False</property>
<child>
- <object class="GtkVBox" id="page_6">
+ <object class="GtkVBox" id="page_6_report">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">10</property>
+ <property name="spacing">3</property>
<child>
<object class="GtkLabel" id="lbl_page6">
<property name="visible">True</property>
@@ -655,8 +673,8 @@
<child>
<object class="GtkScrolledWindow" id="container_details2">
<property name="visible">True</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
<property name="can_focus">True</property>
+ <property name="shadow_type">out</property>
<child>
<placeholder/>
</child>
@@ -673,16 +691,16 @@
<object class="GtkWindow" id="window7">
<property name="can_focus">False</property>
<child>
- <object class="GtkVBox" id="page_7">
+ <object class="GtkVBox" id="page_7_report">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">10</property>
+ <property name="spacing">3</property>
<child>
<object class="GtkLabel" id="lbl_report_log">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="ypad">5</property>
<property name="label" translatable="yes">Reporting did not start yet</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
@@ -696,8 +714,8 @@
<child>
<object class="GtkScrolledWindow" id="scrolledwindow6">
<property name="visible">True</property>
- <property name="shadow_type">GTK_SHADOW_OUT</property>
<property name="can_focus">True</property>
+ <property name="shadow_type">out</property>
<child>
<object class="GtkTextView" id="tv_report_log">
<property name="visible">True</property>
diff --git a/src/gui-wizard-gtk/wizard.h b/src/gui-wizard-gtk/wizard.h
index 5e341e34..772fcc05 100644
--- a/src/gui-wizard-gtk/wizard.h
+++ b/src/gui-wizard-gtk/wizard.h
@@ -24,7 +24,7 @@ void show_error_as_msgbox(const char *msg);
extern char *g_glade_file;
extern char *g_dump_dir_name;
extern char *g_analyze_events;
-extern char *g_reanalyze_events;
extern char *g_report_events;
extern problem_data_t *g_cd;
+extern int g_report_only;
void reload_problem_data_from_dump_dir(void);