X-Git-Url: http://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fui_pref.c;h=8d2c8ab5942c854663d34404b15a7c519aac2098;hb=fd0242c4e19038c1eca927498c6c6d163b46c736;hp=40c4dcc5e4d3508f6d121a2da1d638f9b8fb9db7;hpb=30280041f93f4374ce36a151df44c2bc7495d807;p=psensor.git diff --git a/src/ui_pref.c b/src/ui_pref.c index 40c4dcc..8d2c8ab 100644 --- a/src/ui_pref.c +++ b/src/ui_pref.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014 jeanfi@gmail.com + * Copyright (C) 2010-2016 jeanfi@gmail.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -55,6 +55,16 @@ void ui_pref_menu_toggled_cbk(GtkToggleButton *btn, gpointer data) config_set_menu_bar_enabled(gtk_toggle_button_get_active(btn)); } +void ui_pref_count_visible_toggled_cbk(GtkToggleButton *btn, gpointer data) +{ + config_set_count_visible(gtk_toggle_button_get_active(btn)); +} + +void ui_pref_sensorlist_position_changed_cbk(GtkComboBox *combo, gpointer data) +{ + config_set_sensorlist_position(gtk_combo_box_get_active(combo)); +} + GdkRGBA color_to_GdkRGBA(struct color *color) { GdkRGBA c; @@ -158,7 +168,8 @@ void ui_pref_dialog_run(struct ui_psensor *ui) w_sensorlist_pos = GTK_COMBO_BOX (gtk_builder_get_object(builder, "sensors_list_position")); - gtk_combo_box_set_active(w_sensorlist_pos, cfg->sensorlist_position); + gtk_combo_box_set_active(w_sensorlist_pos, + config_get_sensorlist_position()); w_autostart = GTK_TOGGLE_BUTTON (gtk_builder_get_object(builder, "autostart")); @@ -172,7 +183,7 @@ void ui_pref_dialog_run(struct ui_psensor *ui) 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); + config_is_count_visible()); if (ui_unity_is_supported()) { gtk_widget_set_has_tooltip @@ -299,6 +310,8 @@ void ui_pref_dialog_run(struct ui_psensor *ui) gtk_toggle_button_set_active(w_udisks2, config_is_udisks2_enabled()); + gtk_window_set_transient_for(GTK_WINDOW(diag), + GTK_WINDOW(ui->main_window)); gtk_builder_connect_signals(builder, NULL); result = gtk_dialog_run(diag); @@ -332,13 +345,6 @@ void ui_pref_dialog_run(struct ui_psensor *ui) else cfg->alpha_channel_enabled = 1; - cfg->sensorlist_position - = gtk_combo_box_get_active(w_sensorlist_pos); - - cfg->unity_launcher_count_disabled - = !gtk_toggle_button_get_active - (w_enable_launcher_counter); - cfg->sensor_update_interval = gtk_spin_button_get_value_as_int(w_s_update_interval);