preferences_view.h File Reference


Detailed Description

Declaration of preferences editor.

Author:
Jeremy A. Mowery jmowery@tresys.com

Jason Tang jtang@tresys.com

Copyright (C) 2003-2007 Tresys Technology, LLC

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Definition in file preferences_view.h.

#include "toplevel.h"
#include <gtk/gtk.h>

Go to the source code of this file.


Functions

int preferences_view_run (toplevel_t *top, const char *current_log, const apol_policy_path_t *current_policy)
 Display a dialog from which the user may edit his preferences.

Function Documentation

int preferences_view_run toplevel_t top,
const char *  current_log,
const apol_policy_path_t current_policy
 

Display a dialog from which the user may edit his preferences.

Parameters:
top Toplevel object containing preferences to modify
current_log Path to the currently loaded log file, or NULL if none loaded.
current_policy Path to the currently loaded policy, or NULL if none loaded.
Returns:
Non-zero if preferences changed, zero if not.

Definition at line 282 of file preferences_view.c.

References apol_policy_path_t, preferences_view_get_from_dialog(), preferences_view_init_values(), preferences_view_init_widgets(), pref_view::top, toplevel_get_glade_xml(), toplevel_get_prefs(), toplevel_t, and toplevel::xml.

Referenced by toplevel_on_preferences_activate().

00283 {
00284         struct pref_view pv;
00285         gint response;
00286 
00287         memset(&pv, 0, sizeof(pv));
00288         pv.top = top;
00289         pv.xml = glade_xml_new(toplevel_get_glade_xml(top), "PreferencesWindow", NULL);
00290         pv.prefs = toplevel_get_prefs(top);
00291         pv.current_log = current_log;
00292         pv.current_policy = current_policy;
00293 
00294         preferences_view_init_widgets(&pv);
00295         preferences_view_init_values(&pv);
00296 
00297         response = gtk_dialog_run(pv.dialog);
00298         if (response != GTK_RESPONSE_OK) {
00299                 gtk_widget_destroy(GTK_WIDGET(pv.dialog));
00300                 return 0;
00301         }
00302         preferences_view_get_from_dialog(&pv);
00303         gtk_widget_destroy(GTK_WIDGET(pv.dialog));
00304         return 1;
00305 }