diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-02-17 12:31:13 +0100 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-02-17 12:31:13 +0100 |
| commit | 7cc0d036579337f3e1013086ec3dc61d09b5c529 (patch) | |
| tree | 3faad23c612d6ee41bc9dc1c4da05cd52b6c7978 /src | |
| parent | 7c4144b696475261ea9297f05a91bde22f1718e8 (diff) | |
| download | abrt-7cc0d036579337f3e1013086ec3dc61d09b5c529.tar.gz abrt-7cc0d036579337f3e1013086ec3dc61d09b5c529.tar.xz abrt-7cc0d036579337f3e1013086ec3dc61d09b5c529.zip | |
gui-wizard-gtk: show correct list of analyzers available
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/gui-wizard-gtk/main.c | 17 | ||||
| -rw-r--r-- | src/gui-wizard-gtk/wizard.glade | 48 | ||||
| -rw-r--r-- | src/include/report/run_event.h | 1 |
3 files changed, 21 insertions, 45 deletions
diff --git a/src/gui-wizard-gtk/main.c b/src/gui-wizard-gtk/main.c index a8991fcb..4f54ff2b 100644 --- a/src/gui-wizard-gtk/main.c +++ b/src/gui-wizard-gtk/main.c @@ -39,6 +39,7 @@ int main(int argc, char **argv) if (!dd) return 1; cd = create_crash_data_from_dump_dir(dd); + char *analyze_events = list_possible_events(dd, /*dump_dir_name*/ NULL, "analyze"); dd_close(dd); GtkWidget *assistant = create_assistant(); @@ -47,6 +48,22 @@ int main(int argc, char **argv) if (reason) gtk_label_set_text(g_lbl_cd_reason, reason); + GtkWidget *first_rb = NULL; + if (analyze_events[0]) + { + char *event_name = analyze_events; + char *event_name_end = strchr(event_name, '\n'); + *event_name_end = '\0'; + GtkWidget *rb = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(first_rb), event_name); + *event_name_end = '\n'; + event_name = event_name_end + 1; + + if (!first_rb) + first_rb = rb; + gtk_box_pack_start(GTK_BOX(g_vb_analyzers), rb, /*expand*/ false, /*fill*/ false, /*padding*/ 0); + } + else { /*???*/ } + gtk_widget_show_all(assistant); /* Enter main loop */ diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade index c2d67938..25fb17f7 100644 --- a/src/gui-wizard-gtk/wizard.glade +++ b/src/gui-wizard-gtk/wizard.glade @@ -20,8 +20,6 @@ <object class="GtkLabel" id="lbl_page1"> <property name="width_request">750</property> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> <property name="label" translatable="yes">A problem was detected on your computer:</property> <property name="justify">fill</property> <property name="wrap">True</property> @@ -51,8 +49,6 @@ <object class="GtkLabel" id="lbl_page5"> <property name="width_request">750</property> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> <property name="label" translatable="yes">Select how you would like to analyze the problem:</property> <property name="justify">fill</property> <property name="wrap">True</property> @@ -71,51 +67,13 @@ <property name="visible">True</property> <property name="orientation">vertical</property> <child> - <object class="GtkRadioButton" id="radiobutton1"> - <property name="label" translatable="yes">Analyzer 1</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> + <placeholder/> </child> <child> - <object class="GtkRadioButton" id="radiobutton2"> - <property name="label" translatable="yes">Analyzer 2</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <property name="group">radiobutton1</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> + <placeholder/> </child> <child> - <object class="GtkRadioButton" id="radiobutton3"> - <property name="label" translatable="yes">Analyzer 3</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <property name="group">radiobutton1</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">2</property> - </packing> + <placeholder/> </child> </object> <packing> diff --git a/src/include/report/run_event.h b/src/include/report/run_event.h index a1c1f56b..388a74e6 100644 --- a/src/include/report/run_event.h +++ b/src/include/report/run_event.h @@ -46,6 +46,7 @@ void free_run_event_state(struct run_event_state *state); */ int run_event_on_dir_name(struct run_event_state *state, const char *dump_dir_name, const char *event); int run_event_on_crash_data(struct run_event_state *state, crash_data_t *data, const char *event); +/* Returns a malloced string with '\n'-terminated event names */ char *list_possible_events(struct dump_dir *dd, const char *dump_dir_name, const char *pfx); #ifdef __cplusplus |
