diff options
-rw-r--r-- | abrt.spec | 2 | ||||
-rw-r--r-- | src/gui-wizard-gtk/wizard.c | 20 | ||||
-rw-r--r-- | src/gui-wizard-gtk/wizard.glade | 19 | ||||
-rw-r--r-- | src/gui-wizard-gtk/wizard.h | 1 | ||||
-rwxr-xr-x | src/plugins/abrt-action-install-debuginfo.py | 6 | ||||
-rw-r--r-- | src/plugins/abrt-action-upload.c | 2 |
6 files changed, 26 insertions, 24 deletions
@@ -384,7 +384,7 @@ fi %{_initrddir}/abrtd %dir %attr(0755, abrt, abrt) %{_localstatedir}/spool/%{name} %dir %attr(0700, abrt, abrt) %{_localstatedir}/spool/%{name}-upload -%dir /var/run/%{name} +%dir %attr(0775, abrt, abrt) %{_localstatedir}/run/%{name} %dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/%{name}/plugins %dir %{_libdir}/%{name} 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); diff --git a/src/plugins/abrt-action-install-debuginfo.py b/src/plugins/abrt-action-install-debuginfo.py index d09f00f5..f9d1f50f 100755 --- a/src/plugins/abrt-action-install-debuginfo.py +++ b/src/plugins/abrt-action-install-debuginfo.py @@ -131,18 +131,18 @@ class MyDownloadCallback(DownloadBaseCallback): self.last_pct = pct # if run from terminal we can have a fancy output if sys.stdout.isatty(): - sys.stdout.write("\033[sDownloading (%i of %i) %s: %.3s %%\033[u" + sys.stdout.write("\033[sDownloading (%i of %i) %s: %3u%%\033[u" % (self.downloaded_pkgs + 1, self.total_pkgs, name, pct) ) if pct == 100: - print _("Downloading (%i of %i) %s: %.3s %%" + print _("Downloading (%i of %i) %s: %3u%%" % (self.downloaded_pkgs + 1, self.total_pkgs, name, pct) ) # but we want machine friendly output when spawned from abrt-server else: - print (_("Downloading (%i of %i) %s: %.3s %%") + print (_("Downloading (%i of %i) %s: %3u%%") % (self.downloaded_pkgs + 1, self.total_pkgs, name, pct) ) diff --git a/src/plugins/abrt-action-upload.c b/src/plugins/abrt-action-upload.c index b19f5bfb..6f9c5fab 100644 --- a/src/plugins/abrt-action-upload.c +++ b/src/plugins/abrt-action-upload.c @@ -128,7 +128,7 @@ static int create_and_upload_archive( /* Create a child gzip which will compress the data */ /* SELinux guys are not happy with /tmp, using /var/run/abrt */ - tempfile = xasprintf(LOCALSTATEDIR"/run/abrt/tmp-%lu-%lu.tar.gz", (long)getpid(), (long)time(NULL)); + tempfile = xasprintf(LOCALSTATEDIR"/run/abrt/upload-%lu-%lu.tar.gz", (long)getpid(), (long)time(NULL)); int pipe_from_parent_to_child[2]; xpipe(pipe_from_parent_to_child); child = fork(); |