[Xfce4-commits] xfce4-weather-plugin:master Summary window: Use gtk_widget_get_screen instead of gdk_window_get_screen.

2014-01-17 Thread Harald Judt
Updating branch refs/heads/master
 to 52581c4dae8671206c0ed065135d2117100c29b1 (commit)
   from 3f570c0ef4fcb335db13ec1e04f18936ab8122f2 (commit)

commit 52581c4dae8671206c0ed065135d2117100c29b1
Author: Harald Judt h.j...@gmx.at
Date:   Fri Jan 17 12:47:21 2014 +0100

Summary window: Use gtk_widget_get_screen instead of gdk_window_get_screen.

At the moment, we only require GDK-2.20, but gdk_widget_get_screen was
introduced in GDK-2.24. Fix this by using the GTK equivalent available
since GTK-2.2, it works fine too.

 panel-plugin/weather-summary.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index d8ab386..9236fad 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -987,7 +987,7 @@ create_forecast_tab(plugin_data *data)
  * maximum height we may use, subtracting some sane value just to
  * be on the safe side. */
 window = GDK_WINDOW(gtk_widget_get_window(GTK_WIDGET(data-iconimage)));
-screen = GDK_SCREEN(gdk_window_get_screen(window));
+screen = GDK_SCREEN(gtk_widget_get_screen(GTK_WIDGET(data-iconimage)));
 if (G_LIKELY(window  screen))
 monitor_num = gdk_screen_get_monitor_at_window(screen, window);
 gdk_screen_get_monitor_geometry(screen, monitor_num, rect);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Remove code dealing with laptop lid open/close (bug #10330).

2014-01-13 Thread Harald Judt
Updating branch refs/heads/master
 to a2e5010a08c014802157788a50c30ec97e271dba (commit)
   from e85183e08092e1f734b3873e0e000f20303a69b4 (commit)

commit a2e5010a08c014802157788a50c30ec97e271dba
Author: Harald Judt h.j...@gmx.at
Date:   Mon Jan 13 19:32:52 2014 +0100

Remove code dealing with laptop lid open/close (bug #10330).

Lesson learned: Treating lid open/close like on_battery events
is not a good idea in some cases. It is much better to simply
distinguish between on AC/battery instead of doing too much
aggressive powersaving.

 panel-plugin/weather-debug.c   |2 --
 panel-plugin/weather-summary.c |4 ++--
 panel-plugin/weather.c |   24 +---
 3 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/panel-plugin/weather-debug.c b/panel-plugin/weather-debug.c
index f15b239..30fec15 100644
--- a/panel-plugin/weather-debug.c
+++ b/panel-plugin/weather-debug.c
@@ -430,7 +430,6 @@ weather_dump_plugindata(const plugin_data *data)
  \n
 #ifdef HAVE_UPOWER_GLIB
  upower on battery: %s\n
- upower lid closed: %s\n
 #endif
  power saving: %s\n
  \n
@@ -474,7 +473,6 @@ weather_dump_plugindata(const plugin_data *data)
data-panel_orientation,
 #ifdef HAVE_UPOWER_GLIB
YESNO(data-upower_on_battery),
-   YESNO(data-upower_lid_closed),
 #endif
YESNO(data-power_saving),
last_astro_update,
diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index a40dfde..d8ab386 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -1087,7 +1087,7 @@ update_summary_subtitle(plugin_data *data)
 
 time(now_t);
 #ifdef HAVE_UPOWER_GLIB
-if (data-upower_on_battery || data-upower_lid_closed)
+if (data-upower_on_battery)
 date_format = %Y-%m-%d %H:%M %z (%Z);
 else
 #endif
@@ -1103,7 +1103,7 @@ update_summary_subtitle(plugin_data *data)
 g_get_current_time(now);
 now_ms = ((gint64) now.tv_sec * 1000) + ((gint64) now.tv_usec / 1000);
 #ifdef HAVE_UPOWER_GLIB
-if (data-upower_on_battery || data-upower_lid_closed)
+if (data-upower_on_battery)
 update_interval = 6 - (now_ms % 6) + 10;
 else
 #endif
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 7852da0..59b8dde 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -306,13 +306,6 @@ update_icon(plugin_data *data)
 void
 scrollbox_set_visible(plugin_data *data)
 {
-#ifdef HAVE_UPOWER_GLIB
-if (data-upower_lid_closed) {
-gtk_widget_hide_all(GTK_WIDGET(data-vbox_center_scrollbox));
-gtk_scrollbox_set_visible(GTK_SCROLLBOX(data-scrollbox), FALSE);
-return;
-}
-#endif
 if (data-show_scrollbox  data-labels-len  0)
 gtk_widget_show_all(GTK_WIDGET(data-vbox_center_scrollbox));
 else
@@ -1537,23 +1530,18 @@ static void
 upower_changed_cb(UpClient *client,
   plugin_data *data)
 {
-gboolean on_battery, lid_closed;
+gboolean on_battery;
 
 if (G_UNLIKELY(data-upower == NULL) || !data-power_saving)
 return;
 
 on_battery = data-upower_on_battery;
-lid_closed = data-upower_lid_closed;
-weather_debug(upower old status: on_battery=%d, lid_closed=%d,
-  on_battery, lid_closed);
+weather_debug(upower old status: on_battery=%d, on_battery);
 
 data-upower_on_battery = up_client_get_on_battery(client);
-data-upower_lid_closed = up_client_get_lid_is_closed(client);
-weather_debug(upower new status: on_battery=%d, lid_closed=%d,
-  data-upower_on_battery, data-upower_lid_closed);
+weather_debug(upower new status: on_battery=%d, data-upower_on_battery);
 
-if (data-upower_on_battery != on_battery ||
-data-upower_lid_closed != lid_closed) {
+if (data-upower_on_battery != on_battery) {
 if (data-summary_window)
 update_summary_subtitle(data);
 
@@ -1801,10 +1789,8 @@ xfceweather_create_control(XfcePanelPlugin *plugin)
 data-plugin = plugin;
 #ifdef HAVE_UPOWER_GLIB
 data-upower = up_client_new();
-if (data-upower) {
+if (data-upower)
 data-upower_on_battery = up_client_get_on_battery(data-upower);
-data-upower_lid_closed = up_client_get_lid_is_closed(data-upower);
-}
 #endif
 data-units = g_slice_new0(units_config);
 data-weatherdata = make_weather_data();
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Build system: Only generate bzip2 tarballs.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to 89961c0485b0352cc1caca31179e455d56da7373 (commit)
   from babc00b2be0f2b12767f59531a6b59bcfdf7c779 (commit)

commit 89961c0485b0352cc1caca31179e455d56da7373
Author: Harald Judt h.j...@gmx.at
Date:   Sun Jan 12 00:48:28 2014 +0100

Build system: Only generate bzip2 tarballs.

 configure.ac.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac.in b/configure.ac.in
index fb16b7c..6e5f204 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -26,7 +26,7 @@ AC_PREREQ([2.60])
 dnl ***
 dnl *** Initialize automake ***
 dnl ***
-AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar])
+AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip])
 AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE()
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Somewhat fix the update handling.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to 750bfb2208760eee55af064fc4f5758b2741e8e3 (commit)
   from 53b28e24869d9cbf11e7da97696ffd1119621f83 (commit)

commit 750bfb2208760eee55af064fc4f5758b2741e8e3
Author: Harald Judt h.j...@gmx.at
Date:   Fri May 17 22:07:43 2013 +0200

Somewhat fix the update handling.

The recent changes have broken the update code. To be honest, the current
way of dealing with updates is not very nice and probably calls for a
redesign.

This patch cleans up the mess a bit. While it (hopefully) fixes update
handling functionally, conceptually it leaves it broken. However, being
usable and with the changes that are planned for the near future in mind,
time is better spent working on a better solution that fulfills the new
requirements than trying too hard to fix it now.

 panel-plugin/weather.c |   49 +---
 1 file changed, 26 insertions(+), 23 deletions(-)

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 4d2dd11..2f0368b 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -376,19 +376,26 @@ update_scrollbox(plugin_data *data,
 }
 
 
-/* get the present day's astrodata */
+/* get astrodata for the current day */
 static void
 update_current_astrodata(plugin_data *data)
 {
 time_t now_t = time(NULL);
 
-if ((data-current_astro == NULL  data-astrodata) ||
-(data-current_astro 
- difftime(data-current_astro-day, now_t) = 24 * 3600)) {
-data-current_astro = get_astro_data_for_day(data-astrodata, 0);
-weather_debug(Updated astrodata for the present day.);
-weather_dump(weather_dump_astro, data-current_astro);
+if (G_UNLIKELY(data-astrodata == NULL)) {
+data-current_astro = NULL;
+return;
 }
+
+   if (data-current_astro == NULL ||
+   difftime(now_t, data-current_astro-day) = 24 * 3600) {
+   data-current_astro = get_astro_data_for_day(data-astrodata, 0);
+   if (G_UNLIKELY(data-current_astro == NULL))
+   return;
+
+   weather_debug(Updated current astrodata.);
+   weather_dump(weather_dump_astro, data-current_astro);
+   }
 }
 
 
@@ -422,20 +429,21 @@ update_current_conditions(plugin_data *data,
 make_current_conditions(data-weatherdata,
 data-conditions_update-last);
 
-/* update astrodata for the present day */
+/* update current astrodata */
 update_current_astrodata(data);
-
-/* schedule next update */
-now_tm.tm_min += 5;
-data-conditions_update-next = mktime(now_tm);
 data-night_time = is_night_time(data-current_astro);
-schedule_next_wakeup(data);
 
 /* update widgets */
 update_icon(data);
 update_scrollbox(data, FALSE);
 if (immediately)
 gtk_scrollbox_reset(GTK_SCROLLBOX(data-scrollbox));
+
+/* schedule next update */
+now_tm.tm_min += 5;
+data-conditions_update-next = mktime(now_tm);
+schedule_next_wakeup(data);
+
 weather_debug(Updated current conditions.);
 }
 
@@ -525,7 +533,6 @@ cb_astro_update(SoupSession *session,
 data-night_time = is_night_time(data-current_astro);
 update_icon(data);
 
-schedule_next_wakeup(data);
 data-astro_update-finished = TRUE;
 }
 
@@ -581,7 +588,6 @@ cb_weather_update(SoupSession *session,
  (GCompareFunc) xml_time_compare);
 weather_debug(Updating current conditions.);
 update_current_conditions(data, !parsing_error);
-schedule_next_wakeup(data);
 data-weather_update-finished = TRUE;
 weather_dump(weather_dump_weatherdata, data-weatherdata);
 }
@@ -704,7 +710,7 @@ update_handler(plugin_data *data)
 static void
 schedule_next_wakeup(plugin_data *data)
 {
-time_t now_t = time(NULL), future_t;
+time_t now_t = time(NULL), next_day_t;
 struct tm now_tm;
 gdouble diff;
 gchar *date;
@@ -714,9 +720,9 @@ schedule_next_wakeup(plugin_data *data)
 data-update_timer = 0;
 }
 
-now_tm = *localtime(now_t);
-future_t = time_calc_day(now_tm, 3);
-diff = difftime(future_t, now_t);
+next_day_t = day_at_midnight(now_t, 1);
+diff = difftime(next_day_t, now_t);
+   data-next_wakeup_reason = current astro data update;
 SCHEDULE_WAKEUP_COMPARE(data-astro_update-next,
 astro data download);
 SCHEDULE_WAKEUP_COMPARE(data-weather_update-next,
@@ -2108,7 +2114,7 @@ weather_construct(XfcePanelPlugin *plugin)
 xfceweather_read_config(plugin, data);
 update_timezone(data);
 read_cache_file(data);
-update_current_astrodata(data);
+update_current_conditions(data, TRUE);
 scrollbox_set_visible(data);
 gtk_scrollbox_set_fontname(GTK_SCROLLBOX(data-scrollbox),
data-scrollbox_font);
@@ -2150,9 +2156,6 @@ weather_construct(XfcePanelPlugin *plugin)
  G_CALLBACK(upower_changed_cb), data);
 #endif
 
-/* call update

[Xfce4-commits] xfce4-weather-plugin:master Cleanup xml_time_copy.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to fe6baf20e0d6e873efc013b9da13a0abb817abc5 (commit)
   from caa9d6b0d85a9a04980f20eb72b28f76de41005e (commit)

commit fe6baf20e0d6e873efc013b9da13a0abb817abc5
Author: Harald Judt h.j...@gmx.at
Date:   Sat Apr 6 18:08:56 2013 +0200

Cleanup xml_time_copy.

Add a few asserts and compiler optimization hints.

 panel-plugin/weather-parsers.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/weather-parsers.c b/panel-plugin/weather-parsers.c
index c380130..369adf8 100644
--- a/panel-plugin/weather-parsers.c
+++ b/panel-plugin/weather-parsers.c
@@ -623,16 +623,20 @@ xml_time_copy(const xml_time *src)
 xml_location *loc;
 gint i;
 
-if (src == NULL)
+if (G_UNLIKELY(src == NULL))
 return NULL;
 
 dst = g_slice_new0(xml_time);
-if (dst == NULL)
+g_assert(dst != NULL);
+if (G_UNLIKELY(dst == NULL))
 return NULL;
 
 loc = g_slice_new0(xml_location);
-if (loc == NULL)
-return dst;
+g_assert(loc != NULL);
+if (loc == NULL) {
+g_slice_free(xml_time, dst);
+return NULL;
+}
 
 dst-start = src-start;
 dst-end = src-end;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Config dialog: Remove unused variable.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to ab36680d472c1113dd824339686836f634790e0d (commit)
   from 0a018afa98d12c93231852814d7cb0721fc5ee70 (commit)

commit ab36680d472c1113dd824339686836f634790e0d
Author: Harald Judt h.j...@gmx.at
Date:   Sat May 11 12:51:01 2013 +0200

Config dialog: Remove unused variable.

 panel-plugin/weather-config.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index 2035bae..8c83dbd 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -1092,7 +1092,6 @@ static void
 button_icons_dir_clicked(GtkWidget *button,
  gpointer user_data)
 {
-xfceweather_dialog *dialog = (xfceweather_dialog *) user_data;
 gchar *dir, *command;
 
 dir = get_user_icons_dir();
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Debug: Implement full astrodata dump.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to 53b28e24869d9cbf11e7da97696ffd1119621f83 (commit)
   from d525f6648f8556a23da40def8b24d662b799b314 (commit)

commit 53b28e24869d9cbf11e7da97696ffd1119621f83
Author: Harald Judt h.j...@gmx.at
Date:   Sat May 11 12:25:08 2013 +0200

Debug: Implement full astrodata dump.

 panel-plugin/weather-data.c  |2 +-
 panel-plugin/weather-debug.c |   50 +++---
 panel-plugin/weather-debug.h |4 +++-
 panel-plugin/weather.c   |4 +++-
 4 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/panel-plugin/weather-data.c b/panel-plugin/weather-data.c
index 5f626e1..4a6946a 100644
--- a/panel-plugin/weather-data.c
+++ b/panel-plugin/weather-data.c
@@ -914,7 +914,7 @@ astrodata_clean(GArray *astrodata)
 continue;
 if (difftime(now_t, astro-day) = 24 * 3600) {
 weather_debug(Removing expired astrodata:);
-weather_dump(weather_dump_astrodata, astro);
+weather_dump(weather_dump_astro, astro);
 xml_astro_free(astro);
 g_array_remove_index(astrodata, i--);
 weather_debug(Remaining astrodata entries: %d, astrodata-len);
diff --git a/panel-plugin/weather-debug.c b/panel-plugin/weather-debug.c
index 2d30e0c..f15b239 100644
--- a/panel-plugin/weather-debug.c
+++ b/panel-plugin/weather-debug.c
@@ -202,34 +202,47 @@ weather_dump_icon_theme(const icon_theme *theme)
 
 
 gchar *
-weather_dump_astrodata(const xml_astro *astro)
+weather_dump_astrodata(const GArray *astrodata)
+{
+GString *out;
+gchar *result, *line;
+xml_astro *astro;
+gint i;
+
+if (!astrodata || astrodata-len = 0)
+return g_strdup(No astronomical data available.);
+
+out = g_string_sized_new(1024);
+g_string_assign(out, Astronomical data:\n);
+for (i = 0; i  astrodata-len; i++) {
+astro = g_array_index(astrodata, xml_astro *, i);
+line = weather_dump_astro(astro);
+g_string_append(out, line);
+g_free(line);
+}
+/* Free GString only and return its character data */
+result = out-str;
+g_string_free(out, FALSE);
+return result;
+}
+
+
+gchar *
+weather_dump_astro(const xml_astro *astro)
 {
 gchar *out, *day, *sunrise, *sunset, *moonrise, *moonset;
 
 if (!astro)
-return g_strdup(No astronomical data.);
+return g_strdup(Astrodata: NULL.);
 
-day = format_date(astro-day, %Y-%m-%d, TRUE);
+day = format_date(astro-day, %c, TRUE);
 sunrise = format_date(astro-sunrise, %c, TRUE);
 sunset = format_date(astro-sunset, %c, TRUE);
 moonrise = format_date(astro-moonrise, %c, TRUE);
 moonset = format_date(astro-moonset, %c, TRUE);
 
-out = g_strdup_printf(Astronomical data:\n
-\n
-day: %s\n
-\n
-sunrise: %s\n
-sunset: %s\n
-sun never rises: %s\n
-sun never sets: %s\n
-\n
-moonrise: %s\n
-moonset: %s\n
-moon never rises: %s\n
-moon never sets: %s\n
-moon phase: %s\n
-,
+out = g_strdup_printf(day=%s, sun={%s, %s, %s, %s}, 
+  moon={%s, %s, %s, %s, %s}\n,
   day,
   sunrise,
   sunset,
@@ -240,6 +253,7 @@ weather_dump_astrodata(const xml_astro *astro)
   YESNO(astro-moon_never_rises),
   YESNO(astro-moon_never_sets),
   astro-moon_phase);
+
 g_free(day);
 g_free(sunrise);
 g_free(sunset);
diff --git a/panel-plugin/weather-debug.h b/panel-plugin/weather-debug.h
index b5aa53c..ef65b0c 100644
--- a/panel-plugin/weather-debug.h
+++ b/panel-plugin/weather-debug.h
@@ -66,7 +66,9 @@ gchar *weather_dump_timezone(const xml_timezone *timezone);
 
 gchar *weather_dump_icon_theme(const icon_theme *theme);
 
-gchar *weather_dump_astrodata(const xml_astro *astrodata);
+gchar *weather_dump_astrodata(const GArray *astrodata);
+
+gchar *weather_dump_astro(const xml_astro *astro);
 
 gchar *weather_dump_units_config(const units_config *units);
 
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index b7ea9ac..4d2dd11 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -387,7 +387,7 @@ update_current_astrodata(plugin_data *data)
  difftime(data-current_astro-day, now_t) = 24 * 3600)) {
 data-current_astro = get_astro_data_for_day(data-astrodata, 0);
 weather_debug(Updated

[Xfce4-commits] xfce4-weather-plugin:master Fetch and cache astronomical data for multiple days.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to 2e9ef8c8b50f2505b5f21bf2280a3588f6647af0 (commit)
   from fe6baf20e0d6e873efc013b9da13a0abb817abc5 (commit)

commit 2e9ef8c8b50f2505b5f21bf2280a3588f6647af0
Author: Harald Judt h.j...@gmx.at
Date:   Sat Apr 6 18:10:24 2013 +0200

Fetch and cache astronomical data for multiple days.

met.no sunrise API provides astronomical data for up to 30 days in the
future (requesting more than that will result in an error page).
We can make use of that and cache it, similar as we do for the forecast
data. current_astro will point to the astronomical data for the current
day.

Download will now happen in intervals of 24 hours, not at a fixed time
at midnight as previously. The current conditions updates will take
care that astronomical data gets updated for the present day, because
they happen exactly at midnight and thus save us from adding additional
logic having to deal with that.

 panel-plugin/weather-data.c|  130 --
 panel-plugin/weather-data.h|   14 +-
 panel-plugin/weather-debug.c   |7 +-
 panel-plugin/weather-parsers.c |  126 +++---
 panel-plugin/weather-parsers.h |   10 ++
 panel-plugin/weather-summary.c |   22 ++--
 panel-plugin/weather.c |  284 +++-
 panel-plugin/weather.h |3 +-
 8 files changed, 438 insertions(+), 158 deletions(-)

diff --git a/panel-plugin/weather-data.c b/panel-plugin/weather-data.c
index 2c21399..5f626e1 100644
--- a/panel-plugin/weather-data.c
+++ b/panel-plugin/weather-data.c
@@ -760,6 +760,33 @@ make_combined_timeslice(xml_weather *wd,
 
 
 void
+merge_astro(GArray *astrodata,
+const xml_astro *astro)
+{
+xml_astro *old_astro, *new_astro;
+guint index;
+
+g_assert(astrodata != NULL);
+if (G_UNLIKELY(astrodata == NULL))
+return;
+
+/* copy astro, as it may be deleted by the calling function */
+new_astro = xml_astro_copy(astro);
+
+/* check for and replace existing astrodata of the same date */
+if ((old_astro = get_astro(astrodata, astro-day, index))) {
+xml_astro_free(old_astro);
+g_array_remove_index(astrodata, index);
+g_array_insert_val(astrodata, index, new_astro);
+weather_debug(Replaced existing astrodata at %d., index);
+} else {
+g_array_append_val(astrodata, new_astro);
+weather_debug(Appended new astrodata to the existing data.);
+}
+}
+
+
+void
 merge_timeslice(xml_weather *wd,
 const xml_time *timeslice)
 {
@@ -851,6 +878,52 @@ time_calc_day(const struct tm time_tm,
 
 
 /*
+ * Compare two xml_astro structs using their date (days) field.
+ */
+gint
+xml_astro_compare(gconstpointer a,
+  gconstpointer b)
+{
+xml_astro *a1 = *(xml_astro **) a;
+xml_astro *a2 = *(xml_astro **) b;
+
+if (G_UNLIKELY(a1 == NULL  a2 == NULL))
+return 0;
+if (G_UNLIKELY(a1 == NULL))
+return 1;
+if (G_UNLIKELY(a2 == NULL))
+return -1;
+
+return (gint) difftime(a2-day, a1-day) * -1;
+}
+
+
+void
+astrodata_clean(GArray *astrodata)
+{
+xml_astro *astro;
+time_t now_t = time(NULL);
+gint i;
+
+if (G_UNLIKELY(astrodata == NULL))
+return;
+
+for (i = 0; i  astrodata-len; i++) {
+astro = g_array_index(astrodata, xml_astro *, i);
+if (G_UNLIKELY(astro == NULL))
+continue;
+if (difftime(now_t, astro-day) = 24 * 3600) {
+weather_debug(Removing expired astrodata:);
+weather_dump(weather_dump_astrodata, astro);
+xml_astro_free(astro);
+g_array_remove_index(astrodata, i--);
+weather_debug(Remaining astrodata entries: %d, astrodata-len);
+}
+}
+}
+
+
+/*
  * Compare two xml_time structs using their start and end times,
  * returning the result as a qsort()-style comparison function (less
  * than zero for first arg is less than second arg, zero for equal,
@@ -1072,25 +1145,62 @@ make_current_conditions(xml_weather *wd,
 
 
 /*
+ * Add days to time_t and set the calculated day to midnight.
+ */
+time_t
+day_at_midnight(time_t day_t,
+const gint add_days)
+{
+struct tm day_tm;
+
+day_tm = *localtime(day_t);
+day_tm.tm_mday += add_days;
+day_tm.tm_hour = day_tm.tm_min = day_tm.tm_sec = 0;
+day_tm.tm_isdst = -1;
+day_t = mktime(day_tm);
+return day_t;
+}
+
+
+/*
+ * Returns astro data for a given day.
+ */
+xml_astro *
+get_astro_data_for_day(const GArray *astrodata,
+   const gint day)
+{
+xml_astro *astro;
+time_t day_t = time(NULL);
+gint i;
+
+if (G_UNLIKELY(astrodata == NULL))
+return NULL;
+
+day_t = day_at_midnight(day_t, day);
+
+for (i = 0; i  astrodata-len; i++) {
+astro = g_array_index(astrodata, xml_astro *, i);
+if (astro  (difftime(astro-day, day_t) == 0))
+return

[Xfce4-commits] xfce4-weather-plugin:master Build system: Properly handle m4 stuff.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to e6e6d4a96810151d34fa299d3518f6e4dbc7040d (commit)
   from 89961c0485b0352cc1caca31179e455d56da7373 (commit)

commit e6e6d4a96810151d34fa299d3518f6e4dbc7040d
Author: Harald Judt h.j...@gmx.at
Date:   Sun Jan 12 00:52:45 2014 +0100

Build system: Properly handle m4 stuff.

 autogen.sh  |2 ++
 configure.ac.in |1 +
 2 files changed, 3 insertions(+)

diff --git a/autogen.sh b/autogen.sh
index 6bc0c8a..8104646 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -17,4 +17,6 @@ EOF
   exit 1
 }
 
+test -d m4 || mkdir m4
+
 xdt-autogen $@
diff --git a/configure.ac.in b/configure.ac.in
index 6e5f204..9f9eec0 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -22,6 +22,7 @@ AC_COPYRIGHT([Copyright (c) 2006-2013
 The Xfce development team. All rights reserved.])
 AC_INIT([xfce4-weather-plugin], [weather_version], 
[http://bugzilla.xfce.org/], [xfce4-weather-plugin])
 AC_PREREQ([2.60])
+AC_CONFIG_MACRO_DIR([m4])
 
 dnl ***
 dnl *** Initialize automake ***
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Translation: Remove unused function translate_str.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to e9d01e10bc78771c5f3bcac9437dd73af9e7ee09 (commit)
   from ab36680d472c1113dd824339686836f634790e0d (commit)

commit e9d01e10bc78771c5f3bcac9437dd73af9e7ee09
Author: Harald Judt h.j...@gmx.at
Date:   Sat May 11 12:52:05 2013 +0200

Translation: Remove unused function translate_str.

 panel-plugin/weather-translate.c |   30 --
 1 file changed, 30 deletions(-)

diff --git a/panel-plugin/weather-translate.c b/panel-plugin/weather-translate.c
index 89c0310..0c1606d 100644
--- a/panel-plugin/weather-translate.c
+++ b/panel-plugin/weather-translate.c
@@ -45,36 +45,6 @@ static const gchar *moon_phases[] = {
 };
 #define NUM_MOON_PHASES (sizeof(moon_phases) / sizeof(gchar *))
 
-static const gchar *
-translate_str(const gchar **loc_strings,
-  const gchar *str)
-{
-gint loc_string_len, str_len, i;
-
-if (str == NULL)
-return ?;
-
-str_len = strlen(str);
-
-if (str_len  1)
-return ?;
-
-for (i = 0; loc_strings[i] != NULL; i++) {
-loc_string_len = strlen(loc_strings[i]);
-
-if (str_len != loc_string_len)
-continue;
-
-if (str[0] != loc_strings[i][0])
-continue;
-
-if (!g_ascii_strncasecmp(loc_strings[i], str, str_len))
-return _(loc_strings[i]);
-}
-return str;
-}
-
-
 typedef struct {
 gint id;
 gchar *symbol;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Summary window: Add tooltip for forecast day header showing astrodata.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to 0a018afa98d12c93231852814d7cb0721fc5ee70 (commit)
   from 750bfb2208760eee55af064fc4f5758b2741e8e3 (commit)

commit 0a018afa98d12c93231852814d7cb0721fc5ee70
Author: Harald Judt h.j...@gmx.at
Date:   Mon May 20 12:11:21 2013 +0200

Summary window: Add tooltip for forecast day header showing astrodata.

 panel-plugin/weather-summary.c |   89 +++-
 1 file changed, 88 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index 33e52fb..33915c3 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -681,6 +681,87 @@ forecast_cell_get_tooltip_text(plugin_data *data,
 }
 
 
+static gchar *
+forecast_day_header_tooltip_text(xml_astro *astro)
+{
+GString *text;
+gchar *result, *day, *sunrise, *sunset, *moonrise, *moonset, *moonphase;
+
+/* TRANSLATORS: Please use spaces as needed or desired to properly
+   align the values; Monospace font is enforced with tt tags for
+   alignment, and the text is enclosed in small tags because
+   that looks much better and saves space.
+*/
+
+text = g_string_new();
+if (astro) {
+day = format_date(astro-day, %Y-%m-%d, TRUE);
+g_string_append_printf(text, _(b%s/b\n), day);
+g_free(day);
+
+if (astro-sun_never_rises)
+g_string_append(text, _(ttsmall
+Sunrise: The sun never rises this day.
+/small/tt\n));
+else if (astro-sun_never_sets)
+g_string_append(text, _(ttsmall
+Sunset: The sun never sets this day.
+/small/tt\n));
+else {
+sunrise = format_date(astro-sunrise, NULL, TRUE);
+g_string_append_printf(text, _(ttsmall
+   Sunrise: %s
+   /small/tt\n), sunrise);
+g_free(sunrise);
+
+sunset = format_date(astro-sunset, NULL, TRUE);
+g_string_append_printf(text, _(ttsmall
+   Sunset:  %s
+   /small/tt\n\n), sunset);
+g_free(sunset);
+}
+
+if (astro-moon_phase)
+g_string_append_printf(text, _(ttsmall
+   Moon phase: %s
+   /small/tt\n),
+   translate_moon_phase(astro-moon_phase));
+else
+g_string_append(text, _(ttsmall
+Moon phase: Unknown
+/small/tt\n));
+
+if (astro-moon_never_rises)
+g_string_append(text, _(ttsmall
+Moonrise: The moon never rises this day.
+/small/tt\n));
+else if (astro-moon_never_sets)
+g_string_append(text,
+_(ttsmall
+  Moonset: The moon never sets this day.
+  /small/tt\n));
+else {
+moonrise = format_date(astro-moonrise, NULL, TRUE);
+g_string_append_printf(text, _(ttsmall
+   Moonrise: %s
+   /small/tt\n), moonrise);
+g_free(moonrise);
+
+moonset = format_date(astro-moonset, NULL, TRUE);
+g_string_append_printf(text, _(ttsmall
+   Moonset:  %s
+   /small/tt), moonset);
+g_free(moonset);
+}
+}
+
+/* Free GString only and return its character data */
+result = text-str;
+g_string_free(text, FALSE);
+return result;
+}
+
+
 static GtkWidget *
 wrap_forecast_cell(const GtkWidget *widget,
const GdkColor *color)
@@ -815,7 +896,8 @@ make_forecast(plugin_data *data)
 const GdkColor lightbg = {0, 0xeaea, 0xeaea, 0xeaea};
 const GdkColor darkbg = {0, 0x, 0x, 0x};
 GArray *daydata;
-gchar *dayname;
+xml_astro *astro;
+gchar *dayname, *text;
 gint i;
 daytime daytime;
 
@@ -848,6 +930,11 @@ make_forecast(plugin_data *data)
 ebox = add_forecast_header(dayname, 90.0, darkbg);
 g_free(dayname);
 
+/* add tooltip to forecast day header */
+astro = get_astro_data_for_day(data-astrodata, i);
+text = forecast_day_header_tooltip_text(astro);
+gtk_widget_set_tooltip_markup(GTK_WIDGET(ebox), text);
+
 if (data-forecast_layout == FC_LAYOUT_CALENDAR)
 gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(ebox),
   i+1, i+2, 0, 1);
___
Xfce4

[Xfce4-commits] xfce4-weather-plugin:master Remove unused variables.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to babc00b2be0f2b12767f59531a6b59bcfdf7c779 (commit)
   from e9d01e10bc78771c5f3bcac9437dd73af9e7ee09 (commit)

commit babc00b2be0f2b12767f59531a6b59bcfdf7c779
Author: Harald Judt h.j...@gmx.at
Date:   Sun Jan 12 00:45:29 2014 +0100

Remove unused variables.

 panel-plugin/weather-summary.c |2 +-
 panel-plugin/weather.c |1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index 33915c3..a40dfde 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -685,7 +685,7 @@ static gchar *
 forecast_day_header_tooltip_text(xml_astro *astro)
 {
 GString *text;
-gchar *result, *day, *sunrise, *sunset, *moonrise, *moonset, *moonphase;
+gchar *result, *day, *sunrise, *sunset, *moonrise, *moonset;
 
 /* TRANSLATORS: Please use spaces as needed or desired to properly
align the values; Monospace font is enforced with tt tags for
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 2f0368b..7852da0 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -711,7 +711,6 @@ static void
 schedule_next_wakeup(plugin_data *data)
 {
 time_t now_t = time(NULL), next_day_t;
-struct tm now_tm;
 gdouble diff;
 gchar *date;
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Remove unnecessary astrodata dump.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to d525f6648f8556a23da40def8b24d662b799b314 (commit)
   from 0183158cdffb3e432eccaab337b2d9053235b19b (commit)

commit d525f6648f8556a23da40def8b24d662b799b314
Author: Harald Judt h.j...@gmx.at
Date:   Fri May 10 11:43:02 2013 +0200

Remove unnecessary astrodata dump.

 panel-plugin/weather.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 9ee953c..b7ea9ac 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -525,7 +525,6 @@ cb_astro_update(SoupSession *session,
 
 schedule_next_wakeup(data);
 data-astro_update-finished = TRUE;
-weather_dump(weather_dump_astrodata, data-current_astro);
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Let the update handler deal with writing the cache file.

2014-01-11 Thread Harald Judt
Updating branch refs/heads/master
 to 0183158cdffb3e432eccaab337b2d9053235b19b (commit)
   from 2e9ef8c8b50f2505b5f21bf2280a3588f6647af0 (commit)

commit 0183158cdffb3e432eccaab337b2d9053235b19b
Author: Harald Judt h.j...@gmx.at
Date:   Thu May 9 19:10:24 2013 +0200

Let the update handler deal with writing the cache file.

This central function is the proper place to do this. It will write the 
cache
file once all started downloads are completed.

 panel-plugin/weather.c |   16 +++-
 panel-plugin/weather.h |2 ++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 9ca51af..9ee953c 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -524,6 +524,7 @@ cb_astro_update(SoupSession *session,
 update_icon(data);
 
 schedule_next_wakeup(data);
+data-astro_update-finished = TRUE;
 weather_dump(weather_dump_astrodata, data-current_astro);
 }
 
@@ -579,8 +580,8 @@ cb_weather_update(SoupSession *session,
  (GCompareFunc) xml_time_compare);
 weather_debug(Updating current conditions.);
 update_current_conditions(data, !parsing_error);
-write_cache_file(data);
 schedule_next_wakeup(data);
+data-weather_update-finished = TRUE;
 weather_dump(weather_dump_weatherdata, data-weatherdata);
 }
 
@@ -608,11 +609,23 @@ update_handler(plugin_data *data)
 now_t = time(NULL);
 now_tm = *localtime(now_t);
 
+/* check if all started downloads are finished and the cache file
+   can be written */
+if (data-astro_update-started  data-astro_update-finished 
+data-weather_update-started  data-weather_update-finished) {
+data-astro_update-started = FALSE;
+data-astro_update-finished = FALSE;
+data-weather_update-started = FALSE;
+data-weather_update-finished = FALSE;
+write_cache_file(data);
+}
+
 /* fetch astronomical data */
 if (difftime(data-astro_update-next, now_t) = 0) {
 /* real next update time will be calculated when update is finished,
this is to prevent spawning multiple updates in a row */
 data-astro_update-next = time_calc_hour(now_tm, 1);
+data-astro_update-started = TRUE;
 
 /* calculate date range for request */
 end_t = time_calc_day(now_tm, ASTRODATA_MAX_DAYS);
@@ -642,6 +655,7 @@ update_handler(plugin_data *data)
 /* real next update time will be calculated when update is finished,
this is to prevent spawning multiple updates in a row */
 data-weather_update-next = time_calc_hour(now_tm, 1);
+data-weather_update-started = TRUE;
 
 /* build url */
 url =
diff --git a/panel-plugin/weather.h b/panel-plugin/weather.h
index 575a77a..ec8e26f 100644
--- a/panel-plugin/weather.h
+++ b/panel-plugin/weather.h
@@ -57,6 +57,8 @@ typedef struct {
 time_t next;
 guint attempt;
 guint check_interval;
+gboolean started;
+gboolean finished;
 } update_info;
 
 typedef struct {
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Only generate bzip2 tarballs.

2014-01-08 Thread Harald Judt
Updating branch refs/heads/master
 to 1ba5a9e89e3233579a54a1af54b4dbdfad38d918 (commit)
   from 9365424047ad8fc3cfd1fdb7b0bdb06e22c704d4 (commit)

commit 1ba5a9e89e3233579a54a1af54b4dbdfad38d918
Author: Harald Judt h.j...@gmx.at
Date:   Wed Jan 8 20:00:41 2014 +0100

Only generate bzip2 tarballs.

 configure.ac.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac.in b/configure.ac.in
index b84424c..c71efb9 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -23,7 +23,7 @@ AC_CANONICAL_TARGET()
 dnl ***
 dnl *** Initialize automake ***
 dnl ***
-AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar])
+AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip])
 AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE()
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Only generate bzip2 tarballs.

2014-01-08 Thread Harald Judt
Updating branch refs/heads/master
 to e5fbd21847ef7216b4638f37f2977df800e0aae0 (commit)
   from eac601bc177bd252cd65715a6b5d30b51fd8f7fc (commit)

commit e5fbd21847ef7216b4638f37f2977df800e0aae0
Author: Harald Judt h.j...@gmx.at
Date:   Wed Jan 8 20:09:57 2014 +0100

Only generate bzip2 tarballs.

 configure.ac.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac.in b/configure.ac.in
index cb14a12..2482186 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -20,7 +20,7 @@ AC_INIT([xfce4-cpufreq-plugin], [cpufreq_version()], 
[http://bugzilla.xfce.org],
 AC_PREREQ([2.60])
 
 dnl Initialize automake
-AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar])
+AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip])
 AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE()
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Fix build issues with autogen.sh (bug #10570).

2013-12-26 Thread Harald Judt
Updating branch refs/heads/master
 to 9365424047ad8fc3cfd1fdb7b0bdb06e22c704d4 (commit)
   from 34c077d9049615f6223005d1bdb34d53047c5bf5 (commit)

commit 9365424047ad8fc3cfd1fdb7b0bdb06e22c704d4
Author: Jérôme Guelfucci jero...@xfce.org
Date:   Thu Dec 26 20:22:21 2013 +0100

Fix build issues with autogen.sh (bug #10570).

 autogen.sh  |1 +
 configure.ac.in |2 ++
 2 files changed, 3 insertions(+)

diff --git a/autogen.sh b/autogen.sh
index 524cc63..3b7dc64 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -16,4 +16,5 @@ EOF
   exit 1
 }
 
+test -d m4 || mkdir m4
 xdt-autogen $@
diff --git a/configure.ac.in b/configure.ac.in
index 17318f8..b84424c 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -17,6 +17,7 @@ dnl ***
 AC_COPYRIGHT([Copyright (c) 2006-2013 The Xfce development team])
 AC_INIT([xfce4-eyes-plugin], [eyes_version], [http://bugzilla.xfce.org/], 
[xfce4-eyes-plugin])
 AC_PREREQ([2.60])
+AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_TARGET()
 
 dnl ***
@@ -32,6 +33,7 @@ dnl 
 AC_PROG_CC()
 AC_PROG_LD()
 AC_PROG_INSTALL()
+LT_PREREQ([2.2.6])
 LT_INIT([disable-static])
 AC_PROG_INTLTOOL()
 AM_PROG_CC_C_O()
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Fix autogen.sh failing because of missing m4 directory (bug #10571).

2013-12-25 Thread Harald Judt
Updating branch refs/heads/master
 to eac601bc177bd252cd65715a6b5d30b51fd8f7fc (commit)
   from 7c9647e0c3a738bc8c0232f5dcdd32fd0bbdcac4 (commit)

commit eac601bc177bd252cd65715a6b5d30b51fd8f7fc
Author: Harald Judt h.j...@gmx.at
Date:   Wed Dec 25 12:54:15 2013 +0100

Fix autogen.sh failing because of missing m4 directory (bug #10571).

 autogen.sh |2 ++
 1 file changed, 2 insertions(+)

diff --git a/autogen.sh b/autogen.sh
index 6bc0c8a..8104646 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -17,4 +17,6 @@ EOF
   exit 1
 }
 
+test -d m4 || mkdir m4
+
 xdt-autogen $@
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Fix missing return type of cpufreq_show_about (bug #10343).

2013-09-11 Thread Harald Judt
Updating branch refs/heads/master
 to d5143a708d5dbbc27734a98ad788f381c5fa53d9 (commit)
   from f04348d0956d91e827ec656e0c43e37835fd06fc (commit)

commit d5143a708d5dbbc27734a98ad788f381c5fa53d9
Author: Guido Berhoerster g...@opensuse.org
Date:   Wed Sep 11 13:02:51 2013 +0200

Fix missing return type of cpufreq_show_about (bug #10343).

 panel-plugin/xfce4-cpufreq-plugin.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 41285aa..322ddd0 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -558,6 +558,7 @@ cpufreq_set_size (XfcePanelPlugin *plugin, gint size, 
CpuFreqPlugin *cpufreq)
return TRUE;
 }
 
+static void
 cpufreq_show_about(XfcePanelPlugin *plugin,
   CpuFreqPlugin *cpufreq)
 {
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Update NEWS, README and TODO.

2013-09-03 Thread Harald Judt
Updating branch refs/heads/master
 to f6384d9ff9dab351b63ac741e04aa7c8ac692fae (commit)
   from 3ad70bbee6637fc3baeaa3723ea96e4be80085a2 (commit)

commit f6384d9ff9dab351b63ac741e04aa7c8ac692fae
Author: Harald Judt h.j...@gmx.at
Date:   Tue Sep 3 14:01:11 2013 +0200

Update NEWS, README and TODO.

 NEWS   |   22 -
 README |  155 +++-
 TODO   |9 
 3 files changed, 164 insertions(+), 22 deletions(-)

diff --git a/NEWS b/NEWS
index cfd0ba9..7084aaf 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,24 @@
-1.0.0 (2011/01/23)
+1.1.0 (2013-09-03)
+--
+ * Support the Intel performance state driver
+ * Improve config dialog and make it use shortcut keys
+ * Add a proper About dialog
+ * Add min, avg and max frequencies in cpu selection
+ * Add support for selecting a custom font
+ * Support showing icon only (bug #7474)
+ * Improve overview window size and layout
+ * Remove code for showing the frame
+ * Rewrite layout code using =xfce4-panel-4.9 features
+ * Remove code for deprecated APIs and xfce4-panel-4.9
+ * Build plugin as a module
+ * Fix showing frequency of wrong CPU core (bug #7179)
+ * Fix reading min frequency from cpufreq sysfs
+ * Support panel 4.9 features (deskbar mode) (bug #8396)
+ * Port plugin to libxfce4ui (bug #8051)
+ * Code clean up and refactoring
+ * Updates and fixes for build system files
+
+1.0.0 (2011-01-23)
 --
  * Fix support for xfce 4.8, fixing bug #6448
  * Linux 2.4 support
diff --git a/README b/README
index 18e5730..d11137f 100644
--- a/README
+++ b/README
@@ -1,32 +1,145 @@
-*
-***  xfce4-cpufreq-plugin  **
-*
+XFCE4-CPUFREQ-PLUGIN
+==
+You can always find up-to-date information at the plugin homepage:
+http://goodies.xfce.org/projects/panel-plugins/xfce4-cpufreq-plugin
 
-xfce4-cpufreq-plugin is a Plugin for the Xfce Panel, which 
-shows CPU Informations
 
-** Retrieving **
+CONTENTS
+==
+* ABOUT
+* USAGE
+* REPORTING BUGS
+* REQUIREMENTS AND DEPENDENCIES
+* EASY BUILD INSTRUCTIONS
+* TRANSLATING THE PLUGIN FOR YOUR LANGUAGE
 
-The lastet version of xfce4-cpufreq-plugin can always be obtained from
-http://goodies.xfce.org/projects/panel-plugins/xfce4-cpufreq-plugin. 
-Please check to see if there is a newer version available before 
-reporting bugs.
 
-** Requirements **
+ABOUT
+==
+Originally written by Thomas Schreck, this panel plugin shows
+information about the CPU governor and frequencies supported and used
+by your system. At the time of this writing, changing any of these
+settings is not supported by this plugin.
 
-* libxfce4util 4.3.90
-* libxfcegui4 4.3.90
-* libxfce4panel 4.3.90   
 
-** Building **
+USAGE
+==
+From the configuration dialog, which is available by right-clicking on
+the panel widget, select the CPU which you want to monitor in the
+panel. Instead of showing values for a single CPU, you can
+alternatively choose minimum, average or maximum, which might make
+more sense on a multi-core system. If your system is using the Intel
+pstate driver, the current maximum will be chosen by default, as this
+is what other monitoring applications like i7z show as the current
+real performance.
 
-./configure
-make
-make install (as root)
+The remaining options on the configuration dialog let you customize
+the panel widget layout and what data is shown on the panel.
 
-** Usage **
+The overview window can be accessed by left-clicking on the panel
+plugin widget, or from the context menu, similar to the configuration
+dialog. It shows detailed information for every CPU (core).
 
-Using the plugin is quite simple. You select the cpu which you want to monitor 
in the Xfce Panel. Next thing you could change is the timeout interval how 
often the informations have to be updated. The default value is 1,0 s.
 
-You can also specify which informations should be displayed in the panel.
+REPORTING BUGS
+==
+Before reporting bugs or asking for new features, please update to the
+latest version, consolidate the Xfce bug tracker at
+https://bugzilla.xfce.org and check the TODO file, because your issue
+or request might have been reported already or be in planning. However,
+feel free to add any information not yet mentioned that you find useful.
 
+
+BUILD REQUIREMENTS AND DEPENDENCIES
+==
+The build requirements for this plugin match those of XFCE. Note that
+with versions newer than 1.0.0, =xfce4-panel-4.9

[Xfce4-commits] xfce4-cpufreq-plugin|xfce4-cpufreq-plugin-1.1.0 Creating annotated tag xfce4-cpufreq-plugin-1.1.0

2013-09-03 Thread Harald Judt
Updating annotated tag refs/tags/xfce4-cpufreq-plugin-1.1.0
 as new annotated tag
 to 7cc2caa60eed5cef4c2f68fc1ea6554ea6c6b054 (tag)
   succeeds release-1.0.0-123-gcb888fc
  tagged by Harald Judt h.j...@gmx.at
 on 2013-09-03 14:12 +0200

Harald Judt (1):
  Updates for release.

___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Post release tag bump.

2013-09-03 Thread Harald Judt
Updating branch refs/heads/master
 to 0e4e2d916543ef7dea14623a567c2b576006e9d1 (commit)
   from d638f9a3252c80540b06b8fbb15f9f4070d8ef83 (commit)

commit 0e4e2d916543ef7dea14623a567c2b576006e9d1
Author: Harald Judt h.j...@gmx.at
Date:   Tue Sep 3 14:14:50 2013 +0200

Post release tag bump.

 configure.ac.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac.in b/configure.ac.in
index af57a07..cb14a12 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -9,7 +9,7 @@ m4_define([cpufreq_version_major], [1])
 m4_define([cpufreq_version_minor], [1])
 m4_define([cpufreq_version_micro], [0])
 m4_define([cpufreq_version_build], [@REVISION@])
-m4_define([cpufreq_version_tag], [])
+m4_define([cpufreq_version_tag], [git])
 m4_define([cpufreq_version], 
[cpufreq_version_major().cpufreq_version_minor().cpufreq_version_micro()ifelse(cpufreq_version_tag(),
 [git], [cpufreq_version_tag()-cpufreq_version_build()], 
[cpufreq_version_tag()])])
 
 dnl Initialize autoconf
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Updates for release.

2013-09-03 Thread Harald Judt
Updating branch refs/heads/master
 to d638f9a3252c80540b06b8fbb15f9f4070d8ef83 (commit)
   from cb888fcb4889c23fc50df1d85b8aaadda6988827 (commit)

commit d638f9a3252c80540b06b8fbb15f9f4070d8ef83
Author: Harald Judt h.j...@gmx.at
Date:   Tue Sep 3 14:06:04 2013 +0200

Updates for release.

 configure.ac.in |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 26fc56a..af57a07 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -6,10 +6,10 @@ dnl
 dnl Version information
 AC_CONFIG_MACRO_DIR([m4])
 m4_define([cpufreq_version_major], [1])
-m4_define([cpufreq_version_minor], [0])
+m4_define([cpufreq_version_minor], [1])
 m4_define([cpufreq_version_micro], [0])
 m4_define([cpufreq_version_build], [@REVISION@])
-m4_define([cpufreq_version_tag], [git])
+m4_define([cpufreq_version_tag], [])
 m4_define([cpufreq_version], 
[cpufreq_version_major().cpufreq_version_minor().cpufreq_version_micro()ifelse(cpufreq_version_tag(),
 [git], [cpufreq_version_tag()-cpufreq_version_build()], 
[cpufreq_version_tag()])])
 
 dnl Initialize autoconf
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Correct copyright year for en_GB.po again.

2013-09-03 Thread Harald Judt
Updating branch refs/heads/master
 to cb888fcb4889c23fc50df1d85b8aaadda6988827 (commit)
   from f6384d9ff9dab351b63ac741e04aa7c8ac692fae (commit)

commit cb888fcb4889c23fc50df1d85b8aaadda6988827
Author: Harald Judt h.j...@gmx.at
Date:   Tue Sep 3 14:02:58 2013 +0200

Correct copyright year for en_GB.po again.

...for release.

 po/en_GB.po |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/po/en_GB.po b/po/en_GB.po
index 56f5645..a440fa2 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -167,8 +167,8 @@ msgid Show CPU frequencies and governor
 msgstr Show CPU frequencies and governor
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:561
-msgid Copyright (c) 2003-2012\n
-msgstr Copyright (c) 2003-2012\n
+msgid Copyright (c) 2003-2013\n
+msgstr Copyright (c) 2003-2013\n
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:584
 msgid 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Fix typo in panel-plugin/Makefile.am (bug #10332).

2013-09-03 Thread Harald Judt
Updating branch refs/heads/master
 to 76ffedc78bf2b4a38facb7c53eb2c2dd1d19c445 (commit)
   from 0e4e2d916543ef7dea14623a567c2b576006e9d1 (commit)

commit 76ffedc78bf2b4a38facb7c53eb2c2dd1d19c445
Author: Jani Välimaa wa...@mageia.org
Date:   Tue Sep 3 17:48:30 2013 +0200

Fix typo in panel-plugin/Makefile.am (bug #10332).

 panel-plugin/Makefile.am |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 2b61f12..c753d15 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -28,7 +28,7 @@ libcpufreq_la_SOURCES =   
\
xfce4-cpufreq-utils.h   \
xfce4-cpufreq-utils.c
 
-libcpugraph_la_LDFLAGS = \
+libcpufreq_la_LDFLAGS = \
-avoid-version \
-module \
-no-undefined \
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Fix copyright year in About dialog and translation files.

2013-08-29 Thread Harald Judt
Updating branch refs/heads/master
 to bae433848b41537d43b7c0b87a03391114da9cb8 (commit)
   from 261e8617acb9f79469110e053f9b431584b71d72 (commit)

commit bae433848b41537d43b7c0b87a03391114da9cb8
Author: Harald Judt h.j...@gmx.at
Date:   Thu Aug 29 23:04:15 2013 +0200

Fix copyright year in About dialog and translation files.

Thanks to Sérgio Marques for spotting it.

 panel-plugin/xfce4-cpufreq-plugin.c |2 +-
 po/ar.po|2 +-
 po/ast.po   |2 +-
 po/ca.po|2 +-
 po/cs.po|2 +-
 po/da.po|2 +-
 po/de.po|4 ++--
 po/el.po|2 +-
 po/en_AU.po |4 ++--
 po/es.po|4 ++--
 po/eu.po|2 +-
 po/fr.po|4 ++--
 po/gl.po|2 +-
 po/hr.po|2 +-
 po/hu.po|2 +-
 po/id.po|2 +-
 po/it.po|4 ++--
 po/ja.po|4 ++--
 po/kk.po|2 +-
 po/ko.po|4 ++--
 po/lt.po|2 +-
 po/lv.po|2 +-
 po/nb.po|2 +-
 po/nl.po|4 ++--
 po/pa.po|2 +-
 po/pl.po|4 ++--
 po/pt.po|2 +-
 po/pt_BR.po |4 ++--
 po/ru.po|4 ++--
 po/sk.po|2 +-
 po/sq.po|2 +-
 po/sr.po|4 ++--
 po/sv.po|2 +-
 po/tr.po|4 ++--
 po/ug.po|2 +-
 po/uk.po|2 +-
 po/ur.po|2 +-
 po/ur_PK.po |2 +-
 po/zh_TW.po |2 +-
 39 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 57fff8c..41285aa 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -576,7 +576,7 @@ cpufreq_show_about(XfcePanelPlugin *plugin,
 program-name, PACKAGE_NAME,
 comments, _(Show CPU frequencies and governor),
 website, PLUGIN_WEBSITE,
-copyright, _(Copyright (c) 2003-2012\n),
+copyright, _(Copyright (c) 2003-2013\n),
 authors, auth,
 NULL);
 
diff --git a/po/ar.po b/po/ar.po
index bc7747b..bc5f340 100644
--- a/po/ar.po
+++ b/po/ar.po
@@ -171,7 +171,7 @@ msgid Show CPU frequencies and governor
 msgstr تظهر تردد المعالج والحكام
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:561
-msgid Copyright (c) 2003-2012\n
+msgid Copyright (c) 2003-2013\n
 msgstr 
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:584
diff --git a/po/ast.po b/po/ast.po
index 5cdb6fa..ea3d24d 100644
--- a/po/ast.po
+++ b/po/ast.po
@@ -165,7 +165,7 @@ msgid Show CPU frequencies and governor
 msgstr Amuesa la frecuencia de CPU y los gobernadores
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:561
-msgid Copyright (c) 2003-2012\n
+msgid Copyright (c) 2003-2013\n
 msgstr 
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:584
diff --git a/po/ca.po b/po/ca.po
index d1c4577..6677d09 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -178,7 +178,7 @@ msgid Show CPU frequencies and governor
 msgstr Mostra la freqüència de la CPU i els seus controladors
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:561
-msgid Copyright (c) 2003-2012\n
+msgid Copyright (c) 2003-2013\n
 msgstr 
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:584
diff --git a/po/cs.po b/po/cs.po
index 7fbbb19..2e9ab47 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -168,7 +168,7 @@ msgid Show CPU frequencies and governor
 msgstr Zobrazit frekvenci procesoru a regulátor
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:561
-msgid Copyright (c) 2003-2012\n
+msgid Copyright (c) 2003-2013\n
 msgstr Copyright (c) 2003-2013⏎\n
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:584
diff --git a/po/da.po b/po/da.po
index 40fa1d9..6e2737b 100644
--- a/po/da.po
+++ b/po/da.po
@@ -177,7 +177,7 @@ msgid Show CPU frequencies and governor
 msgstr Viser CPU-frekvensen og bestyrere
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:561
-msgid Copyright (c) 2003-2012\n
+msgid Copyright (c) 2003-2013\n
 msgstr 
 
 #: ../panel-plugin/xfce4-cpufreq-plugin.c:584
diff --git a/po/de.po b/po/de.po
index 2eb9e2a..2a024f4 100644
--- a/po/de.po
+++ b/po/de.po
@@ -169,8 +169,8 @@ msgid Show CPU frequencies and governor
 msgstr Zeigt CPU-Frequenzen und Regler

[Xfce4-commits] xfce4-cpufreq-plugin:master Optimize panel state handling.

2013-08-20 Thread Harald Judt
Updating branch refs/heads/master
 to 92adcd259c605d8f5256ca20c2d639c4e3c6cfc8 (commit)
   from b94f3166b60696a1f19364049031cda07ee52c7d (commit)

commit 92adcd259c605d8f5256ca20c2d639c4e3c6cfc8
Author: Harald Judt h.j...@gmx.at
Date:   Tue Aug 20 20:18:51 2013 +0200

Optimize panel state handling.

Let's save the panel state (size, mode, number of rows) in our plugin
struct and update them when necessary. We can then rely on these variables
instead of calling the panel library functions each time we need to
access these attributes.

 panel-plugin/xfce4-cpufreq-plugin.c |   37 +--
 panel-plugin/xfce4-cpufreq-plugin.h |4 ++--
 2 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 99d9514..57fff8c 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -117,7 +117,7 @@ gboolean
 cpufreq_update_label (CpuInfo *cpu)
 {
gchar *label, *freq;
-   gint size, both;
+   gint both;
 
if (!cpuFreq-options-show_label_governor 
!cpuFreq-options-show_label_freq) {
@@ -167,8 +167,7 @@ cpufreq_widgets_layout (void)
gboolean resized = FALSE;
gboolean hide_label = (!cpuFreq-options-show_label_freq 
   
!cpuFreq-options-show_label_governor);
-   gint panel_size, pos = 1;
-   gint lw = 0, lh = 0, iw = 0, ih = 0;
+   gint pos = 1, lw = 0, lh = 0, iw = 0, ih = 0;
 
small = (hide_label ? TRUE : cpuFreq-options-keep_compact);
 
@@ -192,7 +191,6 @@ cpufreq_widgets_layout (void)
xfce_panel_plugin_set_small (cpuFreq-plugin, TRUE);
 
/* check if the label fits below the icon, else put them side by side */
-   panel_size = xfce_panel_plugin_get_size(cpuFreq-plugin);
if (GTK_IS_WIDGET(cpuFreq-label)  ! hide_label) {
gtk_widget_size_request (cpuFreq-label, label_size);
lw = label_size.width;
@@ -205,11 +203,11 @@ cpufreq_widgets_layout (void)
}
if (cpuFreq-panel_mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL 
orientation == GTK_ORIENTATION_VERTICAL 
-   lh + ih + BORDER * 2 = panel_size) {
+   lh + ih + BORDER * 2 = cpuFreq-panel_size) {
orientation = GTK_ORIENTATION_HORIZONTAL;
resized = TRUE;
} else if (orientation == GTK_ORIENTATION_HORIZONTAL 
-  lw + iw + BORDER * 2 = panel_size 
+  lw + iw + BORDER * 2 = cpuFreq-panel_size 
   (cpuFreq-panel_mode == 
XFCE_PANEL_PLUGIN_MODE_DESKBAR ||
!small)) {
orientation = GTK_ORIENTATION_VERTICAL;
@@ -364,6 +362,7 @@ static void
 cpufreq_mode_changed (XfcePanelPlugin *plugin, XfcePanelPluginMode mode, 
CpuFreqPlugin *cpufreq)
 {
cpuFreq-panel_mode = mode;
+   cpuFreq-panel_rows = xfce_panel_plugin_get_nrows (plugin);
cpuFreq-layout_changed = TRUE;
cpufreq_update_plugin ();
 }
@@ -378,21 +377,17 @@ cpufreq_update_icon (CpuFreqPlugin *cpufreq)
 
if (cpufreq-options-show_icon) {
GdkPixbuf *buf;
-   guint nrows;
-   gint panel_size;
+   gint icon_size;
 
-   panel_size = xfce_panel_plugin_get_size (cpufreq-plugin);
-   nrows = xfce_panel_plugin_get_nrows (cpuFreq-plugin);
-
-   cpufreq-icon_size = panel_size / nrows;
+   icon_size = cpuFreq-panel_size / cpuFreq-panel_rows;
if (cpufreq-options-keep_compact ||
(!cpufreq-options-show_label_freq 
 !cpufreq-options-show_label_governor))
-   cpufreq-icon_size -= 4;
+   icon_size -= 4;
 
buf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),

xfce4-cpufreq-plugin,
-   
cpufreq-icon_size, 0, NULL);
+   
icon_size, 0, NULL);
if (buf) {
cpufreq-icon = gtk_image_new_from_pixbuf (buf);
g_object_unref (G_OBJECT (buf));
@@ -423,9 +418,6 @@ cpufreq_prepare_label (CpuFreqPlugin *cpufreq)
 static void
 cpufreq_widgets (void)
 {
-   cpuFreq-icon_size = xfce_panel_plugin_get_size (cpuFreq-plugin);
-   cpuFreq-icon_size /= xfce_panel_plugin_get_nrows (cpuFreq-plugin);
-
/* create panel toggle button which will contain all other widgets */
cpuFreq-button = xfce_create_panel_toggle_button ();
xfce_panel_plugin_add_action_widget (cpuFreq-plugin, cpuFreq-button);
@@ -447,10 +439,6

[Xfce4-commits] xfce4-cpufreq-plugin:master Fix tooltip not being updated with correct cpu info.

2013-08-20 Thread Harald Judt
Updating branch refs/heads/master
 to 67898aabce1f010381460dc905bd9bcf11e5d04d (commit)
   from 487819f36cc6a00120988ba3276b949d1013c100 (commit)

commit 67898aabce1f010381460dc905bd9bcf11e5d04d
Author: Harald Judt h.j...@gmx.at
Date:   Tue Aug 20 18:53:24 2013 +0200

Fix tooltip not being updated with correct cpu info.

 panel-plugin/xfce4-cpufreq-plugin.c |   92 +++
 1 file changed, 49 insertions(+), 43 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 6874838..61cc106 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -155,45 +155,6 @@ cpufreq_update_label (CpuInfo *cpu)
return TRUE;
 }
 
-static gboolean
-cpufreq_update_tooltip (GtkWidget *widget,
-   gint x,
-   gint y,
-   gboolean keyboard_mode,
-   GtkTooltip *tooltip,
-   CpuInfo *cpu)
-{
-   gchar *tooltip_msg, *freq = NULL;
-
-   if (G_UNLIKELY(cpu == NULL)) {
-   tooltip_msg = g_strdup (_(No CPU information available.));
-   } else {
-   freq = cpufreq_get_human_readable_freq (cpu-cur_freq);
-   if (cpuFreq-options-show_label_governor  
cpuFreq-options-show_label_freq)
-   tooltip_msg = g_strdup_printf (ngettext(%d cpu 
available, %d cpus available, cpuFreq-cpus-len), cpuFreq-cpus-len);
-   else
-   tooltip_msg =
-   g_strconcat (!cpuFreq-options-show_label_freq 
? _(Frequency: ) : ,
-
!cpuFreq-options-show_label_freq ? freq : ,
-
-cpu-cur_governor != 
NULL 
-
!cpuFreq-options-show_label_freq 
-
!cpuFreq-options-show_label_governor ? \n : ,
-
-cpu-cur_governor != 
NULL 
-
!cpuFreq-options-show_label_governor ? _(Governor: ) : ,
-cpu-cur_governor != 
NULL 
-
!cpuFreq-options-show_label_governor ? cpu-cur_governor : ,
-NULL);
-   }
-
-   gtk_tooltip_set_text (tooltip, tooltip_msg);
-
-   g_free (freq);
-   g_free (tooltip_msg);
-   return TRUE;
-}
-
 static void
 cpufreq_widgets_layout (void)
 {
@@ -328,6 +289,54 @@ cpufreq_update_plugin (void)
return ret;
 }
 
+static gboolean
+cpufreq_update_tooltip (GtkWidget *widget,
+   gint x,
+   gint y,
+   gboolean keyboard_mode,
+   GtkTooltip *tooltip,
+   CpuFreqPlugin *cpufreq)
+{
+   CpuInfo *cpu;
+   gchar *tooltip_msg, *freq = NULL;
+
+   cpu = cpufreq_current_cpu ();
+
+   if (G_UNLIKELY(cpu == NULL)) {
+   tooltip_msg = g_strdup (_(No CPU information available.));
+   } else {
+   freq = cpufreq_get_human_readable_freq (cpu-cur_freq);
+   if (cpuFreq-options-show_label_governor 
+   cpuFreq-options-show_label_freq)
+   tooltip_msg =
+   g_strdup_printf (ngettext (%d cpu available,
+   
   %d cpus available,
+   
   cpuFreq-cpus-len),
+
cpuFreq-cpus-len);
+   else
+   tooltip_msg =
+   g_strconcat
+   (!cpuFreq-options-show_label_freq ? 
_(Frequency: ) : ,
+!cpuFreq-options-show_label_freq ? freq : ,
+
+cpu-cur_governor != NULL 
+!cpuFreq-options-show_label_freq 
+!cpuFreq-options-show_label_governor ? \n 
: ,
+
+cpu-cur_governor != NULL 
+!cpuFreq-options-show_label_governor ? 
_(Governor: ) : ,
+cpu-cur_governor != NULL 
+!cpuFreq-options-show_label_governor ? 
cpu-cur_governor : ,
+NULL);
+   }
+
+   gtk_tooltip_set_text (tooltip, tooltip_msg

[Xfce4-commits] xfce4-cpufreq-plugin:master Always update icon when changing options.

2013-08-20 Thread Harald Judt
Updating branch refs/heads/master
 to 9073a09b3b48b1ed72b4554cc0e348577346b14d (commit)
   from 406dd2e9872a64a883aca80d8727587688926e20 (commit)

commit 9073a09b3b48b1ed72b4554cc0e348577346b14d
Author: Harald Judt h.j...@gmx.at
Date:   Tue Aug 20 19:28:53 2013 +0200

Always update icon when changing options.

It happens rarely, so why not make the code a bit cleaner?

 panel-plugin/xfce4-cpufreq-configure.c |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index 56939f7..125bec0 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -37,11 +37,8 @@ static void
 check_button_changed (GtkWidget *button, CpuFreqPluginConfigure *configure)
 {
if (button == configure-display_icon)
-   {
cpuFreq-options-show_icon = 
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(button));
-   cpufreq_update_icon (cpuFreq);
-   }
 
else if (button == configure-display_freq)
cpuFreq-options-show_label_freq =
@@ -51,11 +48,9 @@ check_button_changed (GtkWidget *button, 
CpuFreqPluginConfigure *configure)
cpuFreq-options-show_label_governor =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(button));
 
-   else if (button == configure-keep_compact) {
+   else if (button == configure-keep_compact)
cpuFreq-options-keep_compact =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(button));
-   cpufreq_update_icon (cpuFreq);
-   }
 
else if (button == configure-one_line)
cpuFreq-options-one_line =
@@ -70,6 +65,7 @@ check_button_changed (GtkWidget *button, 
CpuFreqPluginConfigure *configure)
} else
gtk_widget_set_sensitive (configure-display_icon, TRUE);
 
+   cpufreq_update_icon (cpuFreq);
cpuFreq-layout_changed = TRUE;
cpufreq_update_plugin ();
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Support showing icon only (bug #7474).

2013-08-20 Thread Harald Judt
Updating branch refs/heads/master
 to 406dd2e9872a64a883aca80d8727587688926e20 (commit)
   from 8e98219a76463e3634a75214d70c857c8ac5cb85 (commit)

commit 406dd2e9872a64a883aca80d8727587688926e20
Author: Harald Judt h.j...@gmx.at
Date:   Tue Aug 20 18:54:47 2013 +0200

Support showing icon only (bug #7474).

 panel-plugin/xfce4-cpufreq-configure.c |   14 --
 panel-plugin/xfce4-cpufreq-plugin.c|8 +++-
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index 6b9924c..56939f7 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -57,10 +57,18 @@ check_button_changed (GtkWidget *button, 
CpuFreqPluginConfigure *configure)
cpufreq_update_icon (cpuFreq);
}
 
-   else if (button == configure-one_line) {
+   else if (button == configure-one_line)
cpuFreq-options-one_line =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(button));
-   }
+
+   if (!cpuFreq-options-show_label_freq 
+   !cpuFreq-options-show_label_governor) {
+   if (!cpuFreq-options-show_icon)
+   gtk_toggle_button_set_active
+   (GTK_TOGGLE_BUTTON (configure-display_icon), 
TRUE);
+   gtk_widget_set_sensitive (configure-display_icon, FALSE);
+   } else
+   gtk_widget_set_sensitive (configure-display_icon, TRUE);
 
cpuFreq-layout_changed = TRUE;
cpufreq_update_plugin ();
@@ -305,6 +313,8 @@ cpufreq_configure (XfcePanelPlugin *plugin)
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-show_icon);
g_signal_connect (G_OBJECT (button), toggled, G_CALLBACK 
(check_button_changed), configure);
+   if (!cpuFreq-options-show_label_freq  
!cpuFreq-options-show_label_governor)
+   gtk_widget_set_sensitive (configure-display_icon, FALSE);
 
button = configure-display_freq = gtk_check_button_new_with_mnemonic 
(_(Show CPU fre_quency));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 5a3836c..054fe37 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -120,8 +120,11 @@ cpufreq_update_label (CpuInfo *cpu)
gint size, both;
 
if (!cpuFreq-options-show_label_governor 
-   !cpuFreq-options-show_label_freq)
+   !cpuFreq-options-show_label_freq) {
+   if (cpuFreq-label != NULL)
+   gtk_widget_hide (cpuFreq-label);
return TRUE;
+   }

both = cpu-cur_governor != NULL 
cpuFreq-options-show_label_freq 
@@ -472,6 +475,9 @@ cpufreq_read_config (void)
cpuFreq-options-keep_compact= xfce_rc_read_bool_entry (rc, 
keep_compact, FALSE);
cpuFreq-options-one_line= xfce_rc_read_bool_entry (rc, 
one_line, FALSE);
 
+   if (!cpuFreq-options-show_label_freq  
!cpuFreq-options-show_label_governor)
+   cpuFreq-options-show_icon = TRUE;
+
value = xfce_rc_read_entry (rc, fontname, NULL);
if (value) {
g_free (cpuFreq-options-fontname);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Always use a single row when only the icon is shown.

2013-08-20 Thread Harald Judt
Updating branch refs/heads/master
 to b94f3166b60696a1f19364049031cda07ee52c7d (commit)
   from 9073a09b3b48b1ed72b4554cc0e348577346b14d (commit)

commit b94f3166b60696a1f19364049031cda07ee52c7d
Author: Harald Judt h.j...@gmx.at
Date:   Tue Aug 20 19:49:17 2013 +0200

Always use a single row when only the icon is shown.

 panel-plugin/xfce4-cpufreq-plugin.c |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 054fe37..99d9514 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -165,9 +165,13 @@ cpufreq_widgets_layout (void)
GtkOrientation orientation;
gboolean small = cpuFreq-options-keep_compact;
gboolean resized = FALSE;
+   gboolean hide_label = (!cpuFreq-options-show_label_freq 
+  
!cpuFreq-options-show_label_governor);
gint panel_size, pos = 1;
gint lw = 0, lh = 0, iw = 0, ih = 0;
 
+   small = (hide_label ? TRUE : cpuFreq-options-keep_compact);
+
switch (cpuFreq-panel_mode) {
case XFCE_PANEL_PLUGIN_MODE_HORIZONTAL:
orientation = small ? GTK_ORIENTATION_HORIZONTAL : 
GTK_ORIENTATION_VERTICAL;
@@ -183,9 +187,13 @@ cpufreq_widgets_layout (void)
break;
}
 
+   /* always set plugin small state when only icon is shown */
+   if (hide_label)
+   xfce_panel_plugin_set_small (cpuFreq-plugin, TRUE);
+
/* check if the label fits below the icon, else put them side by side */
panel_size = xfce_panel_plugin_get_size(cpuFreq-plugin);
-   if (GTK_IS_WIDGET(cpuFreq-label)) {
+   if (GTK_IS_WIDGET(cpuFreq-label)  ! hide_label) {
gtk_widget_size_request (cpuFreq-label, label_size);
lw = label_size.width;
lh = label_size.height;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Show max performance value by default when using intel pstate driver.

2013-08-20 Thread Harald Judt
Updating branch refs/heads/master
 to 1b7dfa6c25ac8d684f7530e52ca43375c30ff8b4 (commit)
   from 92adcd259c605d8f5256ca20c2d639c4e3c6cfc8 (commit)

commit 1b7dfa6c25ac8d684f7530e52ca43375c30ff8b4
Author: Harald Judt h.j...@gmx.at
Date:   Tue Aug 20 20:39:16 2013 +0200

Show max performance value by default when using intel pstate driver.

 panel-plugin/xfce4-cpufreq-linux.c |   19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-linux.c 
b/panel-plugin/xfce4-cpufreq-linux.c
index 585028b..23fbcef 100644
--- a/panel-plugin/xfce4-cpufreq-linux.c
+++ b/panel-plugin/xfce4-cpufreq-linux.c
@@ -458,9 +458,22 @@ cpufreq_linux_init (void)
if (cpuFreq-cpus == NULL)
return FALSE;
 
-   if (g_file_test (/sys/devices/system/cpu/intel_pstate, 
G_FILE_TEST_EXISTS))
-   return cpufreq_cpu_intel_pstate_read ();
-   else if (g_file_test (/sys/devices/system/cpu/cpu0/cpufreq,
+   if (g_file_test (/sys/devices/system/cpu/intel_pstate, 
G_FILE_TEST_EXISTS)) {
+   gboolean ret = cpufreq_cpu_intel_pstate_read ();
+
+   /* Tools like i7z show the current real frequency using the
+  current maximum performance. Assuming this is the proper
+  way to do it, let's choose the maximum per default. Most
+  CPUs nowadays have more than one core anyway, so there will
+  not be much use in showing a single core's performance
+  value. Besides, it's not very likely the user wants to
+  follow values for 4 or 8 cores per second. */
+   if (ret  cpuFreq-options-show_warning) {
+   cpuFreq-options-show_cpu = CPU_MAX;
+   cpuFreq-options-show_warning = FALSE;
+   }
+   return ret;
+   } else if (g_file_test (/sys/devices/system/cpu/cpu0/cpufreq,
  G_FILE_TEST_EXISTS))
return cpufreq_cpu_read_sysfs ();
else if (g_file_test (/proc/cpufreq, G_FILE_TEST_EXISTS))
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Merge branch 'master' of git://git.xfce.org/panel-plugins/xfce4-cpufreq-plugin

2013-08-19 Thread Harald Judt
Updating branch refs/heads/master
 to bf847ce2735839be4aa5ee2a1b188f66ba32a022 (commit)
   from e12661067a0e9d667573609926b0ecca92158931 (commit)

commit bf847ce2735839be4aa5ee2a1b188f66ba32a022
Merge: e126610 8896314
Author: Harald Judt h.j...@gmx.at
Date:   Mon Aug 19 16:40:43 2013 +0200

Merge branch 'master' of 
git://git.xfce.org/panel-plugins/xfce4-cpufreq-plugin

commit 889631419625683beca568b92ebd225603537868
Author: MC correomc2000-...@yahoo.es
Date:   Mon Aug 19 12:31:36 2013 +0200

I18n: Update translation es (71%).

28 translated messages, 11 untranslated messages.

Transifex (https://www.transifex.com/projects/p/xfce/).

commit fd79ead5af32707fc59cdb838be208ffbef0f067
Author: Rafael Ferreira rafael.f...@gmail.com
Date:   Mon Aug 19 06:31:21 2013 +0200

I18n: Update translation pt_BR (100%).

39 translated messages.

Transifex (https://www.transifex.com/projects/p/xfce/).

commit 0d7711305d33d397b7453602a6da3252d0d96b73
Author: k3lt01 keltoi...@gmail.com
Date:   Mon Aug 19 06:31:21 2013 +0200

I18n: Update translation en_AU (100%).

39 translated messages.

Transifex (https://www.transifex.com/projects/p/xfce/).

commit b909c7da7653952a1a4f6d748f7b0cfc5edd22c9
Author: jc1 jc1.quebe...@gmail.com
Date:   Mon Aug 19 00:31:21 2013 +0200

I18n: Update translation fr (100%).

39 translated messages.

Transifex (https://www.transifex.com/projects/p/xfce/).

 po/en_AU.po |   76 ++
 po/es.po|   82 +++---
 po/fr.po|   93 +++--
 po/pt_BR.po |   96 +++
 4 files changed, 134 insertions(+), 213 deletions(-)

diff --git a/po/en_AU.po b/po/en_AU.po
index 426b032..6caddbd 100644
--- a/po/en_AU.po
+++ b/po/en_AU.po
@@ -1,39 +1,38 @@
 # SOME DESCRIPTIVE TITLE.
 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
 # This file is distributed under the same license as the PACKAGE package.
-#
+# 
 # Translators:
 # k3lt01 keltoi...@gmail.com, 2013
 msgid 
 msgstr 
 Project-Id-Version: Xfce Panel Plugins\n
 Report-Msgid-Bugs-To: \n
-POT-Creation-Date: 2013-08-18 09:44+0200\n
-PO-Revision-Date: 2013-07-29 08:40+\n
+POT-Creation-Date: 2013-08-18 12:31+0200\n
+PO-Revision-Date: 2013-08-19 03:33+\n
 Last-Translator: k3lt01 keltoi...@gmail.com\n
-Language-Team: English (Australia) (http://www.transifex.com/projects/p/xfce/;
-language/en_AU/)\n
-Language: en_AU\n
+Language-Team: English (Australia) 
(http://www.transifex.com/projects/p/xfce/language/en_AU/)\n
 MIME-Version: 1.0\n
 Content-Type: text/plain; charset=UTF-8\n
 Content-Transfer-Encoding: 8bit\n
+Language: en_AU\n
 Plural-Forms: nplurals=2; plural=(n != 1);\n
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:78
 msgid Select font...
-msgstr 
+msgstr Select font...
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:80
 msgid Select font family and size to use for the labels.
-msgstr 
+msgstr Select font family and size to use for the labels.
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:84
 msgid Right-click to revert to the default font.
-msgstr 
+msgstr Right-click to revert to the default font.
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:102
 msgid Select font
-msgstr 
+msgstr Select font
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:188
 msgid Configure CPU Frequency Monitor
@@ -49,7 +48,7 @@ msgstr bMonitor/b
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:223
 msgid _Update interval:
-msgstr 
+msgstr _Update interval:
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:241
 msgid bPanel/b
@@ -57,56 +56,50 @@ msgstr bPanel/b
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:257
 msgid _Font:
-msgstr 
+msgstr _Font:
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:275
-#, fuzzy
 msgid _Display CPU:
-msgstr Display CPU:
+msgstr _Display CPU:
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:290
 msgid min
-msgstr 
+msgstr min
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:291
 msgid avg
-msgstr 
+msgstr avg
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:292
 msgid max
-msgstr 
+msgstr max
 
 #. check buttons for display widgets in panel
 #: ../panel-plugin/xfce4-cpufreq-configure.c:298
 msgid _Keep compact
-msgstr 
+msgstr _Keep compact
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:303
 msgid Show text in a single _line
-msgstr 
+msgstr Show text in a single _line
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:308
-#, fuzzy
 msgid Show CPU _icon
-msgstr Show CPU icon
+msgstr Show CPU _icon
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:313
-#, fuzzy
 msgid Show CPU fre_quency
-msgstr Show CPU frequency
+msgstr Show CPU fre_quency
 
 #: ../panel-plugin/xfce4-cpufreq-configure.c:318
-#, fuzzy
 msgid Show CPU _governor
-msgstr Show CPU governor
+msgstr Show CPU _governor
 
 #: ../panel-plugin/xfce4-cpufreq-linux.c:465
 msgid 
 Your system does not support

[Xfce4-commits] xfce4-cpufreq-plugin:master Fix reading number of CPUs when cpufreq is available.

2013-08-19 Thread Harald Judt
Updating branch refs/heads/master
 to e12661067a0e9d667573609926b0ecca92158931 (commit)
   from 28e29670f4a9db924959503e7b36c2b67a42631b (commit)

commit e12661067a0e9d667573609926b0ecca92158931
Author: Harald Judt h.j...@gmx.at
Date:   Mon Aug 19 16:37:42 2013 +0200

Fix reading number of CPUs when cpufreq is available.

When using cpufreq, the number of CPUs detected was wrong. Fix it by 
rewriting
the read_sysfs function.

 panel-plugin/xfce4-cpufreq-linux.c |   37 +---
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-linux.c 
b/panel-plugin/xfce4-cpufreq-linux.c
index 26ca1fd..585028b 100644
--- a/panel-plugin/xfce4-cpufreq-linux.c
+++ b/panel-plugin/xfce4-cpufreq-linux.c
@@ -325,26 +325,33 @@ cpufreq_cpu_read_procfs ()
return TRUE;
 }
 
+static inline gboolean
+cpufreq_cpu_exists (gint num)
+{
+   const gchar *base = /sys/devices/system/cpu;
+   gchar *file;
+   gboolean ret;
+
+   file = g_strdup_printf (%s/cpu%d, base, num);
+   ret = g_file_test (file, G_FILE_TEST_EXISTS);
+   g_free (file);
+   return ret;
+}
+
 static gboolean
-cpufreq_cpu_read_sysfs ()
+cpufreq_cpu_read_sysfs (void)
 {
-   gint j, i = -2;
-   DIR *dir;
-   struct dirent *dir_entry;
+   gchar *file;
+   gint count = 0, i = 0;
 
-   if ((dir = opendir (/sys/devices/system/cpu)) != NULL)
-   {
-   while ((dir_entry = readdir (dir)) != NULL)
-   i++;
-   }
-   else
+   while (cpufreq_cpu_exists (count))
+   count++;
+
+   if (count == 0)
return FALSE;
-   closedir (dir);
 
-   for (j = 0; j  i; j++)
-   {
-   cpufreq_cpu_parse_sysfs_init (j, NULL);
-   }
+   while (i  count)
+   cpufreq_cpu_parse_sysfs_init (i++, NULL);
 
return TRUE;
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Support panel 4.9 features (deskbar mode) (bug #8396).

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to d687db9cd1fbbe47a1f4d756aa9ac429c83e97ba (commit)
   from c25b820ed416ddbd890bd4e83237eeae612f1293 (commit)

commit d687db9cd1fbbe47a1f4d756aa9ac429c83e97ba
Author: Andrzej ndrwr...@gmail.com
Date:   Wed Aug 7 10:45:14 2013 +0200

Support panel 4.9 features (deskbar mode) (bug #8396).

Adjust icon size and label orientation to follow panel 4.9+ conventions.

 panel-plugin/xfce4-cpufreq-plugin.c |   48 ---
 1 file changed, 44 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index d6340f5..063fc16 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -71,7 +71,11 @@ cpufreq_update_label (CpuInfo *cpu)
if (strcmp(label,))
{
gtk_label_set_markup (GTK_LABEL(cpuFreq-label), label);
+#if defined (LIBXFCE4PANEL_CHECK_VERSION)  LIBXFCE4PANEL_CHECK_VERSION 
(4,9,0)
+   if (xfce_panel_plugin_get_mode (cpuFreq-plugin) == 
XFCE_PANEL_PLUGIN_MODE_VERTICAL)
+#else
if (xfce_panel_plugin_get_orientation (cpuFreq-plugin) == 
GTK_ORIENTATION_VERTICAL)
+#endif
gtk_label_set_angle (GTK_LABEL(cpuFreq-label), -90);
else
gtk_label_set_angle (GTK_LABEL(cpuFreq-label), 0);
@@ -142,12 +146,29 @@ cpufreq_restart_timeout (void)
 #endif
 }
 
+#if defined (LIBXFCE4PANEL_CHECK_VERSION)  LIBXFCE4PANEL_CHECK_VERSION 
(4,9,0)
+static void
+cpufreq_mode_changed (XfcePanelPlugin *plugin, XfcePanelPluginMode mode, 
CpuFreqPlugin *cpufreq)
+{
+GtkOrientation orientation;
+
+orientation =
+  (mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL) ?
+  GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL;
+
+   gtk_orientable_set_orientation (GTK_ORIENTABLE (cpufreq-box), 
orientation);
+   cpufreq_update_plugin ();
+}
+
+#else
+
 static void
 cpufreq_orientation_changed (XfcePanelPlugin *plugin, GtkOrientation 
orientation, CpuFreqPlugin *cpufreq)
 {
gtk_orientable_set_orientation (GTK_ORIENTABLE (cpufreq-box), 
orientation);
cpufreq_update_plugin ();
 }
+#endif
 
 void
 cpufreq_update_icon (CpuFreqPlugin *cpufreq)
@@ -195,10 +216,13 @@ cpufreq_prepare_label (CpuFreqPlugin *cpufreq)
 static void
 cpufreq_widgets (void)
 {
-   GtkOrientation  orientation;
-
-   orientation = xfce_panel_plugin_get_orientation (cpuFreq-plugin);
+#if defined (LIBXFCE4PANEL_CHECK_VERSION)  LIBXFCE4PANEL_CHECK_VERSION 
(4,9,0)
+   cpuFreq-icon_size = xfce_panel_plugin_get_size (cpuFreq-plugin);
+   cpuFreq-icon_size /= xfce_panel_plugin_get_nrows (cpuFreq-plugin);
+   cpuFreq-icon_size -=4;
+#else
cpuFreq-icon_size = xfce_panel_plugin_get_size (cpuFreq-plugin) - 4;
+#endif
 
cpuFreq-ebox = gtk_event_box_new ();
xfce_panel_plugin_add_action_widget (cpuFreq-plugin, cpuFreq-ebox);
@@ -221,7 +245,13 @@ cpufreq_widgets (void)
 
g_signal_connect (cpuFreq-ebox, button-press-event, G_CALLBACK 
(cpufreq_overview), cpuFreq);
 
-   cpufreq_orientation_changed (cpuFreq-plugin, orientation, cpuFreq);
+#if defined (LIBXFCE4PANEL_CHECK_VERSION)  LIBXFCE4PANEL_CHECK_VERSION 
(4,9,0)
+   cpufreq_mode_changed
+  (cpuFreq-plugin, xfce_panel_plugin_get_mode (cpuFreq-plugin), 
cpuFreq);
+#else
+   cpufreq_orientation_changed
+  (cpuFreq-plugin, xfce_panel_plugin_get_orientation 
(cpuFreq-plugin), cpuFreq);
+#endif
gtk_widget_show (cpuFreq-box);
gtk_widget_show (cpuFreq-ebox);
 
@@ -308,7 +338,12 @@ cpufreq_free (XfcePanelPlugin *plugin)
 static gboolean
 cpufreq_set_size (XfcePanelPlugin *plugin, gint size, CpuFreqPlugin *cpufreq)
 {
+#if defined (LIBXFCE4PANEL_CHECK_VERSION)  LIBXFCE4PANEL_CHECK_VERSION 
(4,9,0)
+   cpuFreq-icon_size = size / xfce_panel_plugin_get_nrows 
(cpuFreq-plugin);
+   cpuFreq-icon_size -=4;
+#else
cpufreq-icon_size = size - 4;
+#endif
cpufreq_update_icon (cpufreq);
cpufreq_update_plugin ();
 
@@ -350,8 +385,13 @@ cpufreq_construct (XfcePanelPlugin *plugin)
  NULL);
g_signal_connect (plugin, size-changed,
  G_CALLBACK (cpufreq_set_size), cpuFreq);
+#if defined (LIBXFCE4PANEL_CHECK_VERSION)  LIBXFCE4PANEL_CHECK_VERSION 
(4,9,0)
+   g_signal_connect (plugin, mode-changed,
+ G_CALLBACK (cpufreq_mode_changed), cpuFreq);
+#else
g_signal_connect (plugin, orientation-changed,
  G_CALLBACK (cpufreq_orientation_changed), cpuFreq);
+#endif
 
/* the configure and about menu items are hidden by default */
xfce_panel_plugin_menu_show_configure (plugin);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Build the plugin as a module.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 78b49f5eba4ccf0e0aa280e45c80b479ea83e470 (commit)
   from 4e56722b749e6b5c54bd7d8d7814e6339d7f3485 (commit)

commit 78b49f5eba4ccf0e0aa280e45c80b479ea83e470
Author: Harald Judt h.j...@gmx.at
Date:   Thu Aug 8 14:22:57 2013 +0200

Build the plugin as a module.

 configure.ac.in |9 ++--
 panel-plugin/Makefile.am|   51 ---
 panel-plugin/cpufreq.desktop.in |7 
 panel-plugin/xfce4-cpufreq-plugin.c |2 +-
 panel-plugin/xfce4-cpufreq-plugin.desktop.in.in |6 ---
 po/POTFILES.in  |2 +-
 6 files changed, 42 insertions(+), 35 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 635e9dd..f720793 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -14,10 +14,9 @@ m4_define([cpufreq_version], 
[cpufreq_version_major().cpufreq_version_minor().cp
 
 dnl Initialize autoconf
 AC_COPYRIGHT([Copyright (c) 2006 Thomas Schreck sh...@xfce.org
-  Copyright (c) 2010,2011 Florian Rivoal friv...@xfce.org
+  Copyright (c) 2010-2011 Florian Rivoal friv...@xfce.org
   Copyright (c) 2013 Harald Judt h.j...@gmx.at])
-AC_INIT([xfce4-cpufreq-plugin], [cpufreq_version()],
-   [friv...@xfce.org])
+AC_INIT([xfce4-cpufreq-plugin], [cpufreq_version()], 
[http://bugzilla.xfce.org], [xfce4-cpufreq-plugin])
 AC_PREREQ([2.60])
 
 dnl Initialize automake
@@ -27,11 +26,15 @@ AM_MAINTAINER_MODE()
 
 dnl Check for basic programs
 AC_PROG_CC()
+AC_PROG_LD()
 AC_PROG_INSTALL()
 AC_PROG_INTLTOOL()
 LT_PREREQ([2.2.6])
 LT_INIT([disable-static])
 
+dnl Check for standard headers
+AC_HEADER_STDC()
+
 dnl Check for i18n support
 XDT_I18N([@LINGUAS@])
 
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index c8611fa..2b61f12 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -1,19 +1,22 @@
-plugindir = $(libexecdir)/xfce4/panel-plugins
-plugin_PROGRAMS = xfce4-cpufreq-plugin
-
-xfce4_cpufreq_plugin_CFLAGS =  \
-   -I$(top_srcdir) \
-   @LIBXFCE4PANEL_CFLAGS@  \
-   @LIBXFCE4UTIL_CFLAGS@   \
-   @LIBXFCE4UI_CFLAGS@ \
+AM_CPPFLAGS=   \
+   -I$(top_srcdir) \
-DPACKAGE_LOCALE_DIR=\$(localedir)\
 
-xfce4_cpufreq_plugin_LDADD =   \
-   @LIBXFCE4PANEL_LIBS@\
-   @LIBXFCE4UTIL_LIBS@ \
-   @LIBXFCE4UI_LIBS@
+plugindir = $(libdir)/xfce4/panel/plugins
 
-xfce4_cpufreq_plugin_SOURCES = \
+plugin_LTLIBRARIES = libcpufreq.la
+
+libcpufreq_la_CFLAGS = \
+   $(LIBXFCE4PANEL_CFLAGS) \
+   $(LIBXFCE4UTIL_CFLAGS)  \
+   $(LIBXFCE4UI_CFLAGS)
+
+libcpufreq_la_LIBADD = \
+   $(LIBXFCE4PANEL_LIBS)   \
+   $(LIBXFCE4UTIL_LIBS)\
+   $(LIBXFCE4UI_LIBS)
+
+libcpufreq_la_SOURCES =\
xfce4-cpufreq-plugin.h  \
xfce4-cpufreq-plugin.c  \
xfce4-cpufreq-linux.h   \
@@ -25,20 +28,20 @@ xfce4_cpufreq_plugin_SOURCES =  
\
xfce4-cpufreq-utils.h   \
xfce4-cpufreq-utils.c
 
-desktop_in_in_files = xfce4-cpufreq-plugin.desktop.in.in
-desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
+libcpugraph_la_LDFLAGS = \
+   -avoid-version \
+   -module \
+   -no-undefined \
+   -export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
+   $(PLATFORM_LDFLAGS)
 
-desktopdir = $(datadir)/xfce4/panel-plugins
+desktopdir = $(datadir)/xfce4/panel/plugins
+desktop_in_files = cpufreq.desktop.in
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
 
 EXTRA_DIST =   \
-   $(desktop_in_in_files)
-
-DISTCLEANFILES =   \
-   $(desktop_DATA) $(desktop_in_files)
+   $(desktop_in_files)
 
-# get full path into .desktop file
-%.desktop.in: %.desktop.in.in
-   sed -e s^@PLUGIN_PATH@^$(libexecdir)/xfce4/panel-plugins^ \
-   $  $@
+DISTCLEANFILES =   
\
+   $(desktop_DATA)
diff --git a/panel-plugin/cpufreq.desktop.in b/panel-plugin

[Xfce4-commits] xfce4-cpufreq-plugin:master Add option to keep the plugin compact.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 65bb883aa1da7b13567d4a953fe1210bbcaff07a (commit)
   from 3b832bea98e996ca02520e922b975f91e59be1ec (commit)

commit 65bb883aa1da7b13567d4a953fe1210bbcaff07a
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 11 00:28:26 2013 +0200

Add option to keep the plugin compact.

This allows to toggle the single row / panel small property.
Let's also remove the cruft that is the version check for older panels.
panel =4.9 is required now.

 panel-plugin/xfce4-cpufreq-configure.c |9 +++
 panel-plugin/xfce4-cpufreq-configure.h |   12 +++-
 panel-plugin/xfce4-cpufreq-plugin.c|  111 +++-
 panel-plugin/xfce4-cpufreq-plugin.h|2 +
 4 files changed, 85 insertions(+), 49 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index 60af8a7..7d68d85 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -57,6 +57,10 @@ check_button_changed (GtkWidget *button, 
CpuFreqPluginConfigure *configure)
cpuFreq-options-show_label_governor =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(button));
 
+   else if (button == configure-keep_compact)
+   cpuFreq-options-keep_compact =
+   gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(button));
+
cpufreq_prepare_label (cpuFreq);
cpufreq_update_plugin ();
 }
@@ -193,6 +197,11 @@ cpufreq_configure (XfcePanelPlugin *plugin)
 
 
/* check buttons for display widgets in panel */
+   button = configure-keep_compact = gtk_check_button_new_with_mnemonic 
(_(_Keep compact));
+   gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
+   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-keep_compact);
+   g_signal_connect (G_OBJECT (button), toggled, G_CALLBACK 
(check_button_changed), configure);
+
button = configure-display_frame = gtk_check_button_new_with_mnemonic 
(_(Show frame));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-show_frame);
diff --git a/panel-plugin/xfce4-cpufreq-configure.h 
b/panel-plugin/xfce4-cpufreq-configure.h
index c33112c..417f2eb 100644
--- a/panel-plugin/xfce4-cpufreq-configure.h
+++ b/panel-plugin/xfce4-cpufreq-configure.h
@@ -23,9 +23,15 @@
 
 typedef struct
 {
-   GtkWidget *display_icon, *display_freq, *display_governor;
-   GtkWidget *display_cpu, *display_frame, *monitor_timeout;
-   GtkWidget *combo_cpu, *spinner_timeout;
+   GtkWidget *display_icon;
+   GtkWidget *display_freq;
+   GtkWidget *display_governor;
+   GtkWidget *display_cpu;
+   GtkWidget *display_frame;
+   GtkWidget *monitor_timeout;
+   GtkWidget *combo_cpu;
+   GtkWidget *spinner_timeout;
+   GtkWidget *keep_compact;
 } CpuFreqPluginConfigure;
 
 G_BEGIN_DECLS
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 8094586..4c4f293 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -71,11 +71,7 @@ cpufreq_update_label (CpuInfo *cpu)
if (strcmp(label,))
{
gtk_label_set_markup (GTK_LABEL(cpuFreq-label), label);
-#if defined (LIBXFCE4PANEL_CHECK_VERSION)  LIBXFCE4PANEL_CHECK_VERSION 
(4,9,0)
-   if (xfce_panel_plugin_get_mode (cpuFreq-plugin) == 
XFCE_PANEL_PLUGIN_MODE_VERTICAL)
-#else
-   if (xfce_panel_plugin_get_orientation (cpuFreq-plugin) == 
GTK_ORIENTATION_VERTICAL)
-#endif
+   if (cpuFreq-panel_mode == XFCE_PANEL_PLUGIN_MODE_VERTICAL)
gtk_label_set_angle (GTK_LABEL(cpuFreq-label), -90);
else
gtk_label_set_angle (GTK_LABEL(cpuFreq-label), 0);
@@ -130,6 +126,57 @@ cpufreq_update_tooltip (GtkWidget *widget,
return TRUE;
 }
 
+static void
+cpufreq_widgets_layout (void)
+{
+   gint pos = 1;
+   GtkOrientation orientation;
+   XfcePanelPluginMode mode;
+   gboolean small = cpuFreq-options-keep_compact;
+
+   switch (cpuFreq-panel_mode) {
+   case XFCE_PANEL_PLUGIN_MODE_HORIZONTAL:
+   orientation = small ? GTK_ORIENTATION_HORIZONTAL : 
GTK_ORIENTATION_VERTICAL;
+   xfce_panel_plugin_set_small (cpuFreq-plugin, small);
+   break;
+   case XFCE_PANEL_PLUGIN_MODE_VERTICAL:
+   orientation = small ? GTK_ORIENTATION_VERTICAL : 
GTK_ORIENTATION_HORIZONTAL;
+   xfce_panel_plugin_set_small (cpuFreq-plugin, small);
+   break;
+   case XFCE_PANEL_PLUGIN_MODE_DESKBAR:
+   orientation = small ? GTK_ORIENTATION_HORIZONTAL : 
GTK_ORIENTATION_VERTICAL;
+   xfce_panel_plugin_set_small (cpuFreq-plugin, FALSE);
+   break

[Xfce4-commits] xfce4-cpufreq-plugin:master Get rid of the frame.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to bb6ffb59ab5f1549920652a02066b6ab034a11c4 (commit)
   from a2fbdb641398181241688f6181236987a8a508bd (commit)

commit bb6ffb59ab5f1549920652a02066b6ab034a11c4
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 11 00:41:43 2013 +0200

Get rid of the frame.

Drop the frame code. I found the frame useless and ugly. The user can add
separators or spaces to keep the plugin distinct from other objects on the
panel, so there is no need for it.

 panel-plugin/xfce4-cpufreq-configure.c |   13 +
 panel-plugin/xfce4-cpufreq-configure.h |1 -
 panel-plugin/xfce4-cpufreq-plugin.c|   10 +-
 panel-plugin/xfce4-cpufreq-plugin.h|3 +--
 4 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index 7d68d85..67cbe25 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -35,13 +35,7 @@
 static void
 check_button_changed (GtkWidget *button, CpuFreqPluginConfigure *configure)
 {
-   if (button == configure-display_frame)
-   {
-   cpuFreq-options-show_frame = gtk_toggle_button_get_active 
(GTK_TOGGLE_BUTTON (button));
-   gtk_frame_set_shadow_type (GTK_FRAME 
(cpuFreq-frame),cpuFreq-options-show_frame ? GTK_SHADOW_IN : 
GTK_SHADOW_NONE);
-   return;
-   }
-   else if (button == configure-display_icon)
+   if (button == configure-display_icon)
{
cpuFreq-options-show_icon = 
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(button));
@@ -202,11 +196,6 @@ cpufreq_configure (XfcePanelPlugin *plugin)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-keep_compact);
g_signal_connect (G_OBJECT (button), toggled, G_CALLBACK 
(check_button_changed), configure);
 
-   button = configure-display_frame = gtk_check_button_new_with_mnemonic 
(_(Show frame));
-   gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
-   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-show_frame);
-   g_signal_connect (G_OBJECT (button), toggled, G_CALLBACK 
(check_button_changed), configure);
-
button = configure-display_icon = gtk_check_button_new_with_mnemonic 
(_(Show CPU icon));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-show_icon);
diff --git a/panel-plugin/xfce4-cpufreq-configure.h 
b/panel-plugin/xfce4-cpufreq-configure.h
index 417f2eb..c086be4 100644
--- a/panel-plugin/xfce4-cpufreq-configure.h
+++ b/panel-plugin/xfce4-cpufreq-configure.h
@@ -27,7 +27,6 @@ typedef struct
GtkWidget *display_freq;
GtkWidget *display_governor;
GtkWidget *display_cpu;
-   GtkWidget *display_frame;
GtkWidget *monitor_timeout;
GtkWidget *combo_cpu;
GtkWidget *spinner_timeout;
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 4c4f293..97b4ee1 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -266,18 +266,12 @@ cpufreq_widgets (void)
 
cpuFreq-ebox = gtk_event_box_new ();
gtk_event_box_set_visible_window (GTK_EVENT_BOX (cpuFreq-ebox), FALSE);
-
xfce_panel_plugin_add_action_widget (cpuFreq-plugin, cpuFreq-ebox);
gtk_container_add (GTK_CONTAINER (cpuFreq-plugin), cpuFreq-ebox);
 
-   cpuFreq-frame = gtk_frame_new (NULL);
-   gtk_frame_set_shadow_type (GTK_FRAME 
(cpuFreq-frame),cpuFreq-options-show_frame ? GTK_SHADOW_IN : 
GTK_SHADOW_NONE);
-   gtk_container_add (GTK_CONTAINER (cpuFreq-ebox), cpuFreq-frame);
-   gtk_widget_show (cpuFreq-frame);
-
cpuFreq-box = gtk_hbox_new (FALSE, SPACING);
gtk_container_set_border_width (GTK_CONTAINER (cpuFreq-box), BORDER);
-   gtk_container_add (GTK_CONTAINER (cpuFreq-frame), cpuFreq-box);
+   gtk_container_add (GTK_CONTAINER (cpuFreq-ebox), cpuFreq-box);
 
cpufreq_update_icon (cpuFreq);
 
@@ -319,7 +313,6 @@ cpufreq_read_config (void)
if (cpuFreq-options-timeout  TIMEOUT_MAX || 
cpuFreq-options-timeout  TIMEOUT_MIN)
cpuFreq-options-timeout = TIMEOUT_MIN;
cpuFreq-options-show_cpu= xfce_rc_read_int_entry  (rc, 
show_cpu,  0);
-   cpuFreq-options-show_frame  = xfce_rc_read_bool_entry (rc, 
show_frame,  TRUE);
cpuFreq-options-show_icon   = xfce_rc_read_bool_entry (rc, 
show_icon,  TRUE);
cpuFreq-options-show_label_freq = xfce_rc_read_bool_entry (rc, 
show_label_freq, TRUE);
cpuFreq-options-show_label_governor = xfce_rc_read_bool_entry (rc, 
show_label_governor, TRUE);
@@ -345,7 +338,6 @@ cpufreq_write_config (XfcePanelPlugin *plugin)
 
xfce_rc_write_int_entry  (rc, timeout

[Xfce4-commits] xfce4-cpufreq-plugin:master Put widgets in overview window in size groups.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 5a26a2b4b3948f85cf75a6baf16e4903cde5ef68 (commit)
   from 5327de3b636b306439c5ab9943a94f718dba108f (commit)

commit 5a26a2b4b3948f85cf75a6baf16e4903cde5ef68
Author: Harald Judt h.j...@gmx.at
Date:   Tue Aug 13 14:59:10 2013 +0200

Put widgets in overview window in size groups.

 panel-plugin/xfce4-cpufreq-overview.c |   32 
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-overview.c 
b/panel-plugin/xfce4-cpufreq-overview.c
index 9127fd6..8bc80eb 100644
--- a/panel-plugin/xfce4-cpufreq-overview.c
+++ b/panel-plugin/xfce4-cpufreq-overview.c
@@ -42,6 +42,7 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, 
GtkWidget *dialog_hbox)
gint  i = 0, j;
gchar *text;
GtkWidget *hbox, *dialog_vbox, *combo, *label, *icon;
+   GtkSizeGroup *sg0, *sg1;
GList *list;
 
dialog_vbox = gtk_vbox_new (FALSE, BORDER);
@@ -61,12 +62,17 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, 
GtkWidget *dialog_hbox)
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
g_free (text);
 
+   sg0 = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
+   sg1 = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
+
/* display driver */
hbox = gtk_hbox_new (FALSE, BORDER);
gtk_box_pack_start (GTK_BOX (dialog_vbox), hbox, FALSE, FALSE, 0);
 
label = gtk_label_new (_(Scaling driver:));
-   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+   gtk_size_group_add_widget (sg0, label);
+   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+   gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
 
if (cpu-scaling_driver != NULL)
text = g_strdup_printf (b%s/b, cpu-scaling_driver);
@@ -74,6 +80,8 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, 
GtkWidget *dialog_hbox)
text = g_strdup_printf (_(No scaling driver available));
 
label = gtk_label_new (text);
+   gtk_size_group_add_widget (sg1, label);
+   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_box_pack_end (GTK_BOX (hbox), label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
g_free (text);
@@ -83,11 +91,14 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, 
GtkWidget *dialog_hbox)
gtk_box_pack_start (GTK_BOX (dialog_vbox), hbox, FALSE, FALSE, 0);
 
label = gtk_label_new (_(Available frequencies:));
-   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+   gtk_size_group_add_widget (sg0, label);
+   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+   gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
 
if (cpu-available_freqs != NULL) /* Linux 2.6 with scaling support */
{
combo = gtk_combo_box_new_text ();
+   gtk_size_group_add_widget (sg1, combo);
gtk_box_pack_end (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
list = g_list_first (cpu-available_freqs);
j = 0;
@@ -106,6 +117,7 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, 
GtkWidget *dialog_hbox)
else if (cpu-cur_freq  cpu-min_freq  cpu-max_freq) /* Linux 2.4 
with scaling support */
{
combo = gtk_combo_box_new_text ();
+   gtk_size_group_add_widget (sg1, combo);
gtk_box_pack_end (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
 
 text = cpufreq_get_human_readable_freq (cpu-cur_freq);
@@ -125,6 +137,8 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, 
GtkWidget *dialog_hbox)
text = cpufreq_get_human_readable_freq (cpu-cur_freq);
text = g_strdup_printf (b%s/b (current frequency), text);
label = gtk_label_new (text);
+   gtk_size_group_add_widget (sg1, label);
+   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_box_pack_end (GTK_BOX (hbox), label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
g_free (text);
@@ -138,9 +152,12 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, 
GtkWidget *dialog_hbox)
gtk_box_pack_start (GTK_BOX (dialog_vbox), hbox, FALSE, FALSE, 
0);
 
label = gtk_label_new (_(Available governors:));\
-   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+   gtk_size_group_add_widget (sg0, label);
+   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+   gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
 
combo = gtk_combo_box_new_text ();
+   gtk_size_group_add_widget (sg1, combo);
gtk_box_pack_end (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
list = g_list_first (cpu-available_governors);
j = 0;
@@ -161,16

[Xfce4-commits] xfce4-cpufreq-plugin:master Fix build failure on kFreeBSD (bug #7482).

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 0f1c82d42f020331b35cbce179dfd5af008b6de8 (commit)
   from 761bd275c466d5ed18420711ac0ea360e13a6205 (commit)

commit 0f1c82d42f020331b35cbce179dfd5af008b6de8
Author: Yves-Alexis Perez cor...@debian.org
Date:   Wed Aug 7 11:10:36 2013 +0200

Fix build failure on kFreeBSD (bug #7482).

...or other non-Linux systems

 panel-plugin/xfce4-cpufreq-plugin.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index fd9788d..1b3992f 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -133,11 +133,13 @@ cpufreq_update_plugin (void)
 void
 cpufreq_restart_timeout (void)
 {
+#ifdef __linux__
g_source_remove (cpuFreq-timeoutHandle);
cpuFreq-timeoutHandle = g_timeout_add_seconds (
cpuFreq-options-timeout,
(GSourceFunc)cpufreq_update_cpus,
NULL);
+#endif
 }
 
 static void
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Add new cpuinfo_free to deal with memory leaks.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to e5b824087d347de8edd088834c09aa1c69cf953a (commit)
   from 63cd36e4e3b97f8c3bd557a774084fc63de024f6 (commit)

commit e5b824087d347de8edd088834c09aa1c69cf953a
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 11 12:27:16 2013 +0200

Add new cpuinfo_free to deal with memory leaks.

Code for freeing CpuInfo memory is scattered all over the place, but
in many cases not all fields are freed, causing memory leaks.
Let's define a common function to clean up that mess a bit.

 panel-plugin/xfce4-cpufreq-plugin.c |   15 +++
 panel-plugin/xfce4-cpufreq-plugin.h |3 +++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index dd3449e..ce7d7e5 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -348,6 +348,16 @@ cpufreq_write_config (XfcePanelPlugin *plugin)
xfce_rc_close (rc);
 }
 
+void
+cpuinfo_free (CpuInfo *cpu)
+{
+   g_free (cpu-cur_governor);
+   g_free (cpu-scaling_driver);
+   g_list_free (cpu-available_freqs);
+   g_list_free_full (cpu-available_governors, g_free);
+   g_free (cpu);
+}
+
 static void
 cpufreq_free (XfcePanelPlugin *plugin)
 {
@@ -360,10 +370,7 @@ cpufreq_free (XfcePanelPlugin *plugin)
{
CpuInfo *cpu = g_ptr_array_index (cpuFreq-cpus, i);
g_ptr_array_remove_fast (cpuFreq-cpus, cpu);
-   g_free (cpu-cur_governor);
-   g_list_free (cpu-available_freqs);
-   g_list_free (cpu-available_governors);
-   g_free (cpu);
+   cpuinfo_free (cpu);
}
 
g_ptr_array_free (cpuFreq-cpus, TRUE);
diff --git a/panel-plugin/xfce4-cpufreq-plugin.h 
b/panel-plugin/xfce4-cpufreq-plugin.h
index f976cb9..890b22e 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.h
+++ b/panel-plugin/xfce4-cpufreq-plugin.h
@@ -68,6 +68,9 @@ CpuFreqPlugin *cpuFreq;
 
 G_BEGIN_DECLS
 
+void
+cpuinfo_free (CpuInfo *cpu);
+
 gboolean
 cpufreq_update_plugin (void);
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Fix reading min frequency from cpufreq sysfs.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 63cd36e4e3b97f8c3bd557a774084fc63de024f6 (commit)
   from 0257489546053ef5bd952074a59ba5d0513d18a6 (commit)

commit 63cd36e4e3b97f8c3bd557a774084fc63de024f6
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 11 10:32:32 2013 +0200

Fix reading min frequency from cpufreq sysfs.

Apparently a plain copy  paste error.

 panel-plugin/xfce4-cpufreq-linux.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/panel-plugin/xfce4-cpufreq-linux.c 
b/panel-plugin/xfce4-cpufreq-linux.c
index 21bc040..954048e 100644
--- a/panel-plugin/xfce4-cpufreq-linux.c
+++ b/panel-plugin/xfce4-cpufreq-linux.c
@@ -163,7 +163,7 @@ cpufreq_cpu_parse_sysfs_init (gint cpu_number)
 
/* read min cpu freq */
filePath = g_strdup_printf (
-   /sys/devices/system/cpu/cpu%i/cpufreq/scaling_max_freq,
+   /sys/devices/system/cpu/cpu%i/cpufreq/scaling_min_freq,
cpu_number);
if (!g_file_test (filePath, G_FILE_TEST_EXISTS))
goto file_error;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Bump requirements to xfce4-panel 4.10.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to a2fbdb641398181241688f6181236987a8a508bd (commit)
   from 65bb883aa1da7b13567d4a953fe1210bbcaff07a (commit)

commit a2fbdb641398181241688f6181236987a8a508bd
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 11 00:33:34 2013 +0200

Bump requirements to xfce4-panel 4.10.

Removing support for old panel functions forces 4.9 as minimum requirement.

 configure.ac.in |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index f720793..26fc56a 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -41,9 +41,9 @@ XDT_I18N([@LINGUAS@])
 dnl configure the panel plugin
 XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.20.0])
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.7.0])
-XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.7.0])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.7.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.9.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.9.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.9.0])
 
 dnl ***
 dnl *** Check for debugging support ***
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Add support for the Intel P-State driver.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to f3bfa666503563ea9d0e2fb6ce2e8f1d558d738e (commit)
   from e5b824087d347de8edd088834c09aa1c69cf953a (commit)

commit f3bfa666503563ea9d0e2fb6ce2e8f1d558d738e
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 11 13:22:48 2013 +0200

Add support for the Intel P-State driver.

This makes the current version work with the intel pstate driver.
Showing governors and performance values works, the pstate parameters
are read but not used yet; The UI has to be reworked to accommodate
for that.

 panel-plugin/xfce4-cpufreq-linux.c  |  251 ++-
 panel-plugin/xfce4-cpufreq-linux.h  |3 +
 panel-plugin/xfce4-cpufreq-plugin.c |2 +
 panel-plugin/xfce4-cpufreq-plugin.h |   14 +-
 4 files changed, 203 insertions(+), 67 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-linux.c 
b/panel-plugin/xfce4-cpufreq-linux.c
index 954048e..11a7ddb 100644
--- a/panel-plugin/xfce4-cpufreq-linux.c
+++ b/panel-plugin/xfce4-cpufreq-linux.c
@@ -35,48 +35,53 @@
 #endif
 
 static gboolean
-cpufreq_cpu_parse_sysfs_init (gint cpu_number)
+cpufreq_cpu_parse_sysfs_init (gint cpu_number, CpuInfo *cpu)
 {
-   CpuInfo *cpu;
FILE*file;
gchar   *filePath, *fileContent, **tokens;
+   gboolean add_cpu = FALSE;
 
-   cpu = g_new0 (CpuInfo, 1);
+   if (cpu == NULL) {
+   cpu = g_new0 (CpuInfo, 1);
+   add_cpu = TRUE;
+   }
 
/* read available cpu freqs */
-   filePath = g_strdup_printf (
-   
/sys/devices/system/cpu/cpu%i/cpufreq/scaling_available_frequencies,
-   cpu_number);
-   if (!g_file_test (filePath, G_FILE_TEST_EXISTS))
-   goto file_error;
-   file = fopen (filePath, r);
-   if (file)
-   {
-   gint i = 0;
+   if (cpuFreq-intel_pstate == NULL) {
+   filePath =
+   g_strdup_printf (/sys/devices/system/cpu/cpu%i/
+
cpufreq/scaling_available_frequencies,
+cpu_number);
+   if (!g_file_test (filePath, G_FILE_TEST_EXISTS))
+   goto file_error;
+   file = fopen (filePath, r);
+   if (file) {
+   gint i = 0;
 
-   fileContent = g_new (gchar, 255);
-   fgets (fileContent, 255, file);
-   fclose (file);
+   fileContent = g_new (gchar, 255);
+   fgets (fileContent, 255, file);
+   fclose (file);
 
-   fileContent = g_strchomp (fileContent);
-   tokens = g_strsplit (fileContent,  , 0);
-   g_free (fileContent);
+   fileContent = g_strchomp (fileContent);
+   tokens = g_strsplit (fileContent,  , 0);
+   g_free (fileContent);
 
-   while (tokens[i] != NULL)
-   {
-   gint freq = atoi (tokens[i]);
-   cpu-available_freqs = g_list_append (
-   cpu-available_freqs, GINT_TO_POINTER(freq));
-   i++;
+   while (tokens[i] != NULL) {
+   gint freq = atoi (tokens[i]);
+   cpu-available_freqs =
+   g_list_append (cpu-available_freqs,
+  
GINT_TO_POINTER(freq));
+   i++;
+   }
+   g_strfreev (tokens);
}
-   g_strfreev (tokens);
+   g_free (filePath);
}
-   g_free (filePath);
 
/* read available cpu governors */
filePath = g_strdup_printf (

/sys/devices/system/cpu/cpu%i/cpufreq/scaling_available_governors,
-   cpu_number);
+   cpu_number);
if (!g_file_test (filePath, G_FILE_TEST_EXISTS))
goto file_error;
file = fopen (filePath, r);
@@ -112,6 +117,7 @@ cpufreq_cpu_parse_sysfs_init (gint cpu_number)
file = fopen (filePath, r);
if (file)
{
+   g_free (cpu-scaling_driver);
cpu-scaling_driver = g_new (gchar, 15);
fscanf (file, %15s, cpu-scaling_driver);
fclose (file);
@@ -119,18 +125,20 @@ cpufreq_cpu_parse_sysfs_init (gint cpu_number)
g_free (filePath);
 
/* read current cpu freq */
-   filePath = g_strdup_printf (
-   /sys/devices/system/cpu/cpu%i/cpufreq/scaling_cur_freq,
-   cpu_number);
-   if (!g_file_test (filePath, G_FILE_TEST_EXISTS))
-   goto file_error;
-   file = fopen (filePath, r);
-   if (file)
-   {
-   fscanf (file, %d, cpu-cur_freq

[Xfce4-commits] xfce4-cpufreq-plugin:master Fix crash when the machine uses the intel pstate driver.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to f41f66ba8a9b7e9496d07a862f1ddad72ab10e8c (commit)
   from f624eb1d06fb0375c4fbc29298965d7667519a1f (commit)

commit f41f66ba8a9b7e9496d07a862f1ddad72ab10e8c
Author: Harald Judt h.j...@gmx.at
Date:   Sat Aug 10 12:27:28 2013 +0200

Fix crash when the machine uses the intel pstate driver.

At the moment, the plugin does not support the intel pstate driver and will
crash trying to access the non-existant current frequency file in sysfs.
Disable cpufreq features until proper pstate support has been implemented.

 panel-plugin/xfce4-cpufreq-linux.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/xfce4-cpufreq-linux.c 
b/panel-plugin/xfce4-cpufreq-linux.c
index 00c6dd4..21bc040 100644
--- a/panel-plugin/xfce4-cpufreq-linux.c
+++ b/panel-plugin/xfce4-cpufreq-linux.c
@@ -402,7 +402,8 @@ cpufreq_linux_init (void)
if (cpuFreq-cpus == NULL)
return FALSE;
 
-   if (g_file_test (/sys/devices/system/cpu/cpu0/cpufreq, 
G_FILE_TEST_EXISTS))
+   if (g_file_test (/sys/devices/system/cpu/cpu0/cpufreq, 
G_FILE_TEST_EXISTS) 
+   !g_file_test (/sys/devices/system/cpu/intel_pstate, 
G_FILE_TEST_EXISTS))
return cpufreq_cpu_read_sysfs ();
else if (g_file_test (/proc/cpufreq, G_FILE_TEST_EXISTS))
return cpufreq_cpu_read_procfs ();
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Better handle icon size.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 73ca04dd894bbbda394fbae2f1fee2bca70047f6 (commit)
   from 5a26a2b4b3948f85cf75a6baf16e4903cde5ef68 (commit)

commit 73ca04dd894bbbda394fbae2f1fee2bca70047f6
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 11 15:06:52 2013 +0200

Better handle icon size.

The icon looked cut off in vertical panel mode, so change the size dependent
on the save space option. Might still need some bit of tweaking, but let's
leave it for now.

 panel-plugin/xfce4-cpufreq-configure.c |8 +++-
 panel-plugin/xfce4-cpufreq-plugin.c|2 --
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index 67cbe25..f51ec57 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -51,9 +51,15 @@ check_button_changed (GtkWidget *button, 
CpuFreqPluginConfigure *configure)
cpuFreq-options-show_label_governor =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(button));
 
-   else if (button == configure-keep_compact)
+   else if (button == configure-keep_compact) {
cpuFreq-options-keep_compact =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(button));
+   if (cpuFreq-options-keep_compact)
+   cpuFreq-icon_size -= 4;
+   else
+   cpuFreq-icon_size += 4;
+   cpufreq_update_icon (cpuFreq);
+   }
 
cpufreq_prepare_label (cpuFreq);
cpufreq_update_plugin ();
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index f19b9d3..3607719 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -262,7 +262,6 @@ cpufreq_widgets (void)
 
cpuFreq-icon_size = xfce_panel_plugin_get_size (cpuFreq-plugin);
cpuFreq-icon_size /= xfce_panel_plugin_get_nrows (cpuFreq-plugin);
-   cpuFreq-icon_size -= 2;
 
/* create panel toggle button which will contain all other widgets */
cpuFreq-button = xfce_create_panel_toggle_button ();
@@ -384,7 +383,6 @@ static gboolean
 cpufreq_set_size (XfcePanelPlugin *plugin, gint size, CpuFreqPlugin *cpufreq)
 {
cpuFreq-icon_size = size / xfce_panel_plugin_get_nrows 
(cpuFreq-plugin);
-   cpuFreq-icon_size -= 2;
 
cpufreq_update_icon (cpufreq);
cpufreq_update_plugin ();
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Improve overview window size and layout a bit.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 5327de3b636b306439c5ab9943a94f718dba108f (commit)
   from f3bfa666503563ea9d0e2fb6ce2e8f1d558d738e (commit)

commit 5327de3b636b306439c5ab9943a94f718dba108f
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 11 14:59:40 2013 +0200

Improve overview window size and layout a bit.

With many CPUs, the window will not even fit on a HD screen. Try to handle 
this
a bit better; this solution is not optimal and will only be good enough for
nowaday's multi-core machines.

 panel-plugin/xfce4-cpufreq-overview.c |   66 ++---
 1 file changed, 44 insertions(+), 22 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-overview.c 
b/panel-plugin/xfce4-cpufreq-overview.c
index c9d5a74..9127fd6 100644
--- a/panel-plugin/xfce4-cpufreq-overview.c
+++ b/panel-plugin/xfce4-cpufreq-overview.c
@@ -47,17 +47,20 @@ cpufreq_overview_add (CpuInfo *cpu, guint cpu_number, 
GtkWidget *dialog_hbox)
dialog_vbox = gtk_vbox_new (FALSE, BORDER);
gtk_box_pack_start (GTK_BOX (dialog_hbox), dialog_vbox, TRUE, TRUE, 0);
 
+   hbox = gtk_hbox_new (FALSE, BORDER);
+   gtk_box_pack_start (GTK_BOX (dialog_vbox), hbox, TRUE, TRUE, 0);
+
+   icon = gtk_image_new_from_icon_name (xfce4-cpufreq-plugin, 
GTK_ICON_SIZE_BUTTON);
+   gtk_misc_set_alignment (GTK_MISC (icon), 1, 0.5);
+   gtk_misc_set_padding (GTK_MISC (icon), 5, 10);
+   gtk_box_pack_start (GTK_BOX (hbox), icon, TRUE, TRUE, 0);
text = g_strdup_printf (bCPU %d/b, cpu_number);
label = gtk_label_new (text);
-   gtk_box_pack_start (GTK_BOX (dialog_vbox), label, FALSE, FALSE, 0);
+   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+   gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
g_free (text);
 
-   icon = gtk_image_new_from_icon_name (xfce4-cpufreq-plugin, 
GTK_ICON_SIZE_BUTTON);
-   gtk_box_pack_start (GTK_BOX (dialog_vbox), icon, FALSE, FALSE, 0);
-   gtk_misc_set_alignment (GTK_MISC (icon), 0.5, 0);
-   gtk_misc_set_padding (GTK_MISC (icon), 10, 10);
-
/* display driver */
hbox = gtk_hbox_new (FALSE, BORDER);
gtk_box_pack_start (GTK_BOX (dialog_vbox), hbox, FALSE, FALSE, 0);
@@ -181,7 +184,7 @@ cpufreq_overview_response (GtkWidget *dialog, gint 
response, gpointer data)
 gboolean
 cpufreq_overview (GtkWidget *widget, GdkEventButton *ev, CpuFreqPlugin 
*cpuFreq)
 {
-   gint  i;
+   gint  i, j, step;
GtkWidget *dialog, *dialog_vbox, *window;
GtkWidget *dialog_hbox, *separator;
 
@@ -217,23 +220,42 @@ cpufreq_overview (GtkWidget *widget, GdkEventButton *ev, 
CpuFreqPlugin *cpuFreq)
 
dialog_vbox = GTK_DIALOG (dialog)-vbox;
 
-   dialog_hbox = gtk_hbox_new (FALSE, BORDER);
-   gtk_box_pack_start (GTK_BOX (dialog_vbox), dialog_hbox, FALSE, FALSE, 
0);
-   gtk_container_set_border_width (GTK_CONTAINER (dialog_hbox), BORDER);
-
-   for (i = 0; i  cpuFreq-cpus-len;)
-   {
-   CpuInfo *cpu = g_ptr_array_index (cpuFreq-cpus, i);
-   cpufreq_overview_add (cpu, i, dialog_hbox);
-
-   if (++i != cpuFreq-cpus-len)
-   {
-   separator = gtk_vseparator_new ();
-   gtk_box_pack_start (GTK_BOX (dialog_hbox), separator, 
FALSE, FALSE, 0);
+   /* choose how many columns and rows depending on cpu count */
+   if (cpuFreq-cpus-len  4)
+   step = 1;
+   else if (cpuFreq-cpus-len  9)
+   step = 2;
+   else if (cpuFreq-cpus-len % 3)
+   step = 4;
+   else
+   step = 3;
+
+   for (i = 0; i  cpuFreq-cpus-len; i += step) {
+   dialog_hbox = gtk_hbox_new (FALSE, BORDER * 2);
+   gtk_box_pack_start (GTK_BOX (dialog_vbox), dialog_hbox,
+   FALSE, FALSE, BORDER * 
2);
+   gtk_container_set_border_width (GTK_CONTAINER (dialog_hbox),
+   
BORDER * 2);
+
+   for (j = i; j  cpuFreq-cpus-len  j  i + step; j++) {
+   CpuInfo *cpu = g_ptr_array_index (cpuFreq-cpus, j);
+   cpufreq_overview_add (cpu, j, dialog_hbox);
+
+   if (j + 1  cpuFreq-cpus-len  j + 1 == i + step) {
+   separator = gtk_hseparator_new ();
+   gtk_box_pack_start (GTK_BOX (dialog_vbox), 
separator,
+   FALSE, 
FALSE, 0);
+   }
+
+   if (j + 1  cpuFreq-cpus-len  j + 1  i + step) {
+   separator = gtk_vseparator_new ();
+   gtk_box_pack_start (GTK_BOX (dialog_hbox), 
separator

[Xfce4-commits] xfce4-cpufreq-plugin:master Fix showing frequency of wrong CPU core (bug #7179).

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 4e56722b749e6b5c54bd7d8d7814e6339d7f3485 (commit)
   from d687db9cd1fbbe47a1f4d756aa9ac429c83e97ba (commit)

commit 4e56722b749e6b5c54bd7d8d7814e6339d7f3485
Author: Lionel Le Folgoc lio...@lefolgoc.net
Date:   Wed Aug 7 10:58:09 2013 +0200

Fix showing frequency of wrong CPU core (bug #7179).

This patch makes the plugin refresh only the core selected in the config
file rather than refreshing all of them and always displaying the last one.

 panel-plugin/xfce4-cpufreq-plugin.c |   19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 063fc16..fffd30b 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -122,15 +122,16 @@ cpufreq_update_tooltip (CpuInfo *cpu)
 gboolean
 cpufreq_update_plugin (void)
 {
-   gint i;
-   for (i = 0; i  cpuFreq-cpus-len; i++)
-   {
-   CpuInfo *cpu = g_ptr_array_index (cpuFreq-cpus, i);
-   if (cpufreq_update_label (cpu)   == FALSE)
-   return FALSE;
-   if (cpufreq_update_tooltip (cpu) == FALSE)
-   return FALSE;
-   }
+   CpuInfo *cpu;
+
+   g_return_val_if_fail (cpuFreq-options-show_cpu  cpuFreq-cpus-len, 
FALSE);
+
+   cpu = g_ptr_array_index (cpuFreq-cpus, cpuFreq-options-show_cpu);
+   if (cpufreq_update_label (cpu)   == FALSE)
+   return FALSE;
+   if (cpufreq_update_tooltip (cpu) == FALSE)
+   return FALSE;
+
return TRUE;
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Fix panel widget transparency.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to f624eb1d06fb0375c4fbc29298965d7667519a1f (commit)
   from 78b49f5eba4ccf0e0aa280e45c80b479ea83e470 (commit)

commit f624eb1d06fb0375c4fbc29298965d7667519a1f
Author: Harald Judt h.j...@gmx.at
Date:   Thu Aug 8 14:36:42 2013 +0200

Fix panel widget transparency.

Building the plugin as a module had the side-effect that the panel widget
is no longer transparent. Fix this by setting the visibility of the
containing GtkEventBox to false.

 panel-plugin/xfce4-cpufreq-plugin.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index bad8bf8..1817f26 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -226,6 +226,7 @@ cpufreq_widgets (void)
 #endif
 
cpuFreq-ebox = gtk_event_box_new ();
+   gtk_event_box_set_visible_window (GTK_EVENT_BOX (cpuFreq-ebox), FALSE);
xfce_panel_plugin_add_action_widget (cpuFreq-plugin, cpuFreq-ebox);
gtk_container_add (GTK_CONTAINER (cpuFreq-plugin), cpuFreq-ebox);
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Port plugin to libxfce4ui (bug #8051).

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to c25b820ed416ddbd890bd4e83237eeae612f1293 (commit)
   from 0f1c82d42f020331b35cbce179dfd5af008b6de8 (commit)

commit c25b820ed416ddbd890bd4e83237eeae612f1293
Author: Andreas Müller schnitzelt...@gmx.de
Date:   Wed Aug 7 10:26:36 2013 +0200

Port plugin to libxfce4ui (bug #8051).

Patch by Andreas Müller, slightly modified.

 configure.ac.in|   10 +-
 panel-plugin/Makefile.am   |4 ++--
 panel-plugin/xfce4-cpufreq-configure.c |2 +-
 panel-plugin/xfce4-cpufreq-linux.c |4 ++--
 panel-plugin/xfce4-cpufreq-overview.c  |2 +-
 panel-plugin/xfce4-cpufreq-plugin.c|6 +++---
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 61a5518..635e9dd 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -36,11 +36,11 @@ dnl Check for i18n support
 XDT_I18N([@LINGUAS@])
 
 dnl configure the panel plugin
-XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.6.0])
-XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.90])
-XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.90])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.90])
+XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.20.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.7.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.7.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.7.0])
 
 dnl ***
 dnl *** Check for debugging support ***
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 68a4047..c8611fa 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -5,13 +5,13 @@ xfce4_cpufreq_plugin_CFLAGS = 
\
-I$(top_srcdir) \
@LIBXFCE4PANEL_CFLAGS@  \
@LIBXFCE4UTIL_CFLAGS@   \
-   @LIBXFCEGUI4_CFLAGS@\
+   @LIBXFCE4UI_CFLAGS@ \
-DPACKAGE_LOCALE_DIR=\$(localedir)\
 
 xfce4_cpufreq_plugin_LDADD =   \
@LIBXFCE4PANEL_LIBS@\
@LIBXFCE4UTIL_LIBS@ \
-   @LIBXFCEGUI4_LIBS@
+   @LIBXFCE4UI_LIBS@
 
 xfce4_cpufreq_plugin_SOURCES = \
xfce4-cpufreq-plugin.h  \
diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index 3de12c8..60af8a7 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -23,7 +23,7 @@
 #include config.h
 #endif
 
-#include libxfcegui4/libxfcegui4.h
+#include libxfce4ui/libxfce4ui.h
 #include xfce4-cpufreq-plugin.h
 #include xfce4-cpufreq-configure.h
 
diff --git a/panel-plugin/xfce4-cpufreq-linux.c 
b/panel-plugin/xfce4-cpufreq-linux.c
index 9a27419..00c6dd4 100644
--- a/panel-plugin/xfce4-cpufreq-linux.c
+++ b/panel-plugin/xfce4-cpufreq-linux.c
@@ -27,7 +27,7 @@
 #include xfce4-cpufreq-plugin.h
 #include xfce4-cpufreq-linux.h
 
-#include libxfcegui4/libxfcegui4.h
+#include libxfce4ui/libxfce4ui.h
 
 #ifndef _
 # include libintl.h
@@ -410,7 +410,7 @@ cpufreq_linux_init (void)
{
if (cpuFreq-options-show_warning)
{
-   xfce_warn (_(Your system does not support 
cpufreq.\nThe applet only shows the current cpu frequency));
+   xfce_dialog_show_warning (NULL, NULL, _(Your system 
does not support cpufreq.\nThe applet only shows the current cpu frequency));
cpuFreq-options-show_warning = FALSE;
}
 
diff --git a/panel-plugin/xfce4-cpufreq-overview.c 
b/panel-plugin/xfce4-cpufreq-overview.c
index a186f30..c4937bf 100644
--- a/panel-plugin/xfce4-cpufreq-overview.c
+++ b/panel-plugin/xfce4-cpufreq-overview.c
@@ -23,7 +23,7 @@
 #include config.h
 #endif
 
-#include libxfcegui4/libxfcegui4.h
+#include libxfce4ui/libxfce4ui.h
 #ifndef _
 # include libintl.h
 # define _(String) gettext (String)
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 1b3992f..d6340f5 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -26,7 +26,7 @@
 #endif
 
 #include libxfce4util/libxfce4util.h
-#include libxfcegui4/libxfcegui4.h
+#include libxfce4ui/libxfce4ui.h
 #ifndef _
 # include libintl.h
 # define _(String) gettext (String)
@@ -331,7 +331,7 @@ cpufreq_construct (XfcePanelPlugin *plugin)
 
 #ifdef __linux__
if (cpufreq_linux_init () == FALSE)
-   xfce_err (_(Your system is not configured correctly to support 
cpu frequency scaling !));
+   

[Xfce4-commits] xfce4-cpufreq-plugin:master Updates for new autotools.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 761bd275c466d5ed18420711ac0ea360e13a6205 (commit)
   from 970380078c7f895a716c3dc952d3d030912e38b4 (commit)

commit 761bd275c466d5ed18420711ac0ea360e13a6205
Author: Harald Judt h.j...@gmx.at
Date:   Wed Aug 7 09:41:59 2013 +0200

Updates for new autotools.

Clean up build system files, make the plugin compile with automake-1.13
and fix bug #9763.

 Makefile.am  |5 +
 configure.ac.in  |   28 ++--
 panel-plugin/Makefile.am |6 +++---
 3 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e0fa72d..89d5447 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,9 +2,14 @@
 
 SUBDIRS = panel-plugin po icons 
 
+ACLOCAL_AMFLAGS = -I m4
+
 distclean-local:
rm -rf *.cache *~
 
+distuninstallcheck_listfiles = \
+find . -type f -print | grep -v ./share/icons/hicolor/icon-theme.cache
+
 dist-bz2: dist
zcat $(PACKAGE)-$(VERSION).tar.gz | bzip2 --best -c  
$(PACKAGE)-$(VERSION).tar.bz2
 
diff --git a/configure.ac.in b/configure.ac.in
index 1856861..61a5518 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -1,28 +1,36 @@
 dnl configure.ac
 dnl
-dnl xfce4-cpufreq-plugin - Plugin shows Infos about Frequency and Governour of
-dnl CPUs
+dnl xfce4-cpufreq-plugin - Show CPU frequency and governour information
 dnl
 
 dnl Version information
-m4_define([xfce4_cpufreq_plugin_version], [1.0.0])
+AC_CONFIG_MACRO_DIR([m4])
+m4_define([cpufreq_version_major], [1])
+m4_define([cpufreq_version_minor], [0])
+m4_define([cpufreq_version_micro], [0])
+m4_define([cpufreq_version_build], [@REVISION@])
+m4_define([cpufreq_version_tag], [git])
+m4_define([cpufreq_version], 
[cpufreq_version_major().cpufreq_version_minor().cpufreq_version_micro()ifelse(cpufreq_version_tag(),
 [git], [cpufreq_version_tag()-cpufreq_version_build()], 
[cpufreq_version_tag()])])
 
 dnl Initialize autoconf
 AC_COPYRIGHT([Copyright (c) 2006 Thomas Schreck sh...@xfce.org
-Copyright (c) 2010,2011 Florian Rivoal friv...@xfce.org])
-AC_INIT([xfce4-cpufreq-plugin], [xfce4_cpufreq_plugin_version()],
+  Copyright (c) 2010,2011 Florian Rivoal friv...@xfce.org
+  Copyright (c) 2013 Harald Judt h.j...@gmx.at])
+AC_INIT([xfce4-cpufreq-plugin], [cpufreq_version()],
[friv...@xfce.org])
+AC_PREREQ([2.60])
 
 dnl Initialize automake
-AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()])
-AM_CONFIG_HEADER([config.h])
+AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar])
+AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE()
 
 dnl Check for basic programs
-AC_PROG_CC
-AC_PROG_INSTALL
-AC_PROG_LIBTOOL
+AC_PROG_CC()
+AC_PROG_INSTALL()
 AC_PROG_INTLTOOL()
+LT_PREREQ([2.2.6])
+LT_INIT([disable-static])
 
 dnl Check for i18n support
 XDT_I18N([@LINGUAS@])
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index d890f85..68a4047 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -24,10 +24,10 @@ xfce4_cpufreq_plugin_SOURCES =  
\
xfce4-cpufreq-overview.c\
xfce4-cpufreq-utils.h   \
xfce4-cpufreq-utils.c
-   
+
 desktop_in_in_files = xfce4-cpufreq-plugin.desktop.in.in
 desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
-   
+
 desktopdir = $(datadir)/xfce4/panel-plugins
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@
@@ -37,7 +37,7 @@ EXTRA_DIST =  
\
 
 DISTCLEANFILES =   \
$(desktop_DATA) $(desktop_in_files)
-   
+
 # get full path into .desktop file
 %.desktop.in: %.desktop.in.in
sed -e s^@PLUGIN_PATH@^$(libexecdir)/xfce4/panel-plugins^ \
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Use new GtkTooltip API.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 3b832bea98e996ca02520e922b975f91e59be1ec (commit)
   from f41f66ba8a9b7e9496d07a862f1ddad72ab10e8c (commit)

commit 3b832bea98e996ca02520e922b975f91e59be1ec
Author: Harald Judt h.j...@gmx.at
Date:   Sat Aug 10 12:58:08 2013 +0200

Use new GtkTooltip API.

The old GtkTooltips API has been deprecated ages ago.

 panel-plugin/xfce4-cpufreq-plugin.c |   70 ---
 panel-plugin/xfce4-cpufreq-plugin.h |1 -
 2 files changed, 41 insertions(+), 30 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 1817f26..8094586 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -91,28 +91,39 @@ cpufreq_update_label (CpuInfo *cpu)
return TRUE;
 }
 
-gboolean
-cpufreq_update_tooltip (CpuInfo *cpu)
+static gboolean
+cpufreq_update_tooltip (GtkWidget *widget,
+   gint x,
+   gint y,
+   gboolean keyboard_mode,
+   GtkTooltip *tooltip,
+   CpuInfo *cpu)
 {
-   gchar *tooltip_msg, *freq;
-
-   freq = cpufreq_get_human_readable_freq (cpu-cur_freq);
-   if (cpuFreq-options-show_label_governor  
cpuFreq-options-show_label_freq)
-   tooltip_msg = g_strdup_printf (ngettext(%d cpu available, %d 
cpus available, cpuFreq-cpus-len), cpuFreq-cpus-len);
-   else
-   tooltip_msg = g_strconcat (!cpuFreq-options-show_label_freq ? 
_(Frequency: ) : ,
-   !cpuFreq-options-show_label_freq ? freq : ,
-   
-   cpu-cur_governor != NULL  
-   !cpuFreq-options-show_label_freq  
!cpuFreq-options-show_label_governor ? \n : ,
-   
-   cpu-cur_governor != NULL 
-   !cpuFreq-options-show_label_governor ? _(Governor: 
) : ,
-   cpu-cur_governor != NULL 
-   !cpuFreq-options-show_label_governor ? 
cpu-cur_governor : ,
-   NULL);
+   gchar *tooltip_msg, *freq = NULL;
+
+   if (G_UNLIKELY(cpu == NULL)) {
+   tooltip_msg = g_strdup (_(No CPU information available.));
+   } else {
+   freq = cpufreq_get_human_readable_freq (cpu-cur_freq);
+   if (cpuFreq-options-show_label_governor  
cpuFreq-options-show_label_freq)
+   tooltip_msg = g_strdup_printf (ngettext(%d cpu 
available, %d cpus available, cpuFreq-cpus-len), cpuFreq-cpus-len);
+   else
+   tooltip_msg =
+   g_strconcat (!cpuFreq-options-show_label_freq 
? _(Frequency: ) : ,
+
!cpuFreq-options-show_label_freq ? freq : ,
+
+cpu-cur_governor != 
NULL 
+
!cpuFreq-options-show_label_freq 
+
!cpuFreq-options-show_label_governor ? \n : ,
+
+cpu-cur_governor != 
NULL 
+
!cpuFreq-options-show_label_governor ? _(Governor: ) : ,
+cpu-cur_governor != 
NULL 
+
!cpuFreq-options-show_label_governor ? cpu-cur_governor : ,
+NULL);
+   }
 
-   gtk_tooltips_set_tip (cpuFreq-tooltip, cpuFreq-ebox, tooltip_msg, 
NULL);
+   gtk_tooltip_set_text (tooltip, tooltip_msg);
 
g_free (freq);
g_free (tooltip_msg);
@@ -127,9 +138,7 @@ cpufreq_update_plugin (void)
g_return_val_if_fail (cpuFreq-options-show_cpu  cpuFreq-cpus-len, 
FALSE);
 
cpu = g_ptr_array_index (cpuFreq-cpus, cpuFreq-options-show_cpu);
-   if (cpufreq_update_label (cpu)   == FALSE)
-   return FALSE;
-   if (cpufreq_update_tooltip (cpu) == FALSE)
+   if (cpufreq_update_label (cpu) == FALSE)
return FALSE;
 
return TRUE;
@@ -217,6 +226,8 @@ cpufreq_prepare_label (CpuFreqPlugin *cpufreq)
 static void
 cpufreq_widgets (void)
 {
+   CpuInfo *cpu;
+
 #if defined (LIBXFCE4PANEL_CHECK_VERSION)  LIBXFCE4PANEL_CHECK_VERSION 
(4,9,0)
cpuFreq-icon_size = xfce_panel_plugin_get_size (cpuFreq-plugin);
cpuFreq-icon_size /= xfce_panel_plugin_get_nrows (cpuFreq-plugin);
@@ -227,6 +238,7 @@ cpufreq_widgets (void)
 
cpuFreq-ebox = gtk_event_box_new ();
gtk_event_box_set_visible_window (GTK_EVENT_BOX (cpuFreq-ebox), FALSE);
+
xfce_panel_plugin_add_action_widget (cpuFreq-plugin, cpuFreq-ebox

[Xfce4-commits] xfce4-cpufreq-plugin:master Replace GtkEventBox with a toggle button.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 0257489546053ef5bd952074a59ba5d0513d18a6 (commit)
   from bb6ffb59ab5f1549920652a02066b6ab034a11c4 (commit)

commit 0257489546053ef5bd952074a59ba5d0513d18a6
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 11 00:52:15 2013 +0200

Replace GtkEventBox with a toggle button.

The panel toggle button provides better UI feedback for the user and
makes the overview window open or close.

 panel-plugin/xfce4-cpufreq-overview.c |   11 ++-
 panel-plugin/xfce4-cpufreq-plugin.c   |   19 ++-
 panel-plugin/xfce4-cpufreq-plugin.h   |2 +-
 3 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-overview.c 
b/panel-plugin/xfce4-cpufreq-overview.c
index c4937bf..c9d5a74 100644
--- a/panel-plugin/xfce4-cpufreq-overview.c
+++ b/panel-plugin/xfce4-cpufreq-overview.c
@@ -175,6 +175,7 @@ cpufreq_overview_response (GtkWidget *dialog, gint 
response, gpointer data)
 {
g_object_set_data (G_OBJECT (cpuFreq-plugin), overview, NULL);
gtk_widget_destroy (dialog);
+   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cpuFreq-button), 
FALSE);
 }
 
 gboolean
@@ -189,8 +190,16 @@ cpufreq_overview (GtkWidget *widget, GdkEventButton *ev, 
CpuFreqPlugin *cpuFreq)
 
window = g_object_get_data (G_OBJECT (cpuFreq-plugin), overview);
 
-   if (window)
+   if (window) {
+   g_object_set_data (G_OBJECT (cpuFreq-plugin), overview, 
NULL);
gtk_widget_destroy (window);
+   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 
(cpuFreq-button),
+ 
FALSE);
+   return TRUE;
+   }
+
+   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cpuFreq-button),
+ TRUE);
 
dialog = xfce_titled_dialog_new_with_buttons (_(CPU Information),
NULL,
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 97b4ee1..dd3449e 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -264,25 +264,26 @@ cpufreq_widgets (void)
cpuFreq-icon_size /= xfce_panel_plugin_get_nrows (cpuFreq-plugin);
cpuFreq-icon_size -= 2;
 
-   cpuFreq-ebox = gtk_event_box_new ();
-   gtk_event_box_set_visible_window (GTK_EVENT_BOX (cpuFreq-ebox), FALSE);
-   xfce_panel_plugin_add_action_widget (cpuFreq-plugin, cpuFreq-ebox);
-   gtk_container_add (GTK_CONTAINER (cpuFreq-plugin), cpuFreq-ebox);
+   /* create panel toggle button which will contain all other widgets */
+   cpuFreq-button = xfce_create_panel_toggle_button ();
+   xfce_panel_plugin_add_action_widget (cpuFreq-plugin, cpuFreq-button);
+   gtk_container_add (GTK_CONTAINER (cpuFreq-plugin), cpuFreq-button);
 
cpuFreq-box = gtk_hbox_new (FALSE, SPACING);
gtk_container_set_border_width (GTK_CONTAINER (cpuFreq-box), BORDER);
-   gtk_container_add (GTK_CONTAINER (cpuFreq-ebox), cpuFreq-box);
+   gtk_container_add (GTK_CONTAINER (cpuFreq-button), cpuFreq-box);
 
cpufreq_update_icon (cpuFreq);
 
cpufreq_prepare_label (cpuFreq);
 
-   g_signal_connect (cpuFreq-ebox, button-press-event, G_CALLBACK 
(cpufreq_overview), cpuFreq);
+   g_signal_connect (cpuFreq-button, button-press-event,
+ G_CALLBACK (cpufreq_overview), 
cpuFreq);
 
/* activate panel widget tooltip */
cpu = g_ptr_array_index (cpuFreq-cpus, cpuFreq-options-show_cpu);
-   g_object_set (G_OBJECT (cpuFreq-ebox), has-tooltip, TRUE, NULL);
-   g_signal_connect (G_OBJECT (cpuFreq-ebox), query-tooltip,
+   g_object_set (G_OBJECT (cpuFreq-button), has-tooltip, TRUE, NULL);
+   g_signal_connect (G_OBJECT (cpuFreq-button), query-tooltip,
  G_CALLBACK (cpufreq_update_tooltip), 
cpu);
 
cpufreq_mode_changed (cpuFreq-plugin,
@@ -290,7 +291,7 @@ cpufreq_widgets (void)
  cpuFreq);
 
gtk_widget_show (cpuFreq-box);
-   gtk_widget_show (cpuFreq-ebox);
+   gtk_widget_show (cpuFreq-button);
 
cpufreq_update_plugin ();
 }
diff --git a/panel-plugin/xfce4-cpufreq-plugin.h 
b/panel-plugin/xfce4-cpufreq-plugin.h
index bbc5a3e..f976cb9 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.h
+++ b/panel-plugin/xfce4-cpufreq-plugin.h
@@ -56,7 +56,7 @@ typedef struct
GPtrArray *cpus;
 
/* Widgets */
-   GtkWidget   *ebox, *box, *icon, *label;
+   GtkWidget *button, *box, *icon, *label;
 
gint icon_size;
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Fix description in desktop file.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 55e8426020550c7c913145ed00e9d18256e44ae6 (commit)
   from dd8b31632c78fce476e7fa7cb022d45bbca33407 (commit)

commit 55e8426020550c7c913145ed00e9d18256e44ae6
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 18 01:25:28 2013 +0200

Fix description in desktop file.

 panel-plugin/cpufreq.desktop.in |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/panel-plugin/cpufreq.desktop.in b/panel-plugin/cpufreq.desktop.in
index c06261c..3ee58c2 100644
--- a/panel-plugin/cpufreq.desktop.in
+++ b/panel-plugin/cpufreq.desktop.in
@@ -1,7 +1,7 @@
 [Xfce Panel]
 Type=X-XFCE-PanelPlugin
 _Name=CPU Frequency Monitor
-_Comment=Show cpu frequencies and governours
+_Comment=Show CPU frequencies and governor
 Icon=xfce4-cpufreq-plugin
 X-XFCE-Internal=FALSE
 X-XFCE-Module=cpufreq
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Make layout dependent on widgets and panel sizes.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 25bfe279a604f7cc9e248f294eca595e11771414 (commit)
   from e01d15daa5e1eefab75810ea53111f70242485d0 (commit)

commit 25bfe279a604f7cc9e248f294eca595e11771414
Author: Harald Judt h.j...@gmx.at
Date:   Mon Aug 12 23:21:15 2013 +0200

Make layout dependent on widgets and panel sizes.

This also fixes the layout in one-row panels.

 panel-plugin/xfce4-cpufreq-configure.c |4 +-
 panel-plugin/xfce4-cpufreq-plugin.c|   88 +++-
 2 files changed, 64 insertions(+), 28 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index 6176127..5e11c77 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -40,7 +40,6 @@ check_button_changed (GtkWidget *button, 
CpuFreqPluginConfigure *configure)
cpuFreq-options-show_icon = 
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(button));
cpufreq_update_icon (cpuFreq);
-   return;
}
 
else if (button == configure-display_freq)
@@ -59,10 +58,9 @@ check_button_changed (GtkWidget *button, 
CpuFreqPluginConfigure *configure)
else
cpuFreq-icon_size += 4;
cpufreq_update_icon (cpuFreq);
-   cpuFreq-layout_changed = TRUE;
}
 
-   cpufreq_prepare_label (cpuFreq);
+   cpuFreq-layout_changed = TRUE;
cpufreq_update_plugin ();
 }
 
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index ddc9eff..3cb9d4e 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -129,10 +129,12 @@ cpufreq_update_tooltip (GtkWidget *widget,
 static void
 cpufreq_widgets_layout (void)
 {
-   gint pos = 1;
+   GtkRequisition icon_size, label_size;
GtkOrientation orientation;
-   XfcePanelPluginMode mode;
gboolean small = cpuFreq-options-keep_compact;
+   gboolean resized = FALSE;
+   gint panel_size, pos = 1;
+   gint lw = 0, lh = 0, iw = 0, ih = 0;
 
switch (cpuFreq-panel_mode) {
case XFCE_PANEL_PLUGIN_MODE_HORIZONTAL:
@@ -148,33 +150,70 @@ cpufreq_widgets_layout (void)
xfce_panel_plugin_set_small (cpuFreq-plugin, FALSE);
break;
}
+
+   /* check if the label fits below the icon, else put them side by side */
+   panel_size = xfce_panel_plugin_get_size(cpuFreq-plugin);
+   if (GTK_IS_WIDGET(cpuFreq-label)) {
+   gtk_widget_size_request (cpuFreq-label, label_size);
+   lw = label_size.width;
+   lh = label_size.height;
+   }
+   if (GTK_IS_WIDGET(cpuFreq-icon)) {
+   gtk_widget_size_request (cpuFreq-icon, icon_size);
+   iw = icon_size.width;
+   ih = icon_size.height;
+   }
+   if (cpuFreq-panel_mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL 
+   orientation == GTK_ORIENTATION_VERTICAL 
+   lh + ih + BORDER * 2 = panel_size) {
+   orientation = GTK_ORIENTATION_HORIZONTAL;
+   resized = TRUE;
+   } else if (orientation == GTK_ORIENTATION_HORIZONTAL 
+  lw + iw + BORDER * 2 = panel_size 
+  (cpuFreq-panel_mode == 
XFCE_PANEL_PLUGIN_MODE_DESKBAR ||
+   !small)) {
+   orientation = GTK_ORIENTATION_VERTICAL;
+   resized = TRUE;
+   }
+
gtk_orientable_set_orientation (GTK_ORIENTABLE (cpuFreq-box), 
orientation);
 
-   if (cpuFreq-options-keep_compact) {
+   if (small) {
if (orientation == GTK_ORIENTATION_VERTICAL) {
-   gtk_misc_set_alignment (GTK_MISC (cpuFreq-icon), 0.5, 
0);
-   gtk_misc_set_alignment (GTK_MISC (cpuFreq-label), 0.5, 
0);
+   if (cpuFreq-icon)
+   gtk_misc_set_alignment (GTK_MISC 
(cpuFreq-icon), 0.5, 0);
+   if (cpuFreq-label)
+   gtk_misc_set_alignment (GTK_MISC 
(cpuFreq-label), 0.5, 0);
} else {
-   gtk_misc_set_alignment (GTK_MISC (cpuFreq-icon), 0, 
0.5);
-   gtk_misc_set_alignment (GTK_MISC (cpuFreq-label), 0, 
0.5);
+   if (cpuFreq-icon)
+   gtk_misc_set_alignment (GTK_MISC 
(cpuFreq-icon), 0, 0.5);
+   if (cpuFreq-label)
+   gtk_misc_set_alignment (GTK_MISC 
(cpuFreq-label), 0, 0.5);
}
-   gtk_box_set_child_packing (GTK_BOX (cpuFreq-box),
-  
cpuFreq-icon,
-  FALSE, 
FALSE, 0, GTK_PACK_START);
+   if (cpuFreq-icon

[Xfce4-commits] xfce4-cpufreq-plugin:master Use mnemonics in configuration dialog.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 8f1ffd6142d1d757d3f09b4bcea09e28b9bf1a6b (commit)
   from 379fd856f9ccede855cc45575e5c57679b5e05ac (commit)

commit 8f1ffd6142d1d757d3f09b4bcea09e28b9bf1a6b
Author: Harald Judt h.j...@gmx.at
Date:   Thu Aug 15 11:53:07 2013 +0200

Use mnemonics in configuration dialog.

 panel-plugin/xfce4-cpufreq-configure.c |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index abb83bd..7b8bd38 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -212,12 +212,13 @@ cpufreq_configure (XfcePanelPlugin *plugin)
hbox = gtk_hbox_new (FALSE, BORDER);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
 
-   label = gtk_label_new (_(Timeout Interval:));
+   label = gtk_label_new_with_mnemonic (_(_Timeout interval:));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
 
spinner = configure-spinner_timeout = 
gtk_spin_button_new_with_range (TIMEOUT_MIN, TIMEOUT_MAX, 
TIMEOUT_STEP);
+   gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinner);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spinner), 
(gdouble)cpuFreq-options-timeout);
gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (spinner), value-changed, G_CALLBACK 
(spinner_changed), configure);
@@ -261,12 +262,13 @@ cpufreq_configure (XfcePanelPlugin *plugin)
hbox = gtk_hbox_new (FALSE, BORDER);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
 
-   label = gtk_label_new (_(Display CPU:));
+   label = gtk_label_new_with_mnemonic (_(_Display CPU:));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
 
combo = configure-combo_cpu = gtk_combo_box_new_text ();
gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, TRUE, 0);
+   gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
 
for (i = 0; i  cpuFreq-cpus-len; ++i)
{
@@ -284,17 +286,17 @@ cpufreq_configure (XfcePanelPlugin *plugin)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-keep_compact);
g_signal_connect (G_OBJECT (button), toggled, G_CALLBACK 
(check_button_changed), configure);
 
-   button = configure-display_icon = gtk_check_button_new_with_mnemonic 
(_(Show CPU icon));
+   button = configure-display_icon = gtk_check_button_new_with_mnemonic 
(_(Show CPU _icon));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-show_icon);
g_signal_connect (G_OBJECT (button), toggled, G_CALLBACK 
(check_button_changed), configure);
 
-   button = configure-display_freq = gtk_check_button_new_with_mnemonic 
(_(Show CPU frequency));
+   button = configure-display_freq = gtk_check_button_new_with_mnemonic 
(_(Show CPU fre_quency));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-show_label_freq);
g_signal_connect (G_OBJECT (button), toggled, G_CALLBACK 
(check_button_changed), configure);
 
-   button = configure-display_governor = 
gtk_check_button_new_with_mnemonic (_(Show CPU governor));
+   button = configure-display_governor = 
gtk_check_button_new_with_mnemonic (_(Show CPU _governor));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-show_label_governor);
g_signal_connect (G_OBJECT (button), toggled, G_CALLBACK 
(check_button_changed), configure);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Update authors.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to b4d7a0767efcb1fbf16139e7654fdfcff748e22b (commit)
   from 55e8426020550c7c913145ed00e9d18256e44ae6 (commit)

commit b4d7a0767efcb1fbf16139e7654fdfcff748e22b
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 18 01:37:56 2013 +0200

Update authors.

 AUTHORS|1 +
 panel-plugin/xfce4-cpufreq-configure.c |1 +
 panel-plugin/xfce4-cpufreq-configure.h |1 +
 panel-plugin/xfce4-cpufreq-linux.c |1 +
 panel-plugin/xfce4-cpufreq-linux.h |1 +
 panel-plugin/xfce4-cpufreq-overview.c  |1 +
 panel-plugin/xfce4-cpufreq-overview.h  |1 +
 panel-plugin/xfce4-cpufreq-plugin.c|1 +
 panel-plugin/xfce4-cpufreq-plugin.h|1 +
 9 files changed, 9 insertions(+)

diff --git a/AUTHORS b/AUTHORS
index f1a1040..9c715a6 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,2 +1,3 @@
 Thomas Schreck sh...@xfce.org
 Florian Rivoal friv...@xfce.org
+Harald Judt h.j...@gmx.at
diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index f7172d0..57afe43 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -2,6 +2,7 @@
  *
  *  Copyright (c) 2006 Thomas Schreck sh...@xfce.org
  *  Copyright (c) 2010,2011 Florian Rivoal friv...@xfce.org
+ *  Copyright (c) 2013 Harald Judt h.j...@gmx.at
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/panel-plugin/xfce4-cpufreq-configure.h 
b/panel-plugin/xfce4-cpufreq-configure.h
index 2eb79b8..edddbaf 100644
--- a/panel-plugin/xfce4-cpufreq-configure.h
+++ b/panel-plugin/xfce4-cpufreq-configure.h
@@ -2,6 +2,7 @@
  *
  *  Copyright (c) 2006 Thomas Schreck sh...@xfce.org
  *  Copyright (c) 2010,2011 Florian Rivoal friv...@xfce.org
+ *  Copyright (c) 2013 Harald Judt h.j...@gmx.at
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/panel-plugin/xfce4-cpufreq-linux.c 
b/panel-plugin/xfce4-cpufreq-linux.c
index 9460806..26ca1fd 100644
--- a/panel-plugin/xfce4-cpufreq-linux.c
+++ b/panel-plugin/xfce4-cpufreq-linux.c
@@ -2,6 +2,7 @@
  *
  *  Copyright (c) 2006 Thomas Schreck sh...@xfce.org
  *  Copyright (c) 2010,2011 Florian Rivoal friv...@xfce.org
+ *  Copyright (c) 2013 Harald Judt h.j...@gmx.at
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/panel-plugin/xfce4-cpufreq-linux.h 
b/panel-plugin/xfce4-cpufreq-linux.h
index 7360c42..3814630 100644
--- a/panel-plugin/xfce4-cpufreq-linux.h
+++ b/panel-plugin/xfce4-cpufreq-linux.h
@@ -1,6 +1,7 @@
 /*  xfce4-cpu-freq-plugin - panel plugin for cpu informations
  *
  *  Copyright (c) 2006 Thomas Schreck sh...@xfce.org
+ *  Copyright (c) 2013 Harald Judt h.j...@gmx.at
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/panel-plugin/xfce4-cpufreq-overview.c 
b/panel-plugin/xfce4-cpufreq-overview.c
index 8bc80eb..8e35856 100644
--- a/panel-plugin/xfce4-cpufreq-overview.c
+++ b/panel-plugin/xfce4-cpufreq-overview.c
@@ -2,6 +2,7 @@
  *
  *  Copyright (c) 2006 Thomas Schreck sh...@xfce.org
  *  Copyright (c) 2010,2011 Florian Rivoal friv...@xfce.org
+ *  Copyright (c) 2013 Harald Judt h.j...@gmx.at
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/panel-plugin/xfce4-cpufreq-overview.h 
b/panel-plugin/xfce4-cpufreq-overview.h
index 6002213..2503048 100644
--- a/panel-plugin/xfce4-cpufreq-overview.h
+++ b/panel-plugin/xfce4-cpufreq-overview.h
@@ -1,6 +1,7 @@
 /*  xfce4-cpu-freq-plugin - panel plugin for cpu informations
  *
  *  Copyright (c) 2006 Thomas Schreck sh...@xfce.org
+ *  Copyright (c) 2013 Harald Judt h.j...@gmx.at
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 30b8e57..5cb7b54 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -2,6 +2,7 @@
  *
  *  Copyright (c) 2006 Thomas Schreck sh...@xfce.org
  *  Copyright (c) 2010,2011 Florian Rivoal friv...@xfce.org
+ *  Copyright (c) 2013 Harald Judt h.j...@gmx.at
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/panel-plugin/xfce4-cpufreq-plugin.h 
b/panel-plugin/xfce4-cpufreq-plugin.h
index f3589ea..8e4f232 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.h
+++ b/panel-plugin/xfce4-cpufreq-plugin.h
@@ -2,6 +2,7

[Xfce4-commits] xfce4-cpufreq-plugin:master Add option to keep text in one line.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 3e4d258e613679b5effdfb60b7109b6d6893af10 (commit)
   from a16a636d61e86a803536066d7fbdb3577b218743 (commit)

commit 3e4d258e613679b5effdfb60b7109b6d6893af10
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 18 09:42:02 2013 +0200

Add option to keep text in one line.

This can be useful in single-row panel configurations, when you don't
want to shrink the text too much.

 panel-plugin/xfce4-cpufreq-configure.c |   10 ++
 panel-plugin/xfce4-cpufreq-configure.h |1 +
 panel-plugin/xfce4-cpufreq-plugin.c|4 +++-
 panel-plugin/xfce4-cpufreq-plugin.h|1 +
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index 57afe43..bfff760 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -61,6 +61,11 @@ check_button_changed (GtkWidget *button, 
CpuFreqPluginConfigure *configure)
cpufreq_update_icon (cpuFreq);
}
 
+   else if (button == configure-one_line) {
+   cpuFreq-options-one_line =
+   gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 
(button));
+   }
+
cpuFreq-layout_changed = TRUE;
cpufreq_update_plugin ();
 }
@@ -295,6 +300,11 @@ cpufreq_configure (XfcePanelPlugin *plugin)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-keep_compact);
g_signal_connect (G_OBJECT (button), toggled, G_CALLBACK 
(check_button_changed), configure);
 
+   button = configure-one_line = gtk_check_button_new_with_mnemonic 
(_(Show text in a single _line));
+   gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
+   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-one_line);
+   g_signal_connect (G_OBJECT (button), toggled, G_CALLBACK 
(check_button_changed), configure);
+
button = configure-display_icon = gtk_check_button_new_with_mnemonic 
(_(Show CPU _icon));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), 
cpuFreq-options-show_icon);
diff --git a/panel-plugin/xfce4-cpufreq-configure.h 
b/panel-plugin/xfce4-cpufreq-configure.h
index edddbaf..3ea3f43 100644
--- a/panel-plugin/xfce4-cpufreq-configure.h
+++ b/panel-plugin/xfce4-cpufreq-configure.h
@@ -32,6 +32,7 @@ typedef struct
GtkWidget *combo_cpu;
GtkWidget *spinner_timeout;
GtkWidget *keep_compact;
+   GtkWidget *one_line;
GtkWidget *fontname;
 } CpuFreqPluginConfigure;
 
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 0cce335..6874838 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -130,7 +130,7 @@ cpufreq_update_label (CpuInfo *cpu)
freq = cpufreq_get_human_readable_freq (cpu-cur_freq);
label = g_strconcat
(cpuFreq-options-show_label_freq ? freq : ,
-both ? \n : ,
+both ? (cpuFreq-options-one_line ?   : \n) : ,
 cpu-cur_governor != NULL 
 cpuFreq-options-show_label_governor ? cpu-cur_governor : ,
 NULL);
@@ -454,6 +454,7 @@ cpufreq_read_config (void)
cpuFreq-options-show_label_governor = xfce_rc_read_bool_entry (rc, 
show_label_governor, TRUE);
cpuFreq-options-show_warning= xfce_rc_read_bool_entry (rc, 
show_warning, TRUE);
cpuFreq-options-keep_compact= xfce_rc_read_bool_entry (rc, 
keep_compact, FALSE);
+   cpuFreq-options-one_line= xfce_rc_read_bool_entry (rc, 
one_line, FALSE);
 
value = xfce_rc_read_entry (rc, fontname, NULL);
if (value) {
@@ -485,6 +486,7 @@ cpufreq_write_config (XfcePanelPlugin *plugin)
xfce_rc_write_bool_entry (rc, show_label_governor, 
cpuFreq-options-show_label_governor);
xfce_rc_write_bool_entry (rc, show_warning,
cpuFreq-options-show_warning);
xfce_rc_write_bool_entry (rc, keep_compact,
cpuFreq-options-keep_compact);
+   xfce_rc_write_bool_entry (rc, one_line,
cpuFreq-options-one_line);
if (cpuFreq-options-fontname)
xfce_rc_write_entry  (rc, fontname,
cpuFreq-options-fontname);
 
diff --git a/panel-plugin/xfce4-cpufreq-plugin.h 
b/panel-plugin/xfce4-cpufreq-plugin.h
index 8e4f232..e955d0d 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.h
+++ b/panel-plugin/xfce4-cpufreq-plugin.h
@@ -59,6 +59,7 @@ typedef struct
gboolean show_label_freq;
gboolean show_warning;
gboolean keep_compact;
+   gboolean one_line;
gchar   *fontname;
 } CpuFreqPluginOptions;
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Use GtkSizeGroup for widgets in configure dialog.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to d19cbd9d86281273462c69ee38dd4ff79bf3dc79 (commit)
   from 8f1ffd6142d1d757d3f09b4bcea09e28b9bf1a6b (commit)

commit d19cbd9d86281273462c69ee38dd4ff79bf3dc79
Author: Harald Judt h.j...@gmx.at
Date:   Thu Aug 15 12:15:41 2013 +0200

Use GtkSizeGroup for widgets in configure dialog.

 panel-plugin/xfce4-cpufreq-configure.c |6 ++
 1 file changed, 6 insertions(+)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index 7b8bd38..5abbe02 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -172,6 +172,7 @@ cpufreq_configure (XfcePanelPlugin *plugin)
GtkWidget *dialog, *dialog_vbox;
GtkWidget *frame, *align, *label, *vbox, *hbox;
GtkWidget *combo, *spinner, *button;
+   GtkSizeGroup *sg0;
CpuFreqPluginConfigure *configure;
 
configure = g_new0 (CpuFreqPluginConfigure, 1);
@@ -191,6 +192,7 @@ cpufreq_configure (XfcePanelPlugin *plugin)
 
dialog_vbox = GTK_DIALOG (dialog)-vbox;
 
+   sg0 = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
 
/* monitor behaviours */
frame = gtk_frame_new (NULL);
@@ -215,6 +217,7 @@ cpufreq_configure (XfcePanelPlugin *plugin)
label = gtk_label_new_with_mnemonic (_(_Timeout interval:));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+   gtk_size_group_add_widget (sg0, label);
 
spinner = configure-spinner_timeout = 
gtk_spin_button_new_with_range (TIMEOUT_MIN, TIMEOUT_MAX, 
TIMEOUT_STEP);
@@ -248,6 +251,7 @@ cpufreq_configure (XfcePanelPlugin *plugin)
label = gtk_label_new_with_mnemonic (_(_Font:));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+   gtk_size_group_add_widget (sg0, label);
 
button = configure-fontname = gtk_button_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
@@ -265,6 +269,7 @@ cpufreq_configure (XfcePanelPlugin *plugin)
label = gtk_label_new_with_mnemonic (_(_Display CPU:));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+   gtk_size_group_add_widget (sg0, label);
 
combo = configure-combo_cpu = gtk_combo_box_new_text ();
gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, TRUE, 0);
@@ -303,5 +308,6 @@ cpufreq_configure (XfcePanelPlugin *plugin)
 
g_signal_connect(G_OBJECT (dialog), response, 
G_CALLBACK(cpufreq_configure_response), configure);
 
+   g_object_unref (sg0);
gtk_widget_show_all (dialog);
 }
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Center or left align label depending on layout.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to d205f3e9d694ad08887d8b2793b6719ca3ace01d (commit)
   from 25bfe279a604f7cc9e248f294eca595e11771414 (commit)

commit d205f3e9d694ad08887d8b2793b6719ca3ace01d
Author: Harald Judt h.j...@gmx.at
Date:   Tue Aug 13 00:56:52 2013 +0200

Center or left align label depending on layout.

 panel-plugin/xfce4-cpufreq-plugin.c |   10 ++
 1 file changed, 10 insertions(+)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 3cb9d4e..7fe718f 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -190,6 +190,11 @@ cpufreq_widgets_layout (void)
if (cpuFreq-label)
gtk_misc_set_alignment (GTK_MISC 
(cpuFreq-label), 0, 0.5);
}
+   if (cpuFreq-label)
+   gtk_label_set_justify (GTK_LABEL (cpuFreq-label),
+  resized
+  ? 
GTK_JUSTIFY_CENTER : GTK_JUSTIFY_LEFT);
+
if (cpuFreq-icon)
gtk_box_set_child_packing (GTK_BOX (cpuFreq-box),
   
cpuFreq-icon,
@@ -207,6 +212,11 @@ cpufreq_widgets_layout (void)
gtk_misc_set_alignment (GTK_MISC 
(cpuFreq-label), 1.0, 0.5);
pos = resized ? 1 : 0;
}
+   if (cpuFreq-label)
+   gtk_label_set_justify (GTK_LABEL (cpuFreq-label),
+  resized
+  ? 
GTK_JUSTIFY_LEFT : GTK_JUSTIFY_CENTER);
+
if (cpuFreq-icon)
gtk_box_set_child_packing (GTK_BOX (cpuFreq-box),
   
cpuFreq-icon,
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Refactor code for reading sysfs files.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 3db6c5ebd7161bc71354522f5703607902b9b2fd (commit)
   from 8b0228ac7c58f1ff5d861c8e38d92a5aa86e87b5 (commit)

commit 3db6c5ebd7161bc71354522f5703607902b9b2fd
Author: Harald Judt h.j...@gmx.at
Date:   Sat Aug 17 16:03:46 2013 +0200

Refactor code for reading sysfs files.

 panel-plugin/xfce4-cpufreq-linux.c |  287 ++--
 1 file changed, 108 insertions(+), 179 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-linux.c 
b/panel-plugin/xfce4-cpufreq-linux.c
index 11a7ddb..9460806 100644
--- a/panel-plugin/xfce4-cpufreq-linux.c
+++ b/panel-plugin/xfce4-cpufreq-linux.c
@@ -34,11 +34,71 @@
 # define _(String) gettext (String)
 #endif
 
-static gboolean
+#define SYSFS_READ_STRING(file, contents, string)  \
+   if (contents = read_sysfs_file_contents (file)) {   \
+   g_free (string);
\
+   string = contents;  
\
+   }
+
+#define SYSFS_READ_STRING_LIST(file, contents, list)   
\
+   if (contents = read_sysfs_file_contents (file)) {   
\
+   gchar **tokens = NULL;  
\
+   gint i = 0; 
\
+   tokens = g_strsplit (contents,  , 0); 
\
+   g_free (contents);  
\
+   g_list_free_full (list, g_free);
\
+   while (tokens[i] != NULL) { 
\
+   list = g_list_append (list, strdup (tokens[i]));
\
+   i++;
\
+   }   
\
+   g_strfreev (tokens);
\
+   }
+
+#define SYSFS_READ_INT(file, contents, intval) \
+   if (contents = read_sysfs_file_contents (file)) {   \
+   intval = atoi (contents);   
\
+   g_free (contents);  
\
+   }
+
+#define SYSFS_READ_INT_LIST(file, contents, list)  
\
+   if (contents = read_sysfs_file_contents (file)) {   
\
+   gchar **tokens = NULL;  
\
+   gint i = 0; 
\
+   tokens = g_strsplit (contents,  , 0); 
\
+   g_free (contents);  
\
+   g_list_free (list); 
\
+   while (tokens[i] != NULL) { 
\
+   gint value = atoi (tokens[i]);  
\
+   list = g_list_append (list, GINT_TO_POINTER (value));   
\
+   i++;
\
+   }   
\
+   g_strfreev (tokens);
\
+   }
+
+
+static inline gchar *
+read_sysfs_file_contents (const gchar *file)
+{
+   GError *error = NULL;
+   gchar *contents = NULL;
+
+   if (!g_file_test (file, G_FILE_TEST_EXISTS))
+   return NULL;
+
+   if (g_file_get_contents (file, contents, NULL, error)) {
+   g_strstrip (contents);
+   return contents;
+   } else {
+   g_debug (Error reading %s: %s\n, file, error-message);
+   g_error_free (error);
+   return NULL;
+   }
+}
+
+static void
 cpufreq_cpu_parse_sysfs_init (gint cpu_number, CpuInfo *cpu)
 {
-   FILE*file;
-   gchar   *filePath, *fileContent, **tokens;
+   gchar   *file, *contents;
gboolean add_cpu = FALSE

[Xfce4-commits] xfce4-cpufreq-plugin:master Fix typos in strings.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to a16a636d61e86a803536066d7fbdb3577b218743 (commit)
   from b4d7a0767efcb1fbf16139e7654fdfcff748e22b (commit)

commit a16a636d61e86a803536066d7fbdb3577b218743
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 18 01:54:59 2013 +0200

Fix typos in strings.

 panel-plugin/xfce4-cpufreq-plugin.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 5cb7b54..0cce335 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -579,7 +579,7 @@ cpufreq_construct (XfcePanelPlugin *plugin)
 
 #ifdef __linux__
if (cpufreq_linux_init () == FALSE)
-   xfce_dialog_show_error (NULL, NULL, _(Your system is not 
configured correctly to support cpu frequency scaling !));
+   xfce_dialog_show_error (NULL, NULL, _(Your system is not 
configured correctly to support CPU frequency scaling!));
 
gtk_widget_set_size_request (GTK_WIDGET (plugin), -1, -1);
cpufreq_widgets ();
@@ -589,7 +589,7 @@ cpufreq_construct (XfcePanelPlugin *plugin)
(GSourceFunc) cpufreq_update_cpus,
NULL);
 #else
-   xfce_dialog_show_error (NULL, NULL, _(Your system is not supported yet 
!));
+   xfce_dialog_show_error (NULL, NULL, _(Your system is not supported 
yet!));
 #endif /* __linux__ */
 
g_signal_connect (plugin, free-data, G_CALLBACK (cpufreq_free),
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Add min, avg and max frequencies options.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 41af8d0c4fc3a83d0578b337f73d8d1a7db77ab1 (commit)
   from 3db6c5ebd7161bc71354522f5703607902b9b2fd (commit)

commit 41af8d0c4fc3a83d0578b337f73d8d1a7db77ab1
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 18 01:03:28 2013 +0200

Add min, avg and max frequencies options.

The CPU combo box now allows to select three options besides the real CPUs.
These are calculated values over the current frequencies of the CPUs.

According to the i7z tool, the max frequency is supposed to be the real
current frequency when using the intel pstate driver.

 panel-plugin/xfce4-cpufreq-configure.c |3 ++
 panel-plugin/xfce4-cpufreq-plugin.c|   80 ++--
 panel-plugin/xfce4-cpufreq-plugin.h|9 
 3 files changed, 88 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index cd8e3f7..f7172d0 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -281,6 +281,9 @@ cpufreq_configure (XfcePanelPlugin *plugin)
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), cpu_name);
g_free (cpu_name);
}
+   gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _(min));
+   gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _(avg));
+   gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _(max));
 
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 
cpuFreq-options-show_cpu);
g_signal_connect (G_OBJECT (combo), changed, G_CALLBACK 
(combo_changed), configure);
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 32abdc2..0474f74 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -40,6 +40,63 @@
 #include xfce4-cpufreq-overview.h
 #include xfce4-cpufreq-utils.h
 
+
+CpuInfo *
+cpufreq_cpus_calc_min (void)
+{
+   guint freq = 0;
+   gint i;
+
+   for (i = 0; i  cpuFreq-cpus-len; i++) {
+   CpuInfo *cpu = g_ptr_array_index (cpuFreq-cpus, i);
+   if (freq  cpu-cur_freq || i == 0)
+   freq = cpu-cur_freq;
+   }
+
+   cpuinfo_free (cpuFreq-cpu_min);
+   cpuFreq-cpu_min = g_new0 (CpuInfo, 1);
+   cpuFreq-cpu_min-cur_freq = freq;
+   cpuFreq-cpu_min-cur_governor = g_strdup (_(current min));
+   return cpuFreq-cpu_min;
+}
+
+CpuInfo *
+cpufreq_cpus_calc_avg (void)
+{
+   guint freq = 0;
+   gint i;
+
+   for (i = 0; i  cpuFreq-cpus-len; i++) {
+   CpuInfo *cpu = g_ptr_array_index (cpuFreq-cpus, i);
+   freq += cpu-cur_freq;
+   }
+
+   freq /= cpuFreq-cpus-len;
+   cpuinfo_free (cpuFreq-cpu_avg);
+   cpuFreq-cpu_avg = g_new0 (CpuInfo, 1);
+   cpuFreq-cpu_avg-cur_freq = freq;
+   cpuFreq-cpu_avg-cur_governor = g_strdup (_(current avg));
+   return cpuFreq-cpu_avg;
+}
+
+CpuInfo *
+cpufreq_cpus_calc_max (void)
+{
+   guint freq = 0;
+   gint i;
+
+   for (i = 0; i  cpuFreq-cpus-len; i++) {
+   CpuInfo *cpu = g_ptr_array_index (cpuFreq-cpus, i);
+   if (freq  cpu-cur_freq)
+   freq = cpu-cur_freq;
+   }
+   cpuinfo_free (cpuFreq-cpu_max);
+   cpuFreq-cpu_max = g_new0 (CpuInfo, 1);
+   cpuFreq-cpu_max-cur_freq = freq;
+   cpuFreq-cpu_max-cur_governor = g_strdup (_(current max));
+   return cpuFreq-cpu_max;
+}
+
 void
 cpufreq_label_set_font (void)
 {
@@ -238,15 +295,28 @@ cpufreq_widgets_layout (void)
cpuFreq-layout_changed = FALSE;
 }
 
+CpuInfo *
+cpufreq_current_cpu ()
+{
+   CpuInfo *cpu = NULL;
+   if (cpuFreq-options-show_cpu  cpuFreq-cpus-len)
+   cpu = g_ptr_array_index (cpuFreq-cpus, 
cpuFreq-options-show_cpu);
+   else if (cpuFreq-options-show_cpu == CPU_MIN)
+   cpu = cpufreq_cpus_calc_min ();
+   else if (cpuFreq-options-show_cpu == CPU_AVG)
+   cpu = cpufreq_cpus_calc_avg ();
+   else if (cpuFreq-options-show_cpu == CPU_MAX)
+   cpu = cpufreq_cpus_calc_max ();
+   return cpu;
+}
+
 gboolean
 cpufreq_update_plugin (void)
 {
CpuInfo *cpu;
gboolean ret;
 
-   g_return_val_if_fail (cpuFreq-options-show_cpu  cpuFreq-cpus-len, 
FALSE);
-
-   cpu = g_ptr_array_index (cpuFreq-cpus, cpuFreq-options-show_cpu);
+   cpu = cpufreq_current_cpu ();
ret = cpufreq_update_label (cpu);
 
if (cpuFreq-layout_changed) {
@@ -344,7 +414,7 @@ cpufreq_widgets (void)
  G_CALLBACK (cpufreq_overview), 
cpuFreq);
 
/* activate panel widget tooltip */
-   cpu = g_ptr_array_index (cpuFreq-cpus, cpuFreq-options-show_cpu);
+   cpu = cpufreq_current_cpu ();
g_object_set (G_OBJECT (cpuFreq-button), has-tooltip, TRUE, NULL);
g_signal_connect (G_OBJECT (cpuFreq-button), query-tooltip

[Xfce4-commits] xfce4-cpufreq-plugin:master Use update interval instead of timeout interval.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 8b0228ac7c58f1ff5d861c8e38d92a5aa86e87b5 (commit)
   from d19cbd9d86281273462c69ee38dd4ff79bf3dc79 (commit)

commit 8b0228ac7c58f1ff5d861c8e38d92a5aa86e87b5
Author: Harald Judt h.j...@gmx.at
Date:   Thu Aug 15 12:23:47 2013 +0200

Use update interval instead of timeout interval.

Timeout might be the programmer's or technical term, but in practice we're
dealing with widget updates.

 panel-plugin/xfce4-cpufreq-configure.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index 5abbe02..cd8e3f7 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -214,7 +214,7 @@ cpufreq_configure (XfcePanelPlugin *plugin)
hbox = gtk_hbox_new (FALSE, BORDER);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
 
-   label = gtk_label_new_with_mnemonic (_(_Timeout interval:));
+   label = gtk_label_new_with_mnemonic (_(_Update interval:));
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_size_group_add_widget (sg0, label);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Add code for setting font.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 512444b19ffd48f86c0dd88ab4d910f5a09a8d3e (commit)
   from d205f3e9d694ad08887d8b2793b6719ca3ace01d (commit)

commit 512444b19ffd48f86c0dd88ab4d910f5a09a8d3e
Author: Harald Judt h.j...@gmx.at
Date:   Tue Aug 13 23:29:48 2013 +0200

Add code for setting font.

 panel-plugin/xfce4-cpufreq-plugin.c |   64 +++
 panel-plugin/xfce4-cpufreq-plugin.h |4 +++
 2 files changed, 47 insertions(+), 21 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 7fe718f..32abdc2 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -40,37 +40,47 @@
 #include xfce4-cpufreq-overview.h
 #include xfce4-cpufreq-utils.h
 
+void
+cpufreq_label_set_font (void)
+{
+   PangoFontDescription *desc = NULL;
+
+   if (G_UNLIKELY (cpuFreq-label == NULL))
+   return;
+
+   if (cpuFreq-options-fontname)
+   desc = pango_font_description_from_string 
(cpuFreq-options-fontname);
+
+   gtk_widget_modify_font (cpuFreq-label, desc);
+pango_font_description_free (desc);
+}
+
 gboolean
 cpufreq_update_label (CpuInfo *cpu)
 {
gchar *label, *freq;
+   gint size, both;
 
-   if (!cpuFreq-options-show_label_governor  
!cpuFreq-options-show_label_freq)
+   if (!cpuFreq-options-show_label_governor 
+   !cpuFreq-options-show_label_freq)
return TRUE;

-   gint size = xfce_panel_plugin_get_size (cpuFreq-plugin);
-   gboolean both = cpu-cur_governor != NULL  
cpuFreq-options-show_label_freq  cpuFreq-options-show_label_governor;
-
-   gchar *txt_size = both ?
-  (size = 38 ? (size = 28 ? span 
size=\xx-small\ : span size=\x-small\) : span) :
-  (size = 19 ? span size=\x-small\ : 
span); 
+   both = cpu-cur_governor != NULL 
+   cpuFreq-options-show_label_freq 
+   cpuFreq-options-show_label_governor;
 
freq = cpufreq_get_human_readable_freq (cpu-cur_freq);
-   label = g_strconcat (txt_size,
-
-   cpuFreq-options-show_label_freq ? freq : ,
-   
-   both ? (size = 25 ?   : \n) : ,
-   
-   cpu-cur_governor != NULL 
-   cpuFreq-options-show_label_governor ? cpu-cur_governor : ,
+   label = g_strconcat
+   (cpuFreq-options-show_label_freq ? freq : ,
+both ? \n : ,
+cpu-cur_governor != NULL 
+cpuFreq-options-show_label_governor ? cpu-cur_governor : ,
+NULL);
 
-   /span,
-   NULL);
+   gtk_label_set_text (GTK_LABEL (cpuFreq-label), label);
 
-   if (strcmp(label,))
+   if (strcmp(label, ))
{
-   gtk_label_set_markup (GTK_LABEL(cpuFreq-label), label);
if (cpuFreq-panel_mode == XFCE_PANEL_PLUGIN_MODE_VERTICAL)
gtk_label_set_angle (GTK_LABEL(cpuFreq-label), -90);
else
@@ -239,8 +249,10 @@ cpufreq_update_plugin (void)
cpu = g_ptr_array_index (cpuFreq-cpus, cpuFreq-options-show_cpu);
ret = cpufreq_update_label (cpu);
 
-   if (cpuFreq-layout_changed)
+   if (cpuFreq-layout_changed) {
+   cpufreq_label_set_font ();
cpufreq_widgets_layout ();
+   }
 
return ret;
 }
@@ -352,6 +364,7 @@ cpufreq_read_config (void)
 {
XfceRc *rc;
gchar  *file;
+   const gchar *value;
 
file = xfce_panel_plugin_save_location (cpuFreq-plugin, FALSE);
 
@@ -371,6 +384,12 @@ cpufreq_read_config (void)
cpuFreq-options-show_warning= xfce_rc_read_bool_entry (rc, 
show_warning, TRUE);
cpuFreq-options-keep_compact= xfce_rc_read_bool_entry (rc, 
keep_compact, FALSE);
 
+   value = xfce_rc_read_entry (rc, fontname, NULL);
+   if (value) {
+   g_free (cpuFreq-options-fontname);
+   cpuFreq-options-fontname = g_strdup (value);
+   }
+
xfce_rc_close (rc);
 }
 
@@ -395,6 +414,8 @@ cpufreq_write_config (XfcePanelPlugin *plugin)
xfce_rc_write_bool_entry (rc, show_label_governor, 
cpuFreq-options-show_label_governor);
xfce_rc_write_bool_entry (rc, show_warning,
cpuFreq-options-show_warning);
xfce_rc_write_bool_entry (rc, keep_compact,
cpuFreq-options-keep_compact);
+   if (cpuFreq-options-fontname)
+   xfce_rc_write_entry  (rc, fontname,
cpuFreq-options-fontname);
 
xfce_rc_close (rc);
 }
@@ -425,8 +446,9 @@ cpufreq_free (XfcePanelPlugin *plugin)
g_ptr_array_remove_fast (cpuFreq-cpus, cpu);
cpuinfo_free (cpu);
}
-
g_ptr_array_free (cpuFreq-cpus, TRUE);
+
+   g_free (cpuFreq-options-fontname);
cpuFreq-plugin = NULL;
g_free (cpuFreq);
 }
diff --git a/panel-plugin/xfce4

[Xfce4-commits] xfce4-cpufreq-plugin:master Update layout only if necessary.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to e01d15daa5e1eefab75810ea53111f70242485d0 (commit)
   from 73ca04dd894bbbda394fbae2f1fee2bca70047f6 (commit)

commit e01d15daa5e1eefab75810ea53111f70242485d0
Author: Harald Judt h.j...@gmx.at
Date:   Mon Aug 12 15:40:34 2013 +0200

Update layout only if necessary.

It is a bit costly and unnecessary to do this every update.

 panel-plugin/xfce4-cpufreq-configure.c |1 +
 panel-plugin/xfce4-cpufreq-plugin.c|8 +++-
 panel-plugin/xfce4-cpufreq-plugin.h|1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index f51ec57..6176127 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -59,6 +59,7 @@ check_button_changed (GtkWidget *button, 
CpuFreqPluginConfigure *configure)
else
cpuFreq-icon_size += 4;
cpufreq_update_icon (cpuFreq);
+   cpuFreq-layout_changed = TRUE;
}
 
cpufreq_prepare_label (cpuFreq);
diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 3607719..ddc9eff 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -175,6 +175,8 @@ cpufreq_widgets_layout (void)
   TRUE, TRUE, 
0, GTK_PACK_START);
}
gtk_box_reorder_child (GTK_BOX (cpuFreq-box), cpuFreq-label, pos);
+
+   cpuFreq-layout_changed = FALSE;
 }
 
 gboolean
@@ -184,7 +186,8 @@ cpufreq_update_plugin (void)
 
g_return_val_if_fail (cpuFreq-options-show_cpu  cpuFreq-cpus-len, 
FALSE);
 
-   cpufreq_widgets_layout ();
+   if (cpuFreq-layout_changed)
+   cpufreq_widgets_layout ();
 
cpu = g_ptr_array_index (cpuFreq-cpus, cpuFreq-options-show_cpu);
if (cpufreq_update_label (cpu) == FALSE)
@@ -209,6 +212,7 @@ static void
 cpufreq_mode_changed (XfcePanelPlugin *plugin, XfcePanelPluginMode mode, 
CpuFreqPlugin *cpufreq)
 {
cpuFreq-panel_mode = mode;
+   cpuFreq-layout_changed = TRUE;
cpufreq_update_plugin ();
 }
 
@@ -384,6 +388,7 @@ cpufreq_set_size (XfcePanelPlugin *plugin, gint size, 
CpuFreqPlugin *cpufreq)
 {
cpuFreq-icon_size = size / xfce_panel_plugin_get_nrows 
(cpuFreq-plugin);
 
+   cpuFreq-layout_changed = TRUE;
cpufreq_update_icon (cpufreq);
cpufreq_update_plugin ();
 
@@ -401,6 +406,7 @@ cpufreq_construct (XfcePanelPlugin *plugin)
cpuFreq-cpus= g_ptr_array_new ();
 
cpufreq_read_config ();
+   cpuFreq-layout_changed = TRUE;
 
 #ifdef __linux__
if (cpufreq_linux_init () == FALSE)
diff --git a/panel-plugin/xfce4-cpufreq-plugin.h 
b/panel-plugin/xfce4-cpufreq-plugin.h
index 0f2d313..89fc977 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.h
+++ b/panel-plugin/xfce4-cpufreq-plugin.h
@@ -67,6 +67,7 @@ typedef struct
 
/* Widgets */
GtkWidget *button, *box, *icon, *label;
+   gboolean layout_changed;
 
gint icon_size;
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Add a proper About dialog.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to dd8b31632c78fce476e7fa7cb022d45bbca33407 (commit)
   from 41af8d0c4fc3a83d0578b337f73d8d1a7db77ab1 (commit)

commit dd8b31632c78fce476e7fa7cb022d45bbca33407
Author: Harald Judt h.j...@gmx.at
Date:   Sun Aug 18 01:22:40 2013 +0200

Add a proper About dialog.

 panel-plugin/xfce4-cpufreq-plugin.c |   31 ++-
 panel-plugin/xfce4-cpufreq-plugin.h |2 ++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c 
b/panel-plugin/xfce4-cpufreq-plugin.c
index 0474f74..30b8e57 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -537,6 +537,32 @@ cpufreq_set_size (XfcePanelPlugin *plugin, gint size, 
CpuFreqPlugin *cpufreq)
return TRUE;
 }
 
+cpufreq_show_about(XfcePanelPlugin *plugin,
+  CpuFreqPlugin *cpufreq)
+{
+   GdkPixbuf *icon;
+   const gchar *auth[] = {
+   Thomas Schreck sh...@xfce.org,
+   Florian Rivoal friv...@xfce.org,
+   Harald Judt h.j...@gmx.at,
+   NULL };
+   icon = xfce_panel_pixbuf_from_source(xfce4-cpufreq-plugin, NULL, 48);
+   gtk_show_about_dialog
+   (NULL,
+logo, icon,
+license, xfce_get_license_text(XFCE_LICENSE_TEXT_GPL),
+version, PACKAGE_VERSION,
+program-name, PACKAGE_NAME,
+comments, _(Show CPU frequencies and governor),
+website, PLUGIN_WEBSITE,
+copyright, _(Copyright (c) 2003-2012\n),
+authors, auth,
+NULL);
+
+   if (icon)
+   g_object_unref(G_OBJECT(icon));
+}
+
 static void
 cpufreq_construct (XfcePanelPlugin *plugin)
 {
@@ -577,7 +603,10 @@ cpufreq_construct (XfcePanelPlugin *plugin)
/* the configure and about menu items are hidden by default */
xfce_panel_plugin_menu_show_configure (plugin);
g_signal_connect (plugin, configure-plugin,
- G_CALLBACK (cpufreq_configure), NULL);
+ G_CALLBACK (cpufreq_configure), NULL);
+   xfce_panel_plugin_menu_show_about(plugin);
+   g_signal_connect (G_OBJECT (plugin), about,
+ G_CALLBACK (cpufreq_show_about), 
cpuFreq);
 }
 
 XFCE_PANEL_PLUGIN_REGISTER (cpufreq_construct);
diff --git a/panel-plugin/xfce4-cpufreq-plugin.h 
b/panel-plugin/xfce4-cpufreq-plugin.h
index 9daa546..f3589ea 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.h
+++ b/panel-plugin/xfce4-cpufreq-plugin.h
@@ -24,6 +24,8 @@
 #include gtk/gtk.h
 #include libxfce4panel/xfce-panel-plugin.h
 
+#define PLUGIN_WEBSITE 
(http://goodies.xfce.org/projects/panel-plugins/xfce4-cpufreq-plugin;)
+
 #define CPU_MIN (cpuFreq-cpus-len + 0)
 #define CPU_AVG (cpuFreq-cpus-len + 1)
 #define CPU_MAX (cpuFreq-cpus-len + 2)
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-cpufreq-plugin:master Add UI for font selection.

2013-08-18 Thread Harald Judt
Updating branch refs/heads/master
 to 379fd856f9ccede855cc45575e5c57679b5e05ac (commit)
   from 512444b19ffd48f86c0dd88ab4d910f5a09a8d3e (commit)

commit 379fd856f9ccede855cc45575e5c57679b5e05ac
Author: Harald Judt h.j...@gmx.at
Date:   Tue Aug 13 23:30:29 2013 +0200

Add UI for font selection.

 panel-plugin/xfce4-cpufreq-configure.c |   86 +++-
 panel-plugin/xfce4-cpufreq-configure.h |1 +
 2 files changed, 85 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c 
b/panel-plugin/xfce4-cpufreq-configure.c
index 5e11c77..abb83bd 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -65,6 +65,74 @@ check_button_changed (GtkWidget *button, 
CpuFreqPluginConfigure *configure)
 }
 
 static void
+button_fontname_update(GtkWidget *button,
+  gboolean update_plugin)
+{
+   if (cpuFreq-options-fontname == NULL) {
+   gtk_button_set_label (GTK_BUTTON (button), _(Select font...));
+   gtk_widget_set_tooltip_text
+   (button, _(Select font family and size to use for the 
labels.));
+   } else {
+   gtk_button_set_label (GTK_BUTTON (button), 
cpuFreq-options-fontname);
+   gtk_widget_set_tooltip_text
+   (button, _(Right-click to revert to the default 
font.));
+   }
+   if (update_plugin) {
+   cpufreq_label_set_font ();
+   cpuFreq-layout_changed = TRUE;
+   cpufreq_update_plugin ();
+   }
+}
+
+static gboolean
+button_fontname_clicked(GtkWidget *button,
+   CpuFreqPluginConfigure 
*configure)
+{
+   GtkFontSelectionDialog *fsd;
+   gchar *fontname;
+   gint result;
+
+   fsd = GTK_FONT_SELECTION_DIALOG
+   (gtk_font_selection_dialog_new (_(Select font)));
+   if (cpuFreq-options-fontname)
+   gtk_font_selection_dialog_set_font_name(fsd,
+   
cpuFreq-options-fontname);
+
+   result = gtk_dialog_run(GTK_DIALOG(fsd));
+   if (result == GTK_RESPONSE_OK || result == GTK_RESPONSE_ACCEPT) {
+   fontname = gtk_font_selection_dialog_get_font_name(fsd);
+   if (fontname != NULL) {
+   gtk_button_set_label(GTK_BUTTON(button), fontname);
+   g_free (cpuFreq-options-fontname);
+   cpuFreq-options-fontname = fontname;
+   }
+   button_fontname_update(button, TRUE);
+   }
+   gtk_widget_destroy(GTK_WIDGET(fsd));
+   return TRUE;
+}
+
+static gboolean
+button_fontname_pressed(GtkWidget *button,
+   GdkEventButton *event,
+   CpuFreqPluginConfigure 
*configure)
+{
+   if (event-type != GDK_BUTTON_PRESS)
+   return FALSE;
+
+   /* right mouse click clears the font name and resets the button */
+   if (event-button == 3  cpuFreq-options-fontname) {
+   g_free (cpuFreq-options-fontname);
+   cpuFreq-options-fontname = NULL;
+   button_fontname_update(button, TRUE);
+   return TRUE;
+   }
+
+   /* left mouse click will be handled in a different function */
+   return FALSE;
+}
+
+static void
 combo_changed (GtkWidget *combo, CpuFreqPluginConfigure *configure)
 {
guint selected = gtk_combo_box_get_active (GTK_COMBO_BOX (combo));
@@ -172,6 +240,22 @@ cpufreq_configure (XfcePanelPlugin *plugin)
gtk_container_add (GTK_CONTAINER (align), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER);
 
+   /* font settings */
+   hbox = gtk_hbox_new (FALSE, BORDER);
+   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+
+   label = gtk_label_new_with_mnemonic (_(_Font:));
+   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+
+   button = configure-fontname = gtk_button_new ();
+   gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
+   gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
+   g_signal_connect (G_OBJECT (button), clicked,
+ G_CALLBACK (button_fontname_clicked), 
configure);
+   g_signal_connect (G_OBJECT (button), button_press_event,
+ G_CALLBACK (button_fontname_pressed), 
configure);
+   button_fontname_update (button, FALSE);
 
/* which cpu to show in panel */
hbox = gtk_hbox_new (FALSE, BORDER);
@@ -194,7 +278,6 @@ cpufreq_configure (XfcePanelPlugin *plugin)
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 
cpuFreq-options-show_cpu);
g_signal_connect (G_OBJECT (combo

[Xfce4-commits] xfce4-weather-plugin:master Rewrite README section for package maintainers and distributors.

2013-04-06 Thread Harald Judt
Updating branch refs/heads/master
 to 1158574f903f2e01f62a27b7e8f80035aba23afb (commit)
   from 5772b85b53fe906c52f68f9a507d19b9f34078ef (commit)

commit 1158574f903f2e01f62a27b7e8f80035aba23afb
Author: Harald Judt h.j...@gmx.at
Date:   Sat Apr 6 18:38:32 2013 +0200

Rewrite README section for package maintainers and distributors.

The part about registering a GeoNames user account might be a bit
misleading, making the reader think registering an account is a
requirement. This is certainly not the case, so let's state it
this way.

 README |   27 ++-
 1 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/README b/README
index 53479ac..b88a2a5 100644
--- a/README
+++ b/README
@@ -60,15 +60,24 @@ contextual menu with more actions.
 
 INFORMATION FOR PACKAGE MAINTAINERS AND DISTRIBUTORS
 ==
-If you're going to distribute this package, please be so kind and set
-the GEONAMES_USERNAME configure option for the GeoNames web service
-which is used for altitude and timezone detection. GeoNames requires
-you to register an account and limits requests on a per-hour and
-per-day basis to prevent misuse of their service. There are no other
+If you're going to distribute this package, and legal concerns and
+principles allow you to do it, please be so kind and set the
+GEONAMES_USERNAME configure option for the GeoNames web service which
+is used for altitude and timezone detection. GeoNames requires one to
+register an account and limits requests on a per-hour and per-day
+basis to prevent misuse of their service. There are no other
 restrictions and registration is free, uncomplicated and takes less
 than a minute (http://www.geonames.org/export/web-services.html).
 Performing these steps will ensure automatic altitude and timezone
-detection are kept operational for all users of the plugin.
+detection are kept operational for all users of the plugin. Currently,
+it is no big deal and only a precaution, as there are likely not that
+many users setting up the plugin within the same hour and exhausting
+the credits. Still, if it is ok with you to register a username
+yourself for the users of your package, then it would certainly help
+should that unlikely case become true. While the user can also set
+this via a hidden option, the developer/maintainer of the plugin
+thinks the user should not be bothered with it, as every user would
+need to do it by default, and that would hurt user experience.
 
 
 MET.NO API DOCUMENTATION
@@ -187,9 +196,9 @@ the cause for the failure (e.g. missings libraries). If 
you're missing
 a dependency you need to install it using the package management
 system of your distribution. Distributions commonly have two versions
 of a software package: One containing the supplementary files needed
-for compiling other packages, and the other one providing the runtime
-libraries etc. While the latter is usually installed, the former often
-is not, so better check this.
+for compiling other packages (usually called dev-packages), and the
+other one providing the runtime libraries etc. While the latter is
+usually installed, the former often is not, so better check this.
 
 Note: To solve distribution-specific problems the most efficient way
 is to ask at a forum for your distribution, not on a general forum.
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Build system: Remove check for libresolv.

2013-04-02 Thread Harald Judt
Updating branch refs/heads/master
 to 5772b85b53fe906c52f68f9a507d19b9f34078ef (commit)
   from 20f99778941f73053020b77185b337417615fed1 (commit)

commit 5772b85b53fe906c52f68f9a507d19b9f34078ef
Author: Harald Judt h.j...@gmx.at
Date:   Tue Apr 2 13:49:52 2013 +0200

Build system: Remove check for libresolv.

 configure.ac.in |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index d95bab0..fb16b7c 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -68,8 +68,6 @@ XDT_CHECK_PACKAGE([SOUP], [libsoup-2.4], [2.26.0])
 XDT_CHECK_OPTIONAL_PACKAGE([UPOWER_GLIB], [upower-glib], [0.9.0], [upower],
[upower for adapting update interval to power 
state])
 
-AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
-AC_SUBST(LIBRESOLV)
 
 dnl 
 dnl *** Special compile time options ***
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Icon theme: Sort icon theme array using icon theme path names.

2013-03-28 Thread Harald Judt
Updating branch refs/heads/master
 to 034541e4cf6981c61a453c4054edff5eec42d3d1 (commit)
   from 9b9db55aebaefed83c41e18d6916e613b8d7d76c (commit)

commit 034541e4cf6981c61a453c4054edff5eec42d3d1
Author: Harald Judt h.j...@gmx.at
Date:   Thu Mar 28 23:07:48 2013 +0100

Icon theme: Sort icon theme array using icon theme path names.

Let's still list the themes in the user dir first, then those in the
system dir.

 panel-plugin/weather-icon.c |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/weather-icon.c b/panel-plugin/weather-icon.c
index 6305782..b3c77e1 100644
--- a/panel-plugin/weather-icon.c
+++ b/panel-plugin/weather-icon.c
@@ -305,6 +305,30 @@ icon_theme_load(const gchar *dir)
 }
 
 
+/*
+ * Compare two icon_theme structs using their path names, returning
+ * the result as a qsort()-style comparison function (less than zero
+ * for first arg is less than second arg, zero for equal, greater zero
+ * if first arg is greater than second arg).
+ */
+static gint
+icon_theme_compare(gconstpointer a,
+   gconstpointer b)
+{
+icon_theme *it1 = *(icon_theme **) a;
+icon_theme *it2 = *(icon_theme **) b;
+
+if (G_UNLIKELY(it1 == NULL  it2 == NULL))
+return 0;
+if (G_UNLIKELY(it1 == NULL))
+return -1;
+if (G_UNLIKELY(it2 == NULL))
+return 1;
+
+return g_strcmp0(it1-dir, it2-dir);
+}
+
+
 static GArray *
 find_themes_in_dir(const gchar *path)
 {
@@ -339,6 +363,7 @@ find_themes_in_dir(const gchar *path)
 weather_debug(Found %d icon theme(s) in %s., themes-len, path);
 } else
 weather_debug(Could not list directory %s., path);
+g_array_sort(themes, (GCompareFunc) icon_theme_compare);
 return themes;
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Add a new public function for getting the user icon themes path.

2013-03-28 Thread Harald Judt
Updating branch refs/heads/master
 to add24d3e35db5724a3b6a1efe47274fc809b4992 (commit)
   from 034541e4cf6981c61a453c4054edff5eec42d3d1 (commit)

commit add24d3e35db5724a3b6a1efe47274fc809b4992
Author: Harald Judt h.j...@gmx.at
Date:   Fri Mar 29 00:45:24 2013 +0100

Add a new public function for getting the user icon themes path.

 panel-plugin/weather-icon.c |   17 ++---
 panel-plugin/weather-icon.h |2 ++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/weather-icon.c b/panel-plugin/weather-icon.c
index b3c77e1..e8680ec 100644
--- a/panel-plugin/weather-icon.c
+++ b/panel-plugin/weather-icon.c
@@ -369,6 +369,19 @@ find_themes_in_dir(const gchar *path)
 
 
 /*
+ * Returns the user icon theme directory as a string which needs to be
+ * freed by the calling function.
+ */
+gchar *
+get_user_icons_dir(void)
+{
+return g_strconcat(g_get_user_config_dir(), G_DIR_SEPARATOR_S,
+   xfce4, G_DIR_SEPARATOR_S, weather,
+   G_DIR_SEPARATOR_S, icons, NULL);
+}
+
+
+/*
  * Find all available themes in user's config dir and at the install
  * location.
  */
@@ -381,9 +394,7 @@ find_icon_themes(void)
 themes = g_array_new(FALSE, TRUE, sizeof(icon_theme *));
 
 /* look in user directory first */
-dir = g_strconcat(g_get_user_config_dir(), G_DIR_SEPARATOR_S,
-  xfce4, G_DIR_SEPARATOR_S, weather,
-  G_DIR_SEPARATOR_S, icons, NULL);
+dir = get_user_icons_dir();
 found = find_themes_in_dir(dir);
 g_free(dir);
 if (found) {
diff --git a/panel-plugin/weather-icon.h b/panel-plugin/weather-icon.h
index 6cc3984..41a007e 100644
--- a/panel-plugin/weather-icon.h
+++ b/panel-plugin/weather-icon.h
@@ -95,6 +95,8 @@ icon_theme *icon_theme_load_info(const gchar *dir);
 
 icon_theme *icon_theme_load(const gchar *dir);
 
+gchar *get_user_icons_dir(void);
+
 GArray *find_icon_themes(void);
 
 icon_theme *icon_theme_copy(icon_theme *src);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Config: Add a button for opening/creating the user icon themes directory.

2013-03-28 Thread Harald Judt
Updating branch refs/heads/master
 to 7f2257c3e67d2df262592b4839852fd5b746365d (commit)
   from add24d3e35db5724a3b6a1efe47274fc809b4992 (commit)

commit 7f2257c3e67d2df262592b4839852fd5b746365d
Author: Harald Judt h.j...@gmx.at
Date:   Fri Mar 29 00:46:54 2013 +0100

Config: Add a button for opening/creating the user icon themes directory.

The button opens the directory in the file manager, so that the user doesn't
have to waste time navigating around. If the directory doesn't exist, it
will try to create it.

 panel-plugin/weather-config.c |   34 +-
 panel-plugin/weather-config.h |1 +
 2 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index f562684..2035bae 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -1089,6 +1089,23 @@ combo_icon_theme_changed(GtkWidget *combo,
 
 
 static void
+button_icons_dir_clicked(GtkWidget *button,
+ gpointer user_data)
+{
+xfceweather_dialog *dialog = (xfceweather_dialog *) user_data;
+gchar *dir, *command;
+
+dir = get_user_icons_dir();
+g_mkdir_with_parents(dir, 0755);
+command = g_strdup_printf(exo-open %s, dir);
+g_free(dir);
+xfce_spawn_command_line_on_screen(gdk_screen_get_default(),
+  command, FALSE, TRUE, NULL);
+g_free(command);
+}
+
+
+static void
 check_single_row_toggled(GtkWidget *button,
  gpointer user_data)
 {
@@ -1170,8 +1187,9 @@ check_round_values_toggled(GtkWidget *button,
 static GtkWidget *
 create_appearance_page(xfceweather_dialog *dialog)
 {
-GtkWidget *palign, *page, *sep, *hbox, *vbox, *label;
+GtkWidget *palign, *page, *sep, *hbox, *vbox, *label, *image;
 GtkSizeGroup *sg;
+GtkSettings *default_settings;
 icon_theme *theme;
 gchar *text;
 gint i;
@@ -1192,6 +1210,18 @@ create_appearance_page(xfceweather_dialog *dialog)
   you open this config dialog.));
 ADD_COMBO(dialog-combo_icon_theme);
 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+default_settings = gtk_settings_get_default();
+g_object_set(default_settings, gtk-button-images, TRUE, NULL);
+image = gtk_image_new();
+gtk_image_set_from_stock(GTK_IMAGE(image), GTK_STOCK_OPEN,
+ GTK_ICON_SIZE_BUTTON);
+dialog-button_icons_dir = gtk_button_new();
+gtk_button_set_image(GTK_BUTTON(dialog-button_icons_dir), image);
+gtk_box_pack_start(GTK_BOX(hbox), dialog-button_icons_dir,
+   FALSE, FALSE, 0);
+SET_TOOLTIP(dialog-button_icons_dir,
+_(Open the user icon themes directory in your file manager, 
+  creating it if necessary.));
 dialog-icon_themes = find_icon_themes();
 for (i = 0; i  dialog-icon_themes-len; i++) {
 theme = g_array_index(dialog-icon_themes, icon_theme *, i);
@@ -1985,6 +2015,8 @@ setup_notebook_signals(xfceweather_dialog *dialog)
 /* appearance page */
 g_signal_connect(dialog-combo_icon_theme, changed,
  G_CALLBACK(combo_icon_theme_changed), dialog);
+g_signal_connect(dialog-button_icons_dir, clicked,
+ G_CALLBACK(button_icons_dir_clicked), dialog);
 g_signal_connect(dialog-check_single_row, toggled,
  G_CALLBACK(check_single_row_toggled), dialog);
 g_signal_connect(dialog-combo_tooltip_style, changed,
diff --git a/panel-plugin/weather-config.h b/panel-plugin/weather-config.h
index 490c164..7b338e8 100644
--- a/panel-plugin/weather-config.h
+++ b/panel-plugin/weather-config.h
@@ -52,6 +52,7 @@ typedef struct {
 /* appearance page */
 GtkWidget *combo_icon_theme;
 GArray *icon_themes;
+GtkWidget *button_icons_dir;
 GtkWidget *combo_tooltip_style;
 GtkWidget *combo_forecast_layout;
 GtkWidget *spin_forecast_days;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Summary window: Delay clock update a bit to avoid jerkiness (bug #9933).

2013-03-21 Thread Harald Judt
Updating branch refs/heads/master
 to 72fdfaec8c9b4c65af6ec9123d7ef910df755f99 (commit)
   from 0b1c2da51ce14962bca36bff174d332c29148e43 (commit)

commit 72fdfaec8c9b4c65af6ec9123d7ef910df755f99
Author: Harald Judt h.j...@gmx.at
Date:   Thu Mar 21 14:17:44 2013 +0100

Summary window: Delay clock update a bit to avoid jerkiness (bug #9933).

For whatever reason, on some machines the clock seems not to update in
appropriate regular intervals which results in updates that seem to be
2 seconds apart. Surprisingly, adding a small delay of 10ms seems to solve
this. While this is a strange solution, it is also easy and effective,
so let's simply do it this way.

 panel-plugin/weather-summary.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index 15cf546..641d077 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -1017,10 +1017,10 @@ update_summary_subtitle(plugin_data *data)
 now_ms = ((gint64) now.tv_sec * 1000) + ((gint64) now.tv_usec / 1000);
 #ifdef HAVE_UPOWER_GLIB
 if (data-upower_on_battery || data-upower_lid_closed)
-update_interval = 6 - (now_ms % 6) + 1;
+update_interval = 6 - (now_ms % 6) + 10;
 else
 #endif
-update_interval = 1000 - (now_ms % 1000) + 1;
+update_interval = 1000 - (now_ms % 1000) + 10;
 data-summary_update_timer =
 g_timeout_add(update_interval, (GSourceFunc) update_summary_subtitle,
   data);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Context menu: Resolve mnemonic conflict for Refresh and Remove (bug #9911).

2013-03-21 Thread Harald Judt
Updating branch refs/heads/master
 to 4e911b63099a3dcf26d5fe49ba0397e90b62e1d6 (commit)
   from 72fdfaec8c9b4c65af6ec9123d7ef910df755f99 (commit)

commit 4e911b63099a3dcf26d5fe49ba0397e90b62e1d6
Author: Harald Judt h.j...@gmx.at
Date:   Thu Mar 21 15:29:10 2013 +0100

Context menu: Resolve mnemonic conflict for Refresh and Remove (bug #9911).

Stock menu items share mnemonics, so we need to build our own Refresh menu
item. Use Re_fresh and keep _Remove for consistency with other plugins.
Translators will have to care about Re_fresh now.

 panel-plugin/weather.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 1c8f438..a4429c9 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -1726,9 +1726,9 @@ xfceweather_create_control(XfcePanelPlugin *plugin)
 plugin_data *data = g_slice_new0(plugin_data);
 SoupURI *soup_proxy_uri;
 const gchar *proxy_uri;
-GtkWidget *refresh;
-data_types lbl;
+GtkWidget *refresh, *refresh_icon;
 GdkPixbuf *icon = NULL;
+data_types lbl;
 
 /* Initialize with sane default values */
 data-plugin = plugin;
@@ -1822,7 +1822,10 @@ xfceweather_create_control(XfcePanelPlugin *plugin)
 
 /* add refresh button to right click menu, for people who missed
the middle mouse click feature */
-refresh = gtk_image_menu_item_new_from_stock(gtk-refresh, NULL);
+refresh = gtk_image_menu_item_new_with_mnemonic(_(Re_fresh));
+refresh_icon = gtk_image_new_from_stock(GTK_STOCK_REFRESH,
+GTK_ICON_SIZE_MENU);
+gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(refresh), refresh_icon);
 gtk_widget_show(refresh);
 g_signal_connect(G_OBJECT(refresh), activate,
  G_CALLBACK(mi_click), data);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Fix wind direction translation (bug #9895).

2013-03-13 Thread Harald Judt
Updating branch refs/heads/master
 to 9be059f8f814bb5b78081b8b2c5303cdb95b2a70 (commit)
   from e015f95b0f29977aa11832b47faf462e9c01ef15 (commit)

commit 9be059f8f814bb5b78081b8b2c5303cdb95b2a70
Author: Harald Judt h.j...@gmx.at
Date:   Wed Mar 13 12:39:29 2013 +0100

Fix wind direction translation (bug #9895).

 panel-plugin/weather-data.c  |   85 +++---
 panel-plugin/weather-summary.c   |   15 ++
 panel-plugin/weather-translate.c |   56 -
 panel-plugin/weather-translate.h |2 -
 panel-plugin/weather.c   |   55 -
 5 files changed, 65 insertions(+), 148 deletions(-)

diff --git a/panel-plugin/weather-data.c b/panel-plugin/weather-data.c
index 714cce4..8d75978 100644
--- a/panel-plugin/weather-data.c
+++ b/panel-plugin/weather-data.c
@@ -266,6 +266,48 @@ calc_apparent_temperature(const xml_location *loc,
 }
 
 
+/*
+ * Return wind direction name for wind degrees, which gives the
+ * direction the wind is coming _from_.
+ */
+static gchar*
+wind_dir_name_by_deg(gchar *degrees, gboolean long_name)
+{
+gdouble deg;
+
+if (G_UNLIKELY(degrees == NULL))
+return ;
+
+deg = string_to_double(degrees, 0);
+
+if (deg = 360 - 22.5 || deg  45 - 22.5)
+return (long_name) ? _(North) : _(N);
+
+if (deg = 45 - 22.5  deg  45 + 22.5)
+return (long_name) ? _(North-East) : _(NE);
+
+if (deg = 90 - 22.5  deg  90 + 22.5)
+return (long_name) ? _(East) : _(E);
+
+if (deg = 135 - 22.5  deg  135 + 22.5)
+return (long_name) ? _(South-East) : _(SE);
+
+if (deg = 180 - 22.5  deg  180 + 22.5)
+return (long_name) ? _(South) : _(S);
+
+if (deg = 225 - 22.5  deg  225 + 22.5)
+return (long_name) ? _(South-West) : _(SW);
+
+if (deg = 270 - 22.5  deg  270 + 22.5)
+return (long_name) ? _(West) : _(W);
+
+if (deg = 315 - 22.5  deg  315 + 22.5)
+return (long_name) ? _(North-West) : _(NW);
+
+return ;
+}
+
+
 gchar *
 get_data(const xml_time *timeslice,
  const units_config *units,
@@ -343,7 +385,7 @@ get_data(const xml_time *timeslice,
 return g_strdup_printf(%.0f, val);
 
 case WIND_DIRECTION:
-return CHK_NULL(loc-wind_dir_name);
+return g_strdup(wind_dir_name_by_deg(loc-wind_dir_deg, FALSE));
 
 case WIND_DIRECTION_DEG:
 return LOCALE_DOUBLE(loc-wind_dir_deg, ROUND_TO_INT(%.1f));
@@ -526,47 +568,6 @@ is_night_time(const xml_astro *astro)
 }
 
 
-/*
- * Return wind direction name (S, N, W,...) for wind degrees.
- */
-static gchar*
-wind_dir_name_by_deg(gchar *degrees, gboolean long_name)
-{
-gdouble deg;
-
-if (G_UNLIKELY(degrees == NULL))
-return ;
-
-deg = string_to_double(degrees, 0);
-
-if (deg = 360 - 22.5 || deg  45 - 22.5)
-return (long_name) ? _(North) : _(N);
-
-if (deg = 45 - 22.5  deg  45 + 22.5)
-return (long_name) ? _(North-East) : _(NE);
-
-if (deg = 90 - 22.5  deg  90 + 22.5)
-return (long_name) ? _(East) : _(E);
-
-if (deg = 135 - 22.5  deg  135 + 22.5)
-return (long_name) ? _(South-East) : _(SE);
-
-if (deg = 180 - 22.5  deg  180 + 22.5)
-return (long_name) ? _(South) : _(S);
-
-if (deg = 225 - 22.5  deg  225 + 22.5)
-return (long_name) ? _(South-West) : _(SW);
-
-if (deg = 270 - 22.5  deg  270 + 22.5)
-return (long_name) ? _(West) : _(W);
-
-if (deg = 315 - 22.5  deg  315 + 22.5)
-return (long_name) ? _(North-West) : _(NW);
-
-return ;
-}
-
-
 static void
 calculate_symbol(xml_time *timeslice,
  gboolean current_conditions)
diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index 2b86cac..15cf546 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -487,14 +487,11 @@ create_summary_tab(plugin_data *data)
 g_free(wind);
 APPEND_TEXT_ITEM_REAL(value);
 
-rawvalue = get_data(conditions, data-units, WIND_DIRECTION,
-FALSE, data-night_time);
-wind = translate_wind_direction(rawvalue);
-g_free(rawvalue);
+/* wind direction */
 rawvalue = get_data(conditions, data-units, WIND_DIRECTION_DEG,
 FALSE, data-night_time);
-
-/* wind direction */
+wind = get_data(conditions, data-units, WIND_DIRECTION,
+FALSE, data-night_time);
 value = g_strdup_printf(_(\tDirection: %s (%s%s)\n),
 wind, rawvalue,
 get_unit(data-units, WIND_DIRECTION_DEG));
@@ -785,16 +782,14 @@ add_forecast_cell(plugin_data *data,
 g_free(value);
 
 /* wind direction and speed */
-rawvalue = get_data(fcdata, data-units, WIND_DIRECTION,
-FALSE, data-night_time);
-wind_direction = translate_wind_direction(rawvalue);
+wind_direction = get_data(fcdata, data-units, WIND_DIRECTION

[Xfce4-commits] xfce4-weather-plugin:master Fix uninitialized variables and switch statements without default values.

2013-03-05 Thread Harald Judt
Updating branch refs/heads/master
 to 808242e32c2ce0708463cb47075b3becdef44c1c (commit)
   from a4c62fbb977f823ffb7d13c4793af187e14fc94f (commit)

commit 808242e32c2ce0708463cb47075b3becdef44c1c
Author: Harald Judt h.j...@gmx.at
Date:   Tue Mar 5 17:10:52 2013 +0100

Fix uninitialized variables and switch statements without default values.

 panel-plugin/weather-config.c |   31 ---
 panel-plugin/weather-data.c   |5 -
 2 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index 9be3467..c36a5f9 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -384,22 +384,23 @@ setup_altitude(xfceweather_dialog *dialog)
 G_CALLBACK(spin_alt_value_changed),
 dialog);
 switch (dialog-pd-units-altitude) {
-case METERS:
+case FEET:
 gtk_label_set_text(GTK_LABEL(dialog-label_alt_unit),
-   _(meters));
+   _(feet));
 gtk_spin_button_set_range(GTK_SPIN_BUTTON(dialog-spin_alt),
-  -420, 1);
+  -1378.0, 32808);
 gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog-spin_alt),
-  (gdouble) (dialog-pd-msl));
+  (gdouble) dialog-pd-msl / 0.3048);
 break;
 
-case FEET:
+case METERS:
+default:
 gtk_label_set_text(GTK_LABEL(dialog-label_alt_unit),
-   _(feet));
+   _(meters));
 gtk_spin_button_set_range(GTK_SPIN_BUTTON(dialog-spin_alt),
-  -1378.0, 32808);
+  -420, 1);
 gtk_spin_button_set_value(GTK_SPIN_BUTTON(dialog-spin_alt),
-  (gdouble) dialog-pd-msl / 0.3048);
+  (gdouble) (dialog-pd-msl));
 break;
 }
 g_signal_handlers_unblock_by_func(dialog-spin_alt,
@@ -626,7 +627,7 @@ create_location_page(xfceweather_dialog *dialog)
 static void
 combo_unit_temperature_set_tooltip(GtkWidget *combo)
 {
-gchar *text;
+gchar *text = NULL;
 gint value = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
 
 switch (value) {
@@ -685,7 +686,7 @@ combo_unit_temperature_changed(GtkWidget *combo,
 static void
 combo_unit_pressure_set_tooltip(GtkWidget *combo)
 {
-gchar *text;
+gchar *text = NULL;
 gint value = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
 
 switch (value) {
@@ -743,7 +744,7 @@ combo_unit_pressure_changed(GtkWidget *combo,
 static void
 combo_unit_windspeed_set_tooltip(GtkWidget *combo)
 {
-gchar *text;
+gchar *text = NULL;
 gint value = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
 
 switch (value) {
@@ -793,7 +794,7 @@ combo_unit_windspeed_changed(GtkWidget *combo,
 static void
 combo_unit_precipitations_set_tooltip(GtkWidget *combo)
 {
-gchar *text;
+gchar *text = NULL;
 gint value = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
 
 switch (value) {
@@ -831,7 +832,7 @@ combo_unit_precipitations_changed(GtkWidget *combo,
 static void
 combo_unit_altitude_set_tooltip(GtkWidget *combo)
 {
-gchar *text;
+gchar *text = NULL;
 gint value = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
 
 switch (value) {
@@ -873,7 +874,7 @@ combo_unit_altitude_changed(GtkWidget *combo,
 static void
 combo_apparent_temperature_set_tooltip(GtkWidget *combo)
 {
-gchar *text;
+gchar *text = NULL;
 gint value = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
 
 switch (value) {
@@ -1114,7 +1115,7 @@ combo_tooltip_style_changed(GtkWidget *combo,
 static void
 combo_forecast_layout_set_tooltip(GtkWidget *combo)
 {
-gchar *text;
+gchar *text = NULL;
 gint value = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
 
 switch (value) {
diff --git a/panel-plugin/weather-data.c b/panel-plugin/weather-data.c
index 5615fb4..714cce4 100644
--- a/panel-plugin/weather-data.c
+++ b/panel-plugin/weather-data.c
@@ -259,6 +259,9 @@ calc_apparent_temperature(const xml_location *loc,
Forecasting. 13, 1998, S. 1187–1193 */
 return 1.41 - 1.162 * windspeed + 0.980 * temp
 + 0.0124 * windspeed * windspeed + 0.0185 * windspeed * temp;
+
+default:
+return temp;
 }
 }
 
@@ -1127,7 +1130,7 @@ make_forecast_data(xml_weather *wd,
 xml_time *ts1, *ts2, *interval = NULL;
 struct tm point_tm, start_tm, end_tm, tm1, tm2;
 time_t point_t, start_t, end_t;
-gint min, max, point, i, j;
+gint min = 0, max = 0, point = 0, i, j;
 
 g_assert(wd != NULL);
 if (G_UNLIKELY(wd == NULL))
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Make single row default for new plugin instances.

2013-03-05 Thread Harald Judt
Updating branch refs/heads/master
 to 652946f85a33ec041500e4b00135cc74f8056503 (commit)
   from 808242e32c2ce0708463cb47075b3becdef44c1c (commit)

commit 652946f85a33ec041500e4b00135cc74f8056503
Author: Harald Judt h.j...@gmx.at
Date:   Tue Mar 5 17:19:41 2013 +0100

Make single row default for new plugin instances.

Not sure why it doesn't get set; reading config file should actually
take care of the missing value.

 panel-plugin/weather.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 9a88bc4..b078d9f 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -1770,6 +1770,7 @@ xfceweather_create_control(XfcePanelPlugin *plugin)
 data-forecast_layout = FC_LAYOUT_LIST;
 data-forecast_days = DEFAULT_FORECAST_DAYS;
 data-round = TRUE;
+data-single_row = TRUE;
 
 /* Setup update infos */
 init_update_infos(data);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Update NEWS and README.

2013-03-04 Thread Harald Judt
Updating branch refs/heads/master
 to c7441b44cdacd6287cfde86b046bc19b054f4b56 (commit)
   from d8ebf3090bc98bda7a3e91792bc29cae639f566b (commit)

commit c7441b44cdacd6287cfde86b046bc19b054f4b56
Author: Harald Judt h.j...@gmx.at
Date:   Mon Mar 4 11:46:15 2013 +0100

Update NEWS and README.

 NEWS   |   24 +---
 README |2 ++
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/NEWS b/NEWS
index c072069..87bb0f9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,15 +1,17 @@
-4.4.2 (2013-02-28):
+4.4.2 (2013-03-04):
 ---
- * Support for deskbar mode and panel multi-row config (=xfce4-panel-4.9.0).
- * Make eye movement independent, like in xeyes (bug #9036).
- * Build the plugin as a module.
- * Autotools update (automake-1.13 compatibility and other issues).
- * Fix remembering theme (bug #9035).
- * Update size after panel orientation change (bug #8404).
- * More translation updates.
- * Port to libxfce4ui (bug #8074).
+- Small optimizations to update function, making animation more smooth.
+- Support for deskbar mode and panel multi-row config (=xfce4-panel-4.9.0).
+- Make eye movement independent, like in xeyes (bug #9036).
+- Implement eye position calculations in 3D coordinatines (bug #9036).
+- Build the plugin as a module.
+- Autotools update (automake-1.13 compatibility and other issues).
+- Fix remembering theme (bug #9035).
+- Update size after panel orientation change (bug #8404).
+- More translation updates.
+- Port to libxfce4ui (bug #8074).
 
 4.4.1 (2010-12-18):
 ---
- * Translated into 11 more languages, for a total of 54, 36 of which are fully 
translated.
- * Fix compile issues, resolving bugs #5740 and #6024
+- Translated into 11 more languages, for a total of 54, 36 of which are fully 
translated.
+- Fix compile issues, resolving bugs #5740 and #6024.
diff --git a/README b/README
index 395f407..4bc3fd2 100644
--- a/README
+++ b/README
@@ -68,6 +68,8 @@ GNU automake installed!):
 
 1a) ./autogen.sh --prefix=/usr
 
+If an error about a missing ltmain.sh occurs, try autoreconf -i.
+
 Otherwise, if you've downloaded the tarball from e.g.
 http://archive.xfce.org/, issue the following command:
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Updates for release.

2013-03-04 Thread Harald Judt
Updating branch refs/heads/master
 to 04b0484b679348fad1af7b2f125a4bfb615503fa (commit)
   from c7441b44cdacd6287cfde86b046bc19b054f4b56 (commit)

commit 04b0484b679348fad1af7b2f125a4bfb615503fa
Author: Harald Judt h.j...@gmx.at
Date:   Mon Mar 4 11:47:44 2013 +0100

Updates for release.

 configure.ac.in |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index b9b6282..7985288 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -6,9 +6,9 @@ dnl *** Version information ***
 dnl ***
 m4_define([eyes_version_major], [4])
 m4_define([eyes_version_minor], [4])
-m4_define([eyes_version_micro], [1])
+m4_define([eyes_version_micro], [2])
 m4_define([eyes_version_build], [r@REVISION@])
-m4_define([eyes_version_tag], [git])
+m4_define([eyes_version_tag], [])
 m4_define([eyes_version], 
[eyes_version_major().eyes_version_minor().eyes_version_micro()ifelse(eyes_version_tag(),
 [git], [eyes_version_tag()-eyes_version_build()], [eyes_version_tag()])])
 
 dnl ***
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin|xfce4-eyes-plugin-4.4.2 Creating annotated tag xfce4-eyes-plugin-4.4.2

2013-03-04 Thread Harald Judt
Updating annotated tag refs/tags/xfce4-eyes-plugin-4.4.2
 as new annotated tag
 to 719cf0c1a0081ea6bad4a3be289afdfa8f77e307 (tag)
   succeeds 4.4.1-57-gc7441b4
  tagged by Harald Judt h.j...@gmx.at
 on 2013-03-04 11:50 +0100

Harald Judt (1):
  Updates for release.

___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Post release tag bump.

2013-03-04 Thread Harald Judt
Updating branch refs/heads/master
 to d1815a1ee5739324b9c735fc3143d3abaa70733d (commit)
   from 04b0484b679348fad1af7b2f125a4bfb615503fa (commit)

commit d1815a1ee5739324b9c735fc3143d3abaa70733d
Author: Harald Judt h.j...@gmx.at
Date:   Mon Mar 4 11:56:34 2013 +0100

Post release tag bump.

 configure.ac.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 7985288..17318f8 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -8,7 +8,7 @@ m4_define([eyes_version_major], [4])
 m4_define([eyes_version_minor], [4])
 m4_define([eyes_version_micro], [2])
 m4_define([eyes_version_build], [r@REVISION@])
-m4_define([eyes_version_tag], [])
+m4_define([eyes_version_tag], [git])
 m4_define([eyes_version], 
[eyes_version_major().eyes_version_minor().eyes_version_micro()ifelse(eyes_version_tag(),
 [git], [eyes_version_tag()-eyes_version_build()], [eyes_version_tag()])])
 
 dnl ***
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


xfce4-eyes-plugin:master Add Swedish translation by Andreas Rönnquist.

2013-03-04 Thread Harald Judt
Updating branch refs/heads/master
 to 804867399980232b13cdb359090c368b2e223b45 (commit)
   from d1815a1ee5739324b9c735fc3143d3abaa70733d (commit)

commit 804867399980232b13cdb359090c368b2e223b45
Author: Andreas Rönnquist mailingli...@gusnan.se
Date:   Mon Mar 4 12:24:26 2013 +0100

Add Swedish translation by Andreas Rönnquist.

 po/sv.po |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/po/sv.po b/po/sv.po
index cc60d9f..f83ae2c 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -1,7 +1,8 @@
 # Swedish messages for xfce4-eyes.
-# Copyright (C) 2003, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2008, 2013 Free Software Foundation, Inc.
 # Johan Hammar Johan ham...@swipnet.se, 2003.
 # Daniel Nylander p...@danielnylander.se, 2008.
+# Andreas Rönnquist gus...@gusnan.se, 2013
 #
 msgid 
 msgstr 
@@ -9,7 +10,7 @@ msgstr 
 Report-Msgid-Bugs-To: \n
 POT-Creation-Date: 2013-03-01 17:32+0100\n
 PO-Revision-Date: 2008-12-13 13:50+0100\n
-Last-Translator: Daniel Nylander p...@danielnylander.se\n
+Last-Translator: Andreas Rönnquist gus...@gusnan.se\n
 Language-Team: Swedish tp...@listor.tp-sv.se\n
 Language: sv\n
 MIME-Version: 1.0\n
@@ -27,7 +28,7 @@ msgstr _Välj ett tema:
 
 #: ../panel-plugin/eyes.c:377
 msgid Use single _row in multi-row panel
-msgstr 
+msgstr Använd enkel _rad i panel med flera rader
 
 #: ../panel-plugin/eyes.desktop.in.h:2
 msgid Eyes that spy on you
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Fix typo in NEWS.

2013-03-04 Thread Harald Judt
Updating branch refs/heads/master
 to f62b2b85fcc2e6c1eadce5849cf11e46d5810c85 (commit)
   from 804867399980232b13cdb359090c368b2e223b45 (commit)

commit f62b2b85fcc2e6c1eadce5849cf11e46d5810c85
Author: Harald Judt h.j...@gmx.at
Date:   Mon Mar 4 12:25:49 2013 +0100

Fix typo in NEWS.

 NEWS |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/NEWS b/NEWS
index 87bb0f9..60a8828 100644
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,7 @@
 - Small optimizations to update function, making animation more smooth.
 - Support for deskbar mode and panel multi-row config (=xfce4-panel-4.9.0).
 - Make eye movement independent, like in xeyes (bug #9036).
-- Implement eye position calculations in 3D coordinatines (bug #9036).
+- Implement eye position calculations in 3D coordinates (bug #9036).
 - Build the plugin as a module.
 - Autotools update (automake-1.13 compatibility and other issues).
 - Fix remembering theme (bug #9035).
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-weather-plugin:master Better handle single row and icon size in various panel modes.

2013-03-04 Thread Harald Judt
Updating branch refs/heads/master
 to a8ad9a7010e01f071f7cce797b06cd0d247c768e (commit)
   from 0d039920249e578bf464b84f6c7647a63f4e5cb0 (commit)

commit a8ad9a7010e01f071f7cce797b06cd0d247c768e
Author: Harald Judt h.j...@gmx.at
Date:   Mon Feb 25 22:35:51 2013 +0100

Better handle single row and icon size in various panel modes.

Add an option to set the single row property manually, defaulting to TRUE.
In deskbar mode, enabling this means that the icon will always be in the 
same
row as the scrollbox, and never get bigger than one row.

If there are more than two rows, the icon will be scaled to 80%. This is
just an arbitrary value, but most icons tend to look better if they do not
fill the whole panel at bigger sizes.

 panel-plugin/weather-config.c |   38 +
 panel-plugin/weather-config.h |1 +
 panel-plugin/weather-debug.c  |8 +++---
 panel-plugin/weather.c|   47 ++--
 panel-plugin/weather.h|   10 +++-
 5 files changed, 77 insertions(+), 27 deletions(-)

diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index 4161cbd..c2468f6 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -1088,6 +1088,21 @@ combo_icon_theme_changed(GtkWidget *combo,
 
 
 static void
+check_single_row_toggled(GtkWidget *button,
+ gpointer user_data)
+{
+xfceweather_dialog *dialog = (xfceweather_dialog *) user_data;
+dialog-pd-single_row =
+gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
+#if LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
+xfceweather_set_mode(dialog-pd-plugin,
+ xfce_panel_plugin_get_mode(dialog-pd-plugin),
+ dialog-pd);
+#endif
+}
+
+
+static void
 combo_tooltip_style_changed(GtkWidget *combo,
 gpointer user_data)
 {
@@ -1188,8 +1203,26 @@ create_appearance_page(xfceweather_dialog *dialog)
 }
 }
 
+/* always use small icon in panel */
+hbox = gtk_hbox_new(FALSE, BORDER);
+dialog-check_single_row =
+gtk_check_button_new_with_mnemonic(_(Use only a single _panel row));
+SET_TOOLTIP(dialog-check_single_row,
+_(Check to always use only a single row on a multi-row panel 
+  and a small icon in deskbar mode.));
+gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog-check_single_row),
+ dialog-pd-single_row);
+gtk_box_pack_start(GTK_BOX(hbox), dialog-check_single_row,
+   FALSE, FALSE, 0);
+gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+gtk_box_pack_start(GTK_BOX(page), vbox, FALSE, FALSE, 0);
+
+sep = gtk_hseparator_new();
+gtk_box_pack_start(GTK_BOX(page), sep, FALSE, FALSE, BORDER * 2);
+
 /* tooltip style */
 hbox = gtk_hbox_new(FALSE, BORDER);
+vbox = gtk_vbox_new(FALSE, BORDER);
 ADD_LABEL(_(_Tooltip style:), sg);
 ADD_COMBO(dialog-combo_tooltip_style);
 ADD_COMBO_VALUE(dialog-combo_tooltip_style, _(Simple));
@@ -1951,6 +1984,8 @@ setup_notebook_signals(xfceweather_dialog *dialog)
 /* appearance page */
 g_signal_connect(dialog-combo_icon_theme, changed,
  G_CALLBACK(combo_icon_theme_changed), dialog);
+g_signal_connect(dialog-check_single_row, toggled,
+ G_CALLBACK(check_single_row_toggled), dialog);
 g_signal_connect(dialog-combo_tooltip_style, changed,
  G_CALLBACK(combo_tooltip_style_changed), dialog);
 g_signal_connect(dialog-combo_forecast_layout, changed,
@@ -2021,6 +2056,9 @@ create_config_dialog(plugin_data *data,
 gtk_box_pack_start(GTK_BOX(vbox), dialog-notebook, TRUE, TRUE, 0);
 gtk_widget_show(GTK_WIDGET(vbox));
 gtk_widget_hide(GTK_WIDGET(dialog-update_spinner));
+#if !LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
+gtk_widget_hide(GTK_WIDGET(dialog-check_single_row));
+#endif
 
 /* automatically detect current location if it is yet unknown */
 if (!(dialog-pd-lat  dialog-pd-lon))
diff --git a/panel-plugin/weather-config.h b/panel-plugin/weather-config.h
index edfaeb8..4c8def5 100644
--- a/panel-plugin/weather-config.h
+++ b/panel-plugin/weather-config.h
@@ -56,6 +56,7 @@ typedef struct {
 GtkWidget *combo_forecast_layout;
 GtkWidget *spin_forecast_days;
 GtkWidget *check_round_values;
+GtkWidget *check_single_row;
 
 /* scrollbox page */
 GtkWidget *check_scrollbox_show;
diff --git a/panel-plugin/weather-debug.c b/panel-plugin/weather-debug.c
index df671f2..288e766 100644
--- a/panel-plugin/weather-debug.c
+++ b/panel-plugin/weather-debug.c
@@ -405,9 +405,9 @@ weather_dump_plugindata(const plugin_data *data)
 g_string_append_printf(out,
  \n
  panel size: %d px\n

[Xfce4-commits] xfce4-weather-plugin:master Reformat and whitespace cleanup.

2013-03-04 Thread Harald Judt
Updating branch refs/heads/master
 to c1533546f2ae4f0a70b01b2d881fc77dcc3af677 (commit)
   from a8ad9a7010e01f071f7cce797b06cd0d247c768e (commit)

commit c1533546f2ae4f0a70b01b2d881fc77dcc3af677
Author: Harald Judt h.j...@gmx.at
Date:   Mon Mar 4 22:36:30 2013 +0100

Reformat and whitespace cleanup.

 panel-plugin/weather-config.c|   10 +-
 panel-plugin/weather-scrollbox.c |2 +-
 panel-plugin/weather-summary.c   |   22 +++---
 panel-plugin/weather.c   |   20 ++--
 4 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c
index c2468f6..9be3467 100644
--- a/panel-plugin/weather-config.c
+++ b/panel-plugin/weather-config.c
@@ -465,7 +465,7 @@ spin_alt_value_changed(const GtkWidget *spin,
 
 static void
 text_timezone_changed(const GtkWidget *entry,
-gpointer user_data)
+  gpointer user_data)
 {
 xfceweather_dialog *dialog = (xfceweather_dialog *) user_data;
 
@@ -1054,10 +1054,10 @@ combo_icon_theme_set_tooltip(GtkWidget *combo,
bAuthor:/b %s\n\n
bDescription:/b %s\n\n
bLicense:/b %s),
-   TEXT_UNKNOWN(dialog-pd-icon_theme-dir),
-   TEXT_UNKNOWN(dialog-pd-icon_theme-author),
-   TEXT_UNKNOWN(dialog-pd-icon_theme-description),
-   TEXT_UNKNOWN(dialog-pd-icon_theme-license));
+ TEXT_UNKNOWN(dialog-pd-icon_theme-dir),
+ TEXT_UNKNOWN(dialog-pd-icon_theme-author),
+ TEXT_UNKNOWN(dialog-pd-icon_theme-description),
+ TEXT_UNKNOWN(dialog-pd-icon_theme-license));
 gtk_widget_set_tooltip_markup(GTK_WIDGET(combo), text);
 g_free(text);
 }
diff --git a/panel-plugin/weather-scrollbox.c b/panel-plugin/weather-scrollbox.c
index ed793be..88206e3 100644
--- a/panel-plugin/weather-scrollbox.c
+++ b/panel-plugin/weather-scrollbox.c
@@ -473,7 +473,7 @@ gtk_scrollbox_set_visible(GtkScrollbox *self,
 (void) gtk_scrollbox_control_loop(self);
 } else {
 /* update immediately if there's only one or no label,
- typically this is the case at startup */
+   typically this is the case at startup */
 if (self-active == NULL || self-labels_len = 1)
 (void) gtk_scrollbox_control_loop(self);
 }
diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index 1181543..2b86cac 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -63,16 +63,16 @@ lnk_clicked(GtkTextTag *tag,
  * unit, use LRM (left-to-right mark) etc. to align it properly with
  * its numeric value.
  */
-#define APPEND_TEXT_ITEM(text, item)\
-rawvalue = get_data(conditions, data-units, item,  \
-FALSE, data-night_time);   \
-unit = get_unit(data-units, item); \
-value = g_strdup_printf(_(\t%s%s%s%s%s\n),\
-text, text ? :  : , \
-rawvalue,   \
-strcmp(unit, °) ?   : ,   \
-unit);  \
-g_free(rawvalue);   \
+#define APPEND_TEXT_ITEM(text, item)\
+rawvalue = get_data(conditions, data-units, item,  \
+FALSE, data-night_time);   \
+unit = get_unit(data-units, item); \
+value = g_strdup_printf(_(\t%s%s%s%s%s\n),\
+text, text ? :  : , \
+rawvalue,   \
+strcmp(unit, °) ?   : ,   \
+unit);  \
+g_free(rawvalue);   \
 APPEND_TEXT_ITEM_REAL(value);
 
 #define APPEND_LINK_ITEM(prefix, text, url, lnk_tag)\
@@ -610,7 +610,7 @@ forecast_cell_get_tooltip_text(plugin_data *data,
align the values; Monospace font is enforced with tt tags for
alignment, and the text is enclosed in small tags because
that looks much better and saves space.
- */
+*/
 text = g_string_new(_(bTimes used for calculations/b\n));
 value = format_date(fcdata-start, NULL, TRUE);
 g_string_append_printf(text, _(ttsmall
diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c
index 8dfeb15..9a88bc4 100644
--- a/panel-plugin/weather.c
+++ b/panel-plugin/weather.c
@@ -55,14 +55,14 @@
earlier: */
 #define UPDATE_INTERVAL (10)
 
-#define DATA_AND_UNIT(var, item)\
-value = get_data(conditions, data-units, item, \
- data-round, data-night_time);\
-unit = get_unit(data-units, item

[Xfce4-commits] xfce4-eyes-plugin:master Implement eye position calculations in 3D coords (bug #9036).

2013-03-03 Thread Harald Judt
Updating branch refs/heads/master
 to 88c2ec822210f0efa7ee2b6c99bc4747bf3fd71d (commit)
   from 6e7c093a7838a19afab73608c375290867122c39 (commit)

commit 88c2ec822210f0efa7ee2b6c99bc4747bf3fd71d
Author: Andrzej ndrwr...@gmail.com
Date:   Sun Mar 3 09:45:03 2013 +0100

Implement eye position calculations in 3D coords (bug #9036).

Current behavior is better but it still feels unnatural. This is mostly
because the eye balls are in the same x-y plane as the mouse pointer.

The attached patch calculates 3D angles of the eye sight as if the eye ball
was slightly behind the screen (at the moment the distance is hardcoded to
3x eyeball radius). Smaller z distance makes the eyeballs more independent,
larger - increases the (x-y) tracking distance (the eyes remain in their
center position longer).

 panel-plugin/eyes.c |   51 ++-
 1 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index d1a28fb..aa3cf48 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -68,11 +68,10 @@ calculate_pupil_xy (EyesPlugin *eyes_applet,
 gint *pupil_y,
 GtkWidget *widget)
 {
-   double sina;
-   double cosa;
-   double h;
-   double temp;
double nx, ny;
+   double distance;
+   double angle, angle_z;
+   double radius_x, radius_y;
 
gfloat xalign, yalign;
gint width, height;
@@ -81,32 +80,34 @@ calculate_pupil_xy (EyesPlugin *eyes_applet,
height = GTK_WIDGET(widget)-allocation.height;
gtk_misc_get_alignment(GTK_MISC(widget), xalign, yalign);
 
+/* calculate x,y pointer offsets wrt to eye center */
nx = x - MAX(width - eyes_applet-eye_width, 0) * xalign
- eyes_applet-eye_width / 2 - GTK_WIDGET(widget)-allocation.x;
ny = y - MAX(height - eyes_applet-eye_height, 0) * yalign
- eyes_applet-eye_height / 2 - 
GTK_WIDGET(widget)-allocation.y;
 
-   h = hypot (nx, ny);
-   if (h  0.5 ||
-   abs (h)  (abs (hypot (eyes_applet-eye_height / 2,
-  
eyes_applet-eye_width / 2))
-  - eyes_applet-wall_thickness
-  - eyes_applet-pupil_height))
-   {
-   *pupil_x = nx + eyes_applet-eye_width / 2;
-   *pupil_y = ny + eyes_applet-eye_height / 2;
-   return;
-   }
+   /* calculate eye sizes */
+   radius_x = (eyes_applet-eye_width -
+   eyes_applet-wall_thickness -
+   eyes_applet-pupil_width) / 2.0;
+   radius_y = (eyes_applet-eye_height -
+   eyes_applet-wall_thickness -
+   eyes_applet-pupil_height) / 2.0;
+
+   /* by default assume the z-axis distance of 3 radius_x */
+   distance = 3 * radius_x;
 
-   sina = nx / h;
-   cosa = ny / h;
+   /* correction factor for aspect ratio of the eye */
+   if (radius_y != 0)
+   ny *= radius_x / radius_y;
 
-   temp = hypot ((eyes_applet-eye_width / 2) * sina, 
(eyes_applet-eye_height / 2) * cosa);
-   temp -= hypot ((eyes_applet-pupil_width / 2) * sina, 
(eyes_applet-pupil_height / 2) * cosa);
-   temp -= hypot ((eyes_applet-wall_thickness / 2) * sina, 
(eyes_applet-wall_thickness / 2) * cosa);
+   /* calculate 3D rotation angles */
+   angle_z = atan2 (ny, nx);
+   angle = atan2 (hypot (nx, ny), distance);
 
-   *pupil_x = temp * sina + (eyes_applet-eye_width / 2);
-   *pupil_y = temp * cosa + (eyes_applet-eye_height / 2);
+   /* perform 3D rotation of a vector [0,0,1] (z=1) */
+   *pupil_x = radius_x * sin (angle) * cos (angle_z) + 
eyes_applet-eye_width / 2;
+   *pupil_y = radius_y * sin (angle) * sin (angle_z) + 
eyes_applet-eye_height / 2;
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Optimize check in timer callback a bit.

2013-03-03 Thread Harald Judt
Updating branch refs/heads/master
 to 9463e7a9416d3f293f7f0e72669a4ce27884ebd2 (commit)
   from 88c2ec822210f0efa7ee2b6c99bc4747bf3fd71d (commit)

commit 9463e7a9416d3f293f7f0e72669a4ce27884ebd2
Author: Harald Judt h.j...@gmx.at
Date:   Sun Mar 3 09:55:26 2013 +0100

Optimize check in timer callback a bit.

It won't help much because there are not that many eyes, but then
it also won't hurt, so stop checking when we know the pointer has
not been moved.

 panel-plugin/eyes.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index aa3cf48..c9780dc 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -162,13 +162,18 @@ timer_cb(EyesPlugin *eyes)
 
 if ((x != eyes-pointer_last_x[i]) || (y != 
eyes-pointer_last_y[i]))
 {
-
 calculate_pupil_xy (eyes, x, y, pupil_x, pupil_y, 
eyes-eyes[i]);
 draw_eye (eyes, i, pupil_x, pupil_y);
 
 eyes-pointer_last_x[i] = x;
 eyes-pointer_last_y[i] = y;
 }
+else
+{
+/* pointer position did not change since last poll, so
+   why would it be different for the remaining eyes? */
+break;
+}
 }
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Decrease update timeout.

2013-03-03 Thread Harald Judt
Updating branch refs/heads/master
 to 0a89042c7b5dbac29f1d01471d759610ebb3ade6 (commit)
   from 9463e7a9416d3f293f7f0e72669a4ce27884ebd2 (commit)

commit 0a89042c7b5dbac29f1d01471d759610ebb3ade6
Author: Harald Judt h.j...@gmx.at
Date:   Sun Mar 3 09:57:34 2013 +0100

Decrease update timeout.

I found that with the 100ms interval, animation is not quite as smooth
as I want it to be, so decrease it to 50ms. CPU load is mostly affected
by the drawing operations, not by the polling, and those happen only
on pointer movement.

 panel-plugin/eyes.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index c9780dc..53ecbdf 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -43,7 +43,7 @@
 /* for xml: */
 #define EYES_ROOT  Eyes
 #define DEFAULTTHEME   Tango
-#define UPDATE_TIMEOUT 100
+#define UPDATE_TIMEOUT 50
 
 
 /***
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Update COPYING and related stuff.

2013-03-02 Thread Harald Judt
Updating branch refs/heads/master
 to 7cfd829fe7cd5a9df8dc855d3779db6f1f90ab4e (commit)
   from e00f90704d8f909d9fd7c10a0bce65d0e95095c4 (commit)

commit 7cfd829fe7cd5a9df8dc855d3779db6f1f90ab4e
Author: Harald Judt h.j...@gmx.at
Date:   Sat Mar 2 09:26:48 2013 +0100

Update COPYING and related stuff.

Replace the current out-of-date version of the document with a
recent one that has updated addresses.

 COPYING   |   41 -
 panel-plugin/eyes.c   |   24 +---
 panel-plugin/eyes.h   |7 ---
 panel-plugin/themes.c |7 ---
 panel-plugin/themes.h |7 ---
 5 files changed, 45 insertions(+), 41 deletions(-)

diff --git a/COPYING b/COPYING
index d60c31a..d159169 100644
--- a/COPYING
+++ b/COPYING
@@ -1,12 +1,12 @@
-   GNU GENERAL PUBLIC LICENSE
-  Version 2, June 1991
+GNU GENERAL PUBLIC LICENSE
+   Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-   Preamble
+Preamble
 
   The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its 
users.  This
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not 
licensed at all.
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
-   GNU GENERAL PUBLIC LICENSE
+
+GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
 License.  (Exception: if the Program itself is interactive but
 does not normally print such an announcement, your work based on
 the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering 
equivalent
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@ make exceptions for this.  Our decision will be guided by 
the two goals
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-   NO WARRANTY
+NO WARRANTY
 
   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE 
WITH ANY OTHER
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-END OF TERMS AND CONDITIONS
-
-   How to Apply These Terms to Your New Programs
+ END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
 possible use to the public, the best way to achieve this is to make it
@@ -303,17 +303,16 @@ the copyright line and a pointer to where the full 
notice

[Xfce4-commits] xfce4-eyes-plugin:master Update README.

2013-03-02 Thread Harald Judt
Updating branch refs/heads/master
 to 064933deb88e5717781883e88073a34148a1972f (commit)
   from 7cfd829fe7cd5a9df8dc855d3779db6f1f90ab4e (commit)

commit 064933deb88e5717781883e88073a34148a1972f
Author: Harald Judt h.j...@gmx.at
Date:   Sat Mar 2 09:28:18 2013 +0100

Update README.

 README |  119 ++-
 1 files changed, 117 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 7636701..395f407 100644
--- a/README
+++ b/README
@@ -1,7 +1,122 @@
+XFCE4-EYES-PLUGIN
+==
+You can always find up-to-date information at the plugin homepage:
+http://goodies.xfce.org/projects/panel-plugins/xfce4-eyes-plugin
 
-eyes is a xfce4 panel plugin that adds eyes which watch your every step.
-Scary!
+
+CONTENTS
+==
+* ABOUT
+* USAGE
+* DEBUGGING AND REPORTING BUGS
+* REQUIREMENTS AND DEPENDENCIES
+* EASY BUILD INSTRUCTIONS
+* TRANSLATING THE PLUGIN FOR YOUR LANGUAGE
+
+
+ABOUT
+==
+xfce4-eyes-plugin is a xfce4 panel plugin that adds eyes which watch
+your every step. Scary!
 
 Portions of the xfce4-eyes code were taken from geyes. These, and the rest of
 the code are licensed under the terms of the GNU General public license; see
 the COPYING file.
+
+
+USAGE
+==
+Simply add the plugin to the panel and select a theme in the
+configuration dialog. Depending on how big the eyes are and where on
+the panel you want the eyes to appear, you might find changing the
+single-row option useful. It becomes effective only in multi-row mode.
+
+
+DEBUGGING AND REPORTING BUGS
+==
+Before reporting bugs or asking for new features, please consolidate
+the Xfce bug tracker at https://bugzilla.xfce.org, because your issue
+or request might have been reported already or be in planning.
+
+
+BUILD REQUIREMENTS AND DEPENDENCIES
+==
+If you have installed Xfce, you already have all required dependencies
+installed.
+
+
+EASY BUILD INSTRUCTIONS
+==
+If you're interesting in building the plugin yourself, these
+instructions provided here will work for most users. If not, please
+look at the INSTALL file or ask at a forum for your linux distribution
+or try the methods explained on http://www.xfce.org/community. Make
+sure you have installed the needed dependencies (see previous section
+BUILD REQUIREMENTS AND DEPENDENCIES).
+
+For the panel being able to find the plugin, it is important to set
+the proper prefix. The prefix is the place in the filesystem where the
+plugin files gets installed. It has to match the prefix used for
+building the panel. There's nothing the plugin can do about that
+requirement. When you're using the panel provided by the package
+management system of your distribution, then the prefix is in most
+cases /usr, otherwise the default prefix is /usr/local.
+
+If you want to install the current version from git, execute the
+following command in the plugin project directory (make sure you have
+GNU automake installed!):
+
+1a) ./autogen.sh --prefix=/usr
+
+Otherwise, if you've downloaded the tarball from e.g.
+http://archive.xfce.org/, issue the following command:
+
+1b) ./configure --prefix=/usr
+
+If 1a) or 1b) fail, you should receive an error message telling you
+the cause for the failure (e.g. missings libraries). If you're missing
+a dependency you need to install it using the package management
+system of your distribution. Distributions commonly have two versions
+of a software package: One containing the supplementary files needed
+for compiling other packages, and the other one providing the runtime
+libraries etc. While the latter is usually installed, the former often
+is not, so better check this.
+
+Note: To solve distribution-specific problems the most efficient way
+is to ask at a forum for your distribution, not on a general forum.
+
+Then for both cases:
+2) make
+
+If this fails, file a bug on https://bugzilla.xfce.org, or send a mail
+to the xfce mailing list and provide make output.
+
+Finally, and usually as root:
+3) make install
+
+Note: Depending on your prefix, this might overwrite an existing
+version of the plugin.
+
+You can later uninstall the plugin (as root) with
+4) make uninstall
+
+The panel should then recognize the new plugin, if it doesn't try to
+restart it using xfce4-panel -r. If it still doesn't work after that
+try to ask for help somewhere (forums, mailing lists, #xfce on
+IRC). Please do not report such problems on the bug tracker.
+
+
+TRANSLATING THE PLUGIN FOR YOUR LANGUAGE

[Xfce4-commits] xfce4-eyes-plugin:master Handle small property better.

2013-03-01 Thread Harald Judt
Updating branch refs/heads/master
 to 3983984bdfafd2617f63643909bdd07b2ebad4d7 (commit)
   from abc76d5cb9dabfea59016613d20dd6de550ea286 (commit)

commit 3983984bdfafd2617f63643909bdd07b2ebad4d7
Author: Harald Judt h.j...@gmx.at
Date:   Fri Mar 1 17:31:23 2013 +0100

Handle small property better.

This improves the previous commit by allowing the user to set the
single-row property manually, as the automatic way doesn't really
work that good.

 panel-plugin/eyes.c |   54 ++
 panel-plugin/eyes.h |1 +
 2 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index aa6ad1c..79f1c94 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -297,11 +297,23 @@ combobox_changed (GtkComboBox*combobox,
 
 
 
+#if LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
+static void
+check_single_row_toggled (GtkWidget  *check,
+  EyesPlugin *eyes)
+{
+eyes-single_row = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check));
+eyes_set_size(eyes-plugin, xfce_panel_plugin_get_size(eyes-plugin),
+  eyes);
+}
+#endif
+
+
 static void
 eyes_properties_dialog (XfcePanelPlugin *plugin,
 EyesPlugin  *eyes)
 {
-   GtkWidget   *dlg, *hbox, *label, *combobox;
+   GtkWidget   *dlg, *hbox, *label, *combobox, *check;
GDir*dir;
gint i;
gchar   *current;
@@ -360,6 +372,14 @@ eyes_properties_dialog (XfcePanelPlugin *plugin,
 g_signal_connect(G_OBJECT(combobox), changed,
 G_CALLBACK(combobox_changed), eyes);
 
+#if LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
+check = gtk_check_button_new_with_mnemonic
+(_(Use single _row in multi-row panel));
+gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), eyes-single_row);
+   gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)-vbox), check, FALSE, 
FALSE, 0);
+g_signal_connect(check, toggled, G_CALLBACK(check_single_row_toggled), 
eyes);
+#endif
+
 gtk_widget_show_all (dlg);
 }
 
@@ -415,31 +435,8 @@ eyes_set_size (XfcePanelPlugin *plugin,
EyesPlugin  *eyes)
 {
 #if LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
-XfcePanelPluginMode mode = xfce_panel_plugin_get_mode (plugin);
-guint rows = xfce_panel_plugin_get_nrows (plugin);
-gint x, y;
-
-/* if there is enough space in a row, keep the plugin small */
-if (rows  1  eyes-eye_width * eyes-num_eyes  size / rows)
-{
-xfce_panel_plugin_set_small (plugin, TRUE);
-size /= rows;
-}
-else
-xfce_panel_plugin_set_small (plugin, FALSE);
-
-if (rows  1 || mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL)
-{
-x = -1;
-y = size;
-}
-else
-{
-x = size;
-y = -1;
-}
-
-gtk_widget_set_size_request (GTK_WIDGET (plugin), x, y);
+xfce_panel_plugin_set_small (plugin, eyes-single_row);
+gtk_widget_set_size_request (GTK_WIDGET (plugin), -1, -1);
 #else
 if (xfce_panel_plugin_get_orientation (plugin) ==
 GTK_ORIENTATION_HORIZONTAL)
@@ -514,6 +511,9 @@ eyes_read_rc_file (XfcePanelPlugin *plugin,
 if (tmp != NULL)
 eyes-active_theme = g_strdup (tmp);
 
+eyes-single_row =
+xfce_rc_read_bool_entry (rc, single_row, FALSE);
+
 xfce_rc_close (rc);
 }
 }
@@ -543,6 +543,8 @@ eyes_write_rc_file (XfcePanelPlugin *plugin,
 if (eyes-active_theme != NULL)
 xfce_rc_write_entry (rc, theme, eyes-active_theme);
 
+xfce_rc_write_bool_entry (rc, single_row, eyes-single_row);
+
 xfce_rc_close (rc);
 }
 
diff --git a/panel-plugin/eyes.h b/panel-plugin/eyes.h
index 55d3eda..da66500 100644
--- a/panel-plugin/eyes.h
+++ b/panel-plugin/eyes.h
@@ -34,6 +34,7 @@ typedef struct
GtkWidget   *align;
GtkWidget   *hbox;
GtkWidget   **eyes;
+   gboolean single_row;
guinttimeout_id;
gint*pointer_last_x;
gint*pointer_last_y;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Update AUTHORS and NEWS.

2013-03-01 Thread Harald Judt
Updating branch refs/heads/master
 to f81f129aea55e66d33e3892893e4475f92a5d945 (commit)
   from 0bba711e54ee5b39de97ea82d20ba84a0d18e110 (commit)

commit f81f129aea55e66d33e3892893e4475f92a5d945
Author: Harald Judt h.j...@gmx.at
Date:   Fri Mar 1 17:35:17 2013 +0100

Update AUTHORS and NEWS.

 AUTHORS |1 +
 NEWS|   14 --
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 6b3c5b3..03d309e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,3 +1,4 @@
 Benedikt Meurer benedikt.meu...@unix-ag.uni-siegen.de
 Danny Milosavljevic danny_m...@yahoo.com
 Nick Schermer n...@xfce.org
+Harald Judt h.j...@gmx.at
diff --git a/NEWS b/NEWS
index fd220f0..c072069 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,15 @@
-4.4.1 (2010/12/18):
+4.4.2 (2013-02-28):
 ---
+ * Support for deskbar mode and panel multi-row config (=xfce4-panel-4.9.0).
+ * Make eye movement independent, like in xeyes (bug #9036).
+ * Build the plugin as a module.
+ * Autotools update (automake-1.13 compatibility and other issues).
+ * Fix remembering theme (bug #9035).
+ * Update size after panel orientation change (bug #8404).
+ * More translation updates.
+ * Port to libxfce4ui (bug #8074).
 
+4.4.1 (2010-12-18):
+---
  * Translated into 11 more languages, for a total of 54, 36 of which are fully 
translated.
- * Fix compile issues, resolving bug # 5740 and 6024
+ * Fix compile issues, resolving bugs #5740 and #6024
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Fix previous commit (independent eye movement).

2013-02-28 Thread Harald Judt
Updating branch refs/heads/master
 to 8164b087d1d2d5650c6835f89b4a46bc3d0426ca (commit)
   from c5f5e0484d8fbcb68ed28732dc240935be336782 (commit)

commit 8164b087d1d2d5650c6835f89b4a46bc3d0426ca
Author: Harald Judt h.j...@gmx.at
Date:   Thu Feb 28 17:05:09 2013 +0100

Fix previous commit (independent eye movement).

Last time I got the brackets wrong, so the eyes did not look exactly
in the right direction.

 panel-plugin/eyes.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index 11a286a..3346adb 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -75,12 +75,10 @@ calculate_pupil_xy (EyesPlugin *eyes_applet,
height = GTK_WIDGET(widget)-allocation.height;
gtk_misc_get_alignment(GTK_MISC(widget), xalign, yalign);
 
-   nx = x - (MAX(width - eyes_applet-eye_width, 0)
- * xalign - eyes_applet-eye_width / 2)
-   - GTK_WIDGET(widget)-allocation.x;
-   ny = y - (MAX(height - eyes_applet-eye_height, 0)
- * yalign - eyes_applet-eye_height / 2)
-   - GTK_WIDGET(widget)-allocation.y;
+   nx = x - MAX(width - eyes_applet-eye_width, 0) * xalign
+   - eyes_applet-eye_width / 2 - GTK_WIDGET(widget)-allocation.x;
+   ny = y - MAX(height - eyes_applet-eye_height, 0) * yalign
+   - eyes_applet-eye_height / 2 - 
GTK_WIDGET(widget)-allocation.y;
 
h = hypot (nx, ny);
if (h  0.5 ||
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Add support for deskbar mode.

2013-02-28 Thread Harald Judt
Updating branch refs/heads/master
 to abc76d5cb9dabfea59016613d20dd6de550ea286 (commit)
   from 8164b087d1d2d5650c6835f89b4a46bc3d0426ca (commit)

commit abc76d5cb9dabfea59016613d20dd6de550ea286
Author: Harald Judt h.j...@gmx.at
Date:   Thu Feb 28 23:13:43 2013 +0100

Add support for deskbar mode.

If the plugin's size needs allow it, set plugin into small mode.

That alignment stuff in the panel multi-row mode seems to be buggy.
I tried to get it working as good as possible, but there are some weird,
unexpected things happening with some configurations.

 panel-plugin/eyes.c |   77 +++---
 1 files changed, 66 insertions(+), 11 deletions(-)

diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index 3346adb..aa6ad1c 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -50,6 +50,10 @@
 static void eyes_write_rc_file (XfcePanelPlugin *plugin,
 EyesPlugin  *eyes);
 
+static gboolean eyes_set_size (XfcePanelPlugin *plugin,
+   gint size,
+   EyesPlugin  *eyes);
+
 
 /*
  *** Eyes Plugin Functions ***
@@ -286,6 +290,9 @@ combobox_changed (GtkComboBox*combobox,
properties_load(eyes);
 setup_eyes(eyes);
 eyes_applet_fill(eyes);
+
+eyes_set_size(eyes-plugin, xfce_panel_plugin_get_size(eyes-plugin),
+  eyes);
 }
 
 
@@ -404,38 +411,81 @@ eyes_free_data(XfcePanelPlugin *plugin,
 
 static gboolean
 eyes_set_size (XfcePanelPlugin *plugin,
-   int  size)
+   gint size,
+   EyesPlugin  *eyes)
 {
-if (xfce_panel_plugin_get_orientation (plugin) ==
-GTK_ORIENTATION_HORIZONTAL)
+#if LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
+XfcePanelPluginMode mode = xfce_panel_plugin_get_mode (plugin);
+guint rows = xfce_panel_plugin_get_nrows (plugin);
+gint x, y;
+
+/* if there is enough space in a row, keep the plugin small */
+if (rows  1  eyes-eye_width * eyes-num_eyes  size / rows)
+{
+xfce_panel_plugin_set_small (plugin, TRUE);
+size /= rows;
+}
+else
+xfce_panel_plugin_set_small (plugin, FALSE);
+
+if (rows  1 || mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL)
 {
-gtk_widget_set_size_request (GTK_WIDGET (plugin),
- -1, size);
+x = -1;
+y = size;
 }
 else
 {
-gtk_widget_set_size_request (GTK_WIDGET (plugin),
- size, -1);
+x = size;
+y = -1;
 }
 
+gtk_widget_set_size_request (GTK_WIDGET (plugin), x, y);
+#else
+if (xfce_panel_plugin_get_orientation (plugin) ==
+GTK_ORIENTATION_HORIZONTAL)
+gtk_widget_set_size_request (GTK_WIDGET (plugin), -1, size);
+else
+gtk_widget_set_size_request (GTK_WIDGET (plugin), size, -1);
+#endif
+
 return TRUE;
 }
 
 
+#if LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
+static gboolean
+eyes_mode_changed (XfcePanelPlugin *plugin,
+   XfcePanelPluginMode  mode,
+   EyesPlugin  *eyes)
+{
+if (mode == XFCE_PANEL_PLUGIN_MODE_VERTICAL ||
+mode == XFCE_PANEL_PLUGIN_MODE_DESKBAR)
+gtk_alignment_set (GTK_ALIGNMENT (eyes-align), 0.5, 0.5, 0.0, 1.0);
+else
+gtk_alignment_set (GTK_ALIGNMENT (eyes-align), 0.5, 0.5, 1.0, 0.0);
+
+eyes_set_size (plugin, xfce_panel_plugin_get_size (plugin), eyes);
+
+return TRUE;
+}
+
+
+#else
+
 
 static void
 eyes_orientation_changed (XfcePanelPlugin *plugin,
   GtkOrientation   orientation,
-  EyesPlugin  *eyes)
+  EyesPlugin  *eyes)
 {
 if (orientation == GTK_ORIENTATION_VERTICAL)
 gtk_alignment_set (GTK_ALIGNMENT (eyes-align), 0.5, 0.5, 0.0, 1.0);
 else
 gtk_alignment_set (GTK_ALIGNMENT (eyes-align), 0.5, 0.5, 1.0, 0.0);
 
-eyes_set_size (plugin, xfce_panel_plugin_get_size (plugin));
+eyes_set_size (plugin, xfce_panel_plugin_get_size (plugin), eyes);
 }
-
+#endif
 
 
 static void
@@ -535,11 +585,16 @@ eyes_construct (XfcePanelPlugin *plugin)
 
 eyes = eyes_plugin_new (plugin);
 
+#if LIBXFCE4PANEL_CHECK_VERSION(4,9,0)
+g_signal_connect (plugin, mode-changed,
+  G_CALLBACK (eyes_mode_changed), eyes);
+#else
 g_signal_connect (plugin, orientation-changed,
   G_CALLBACK (eyes_orientation_changed), eyes);
+#endif
 
 g_signal_connect (plugin, size-changed,
-  G_CALLBACK (eyes_set_size), NULL);
+  G_CALLBACK (eyes_set_size), eyes);
 
 g_signal_connect (plugin, free-data,
   G_CALLBACK (eyes_free_data), eyes);
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Port to libxfce4ui (bug #8074).

2013-02-27 Thread Harald Judt
Updating branch refs/heads/master
 to 00fe6b4e4f12e6e8ac07528fc0f76e31bf802751 (commit)
   from e031b813881a7820d6af3e15568f4cdb8906bc30 (commit)

commit 00fe6b4e4f12e6e8ac07528fc0f76e31bf802751
Author: Andreas Müller schnitzelt...@gmx.de
Date:   Tue Feb 26 15:54:21 2013 +0100

Port to libxfce4ui (bug #8074).

 configure.ac.in  |6 +++---
 panel-plugin/Makefile.am |4 ++--
 panel-plugin/eyes.c  |2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 5ff1397..67e2288 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -56,9 +56,9 @@ dnl *** Check for required packages ***
 dnl ***
 XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.6.0])
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
-XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.90.2])
-XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.90.2])
-XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.99.1])
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
+XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.8.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.8.0])
 
 dnl ***
 dnl *** Check for debugging support ***
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 1ee4d28..249303c 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -13,12 +13,12 @@ xfce4_eyes_plugin_SOURCES = 
\
themes.c
 
 xfce4_eyes_plugin_CFLAGS = \
-   $(LIBXFCEGUI4_CFLAGS)   \
+   $(LIBXFCE4UI_CFLAGS)\
$(LIBXFCE4PANEL_CFLAGS)

 xfce4_eyes_plugin_LDADD =  \
$(LIBXFCE4PANEL_LIBS)   \
-   $(LIBXFCEGUI4_LIBS)
+   $(LIBXFCE4UI_LIBS)
 
 desktopdir = $(datadir)/xfce4/panel-plugins
 desktop_in_in_files = eyes.desktop.in.in
diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index 6c71938..f3cd195 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -33,7 +33,7 @@
 #include stdlib.h
 
 #include libxfce4util/libxfce4util.h
-#include libxfcegui4/libxfcegui4.h
+#include libxfce4ui/libxfce4ui.h
 
 #include eyes.h
 #include themes.h
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Update size after panel orientation change (bug #8404).

2013-02-27 Thread Harald Judt
Updating branch refs/heads/master
 to 2026158e64e961b042076a527cd923d1a606d282 (commit)
   from 00fe6b4e4f12e6e8ac07528fc0f76e31bf802751 (commit)

commit 2026158e64e961b042076a527cd923d1a606d282
Author: Andrzej ndrwr...@gmail.com
Date:   Tue Feb 26 15:56:42 2013 +0100

Update size after panel orientation change (bug #8404).

 panel-plugin/eyes.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index f3cd195..b0073ed 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -415,6 +415,8 @@ eyes_orientation_changed (XfcePanelPlugin *plugin,
 gtk_alignment_set (GTK_ALIGNMENT (eyes-align), 0.5, 0.5, 0.0, 1.0);
 else
 gtk_alignment_set (GTK_ALIGNMENT (eyes-align), 0.5, 0.5, 1.0, 0.0);
+
+eyes_set_size (plugin, xfce_panel_plugin_get_size (plugin));
 }
 
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Write config file when closing config dialog (bug #9035).

2013-02-27 Thread Harald Judt
Updating branch refs/heads/master
 to 5ea3c5f63cf2428e77b8a3dbb1004ddd502b0328 (commit)
   from 2026158e64e961b042076a527cd923d1a606d282 (commit)

commit 5ea3c5f63cf2428e77b8a3dbb1004ddd502b0328
Author: Harald Judt h.j...@gmx.at
Date:   Tue Feb 26 20:33:14 2013 +0100

Write config file when closing config dialog (bug #9035).

 panel-plugin/eyes.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index b0073ed..b1c06af 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -44,6 +44,13 @@
 #define UPDATE_TIMEOUT 100
 
 
+/***
+ *** Function Prototypes ***
+ ***/
+static void eyes_write_rc_file (XfcePanelPlugin *plugin,
+EyesPlugin  *eyes);
+
+
 /*
  *** Eyes Plugin Functions ***
  */
@@ -249,6 +256,8 @@ eyes_properties_dialog_response (GtkWidget  *dlg,
 {
 xfce_panel_plugin_unblock_menu (eyes-plugin);
 
+eyes_write_rc_file (eyes-plugin, eyes);
+
 gtk_widget_destroy (dlg);
 }
 
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Autotools update.

2013-02-27 Thread Harald Judt
Updating branch refs/heads/master
 to eba51dfe7955f9d344d966269ab01ea16f82c38a (commit)
   from 5ea3c5f63cf2428e77b8a3dbb1004ddd502b0328 (commit)

commit eba51dfe7955f9d344d966269ab01ea16f82c38a
Author: Harald Judt h.j...@gmx.at
Date:   Tue Feb 26 20:51:37 2013 +0100

Autotools update.

Fix building with automake-1.13.
Fix configure.ac.in as suggested in bug #6920.

 configure.ac.in  |   15 ---
 panel-plugin/Makefile.am |4 ++--
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 67e2288..b9b6282 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -14,16 +14,16 @@ m4_define([eyes_version], 
[eyes_version_major().eyes_version_minor().eyes_versio
 dnl ***
 dnl *** Initialize autoconf ***
 dnl ***
-AC_COPYRIGHT([Copyright (c) 2006-2007 The Xfce development team])
+AC_COPYRIGHT([Copyright (c) 2006-2013 The Xfce development team])
 AC_INIT([xfce4-eyes-plugin], [eyes_version], [http://bugzilla.xfce.org/], 
[xfce4-eyes-plugin])
-AC_PREREQ([2.50])
+AC_PREREQ([2.60])
 AC_CANONICAL_TARGET()
 
 dnl ***
 dnl *** Initialize automake ***
 dnl ***
-AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar])
-AM_CONFIG_HEADER([config.h])
+AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar])
+AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE()
 
 dnl 
@@ -32,8 +32,9 @@ dnl 
 AC_PROG_CC()
 AC_PROG_LD()
 AC_PROG_INSTALL()
-AC_PROG_LIBTOOL()
+LT_INIT([disable-static])
 AC_PROG_INTLTOOL()
+AM_PROG_CC_C_O()
 
 dnl **
 dnl *** Check for standard headers ***
@@ -54,8 +55,8 @@ XDT_I18N([@LINGUAS@])
 dnl ***
 dnl *** Check for required packages ***
 dnl ***
-XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.6.0])
-XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0])
+XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.20.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.8.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.8.0])
 XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.8.0])
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 249303c..f2d3c14 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = \
+AM_CPPFLAGS =  \
-I$(top_srcdir) \
-DPACKAGE_LOCALE_DIR=\$(localedir)\   \
-DTHEMESDIR=\$(datadir)/xfce4/eyes/themes\
@@ -15,7 +15,7 @@ xfce4_eyes_plugin_SOURCES =   
\
 xfce4_eyes_plugin_CFLAGS = \
$(LIBXFCE4UI_CFLAGS)\
$(LIBXFCE4PANEL_CFLAGS)
-   
+
 xfce4_eyes_plugin_LDADD =  \
$(LIBXFCE4PANEL_LIBS)   \
$(LIBXFCE4UI_LIBS)
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


[Xfce4-commits] xfce4-eyes-plugin:master Make eye movement independent, like in xeyes (bug #9036).

2013-02-27 Thread Harald Judt
Updating branch refs/heads/master
 to c5f5e0484d8fbcb68ed28732dc240935be336782 (commit)
   from 64c5b6460a7efddf2a1829be72430b9dddca1456 (commit)

commit c5f5e0484d8fbcb68ed28732dc240935be336782
Author: Harald Judt h.j...@gmx.at
Date:   Wed Feb 27 13:53:16 2013 +0100

Make eye movement independent, like in xeyes (bug #9036).

Clean up formatting of this function and make the eye movement independent.
The actual change is subtracting GTK_WIDGET(widget)-allocation.x from nx
and GTK_WIDGET(widget)-allocation.y from ny.

 panel-plugin/eyes.c |   30 --
 1 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index a6be752..11a286a 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -56,8 +56,11 @@ static void eyes_write_rc_file (XfcePanelPlugin *plugin,
  */
 static void
 calculate_pupil_xy (EyesPlugin *eyes_applet,
-   gint x, gint y,
-   gint *pupil_x, gint *pupil_y, GtkWidget* widget)
+gint x,
+gint y,
+gint *pupil_x,
+gint *pupil_y,
+GtkWidget *widget)
 {
double sina;
double cosa;
@@ -70,18 +73,25 @@ calculate_pupil_xy (EyesPlugin *eyes_applet,
 
width = GTK_WIDGET(widget)-allocation.width;
height = GTK_WIDGET(widget)-allocation.height;
-   gtk_misc_get_alignment(GTK_MISC(widget),  xalign, yalign);
+   gtk_misc_get_alignment(GTK_MISC(widget), xalign, yalign);
 
-   nx = x - MAX(width - eyes_applet-eye_width, 0) * xalign - 
eyes_applet-eye_width / 2;
-   ny = y - MAX(height- eyes_applet-eye_height, 0) * yalign - 
eyes_applet-eye_height / 2;
+   nx = x - (MAX(width - eyes_applet-eye_width, 0)
+ * xalign - eyes_applet-eye_width / 2)
+   - GTK_WIDGET(widget)-allocation.x;
+   ny = y - (MAX(height - eyes_applet-eye_height, 0)
+ * yalign - eyes_applet-eye_height / 2)
+   - GTK_WIDGET(widget)-allocation.y;
 
h = hypot (nx, ny);
-if (h  0.5 || abs (h)
-(abs (hypot (eyes_applet-eye_height / 2, 
eyes_applet-eye_width / 2)) - eyes_applet-wall_thickness - 
eyes_applet-pupil_height))
+   if (h  0.5 ||
+   abs (h)  (abs (hypot (eyes_applet-eye_height / 2,
+  
eyes_applet-eye_width / 2))
+  - eyes_applet-wall_thickness
+  - eyes_applet-pupil_height))
{
-   *pupil_x = nx + eyes_applet-eye_width / 2;
-   *pupil_y = ny + eyes_applet-eye_height / 2;
-   return;
+   *pupil_x = nx + eyes_applet-eye_width / 2;
+   *pupil_y = ny + eyes_applet-eye_height / 2;
+   return;
}
 
sina = nx / h;
___
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits


  1   2   3   4   5   6   >