Em Seg, 2007-02-05 às 03:26 -0800, Steve Langasek escreveu: > On Fri, Feb 02, 2007 at 04:14:31PM -0200, Goedson Teixeira Paixao wrote: > > > I've upload gnotime 2.2.2-10 to sid a few days ago with the intention of > > getting it into Etch. I've now realised it won't be possible to migrate > > it into Etch through Sid because one of its dependencies (libqof1) is a > > newer upstream version in Sid. So I'm here asking permission to upload a > > rebuild of this revision against Etch libraries into > > testing-proposed-updates so that it can be released with Etch. > > Why is the newer upstream version of libqof1 a problem? There apparently > wasn't a shlibs bump, because britney doesn't report libqof1 as a blocker > for gnotime in unstable -- which means either there are no ABI changes in > that new upstream version, or libqof1 has an unfiled RC bug. Looking closer at the issue now, I see it is not a problem. I thought the dependency on libqof1 would be versioned, but it is not. So I ask you to hint gnotime into Etch. > Separately, the changes to src/app.c seem pretty large, and I'm not sure I'm > comfortable including such an update; it looks to me like a rather large > diff for the fix described. The large size of the diff is, in part, due to differences in the indentation of lines. Attached you'll find a diff file that contains the real patch. OK. It's still large, so let me explain why it is so. The status bar of the application was built using two GtkStatusbar widgets, one for the "total time worked today" and one for the current project. The problem is GtkStatusBar won't ask for more space when it needs, truncating the text if it doesn't fit in its current width. My options were: 1 - Keep the GtkStatusbar and use Pango to calculate their width each time the text or font width changes; or 2 - substitute GtkStatusbars by GtkLabels, which already do the needed calculations and sets its width accordingly. I've opted for the second option because it would make status bar updating code a lot simpler. As for you not feeling comfortable introducing such an update, I'd like to note that I and some of my co-workers are using this version of the code daily since a little before the upload to Sid. So it's already more than one month running with no known issues originating from this change. Best regards, -- Goedson Teixeira Paixao http://mundolivre.wordpress.com/ Debian Project http://www.debian.org/ Jabber ID: goedson@jabber.org http://www.jabber.org/
--- ../gnotime-2.2.2/src/app.c 2007-02-06 11:03:53.000000000 -0200 +++ src/app.c 2007-02-06 11:36:20.000000000 -0200 @@ -57,8 +57,8 @@ GtkWidget *app_window = NULL; GtkWidget *status_bar = NULL; -static GtkStatusbar *status_project = NULL; -static GtkStatusbar *status_day_time = NULL; +static GtkLabel *status_project = NULL; +static GtkLabel *status_day_time = NULL; static GtkWidget *status_timer = NULL; char *config_shell_start = NULL; @@ -76,8 +76,6 @@ update_status_bar(void) { char day_total_str[25]; - static char *old_day_time = NULL; - static char *old_project = NULL; char *s; if (!status_bar) return; @@ -92,29 +90,15 @@ gtk_widget_hide(status_timer); } - if (!old_day_time) old_day_time = g_strdup(""); - if (!old_project) old_project = g_strdup(""); - /* update timestamp */ qof_print_hours_elapsed_buff (day_total_str, 25, gtt_project_list_total_secs_day(), config_show_secs); - s = g_strdup(day_total_str); - if (0 != strcmp(s, old_day_time)) - { - // fprintf(stderr, "before %s\n", s); - gtk_statusbar_pop(status_day_time, 0); - gtk_statusbar_push(status_day_time, 0, s); - // fprintf(stderr, "after %s\n", s); - g_free(old_day_time); - // fprintf(stderr, "after gfree %s\n", s); - old_day_time = s; - } - else - { - g_free(s); - } - + if (0 != strcmp(day_total_str, gtk_label_get_text(status_day_time))) + { + gtk_label_set_text(status_day_time, day_total_str); + } + /* Display the project title */ if (cur_proj) { @@ -127,21 +111,11 @@ s = g_strdup(_("Timer is not running")); } - if (0 != strcmp(s, old_project)) + if (0 != strcmp(s, gtk_label_get_text(status_project))) { - - // fprintf(stderr, "before %s\n", s); - gtk_statusbar_pop(status_project, 0); - gtk_statusbar_push(status_project, 0, s); - // fprintf(stderr, "after %s\n", s); - g_free(old_project); - // fprintf(stderr, "after g_free %s\n", s); - old_project = s; - } - else - { - g_free(s); + gtk_label_set_text(status_project, s); } + g_free(s); } @@ -275,6 +249,11 @@ GtkWidget *vbox; GtkWidget *widget; GtkWidget *vpane; + GtkWidget *separator; + GtkLabel *filler; + GtkHBox *labels; + GtkVBox *status_vbox; + GtkStatusbar *grip; app_window = gnome_app_new(GTT_APP_NAME, GTT_APP_TITLE " " VERSION); gtk_window_set_wmclass(GTK_WINDOW(app_window), @@ -296,32 +275,44 @@ vbox = gtk_vbox_new(FALSE, 0); /* build statusbar */ + + status_vbox = GTK_VBOX(gtk_vbox_new(FALSE, 0)); + gtk_widget_show(GTK_WIDGET(status_vbox)); + + labels = GTK_HBOX(gtk_hbox_new(FALSE, 0)); + gtk_widget_show(GTK_WIDGET(labels)); + status_bar = gtk_hbox_new(FALSE, 0); - gtk_box_set_homogeneous (GTK_BOX(status_bar), FALSE); gtk_widget_show(status_bar); - gtk_box_pack_end(GTK_BOX(vbox), status_bar, FALSE, FALSE, 2); + separator = gtk_hseparator_new(); + gtk_widget_show(separator); + gtk_box_pack_start(GTK_BOX(status_vbox), separator, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(status_vbox), labels, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(status_bar), status_vbox, TRUE, TRUE, 0); + + grip = GTK_STATUSBAR(gtk_statusbar_new()); + gtk_statusbar_set_has_resize_grip(grip, TRUE); + gtk_widget_show(GTK_WIDGET(grip)); + gtk_box_pack_start(GTK_BOX(status_bar), GTK_WIDGET(grip), FALSE, FALSE, 0); + /* put elapsed time into statusbar */ - status_day_time = GTK_STATUSBAR(gtk_statusbar_new()); - gtk_statusbar_set_has_resize_grip (status_day_time, FALSE); + status_day_time = GTK_LABEL(gtk_label_new(_("00:00"))); gtk_widget_show(GTK_WIDGET(status_day_time)); - gtk_statusbar_push(status_day_time, 0, _("00:00")); - /* XXX hack alert: the timer box is not being correctly sized; - * I suspect this is either a gtk bug or a usage bug. - * So instead I set the width to 50 pixels, and hope the - * font size can live with this. */ - gtk_widget_set_size_request (GTK_WIDGET(status_day_time), 50, -1); - gtk_box_pack_start(GTK_BOX(status_bar), GTK_WIDGET(status_day_time), - FALSE, TRUE, 1); + gtk_box_pack_start(GTK_BOX(labels), GTK_WIDGET(status_day_time), + FALSE, TRUE, 0); /* put project name into statusbar */ - status_project = GTK_STATUSBAR(gtk_statusbar_new()); + status_project = GTK_LABEL(gtk_label_new( _("Timer is not running"))); gtk_widget_show(GTK_WIDGET(status_project)); - gtk_statusbar_push(status_project, 0, _("Timer is not running")); - gtk_box_pack_start(GTK_BOX(status_bar), GTK_WIDGET(status_project), - TRUE, TRUE, 1); + gtk_box_pack_start(GTK_BOX(labels), GTK_WIDGET(status_project), + FALSE, TRUE, 10); + + filler = GTK_LABEL(gtk_label_new("")); + gtk_widget_show(GTK_WIDGET(filler)); + gtk_box_pack_start(GTK_BOX(labels), GTK_WIDGET(filler), TRUE, TRUE, 1); /* put timer icon into statusbar */ status_timer = gtk_image_new_from_stock (GNOME_STOCK_TIMER, @@ -344,10 +335,11 @@ */ gtk_widget_ref (vpane); gtk_container_remove(GTK_CONTAINER(vpane->parent), vpane); - // gtk_box_pack_end(GTK_BOX(vbox), vpane, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), vpane, TRUE, TRUE, 0); gtk_widget_unref (vpane); + gtk_box_pack_end(GTK_BOX(vbox), status_bar, FALSE, FALSE, 2); + notes_area_add_ctree (global_na, ctree);
Attachment:
signature.asc
Description: Esta =?ISO-8859-1?Q?=E9?= uma parte de mensagem assinada digitalmente