From 91dabcb1b4aa514d3d00de63e4cb0e42b385c1ed Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Sun, 8 May 2011 21:57:25 +0000 Subject: [PATCH] added 'sensor preferences' in the popup menu --- src/ui_graph.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ui_graph.c b/src/ui_graph.c index c6ce62f..590826d 100644 --- a/src/ui_graph.c +++ b/src/ui_graph.c @@ -20,6 +20,7 @@ #include "graph.h" #include "ui_graph.h" #include "ui_pref.h" +#include "ui_sensorpref.h" static void cb_menu_quit(GtkMenuItem *mi, gpointer data) { @@ -31,10 +32,19 @@ static void cb_preferences(GtkMenuItem *mi, gpointer data) ui_pref_dialog_run((struct ui_psensor *)data); } +static void cb_sensor_preferences(GtkMenuItem *mi, gpointer data) +{ + struct ui_psensor *ui = data; + + if (ui->sensors && *ui->sensors) + ui_sensorpref_dialog_run(*ui->sensors, ui); +} + static const char *menu_desc = "" " " " " +" " " " " " " " @@ -48,6 +58,11 @@ static GtkActionEntry entries[] = { "Preferences", /* tooltip */ G_CALLBACK(cb_preferences) }, + { "SensorPreferencesAction", GTK_STOCK_PREFERENCES,/* name, stock id */ + "_Sensor Preferences", NULL, /* label, accelerator */ + "Sensor Preferences", /* tooltip */ + G_CALLBACK(cb_sensor_preferences) }, + { "QuitAction", GTK_STOCK_QUIT, "_Quit", NULL, "Quit", G_CALLBACK(cb_menu_quit) } }; -- 2.7.4