** added missing french translation
** added different sizes of psensor.png
** psensor: added menu
+** psensor: added enable/disable unity launcher counter
* v0.6.2.7
#define KEY_INTERFACE_MENU_BAR_DISABLED \
"/apps/psensor/interface/menu_bar_disabled"
+#define KEY_INTERFACE_UNITY_LAUNCHER_COUNT_DISABLED \
+"/apps/psensor/interface/unity_launcher_count_disabled"
GConfClient *client;
-char *config_get_string(char *key, char *default_value)
+static char *get_string(char *key, char *default_value)
{
char *value = gconf_client_get_string(client,
key,
struct color *config_get_background_color()
{
- char *scolor = config_get_string(KEY_GRAPH_BACKGROUND_COLOR,
+ char *scolor = get_string(KEY_GRAPH_BACKGROUND_COLOR,
DEFAULT_GRAPH_BACKGROUND_COLOR);
struct color *c = string_to_color(scolor);
struct color *config_get_foreground_color()
{
- char *scolor = config_get_string(KEY_GRAPH_FOREGROUND_COLOR,
- DEFAULT_GRAPH_FOREGROUND_COLOR);
+ char *scolor = get_string(KEY_GRAPH_FOREGROUND_COLOR,
+ DEFAULT_GRAPH_FOREGROUND_COLOR);
struct color *c = string_to_color(scolor);
KEY_INTERFACE_MENU_BAR_DISABLED,
NULL);
+ cfg->unity_launcher_count_disabled = gconf_client_get_bool
+ (client,
+ KEY_INTERFACE_UNITY_LAUNCHER_COUNT_DISABLED,
+ NULL);
+
return cfg;
}
KEY_INTERFACE_MENU_BAR_DISABLED,
cfg->menu_bar_disabled, NULL);
+ gconf_client_set_bool(client,
+ KEY_INTERFACE_UNITY_LAUNCHER_COUNT_DISABLED,
+ cfg->unity_launcher_count_disabled, NULL);
}
int sensor_update_interval;
int menu_bar_disabled;
+
+ int unity_launcher_count_disabled;
};
/*
#endif
#ifdef HAVE_UNITY
- ui_unity_launcher_entry_update(ui->sensors);
+ ui_unity_launcher_entry_update(ui->sensors,
+ !cfg->unity_launcher_count_disabled);
#endif
if (ui->graph_update_interval != cfg->graph_update_interval) {
*w_s_update_interval;
GtkComboBox *w_sensorlist_pos;
GtkToggleButton *w_hide_window_decoration, *w_keep_window_below,
- *w_enable_menu;
+ *w_enable_menu, *w_enable_launcher_counter;
cfg = ui->config;
gtk_toggle_button_set_active(w_enable_menu,
!cfg->menu_bar_disabled);
+ w_enable_launcher_counter = GTK_TOGGLE_BUTTON
+ (gtk_builder_get_object(builder,
+ "enable_launcher_counter"));
+ gtk_toggle_button_set_active(w_enable_launcher_counter,
+ !cfg->unity_launcher_count_disabled);
result = gtk_dialog_run(diag);
cfg->menu_bar_disabled
= !gtk_toggle_button_get_active(w_enable_menu);
+ cfg->unity_launcher_count_disabled
+ = !gtk_toggle_button_get_active
+ (w_enable_launcher_counter);
+
gtk_window_set_decorated(GTK_WINDOW(ui->main_window),
cfg->window_decoration_enabled);
static int initialized;
static UnityLauncherEntry *psensor_entry;
+static unsigned int last_visible = -1;
-void ui_unity_launcher_entry_update(struct psensor **sensors)
+void ui_unity_launcher_entry_update(struct psensor **sensors,
+ unsigned int show)
{
if (!initialized) {
psensor_entry = unity_launcher_entry_get_for_desktop_file
("psensor.desktop");
- unity_launcher_entry_set_count_visible(psensor_entry, TRUE);
+
unity_launcher_entry_set_count(psensor_entry, 0);
initialized = 1;
}
+ if (last_visible != show) {
+ if (show)
+ unity_launcher_entry_set_count_visible(psensor_entry,
+ TRUE);
+ else
+ unity_launcher_entry_set_count_visible(psensor_entry,
+ FALSE);
+ last_visible = show;
+ }
+
if (sensors && *sensors) {
struct psensor *s = *sensors;
double v = psensor_get_current_value(s);
#include "psensor.h"
-void ui_unity_launcher_entry_update(struct psensor **sensors);
+void ui_unity_launcher_entry_update(struct psensor **sensors,
+ unsigned int show);
#endif