Hello community, here is the log from the commit of package xfce4-panel-plugin-battery for openSUSE:Factory checked in at 2012-05-15 17:42:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xfce4-panel-plugin-battery (Old) and /work/SRC/openSUSE:Factory/.xfce4-panel-plugin-battery.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xfce4-panel-plugin-battery", Maintainer is "xfce-maintain...@suse.de" Changes: -------- --- /work/SRC/openSUSE:Factory/xfce4-panel-plugin-battery/xfce4-panel-plugin-battery.changes 2012-05-08 06:50:34.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.xfce4-panel-plugin-battery.new/xfce4-panel-plugin-battery.changes 2012-05-15 17:43:00.000000000 +0200 @@ -1,0 +2,6 @@ +Mon May 14 11:09:36 UTC 2012 - g...@opensuse.org + +- update to version 1.0.4 + - improve the plugin UI in vertical/deskbar/multirows panels + +------------------------------------------------------------------- Old: ---- xfce4-battery-plugin-1.0.2.tar.bz2 New: ---- xfce4-battery-plugin-1.0.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xfce4-panel-plugin-battery.spec ++++++ --- /var/tmp/diff_new_pack.VR3SSR/_old 2012-05-15 17:43:01.000000000 +0200 +++ /var/tmp/diff_new_pack.VR3SSR/_new 2012-05-15 17:43:01.000000000 +0200 @@ -20,7 +20,7 @@ %define plugin_name xfce4-battery-plugin Name: xfce4-panel-plugin-battery -Version: 1.0.2 +Version: 1.0.4 Release: 0 Summary: Battery Monitoring Plugin for the Xfce Panel License: GPL-2.0+ ++++++ xfce4-battery-plugin-1.0.2.tar.bz2 -> xfce4-battery-plugin-1.0.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xfce4-battery-plugin-1.0.2/ChangeLog new/xfce4-battery-plugin-1.0.4/ChangeLog --- old/xfce4-battery-plugin-1.0.2/ChangeLog 2012-04-30 14:24:21.000000000 +0200 +++ new/xfce4-battery-plugin-1.0.4/ChangeLog 2012-05-14 10:35:56.000000000 +0200 @@ -1,3 +1,92 @@ +commit 70b70cdcf267790466064040c523caf04843a778 +Author: Landry Breuil <lan...@xfce.org> +Date: Mon May 14 10:34:29 2012 +0200 + + updates for 1.0.4 + +commit 81909487e1a0a373c2e0d4d3cbccd657a20ba29f +Author: Landry Breuil <lan...@xfce.org> +Date: Mon May 14 10:33:40 2012 +0200 + + fix compilation with panel version < 4.9 + +commit afacc7dae5d01983b8d8ef6df0e7c64f9d3c5194 +Author: Landry Breuil <lan...@xfce.org> +Date: Sun May 13 21:31:21 2012 +0200 + + updates for 1.0.3 + +commit 539a0e314c88cbec3f5e29408ce9da5474b140fb +Author: Landry Breuil <lan...@xfce.org> +Date: Sun May 13 21:27:01 2012 +0200 + + Readd 2px padding so labels are not 'stuck' on the progressbar + +commit 96d431ce25378cb86f73160298fdd8e4ff414236 +Author: Landry Breuil <lan...@xfce.org> +Date: Tue May 8 17:54:31 2012 +0200 + + switch from deprecated GtkTooltips api to GtkTooltip + +commit 71cd9bccc67f5e68ca40fcac2ec0987c05132b87 +Author: Landry Breuil <lan...@xfce.org> +Date: Tue May 8 17:44:44 2012 +0200 + + Revert partially to previous layout for deskbar mode + + - set ebox orientation matching panel orientation + - set horizontal progressbar when the panel is vertical + + still being worked on.. + +commit 10dd7053297faf08d80148defbd5b7fee685b3f8 +Author: Landry Breuil <lan...@xfce.org> +Date: Tue May 8 16:49:35 2012 +0200 + + Rework panel widgets layout to use hvbox instead of loads of boxes + + - drop the eventbox in favor of a global hvbox + - use a pair of hvboxs for labels, with an orientation opposite to the plugin orientation + - drop alt_rtime, you should only display what fits anyway + - rework mode/orientation callbacks to properly update hvboxs orientation (instead of destroying/recreating everything) + +commit b0bf17837ff694d4730a2be19469cd4cff5ddf07 +Author: Landry Breuil <lan...@xfce.org> +Date: Tue May 8 11:55:00 2012 +0200 + + Set small property to TRUE so that the plugin fits in a single row. + +commit 36a61af2e48f63bdb2262fce932e96286dc0a6a3 +Merge: f71d4ed 54ce072 +Author: Landry Breuil <lan...@xfce.org> +Date: Tue May 8 10:49:33 2012 +0200 + + Merge branch 'master' of git://git.xfce.org/panel-plugins/xfce4-battery-plugin + +commit f71d4edac65ee2e4cb9a8a02ad4577c38c8163da +Author: Andrzej <ndrwr...@gmail.com> +Date: Mon May 7 11:19:54 2012 +0900 + + More panel 4.10 compatibility fixes + + Signed-off-by: Landry Breuil <lan...@xfce.org> + +commit 54ce07219521cbf4acbac0548a6a062fcb2a0d00 +Author: Mario Blättermann <mario.blaetterm...@gmail.com> +Date: Mon May 7 00:09:16 2012 +0200 + + l10n: Updated German (de) translation to 100% + + New status: 43 messages complete with 0 fuzzies and 0 untranslated. + + Transmitted-via: Transifex (translations.xfce.org). + +commit 681140ee84f2c0d7faf78d9795ee78027541bf7b +Author: Landry Breuil <lan...@xfce.org> +Date: Mon Apr 30 14:28:34 2012 +0200 + + updates for 1.0.2 + commit 07b05dbe7ed32ecdca75bbe059d03c5465f1443d Author: Jeff Bailes <thepizzak...@gmail.com> Date: Sat Apr 28 01:50:50 2012 +0200 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xfce4-battery-plugin-1.0.2/NEWS new/xfce4-battery-plugin-1.0.4/NEWS --- old/xfce4-battery-plugin-1.0.2/NEWS 2012-04-30 14:11:55.000000000 +0200 +++ new/xfce4-battery-plugin-1.0.4/NEWS 2012-05-14 10:34:09.000000000 +0200 @@ -1,3 +1,10 @@ +1.0.4 (2012/05/14): +=================== +* Fix compilation with panel version < 4.9 +1.0.3 (2012/05/13): +=================== +* Improve plugin UI in vertical/deskbar/multirows panels + 1.0.2 (2012/04/30): =================== * change icon depending on charge level/ac status (bug #7768) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xfce4-battery-plugin-1.0.2/configure new/xfce4-battery-plugin-1.0.4/configure --- old/xfce4-battery-plugin-1.0.2/configure 2012-04-30 14:23:51.000000000 +0200 +++ new/xfce4-battery-plugin-1.0.4/configure 2012-05-14 10:35:24.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for xfce4-battery-plugin 1.0.2. +# Generated by GNU Autoconf 2.61 for xfce4-battery-plugin 1.0.4. # # Report bugs to <http://bugzilla.xfce.org/>. # @@ -597,8 +597,8 @@ # Identity of this package. PACKAGE_NAME='xfce4-battery-plugin' PACKAGE_TARNAME='xfce4-battery-plugin' -PACKAGE_VERSION='1.0.2' -PACKAGE_STRING='xfce4-battery-plugin 1.0.2' +PACKAGE_VERSION='1.0.4' +PACKAGE_STRING='xfce4-battery-plugin 1.0.4' PACKAGE_BUGREPORT='http://bugzilla.xfce.org/' # Factoring default headers for most tests. @@ -1334,7 +1334,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xfce4-battery-plugin 1.0.2 to adapt to many kinds of systems. +\`configure' configures xfce4-battery-plugin 1.0.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1405,7 +1405,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xfce4-battery-plugin 1.0.2:";; + short | recursive ) echo "Configuration of xfce4-battery-plugin 1.0.4:";; esac cat <<\_ACEOF @@ -1513,7 +1513,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xfce4-battery-plugin configure 1.0.2 +xfce4-battery-plugin configure 1.0.4 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1530,7 +1530,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xfce4-battery-plugin $as_me 1.0.2, which was +It was created by xfce4-battery-plugin $as_me 1.0.4, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2283,7 +2283,7 @@ # Define the identity of the package. PACKAGE='xfce4-battery-plugin' - VERSION='1.0.2' + VERSION='1.0.4' cat >>confdefs.h <<_ACEOF @@ -16181,7 +16181,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xfce4-battery-plugin $as_me 1.0.2, which was +This file was extended by xfce4-battery-plugin $as_me 1.0.4, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16234,7 +16234,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -xfce4-battery-plugin config.status 1.0.2 +xfce4-battery-plugin config.status 1.0.4 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xfce4-battery-plugin-1.0.2/configure.ac new/xfce4-battery-plugin-1.0.4/configure.ac --- old/xfce4-battery-plugin-1.0.2/configure.ac 2012-04-30 14:23:15.000000000 +0200 +++ new/xfce4-battery-plugin-1.0.4/configure.ac 2012-05-14 10:34:47.000000000 +0200 @@ -16,8 +16,8 @@ dnl *************************** m4_define([battery_version_major], [1]) m4_define([battery_version_minor], [0]) -m4_define([battery_version_micro], [2]) -m4_define([battery_version_build], [r07b05db]) +m4_define([battery_version_micro], [4]) +m4_define([battery_version_build], [r70b70cd]) m4_define([battery_version_tag], []) m4_define([battery_version], [battery_version_major().battery_version_minor().battery_version_micro()ifelse(battery_version_tag(), [svn], [battery_version_tag()-battery_version_build()], [battery_version_tag()])]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xfce4-battery-plugin-1.0.2/panel-plugin/battery.c new/xfce4-battery-plugin-1.0.4/panel-plugin/battery.c --- old/xfce4-battery-plugin-1.0.2/panel-plugin/battery.c 2012-04-24 10:23:51.000000000 +0200 +++ new/xfce4-battery-plugin-1.0.4/panel-plugin/battery.c 2012-05-14 10:33:22.000000000 +0200 @@ -62,6 +62,12 @@ #define AVERAGING_CYCLE 5 #define PLUGIN_WEBSITE "http://goodies.xfce.org/projects/panel-plugins/xfce4-battery-plugin" +#ifdef LIBXFCE4PANEL_CHECK_VERSION +#if LIBXFCE4PANEL_CHECK_VERSION (4,9,0) +#define HAS_PANEL_49 +#endif +#endif + typedef struct { gboolean display_label; /* Options */ @@ -88,9 +94,7 @@ { XfcePanelPlugin *plugin; - GtkTooltips *tips; - GtkWidget *vbox; /* Widgets */ - GtkWidget *ebox; + GtkWidget *ebox, *timechargebox, *actempbox; GtkWidget *battstatus; int timeoutid; /* To update apm status */ int method; @@ -101,7 +105,6 @@ GtkLabel *label; GtkLabel *charge; GtkLabel *rtime; - GtkLabel *alt_rtime; GtkLabel *acfan; GtkLabel *temp; GtkWidget *image; @@ -140,6 +143,8 @@ enum {BM_BROKEN, BM_USE_ACPI, BM_USE_APM}; enum {BM_MISSING, BM_CRITICAL, BM_CRITICAL_CHARGING, BM_LOW, BM_LOW_CHARGING, BM_OK, BM_OK_CHARGING, BM_FULL, BM_FULL_CHARGING}; +static gboolean battmon_set_size(XfcePanelPlugin *plugin, int size, t_battmon *battmon); + static void init_options(t_battmon_options *options) { @@ -265,25 +270,6 @@ } static gboolean -battmon_time_labels_fits(t_battmon *battmon) -{ - int plugin_size, labels_size; - - GtkRequisition widget_size; - gtk_widget_size_request( GTK_WIDGET(battmon->plugin), &widget_size ); - plugin_size = widget_size.height; - - labels_size = 0; - gtk_widget_size_request( GTK_WIDGET(battmon->charge), &widget_size ); - labels_size += widget_size.height; - gtk_widget_size_request( GTK_WIDGET(battmon->rtime), &widget_size ); - labels_size += widget_size.height; - DBG("label_fits() : labels_size = %d, plugin_size = %d", labels_size, plugin_size); - - return labels_size <= plugin_size; -} - -static gboolean update_apm_status(t_battmon *battmon) { int charge=0, rate; @@ -529,22 +515,12 @@ } if (battmon->options.display_time && time_remaining > 0 && !(battmon->options.hide_when_full && acline && charge >= 99 )){ - GtkLabel *active_label; - if ( battmon_time_labels_fits( battmon ) ) { - active_label = battmon->rtime; - gtk_widget_hide(GTK_WIDGET(battmon->alt_rtime)); - } else { - active_label = battmon->alt_rtime; - gtk_widget_hide(GTK_WIDGET(battmon->rtime)); - } - - gtk_widget_show(GTK_WIDGET(active_label)); + gtk_widget_show(GTK_WIDGET(battmon->rtime)); g_snprintf(buffer, sizeof(buffer),"%02d:%02d ",time_remaining/60,time_remaining%60); - gtk_label_set_text(active_label,buffer); + gtk_label_set_text(battmon->rtime,buffer); } else { gtk_widget_hide(GTK_WIDGET(battmon->rtime)); - gtk_widget_hide(GTK_WIDGET(battmon->alt_rtime)); } @@ -572,7 +548,7 @@ g_snprintf(buffer, sizeof(buffer), _("AC off-line")); } - gtk_tooltips_set_tip (battmon->tips, battmon->ebox, buffer, NULL); + gtk_widget_set_tooltip_text(GTK_WIDGET(battmon->ebox), buffer); if(battmon->options.display_power){ gtk_widget_show(GTK_WIDGET(battmon->acfan)); @@ -673,125 +649,64 @@ return TRUE; } -static void setup_battmon(t_battmon *battmon, - GtkOrientation orientation, - GtkOrientation panel_orientation) +static void setup_battmon(t_battmon *battmon) { - GtkWidget *box,*vbox; + GtkWidget *alignment; GdkPixbuf *icon; gint size; size = xfce_panel_plugin_get_size (battmon->plugin); - battmon->battstatus = gtk_progress_bar_new(); +#ifdef HAS_PANEL_49 + size /= xfce_panel_plugin_get_nrows (battmon->plugin); +#endif - if (panel_orientation == GTK_ORIENTATION_HORIZONTAL) - { - gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(battmon->battstatus), - GTK_PROGRESS_BOTTOM_TO_TOP); - gtk_widget_set_size_request(GTK_WIDGET(battmon->battstatus), - BORDER, size); - box=gtk_hbox_new(FALSE, 0); - battmon->vbox = gtk_hbox_new(FALSE, 0); - gtk_widget_set_size_request(GTK_WIDGET(battmon->plugin), - -1, size); - } else { - gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(battmon->battstatus), - GTK_PROGRESS_LEFT_TO_RIGHT); - gtk_widget_set_size_request(GTK_WIDGET(battmon->battstatus), - size, BORDER); - box=gtk_vbox_new(FALSE, 0); - battmon->vbox = gtk_vbox_new(FALSE, 0); - gtk_widget_set_size_request(GTK_WIDGET(battmon->plugin), - size, -1); - } + battmon->ebox = xfce_hvbox_new(xfce_panel_plugin_get_orientation(battmon->plugin), FALSE, 0); - gtk_container_set_border_width(GTK_CONTAINER(battmon->vbox), BORDER / 2); + battmon->battstatus = gtk_progress_bar_new(); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(battmon->battstatus), 0.0); battmon->label = (GtkLabel *)gtk_label_new(_("Battery")); - gtk_box_pack_start(GTK_BOX(box),GTK_WIDGET(battmon->label),FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(battmon->ebox),GTK_WIDGET(battmon->label),FALSE, FALSE, 0); battmon->image = xfce_panel_image_new_from_source("xfce4-battery-plugin"); xfce_panel_image_set_size(XFCE_PANEL_IMAGE(battmon->image), size); - gtk_box_pack_start(GTK_BOX(box),GTK_WIDGET(battmon->image), FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(battmon->ebox),GTK_WIDGET(battmon->image), FALSE, FALSE, 0); /* init hide the widget */ gtk_widget_hide(battmon->image); - gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(battmon->battstatus), FALSE, FALSE, 0); - - if (orientation == GTK_ORIENTATION_HORIZONTAL) - vbox = gtk_vbox_new(FALSE, 0); - else - vbox = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(battmon->ebox),GTK_WIDGET(battmon->battstatus), FALSE, FALSE, 0); /* percent + rtime */ - gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(vbox), FALSE, FALSE, 0); + /* create the label hvbox with an orientation opposite to the panel */ + battmon->timechargebox = xfce_hvbox_new(!xfce_panel_plugin_get_orientation(battmon->plugin), FALSE, 0); + + alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); + gtk_container_add (GTK_CONTAINER(alignment), battmon->timechargebox); + gtk_box_pack_start(GTK_BOX(battmon->ebox), alignment, FALSE, FALSE, 0); battmon->charge = (GtkLabel *)gtk_label_new("50%%"); - if (orientation == GTK_ORIENTATION_HORIZONTAL) - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(battmon->charge),TRUE, TRUE, 0); - else - gtk_box_pack_end(GTK_BOX(vbox),GTK_WIDGET(battmon->charge),TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(battmon->timechargebox),GTK_WIDGET(battmon->charge),TRUE, TRUE, 2); battmon->rtime = (GtkLabel *)gtk_label_new("01:00"); - if (orientation == GTK_ORIENTATION_HORIZONTAL) - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(battmon->rtime),TRUE, TRUE, 0); - else - gtk_box_pack_end(GTK_BOX(vbox),GTK_WIDGET(battmon->rtime),TRUE, TRUE, 0); - - if (orientation == GTK_ORIENTATION_HORIZONTAL) - vbox = gtk_vbox_new(FALSE, 0); - else - vbox = gtk_hbox_new(FALSE, 0); - - gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(vbox), FALSE, FALSE, 0); - - battmon->alt_rtime = (GtkLabel *)gtk_label_new("01:00"); - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(battmon->alt_rtime),TRUE, TRUE, 0); - - if (orientation == GTK_ORIENTATION_HORIZONTAL) - vbox = gtk_vbox_new(FALSE, 0); - else - vbox = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(battmon->timechargebox),GTK_WIDGET(battmon->rtime),TRUE, TRUE, 2); /* ac-fan-temp */ - gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(vbox), FALSE, FALSE, 0); + /* create the label hvbox with an orientation opposite to the panel */ + battmon->actempbox = xfce_hvbox_new(!xfce_panel_plugin_get_orientation(battmon->plugin), FALSE, 0); + + alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); + gtk_container_add (GTK_CONTAINER(alignment), battmon->actempbox); + gtk_box_pack_start(GTK_BOX(battmon->ebox), alignment, FALSE, FALSE, 0); battmon->acfan = (GtkLabel *)gtk_label_new("AC FAN"); - if (orientation == GTK_ORIENTATION_HORIZONTAL) - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(battmon->acfan),TRUE, TRUE, 0); - else - gtk_box_pack_end(GTK_BOX(vbox),GTK_WIDGET(battmon->acfan),TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(battmon->actempbox),GTK_WIDGET(battmon->acfan),TRUE, TRUE, 0); - battmon->temp = (GtkLabel *)gtk_label_new("40°C"); - if (orientation == GTK_ORIENTATION_HORIZONTAL) - gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(battmon->temp),TRUE, TRUE, 0); - else - gtk_box_pack_end(GTK_BOX(vbox),GTK_WIDGET(battmon->temp),TRUE, TRUE, 0); + battmon->temp = (GtkLabel *)gtk_label_new("40°C"); + gtk_box_pack_start(GTK_BOX(battmon->actempbox),GTK_WIDGET(battmon->temp),TRUE, TRUE, 0); - if (orientation == GTK_ORIENTATION_HORIZONTAL) - { - gtk_label_set_angle(GTK_LABEL(battmon->label), 0); - gtk_label_set_angle(GTK_LABEL(battmon->charge), 0); - gtk_label_set_angle(GTK_LABEL(battmon->rtime), 0); - gtk_label_set_angle(GTK_LABEL(battmon->alt_rtime), 0); - gtk_label_set_angle(GTK_LABEL(battmon->acfan), 0); - gtk_label_set_angle(GTK_LABEL(battmon->temp), 0); - } - else - { - gtk_label_set_angle(GTK_LABEL(battmon->label), 270); - gtk_label_set_angle(GTK_LABEL(battmon->charge), 270); - gtk_label_set_angle(GTK_LABEL(battmon->rtime), 270); - gtk_label_set_angle(GTK_LABEL(battmon->alt_rtime), 270); - gtk_label_set_angle(GTK_LABEL(battmon->acfan), 270); - gtk_label_set_angle(GTK_LABEL(battmon->temp), 270); - } - - gtk_box_pack_start(GTK_BOX(battmon->vbox), box, FALSE, FALSE, 0); - gtk_widget_show_all(battmon->vbox); + gtk_widget_show_all(battmon->ebox); if(!battmon->options.display_bar) gtk_widget_hide(GTK_WIDGET(battmon->battstatus)); if(!battmon->options.display_label) @@ -805,16 +720,8 @@ } if (!battmon->options.display_time){ gtk_widget_hide(GTK_WIDGET(battmon->rtime)); - gtk_widget_hide(GTK_WIDGET(battmon->alt_rtime)); - } else { - if ( battmon_time_labels_fits(battmon) ) { - gtk_widget_hide(GTK_WIDGET(battmon->alt_rtime)); - } else { - gtk_widget_hide(GTK_WIDGET(battmon->rtime)); - } } - gtk_container_add(GTK_CONTAINER(battmon->ebox),GTK_WIDGET(battmon->vbox)); gtk_widget_show(battmon->ebox); battmon->battstatus_style = gtk_widget_get_modifier_style(battmon->battstatus); @@ -831,24 +738,39 @@ gtk_widget_set_size_request(battmon->ebox, -1, -1); } -#if defined (LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION (4,9,0) +static void +battmon_set_labels_orientation(t_battmon *battmon, GtkOrientation orientation) +{ + gint angle = (orientation == GTK_ORIENTATION_HORIZONTAL ? 0 : 270); + gtk_label_set_angle(GTK_LABEL(battmon->label), angle); + gtk_label_set_angle(GTK_LABEL(battmon->charge), angle); + gtk_label_set_angle(GTK_LABEL(battmon->rtime), angle); + gtk_label_set_angle(GTK_LABEL(battmon->acfan), angle); + gtk_label_set_angle(GTK_LABEL(battmon->temp), angle); +} + +#ifdef HAS_PANEL_49 static gboolean battmon_set_mode (XfcePanelPlugin *plugin, XfcePanelPluginMode mode, t_battmon *battmon) { - GtkOrientation orientation, panel_orientation; + GtkOrientation orientation; + DBG("set_mode(%d)", mode); if (battmon->timeoutid) g_source_remove(battmon->timeoutid); - gtk_container_remove(GTK_CONTAINER(battmon->ebox), GTK_WIDGET(battmon->vbox)); orientation = (mode != XFCE_PANEL_PLUGIN_MODE_VERTICAL) ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL; - panel_orientation = - (mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL) ? - GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL; - setup_battmon(battmon,orientation,panel_orientation); + xfce_hvbox_set_orientation(XFCE_HVBOX(battmon->ebox), xfce_panel_plugin_get_orientation(plugin)); + xfce_hvbox_set_orientation(XFCE_HVBOX(battmon->timechargebox), !orientation); + xfce_hvbox_set_orientation(XFCE_HVBOX(battmon->actempbox), !orientation); + gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(battmon->battstatus), + (xfce_panel_plugin_get_orientation(plugin) == GTK_ORIENTATION_HORIZONTAL ? GTK_PROGRESS_BOTTOM_TO_TOP : GTK_PROGRESS_LEFT_TO_RIGHT)); + battmon_set_labels_orientation(battmon, orientation); + battmon_set_size(plugin, xfce_panel_plugin_get_size (plugin), battmon); update_apm_status( battmon ); battmon->timeoutid = g_timeout_add(1 * 1024, (GSourceFunc) update_apm_status, battmon); + xfce_panel_plugin_set_small (plugin, (mode != XFCE_PANEL_PLUGIN_MODE_DESKBAR)); return TRUE; } @@ -859,9 +781,15 @@ battmon_set_orientation (XfcePanelPlugin *plugin, GtkOrientation orientation, t_battmon *battmon) { + DBG("set_orientation(%d)", orientation); if (battmon->timeoutid) g_source_remove(battmon->timeoutid); - gtk_container_remove(GTK_CONTAINER(battmon->ebox), GTK_WIDGET(battmon->vbox)); - setup_battmon(battmon,GTK_ORIENTATION_HORIZONTAL,orientation); + xfce_hvbox_set_orientation(XFCE_HVBOX(battmon->ebox), orientation); + xfce_hvbox_set_orientation(XFCE_HVBOX(battmon->timechargebox), !orientation); + xfce_hvbox_set_orientation(XFCE_HVBOX(battmon->actempbox), !orientation); + gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(battmon->battstatus), + (orientation == GTK_ORIENTATION_HORIZONTAL ? GTK_PROGRESS_BOTTOM_TO_TOP : GTK_PROGRESS_LEFT_TO_RIGHT)); + battmon_set_labels_orientation(battmon, orientation); + battmon_set_size(plugin, xfce_panel_plugin_get_size (plugin), battmon); update_apm_status( battmon ); battmon->timeoutid = g_timeout_add(1 * 1024, (GSourceFunc) update_apm_status, battmon); @@ -873,40 +801,19 @@ battmon_create(XfcePanelPlugin *plugin) { t_battmon *battmon; - GtkOrientation panel_orientation; -#if defined (LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION (4,9,0) - GtkOrientation orientation; - XfcePanelPluginMode mode; -#endif battmon = g_new(t_battmon, 1); init_options(&(battmon->options)); - battmon->plugin = plugin; + battmon->plugin = plugin; battmon->low = FALSE; battmon->critical = FALSE; - battmon->ebox = gtk_event_box_new(); - gtk_event_box_set_visible_window(GTK_EVENT_BOX(battmon->ebox), FALSE); -#if defined (LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION (4,9,0) - mode = xfce_panel_plugin_get_mode (plugin); - orientation = - (mode != XFCE_PANEL_PLUGIN_MODE_VERTICAL) ? - GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL; - panel_orientation = - (mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL) ? - GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL; -#else - panel_orientation = xfce_panel_plugin_get_orientation (plugin); -#endif - setup_battmon(battmon, GTK_ORIENTATION_HORIZONTAL, panel_orientation); + setup_battmon(battmon); battmon->timeoutid = 0; battmon->flag = FALSE; - battmon->tips = gtk_tooltips_new (); - g_object_ref (G_OBJECT (battmon->tips)); - gtk_object_sink (GTK_OBJECT (battmon->tips)); return battmon; } @@ -923,9 +830,6 @@ g_free (battmon->options.command_on_low); g_free (battmon->options.command_on_critical); - /* free tooltip */ - gtk_tooltips_set_tip (battmon->tips, battmon->ebox, NULL, NULL); - g_object_unref (G_OBJECT (battmon->tips)); gtk_rc_style_unref(battmon->battstatus_style); g_free(battmon); @@ -1070,10 +974,11 @@ static gboolean battmon_set_size(XfcePanelPlugin *plugin, int size, t_battmon *battmon) { - GdkPixbuf *icon; +#ifdef HAS_PANEL_49 + size /= xfce_panel_plugin_get_nrows (battmon->plugin); +#endif DBG("set_size(%d)", size); - if (xfce_panel_plugin_get_orientation (plugin) == - GTK_ORIENTATION_HORIZONTAL) + if (xfce_panel_plugin_get_orientation(plugin) == GTK_ORIENTATION_HORIZONTAL) { /* force size of the panel plugin */ gtk_widget_set_size_request(GTK_WIDGET(battmon->plugin), @@ -1092,6 +997,7 @@ size, BORDER); } + gtk_container_set_border_width (GTK_CONTAINER (battmon->ebox), (size > 26 ? 2 : 0)); /* update the icon */ xfce_panel_image_set_size(XFCE_PANEL_IMAGE(battmon->image), size); return TRUE; @@ -1740,8 +1646,9 @@ g_signal_connect (plugin, "size-changed", G_CALLBACK (battmon_set_size), battmon); -#if defined (LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION (4,9,0) +#ifdef HAS_PANEL_49 g_signal_connect (plugin, "mode-changed", G_CALLBACK (battmon_set_mode), battmon); + xfce_panel_plugin_set_small (plugin, TRUE); #else g_signal_connect (plugin, "orientation-changed", G_CALLBACK (battmon_set_orientation), battmon); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xfce4-battery-plugin-1.0.2/po/de.po new/xfce4-battery-plugin-1.0.4/po/de.po --- old/xfce4-battery-plugin-1.0.2/po/de.po 2012-04-29 22:10:49.000000000 +0200 +++ new/xfce4-battery-plugin-1.0.4/po/de.po 2012-05-08 10:49:33.000000000 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: xfce4-battery-plugin 0.5.1svn-r3672\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-04-25 12:45+0000\n" +"POT-Creation-Date: 2012-05-06 19:00+0000\n" "PO-Revision-Date: 2009-02-01 16:15+0100\n" "Last-Translator: Fabian Nowak <timyst...@arcor.de>\n" "Language-Team: German\n" @@ -101,17 +101,14 @@ msgstr "Bei Netzversorgung:" #: ../panel-plugin/battery.c:1461 -#, fuzzy msgid "Battery high:" msgstr "Akkuzustand hoch:" #: ../panel-plugin/battery.c:1478 -#, fuzzy msgid "Battery low:" msgstr "Akkuzustand niedrig:" #: ../panel-plugin/battery.c:1495 -#, fuzzy msgid "Battery critical:" msgstr "Akkuzustand kritisch:" -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org