X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=blobdiff_plain;f=src%2Fui_sensorpref.c;h=b87d53dcb97926d669c9735348779487d8b10645;hp=0704710d8bc67ed2be4e6752ef4dbe717f5ee07e;hb=c1e20f2631a1249720e9c75d753eacfcb0f6c7b9;hpb=912b5d1986633786a656bb3361f7ae9c1263acef diff --git a/src/ui_sensorpref.c b/src/ui_sensorpref.c index 0704710..b87d53d 100644 --- a/src/ui_sensorpref.c +++ b/src/ui_sensorpref.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 @@ -23,10 +23,10 @@ #include #include #include +#include #include #include #include -#include enum { COL_NAME = 0, @@ -53,9 +53,9 @@ static GtkSpinButton *w_sensor_high_threshold; static GtkSpinButton *w_sensor_low_threshold; static GtkListStore *store; - /* 'true' when the notifications of field changes are due to the change - * of the selected sensor. */ + * of the selected sensor. + */ static bool ignore_changes; static struct psensor *get_selected_sensor(void) @@ -236,7 +236,7 @@ ui_sensorpref_alarm_high_threshold_changed_cb(GtkSpinButton *btn, gpointer data) return; v = gtk_spin_button_get_value(btn); - if (config_get_sensor_unit() == FAHRENHEIT) + if (config_get_temperature_unit() == FAHRENHEIT) v = fahrenheit_to_celsius(v); config_set_sensor_alarm_high_threshold(s->id, v); @@ -259,7 +259,7 @@ ui_sensorpref_alarm_low_threshold_changed_cb(GtkSpinButton *btn, gpointer data) return; v = gtk_spin_button_get_value(btn); - if (config_get_sensor_unit() == FAHRENHEIT) + if (config_get_temperature_unit() == FAHRENHEIT) v = fahrenheit_to_celsius(v); config_set_sensor_alarm_low_threshold(s->id, v); @@ -290,7 +290,7 @@ static void update_pref(struct psensor *s) chip = _("Unknown"); gtk_label_set_text(w_sensor_chipname, chip); - use_celsius = config_get_sensor_unit() == CELSIUS ? 1 : 0; + use_celsius = config_get_temperature_unit() == CELSIUS ? 1 : 0; if (s->min == UNKNOWN_DBL_VALUE) smin = strdup(_("Unknown")); @@ -467,6 +467,8 @@ static GtkBuilder *load_ui(struct ui_psensor *ui) store = GTK_LIST_STORE(gtk_builder_get_object(builder, "sensors_liststore")); + gtk_window_set_transient_for(GTK_WINDOW(w_dialog), + GTK_WINDOW(ui->main_window)); gtk_builder_connect_signals(builder, ui); g_signal_connect(w_dialog,