summaryrefslogtreecommitdiffstats
path: root/src/gui-wizard-gtk
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-02-22 05:59:43 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2011-02-22 05:59:43 +0100
commitffece2d20673269029bb0b9403e20125e92382fa (patch)
tree68b7f9ecc79acfd59dfa209278d68fda15d1428c /src/gui-wizard-gtk
parent6cc86c66a15ea305b453e5d1b2d62e4d974f579d (diff)
downloadabrt-ffece2d20673269029bb0b9403e20125e92382fa.tar.gz
abrt-ffece2d20673269029bb0b9403e20125e92382fa.tar.xz
abrt-ffece2d20673269029bb0b9403e20125e92382fa.zip
correct rights on /var/run/abrt; improve new GUI a bit
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/gui-wizard-gtk')
-rw-r--r--src/gui-wizard-gtk/wizard.c20
-rw-r--r--src/gui-wizard-gtk/wizard.glade19
-rw-r--r--src/gui-wizard-gtk/wizard.h1
3 files changed, 21 insertions, 19 deletions
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index 09fea9b8..0881dd44 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -6,6 +6,7 @@
#define DEFAULT_HEIGHT 500
GtkLabel *g_lbl_cd_reason;
+GtkLabel *g_lbl_analyze_log;
GtkBox *g_box_analyzers;
GtkBox *g_box_reporters;
GtkTextView *g_analyze_log;
@@ -206,6 +207,7 @@ static void add_pages()
/* Set pointer to fields we might need to change */
g_lbl_cd_reason = GTK_LABEL(gtk_builder_get_object(builder, "lbl_cd_reason"));
+ g_lbl_analyze_log = GTK_LABEL(gtk_builder_get_object(builder, "lbl_analyze_log"));
g_box_analyzers = GTK_BOX(gtk_builder_get_object(builder, "vb_analyzers"));
g_box_reporters = GTK_BOX(gtk_builder_get_object(builder, "vb_reporters"));
g_analyze_log = GTK_TEXT_VIEW(gtk_builder_get_object(builder, "analyze_log"));
@@ -240,6 +242,11 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g
gtk_text_buffer_insert_at_cursor(tb, buf, r);
}
+ /* Scroll so that end of the log is visible */
+ gtk_text_buffer_get_iter_at_offset(tb, &text_iter, -1);
+ gtk_text_view_scroll_to_iter(g_analyze_log, &text_iter,
+ /*within_margin:*/ 0.0, /*use_align:*/ FALSE, /*xalign:*/ 0, /*yalign:*/ 0);
+
if (r < 0 && errno == EAGAIN)
/* We got all data, but fd is still open. Done for now */
return TRUE; /* "please don't remove this event (yet)" */
@@ -260,7 +267,12 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g
close(evd->fd);
free_run_event_state(evd->run_state);
free(evd);
-//TODO: unfreeze assistant here
+ char *msg = xasprintf(_("Analyze finished with exitcode %d"), retval);
+ gtk_label_set_text(g_lbl_analyze_log, msg);
+ free(msg);
+ /* Unfreeze assistant */
+ gtk_assistant_set_page_complete(GTK_ASSISTANT(assistant),
+ pages[PAGENO_ANALYZE_ACTION_SELECTOR].page_widget, true);
return FALSE; /* "please remove this event" */
}
@@ -279,6 +291,7 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g
static void next_page(GtkAssistant *assistant, gpointer user_data)
{
int page_no = gtk_assistant_get_current_page(assistant);
+ GtkWidget *cur_page_widget = pages[page_no].page_widget;
log("page_no:%d", page_no);
if (page_no == PAGENO_ANALYZE_ACTION_SELECTOR
@@ -312,7 +325,10 @@ static void next_page(GtkAssistant *assistant, gpointer user_data)
consume_cmd_output,
evd
);
-//TODO: freeze assistant so it can't move away from the page until analyzing is done!
+ gtk_label_set_text(g_lbl_analyze_log, _("Analyzing..."));
+ /* Freeze assistant so it can't move away from the page until analyzing is done */
+//doesn't seem to have effect
+ gtk_assistant_set_page_complete(GTK_ASSISTANT(assistant), cur_page_widget, false);
}
}
diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade
index 1669e1d2..65b0c38c 100644
--- a/src/gui-wizard-gtk/wizard.glade
+++ b/src/gui-wizard-gtk/wizard.glade
@@ -92,14 +92,10 @@
<property name="border_width">10</property>
<property name="orientation">vertical</property>
<child>
- <object class="GtkLabel" id="lbl_page2">
+ <object class="GtkLabel" id="lbl_analyze_log">
<property name="width_request">750</property>
<property name="visible">True</property>
- <property name="xalign">0.05000000074505806</property>
- <property name="yalign">0.05000000074505806</property>
- <property name="label" translatable="yes">Please wait until the problem analysis is finished..
-
-You can see the progress in the window below.</property>
+ <property name="label" translatable="yes">Analyzing did not start yet</property>
<property name="use_markup">True</property>
<property name="justify">fill</property>
<property name="wrap">True</property>
@@ -115,7 +111,6 @@ You can see the progress in the window below.</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="analyze_log">
<property name="visible">True</property>
@@ -130,16 +125,6 @@ You can see the progress in the window below.</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkProgressBar" id="pb_analyze">
- <property name="visible">True</property>
- <property name="activity_mode">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
</object>
</child>
</object>
diff --git a/src/gui-wizard-gtk/wizard.h b/src/gui-wizard-gtk/wizard.h
index 6de02b49..85c33611 100644
--- a/src/gui-wizard-gtk/wizard.h
+++ b/src/gui-wizard-gtk/wizard.h
@@ -8,6 +8,7 @@ enum {
PAGENO_REPORT,
};
extern GtkLabel *g_lbl_cd_reason;
+extern GtkLabel *g_lbl_analyze_log;
extern GtkBox *g_box_analyzers;
extern GtkBox *g_box_reporters;
GtkWidget *create_assistant(void);