diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-03-03 16:21:34 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-03-03 16:21:34 +0100 |
commit | cd205619d987cbcf839a5e9261037e40e50d9d5c (patch) | |
tree | b79241b0118afcac79c5af74b05744fd07fe1d54 | |
parent | 9d54c683155d1fa12d10a3cf1c7e171fbbbfffdd (diff) | |
download | abrt-cd205619d987cbcf839a5e9261037e40e50d9d5c.tar.gz abrt-cd205619d987cbcf839a5e9261037e40e50d9d5c.tar.xz abrt-cd205619d987cbcf839a5e9261037e40e50d9d5c.zip |
gui-wizard-gtk: move comment editing to page 2
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r-- | src/gui-wizard-gtk/wizard.c | 56 | ||||
-rw-r--r-- | src/gui-wizard-gtk/wizard.glade | 150 | ||||
-rw-r--r-- | src/gui-wizard-gtk/wizard.h | 2 |
3 files changed, 103 insertions, 105 deletions
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c index 285a0678..a4229571 100644 --- a/src/gui-wizard-gtk/wizard.c +++ b/src/gui-wizard-gtk/wizard.c @@ -38,11 +38,11 @@ static PangoFontDescription *monospace_font; /* THE PAGE FLOW + * page_5: user comments * page_1: analyze action selection * page_2: analyze progress * page_3: reporter selection * page_4: backtrace editor - * page_5: how to + user comments * page_6: summary * page_7: reporting progress */ @@ -52,22 +52,22 @@ static PangoFontDescription *monospace_font; * instead of strcmp. */ static const gchar PAGE_SUMMARY[] = "page_0"; -static const gchar PAGE_ANALYZE_SELECTOR[] = "page_1"; -static const gchar PAGE_ANALYZE_PROGRESS[] = "page_2"; -static const gchar PAGE_REPORTER_SELECTOR[] = "page_3"; -static const gchar PAGE_BACKTRACE_APPROVAL[] = "page_4"; -static const gchar PAGE_HOWTO[] = "page_5"; +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_BACKTRACE_APPROVAL[] = "page_5"; static const gchar PAGE_REPORT[] = "page_6"; static const gchar PAGE_REPORT_PROGRESS[] = "page_7"; static const gchar *const page_names[] = { PAGE_SUMMARY, + PAGE_COMMENT, PAGE_ANALYZE_SELECTOR, PAGE_ANALYZE_PROGRESS, PAGE_REPORTER_SELECTOR, PAGE_BACKTRACE_APPROVAL, - PAGE_HOWTO, PAGE_REPORT, PAGE_REPORT_PROGRESS, NULL @@ -92,6 +92,7 @@ static page_obj_t pages[] = */ /* glade element name , on-screen text , type */ { PAGE_SUMMARY , "Problem description" , GTK_ASSISTANT_PAGE_CONTENT }, + { PAGE_COMMENT , "Provide additional information", GTK_ASSISTANT_PAGE_CONTENT }, { PAGE_ANALYZE_SELECTOR , "Select analyzer" , GTK_ASSISTANT_PAGE_CONFIRM }, { PAGE_ANALYZE_PROGRESS , "Analyzing" , GTK_ASSISTANT_PAGE_CONTENT }, /* Some reporters don't need backtrace, we can skip bt page for them. @@ -99,7 +100,6 @@ static page_obj_t pages[] = */ { PAGE_REPORTER_SELECTOR , "Select reporter" , GTK_ASSISTANT_PAGE_CONTENT }, { 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 }, /* Was GTK_ASSISTANT_PAGE_PROGRESS */ { PAGE_REPORT_PROGRESS , "Reporting" , GTK_ASSISTANT_PAGE_SUMMARY }, @@ -727,13 +727,13 @@ static void on_page_prepare(GtkAssistant *assistant, GtkWidget *page, gpointer u check_backtrace_and_allow_send(); } - if (pages[PAGENO_HOWTO].page_widget == page) + if (pages[PAGENO_BACKTRACE_APPROVAL + 1].page_widget == page) { /* User just pressed [Fwd] on backtrace page. Save backtrace text if changed */ save_text_from_text_view(g_tv_backtrace, FILENAME_BACKTRACE); } - if (pages[PAGENO_REPORT].page_widget == page) + if (pages[PAGENO_COMMENT + 1].page_widget == page) { /* User just pressed [Fwd] on comment page. Same as above */ save_text_from_text_view(g_tv_comment, FILENAME_COMMENT); @@ -755,38 +755,36 @@ static void on_page_prepare(GtkAssistant *assistant, GtkWidget *page, gpointer u static gint next_page_no(gint current_page_no, gpointer data) { + again: + current_page_no++; switch (current_page_no) { - case PAGENO_SUMMARY: +#if 0 + case PAGENO_COMMENT: + if (get_crash_item_content_or_NULL(g_cd, FILENAME_COMMENT)) + break; + goto again; /* no comment, skip next page */ +#endif + + case PAGENO_BACKTRACE_APPROVAL: + if (get_crash_item_content_or_NULL(g_cd, FILENAME_BACKTRACE)) + break; + goto again; /* no backtrace, skip next page */ + + case PAGENO_ANALYZE_SELECTOR: 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)) { - break; - } - current_page_no++; /* no comment, skip next page */ - /* fall through */ -#endif - } - return current_page_no + 1; + VERB2 log("next page_no:%d", current_page_no); + return current_page_no; } - static gboolean highlight_search(gpointer user_data) { GtkEntry *entry = GTK_ENTRY(user_data); diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade index 0ef58259..2b0512c0 100644 --- a/src/gui-wizard-gtk/wizard.glade +++ b/src/gui-wizard-gtk/wizard.glade @@ -108,6 +108,75 @@ <property name="height_request">500</property> <child> <object class="GtkVBox" id="page_1"> + <property name="visible">True</property> + <property name="border_width">10</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</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> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label1"> + <property name="visible">True</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="position">1</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow" id="scrolledwindow4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">automatic</property> + <property name="vscrollbar_policy">automatic</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="position">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="ypad">5</property> + <property name="label" translatable="yes"><b>Your comments are not private.</b> They may be included into publicly visible problem reports.</property> + <property name="use_markup">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">3</property> + </packing> + </child> + </object> + </child> + </object> + <object class="GtkWindow" id="window2"> + <property name="width_request">800</property> + <property name="height_request">500</property> + <child> + <object class="GtkVBox" id="page_2"> <property name="width_request">750</property> <property name="height_request">400</property> <property name="visible">True</property> @@ -145,11 +214,11 @@ </object> </child> </object> - <object class="GtkWindow" id="window2"> + <object class="GtkWindow" id="window3"> <property name="width_request">800</property> <property name="height_request">500</property> <child> - <object class="GtkVBox" id="page_2"> + <object class="GtkVBox" id="page_3"> <property name="visible">True</property> <property name="border_width">10</property> <property name="orientation">vertical</property> @@ -189,11 +258,11 @@ </object> </child> </object> - <object class="GtkWindow" id="window3"> + <object class="GtkWindow" id="window4"> <property name="width_request">800</property> <property name="height_request">500</property> <child> - <object class="GtkVBox" id="page_3"> + <object class="GtkVBox" id="page_4"> <property name="visible">True</property> <property name="border_width">10</property> <property name="orientation">vertical</property> @@ -232,12 +301,12 @@ </object> </child> </object> - <object class="GtkWindow" id="window4"> + <object class="GtkWindow" id="window5"> <property name="width_request">800</property> <property name="height_request">500</property> <property name="tooltip_text" translatable="yes">Use this button to generate more informative backtrace after you installed additional debug packages</property> <child> - <object class="GtkVBox" id="page_4"> + <object class="GtkVBox" id="page_5"> <property name="visible">True</property> <property name="border_width">10</property> <property name="orientation">vertical</property> @@ -410,75 +479,6 @@ </object> </child> </object> - <object class="GtkWindow" id="window5"> - <property name="width_request">800</property> - <property name="height_request">500</property> - <child> - <object class="GtkVBox" id="page_5"> - <property name="visible">True</property> - <property name="border_width">10</property> - <property name="orientation">vertical</property> - <child> - <object class="GtkLabel" id="label2"> - <property name="visible">True</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> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label1"> - <property name="visible">True</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="position">1</property> - </packing> - </child> - <child> - <object class="GtkScrolledWindow" id="scrolledwindow4"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">automatic</property> - <property name="vscrollbar_policy">automatic</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="position">2</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="ypad">5</property> - <property name="label" translatable="yes"><b>Your comments are not private.</b> They may be included into publicly visible problem reports.</property> - <property name="use_markup">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="position">3</property> - </packing> - </child> - </object> - </child> - </object> <object class="GtkWindow" id="window6"> <property name="width_request">800</property> <property name="height_request">500</property> diff --git a/src/gui-wizard-gtk/wizard.h b/src/gui-wizard-gtk/wizard.h index f27fb777..00884b21 100644 --- a/src/gui-wizard-gtk/wizard.h +++ b/src/gui-wizard-gtk/wizard.h @@ -1,10 +1,10 @@ enum { PAGENO_SUMMARY, + PAGENO_COMMENT, PAGENO_ANALYZE_SELECTOR, PAGENO_ANALYZE_PROGRESS, PAGENO_REPORTER_SELECTOR, PAGENO_BACKTRACE_APPROVAL, - PAGENO_HOWTO, PAGENO_REPORT, PAGENO_REPORT_PROGRESS, }; |