fct in ui.c flagged static when needed
#define KEY_INTERFACE_UNITY_LAUNCHER_COUNT_DISABLED \
"/apps/psensor/interface/unity_launcher_count_disabled"
#define KEY_INTERFACE_UNITY_LAUNCHER_COUNT_DISABLED \
"/apps/psensor/interface/unity_launcher_count_disabled"
+#define KEY_INTERFACE_HIDE_ON_STARTUP \
+"/apps/psensor/interface/hide_on_startup"
+
GConfClient *client;
static char *get_string(char *key, char *default_value)
GConfClient *client;
static char *get_string(char *key, char *default_value)
-struct color *config_get_background_color()
+static struct color *config_get_background_color()
{
char *scolor = get_string(KEY_GRAPH_BACKGROUND_COLOR,
{
char *scolor = get_string(KEY_GRAPH_BACKGROUND_COLOR,
-struct color *config_get_foreground_color()
+static struct color *config_get_foreground_color()
{
char *scolor = get_string(KEY_GRAPH_FOREGROUND_COLOR,
DEFAULT_GRAPH_FOREGROUND_COLOR);
{
char *scolor = get_string(KEY_GRAPH_FOREGROUND_COLOR,
DEFAULT_GRAPH_FOREGROUND_COLOR);
-int config_is_alpha_channel_enabled()
+static int config_is_alpha_channel_enabled()
{
gboolean b = gconf_client_get_bool(client,
KEY_ALPHA_CHANNEL_ENABLED,
{
gboolean b = gconf_client_get_bool(client,
KEY_ALPHA_CHANNEL_ENABLED,
-void config_set_alpha_channel_enabled(int enabled)
-{
- if (enabled)
- gconf_client_set_bool(client,
- KEY_ALPHA_CHANNEL_ENABLED, TRUE, NULL);
- else
- gconf_client_set_bool(client,
- KEY_ALPHA_CHANNEL_ENABLED, FALSE, NULL);
-}
-
-int config_get_sensorlist_position()
+static int config_get_sensorlist_position()
{
return gconf_client_get_int(client,
KEY_INTERFACE_SENSORLIST_POSITION, NULL);
}
{
return gconf_client_get_int(client,
KEY_INTERFACE_SENSORLIST_POSITION, NULL);
}
-void config_set_sensorlist_position(int pos)
+static void config_set_sensorlist_position(int pos)
{
gconf_client_set_int(client,
KEY_INTERFACE_SENSORLIST_POSITION, pos, NULL);
}
{
gconf_client_set_int(client,
KEY_INTERFACE_SENSORLIST_POSITION, pos, NULL);
}
-double config_get_graph_background_alpha()
+static double config_get_graph_background_alpha()
{
double a = gconf_client_get_float(client,
KEY_GRAPH_BACKGROUND_ALPHA,
{
double a = gconf_client_get_float(client,
KEY_GRAPH_BACKGROUND_ALPHA,
-void config_set_graph_background_alpha(double alpha)
+static void config_set_graph_background_alpha(double alpha)
{
gconf_client_set_float(client, KEY_GRAPH_BACKGROUND_ALPHA, alpha, NULL);
}
{
gconf_client_set_float(client, KEY_GRAPH_BACKGROUND_ALPHA, alpha, NULL);
}
-void config_set_background_color(struct color *color)
+static void config_set_background_color(struct color *color)
{
char *scolor = color_to_string(color);
{
char *scolor = color_to_string(color);
-void config_set_foreground_color(struct color *color)
+static void config_set_foreground_color(struct color *color)
{
char *scolor = color_to_string(color);
{
char *scolor = color_to_string(color);
-char *config_get_sensor_key(char *sensor_name)
+static char *config_get_sensor_key(char *sensor_name)
{
char *escaped_name = gconf_escape_key(sensor_name, -1);
/* /apps/psensor/sensors/[sensor_name]/color */
{
char *escaped_name = gconf_escape_key(sensor_name, -1);
/* /apps/psensor/sensors/[sensor_name]/color */
-int config_is_window_decoration_enabled()
+static int config_is_window_decoration_enabled()
-int config_is_window_keep_below_enabled()
+static int config_is_window_keep_below_enabled()
-void config_set_window_decoration_enabled(int enabled)
+static void config_set_window_decoration_enabled(int enabled)
{
if (enabled)
gconf_client_set_bool
{
if (enabled)
gconf_client_set_bool
KEY_INTERFACE_WINDOW_DECORATION_DISABLED, TRUE, NULL);
}
KEY_INTERFACE_WINDOW_DECORATION_DISABLED, TRUE, NULL);
}
-void config_set_window_keep_below_enabled(int enabled)
+static void config_set_window_keep_below_enabled(int enabled)
{
if (enabled)
gconf_client_set_bool(client,
{
if (enabled)
gconf_client_set_bool(client,
KEY_INTERFACE_UNITY_LAUNCHER_COUNT_DISABLED,
NULL);
KEY_INTERFACE_UNITY_LAUNCHER_COUNT_DISABLED,
NULL);
+ cfg->hide_on_startup = gconf_client_get_bool
+ (client,
+ KEY_INTERFACE_HIDE_ON_STARTUP,
+ NULL);
+
gconf_client_set_bool(client,
KEY_INTERFACE_UNITY_LAUNCHER_COUNT_DISABLED,
cfg->unity_launcher_count_disabled, NULL);
gconf_client_set_bool(client,
KEY_INTERFACE_UNITY_LAUNCHER_COUNT_DISABLED,
cfg->unity_launcher_count_disabled, NULL);
+
+ gconf_client_set_bool(client,
+ KEY_INTERFACE_HIDE_ON_STARTUP,
+ cfg->hide_on_startup, NULL);
int menu_bar_disabled;
int unity_launcher_count_disabled;
int menu_bar_disabled;
int unity_launcher_count_disabled;
struct psensor **sensor_cur;
GtkAllocation galloc;
struct psensor **sensor_cur;
GtkAllocation galloc;
+ if (!gtk_widget_is_drawable(w_graph))
+ return ;
+
gtk_widget_get_allocation(w_graph, &galloc);
width = galloc.width;
height = galloc.height;
gtk_widget_get_allocation(w_graph, &galloc);
width = galloc.width;
height = galloc.height;
ui->main_window = window;
ui->menu_bar = menubar;
ui->main_window = window;
ui->menu_bar = menubar;
- gtk_widget_show_all(ui->main_window);
+ if (ui->config->hide_on_startup)
+ gtk_widget_show_all(ui->main_box);
+ else
+ gtk_widget_show_all(ui->main_window);
}
static void menu_bar_show(unsigned int show, struct ui_psensor *ui)
}
static void menu_bar_show(unsigned int show, struct ui_psensor *ui)