summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-02-23 19:13:49 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-02-23 19:13:49 +0100
commit29a1981bb36931b89a32ce24d0bef1fcb565d618 (patch)
tree0984fcd9ac7ef82b19b2405f846c0d67a7d57fff /src
parent2db904065288fe6da52792de0ef8297092682c82 (diff)
downloadabrt-29a1981bb36931b89a32ce24d0bef1fcb565d618.tar.gz
abrt-29a1981bb36931b89a32ce24d0bef1fcb565d618.tar.xz
abrt-29a1981bb36931b89a32ce24d0bef1fcb565d618.zip
gui-wizard-gtk: a bit different bt page layout
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui-wizard-gtk/wizard.c55
-rw-r--r--src/gui-wizard-gtk/wizard.glade168
2 files changed, 86 insertions, 137 deletions
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index 667c9328..bfb82a72 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -18,7 +18,7 @@ GtkLabel *g_lbl_cd_reason;
GtkTextView *g_tv_backtrace;
GtkTreeView *g_tv_details;
GtkListStore *g_ls_details;
-GtkBox *g_box_warnings_area;
+GtkWidget *g_widget_warnings_area;
GtkBox *g_box_warning_labels;
GtkToggleButton * g_tb_approve_bt;
@@ -358,7 +358,7 @@ static void create_details_treeview()
/* wizard.glade file as a string WIZARD_GLADE_CONTENTS: */
#include "wizard_glade.c"
-static void add_pages()
+static void add_pages(void)
{
GError *error = NULL;
if (!g_glade_file)
@@ -411,12 +411,11 @@ static void add_pages()
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_details = GTK_TREE_VIEW(gtk_builder_get_object(builder, "tv_details"));
- g_box_warnings_area = GTK_BOX(gtk_builder_get_object(builder, "hb_warnings_area"));
- /* hide the warnings by default */
- gtk_widget_hide(GTK_WIDGET(g_box_warnings_area));
g_box_warning_labels = GTK_BOX(gtk_builder_get_object(builder, "hb_warning_labels"));
g_tb_approve_bt = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "cb_approve_bt"));
-
+ g_widget_warnings_area = GTK_WIDGET(gtk_builder_get_object(builder, "hb_warnings_area"));
+ ///* hide the warnings by default */
+ //gtk_widget_hide(g_widget_warnings_area);
}
static void add_warning(const char *warning)
@@ -426,32 +425,34 @@ static void add_warning(const char *warning)
gtk_misc_set_alignment(GTK_MISC(warning_lbl), 0.0, 0.0);
gtk_label_set_justify(GTK_LABEL(warning_lbl), GTK_JUSTIFY_LEFT);
gtk_box_pack_start(g_box_warning_labels, warning_lbl, false, false, 0);
- gtk_widget_show(GTK_WIDGET(warning_lbl));
+ gtk_widget_show(warning_lbl);
/* should be safe to free it, gtk calls strdup() to copy it */
free(label_str);
}
-static void check_backtrace_and_allow_send()
+static void check_backtrace_and_allow_send(void)
{
bool send = true;
- gtk_widget_hide(GTK_WIDGET(g_box_warnings_area));
+
/* erase all warnings */
+ gtk_widget_hide(g_widget_warnings_area);
gtk_container_foreach(GTK_CONTAINER(g_box_warning_labels), &remove_child_widget, NULL);
- /* FIXME: this should be bind to a reporter not to a compoment
+
+ /*
+ * FIXME: this should be bind to a reporter not to a compoment
* but we don't rate oopses, so for now we skip the "kernel" manually
*/
const char *component = get_crash_item_content_or_NULL(g_cd, FILENAME_COMPONENT);
- if(strcmp(component, "kernel") != 0)
+ if (strcmp(component, "kernel") != 0)
{
const char *rating = get_crash_item_content_or_NULL(g_cd, FILENAME_RATING);
- switch(*rating)
+ if (rating) switch (*rating)
{
case '4': //bt is ok - no warning here
-VERB2 log("rating is 4\n");
break;
case '3': //bt is usable, but not complete, so show a warning
-VERB2 log("rating is 3 - adding warning");
add_warning(_("The backtrace is incomplete, please make sure you provide the steps to reproduce."));
+ send = false;
break;
case '2':
case '1':
@@ -462,21 +463,18 @@ VERB2 log("rating is 3 - adding warning");
}
}
- if(!gtk_toggle_button_get_active(g_tb_approve_bt))
+ if (!gtk_toggle_button_get_active(g_tb_approve_bt))
{
-VERB2 log("bt is not approved");
add_warning(_("You should check the backtrace for sensitive data."));
add_warning(_("You must agree with sending the backtrace."));
send = false;
}
- //use a variable like bool show_warnings instead of this??
- if(g_list_length(gtk_container_get_children(GTK_CONTAINER(g_box_warning_labels))) > 0)
- gtk_widget_show(GTK_WIDGET(g_box_warnings_area));
-
gtk_assistant_set_page_complete(g_assistant,
pages[PAGENO_BACKTRACE_APPROVAL].page_widget,
send);
+ if (!send)
+ gtk_widget_show(g_widget_warnings_area);
}
static void on_bt_approve_toggle(GtkToggleButton *togglebutton, gpointer user_data)
@@ -484,23 +482,18 @@ static void on_bt_approve_toggle(GtkToggleButton *togglebutton, gpointer user_da
check_backtrace_and_allow_send();
}
-void on_page_prepare(GtkAssistant *assistant, GtkWidget *page, gpointer user_data)
+static void on_page_prepare(GtkAssistant *assistant, GtkWidget *page, gpointer user_data)
{
//FIXME: move some of this to the add_pages??
- if(pages[PAGENO_SUMMARY].page_widget == page)
+ if (pages[PAGENO_SUMMARY].page_widget == page)
{
/* the first page doesn't require any action to be completed,
- * so lets make it complete and enable the "Forawrd" button
+ * so lets make it complete and enable the "Forward" button
*/
gtk_assistant_set_page_complete(assistant, page, true);
}
if (pages[PAGENO_BACKTRACE_APPROVAL].page_widget == page)
{
- g_signal_connect(g_tb_approve_bt, "toggled", G_CALLBACK(on_bt_approve_toggle), NULL);
- gtk_assistant_set_page_complete(g_assistant,
- pages[PAGENO_BACKTRACE_APPROVAL].page_widget,
- false
- );
check_backtrace_and_allow_send();
}
}
@@ -531,4 +524,10 @@ void create_assistant()
gtk_tree_view_set_model(g_tv_details, GTK_TREE_MODEL(g_ls_details));
gtk_builder_connect_signals(builder, NULL);
+
+ g_signal_connect(g_tb_approve_bt, "toggled", G_CALLBACK(on_bt_approve_toggle), 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 a2e433a2..6fb77a44 100644
--- a/src/gui-wizard-gtk/wizard.glade
+++ b/src/gui-wizard-gtk/wizard.glade
@@ -203,6 +203,7 @@
<object class="GtkWindow" id="window4">
<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">
<property name="visible">True</property>
@@ -214,52 +215,80 @@
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
- <property name="label" translatable="yes">Below is the backtrace. It 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="ypad">3</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>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox5">
+ <object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <object class="GtkTextView" id="tv_backtrace">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="border_width">10</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <child>
- <object class="GtkTextView" id="tv_backtrace">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="wrap_mode">word</property>
- </object>
- </child>
+ <property name="wrap_mode">word</property>
</object>
- <packing>
- <property name="position">0</property>
- </packing>
</child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
<child>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkHBox" id="hb_warnings_area">
<property name="visible">True</property>
+ <property name="no_show_all">True</property>
<child>
- <object class="GtkAlignment" id="alignment1">
+ <object class="GtkImage" id="image1">
<property name="visible">True</property>
+ <property name="stock">gtk-dialog-warning</property>
+ <property name="icon-size">6</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="hb_warning_labels">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
<child>
<placeholder/>
</child>
</object>
<packing>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox5">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
<object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
@@ -308,113 +337,35 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">0</property>
</packing>
</child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hb_warnings_area">
- <property name="visible">True</property>
- <property name="no_show_all">True</property>
- <child>
- <object class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-dialog-warning</property>
- <property name="icon-size">6</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkVBox" id="hb_warning_labels">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox3">
- <property name="visible">True</property>
- <child>
- <object class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
<child>
<object class="GtkButton" id="b_refresh">
- <property name="label" translatable="yes">Refresh</property>
+ <property name="label" translatable="yes">Regenerate backgrace</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_b_refresh_clicked"/>
</object>
<packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="b_copy">
- <property name="label" translatable="yes">Copy</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
- <property name="position">3</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
@@ -427,8 +378,7 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">4</property>
+ <property name="position">3</property>
</packing>
</child>
</object>