Exemplo n.º 1
0
void
panel_lockdown_init (void)
{
        panel_lockdown.panel_settings = g_settings_new (PANEL_SCHEMA);
        panel_lockdown.lockdown_settings = g_settings_new (LOCKDOWN_SCHEMA);

        panel_lockdown.locked_down =
                panel_lockdown_load_bool (&panel_lockdown,
                                          panel_lockdown.panel_settings,
                                          PANEL_LOCKED_DOWN_KEY,
                                          G_CALLBACK (locked_down_notify));

        panel_lockdown.disable_command_line =
                panel_lockdown_load_bool (&panel_lockdown,
                                          panel_lockdown.lockdown_settings,
                                          LOCKDOWN_DISABLE_COMMAND_LINE_KEY,
                                          G_CALLBACK (disable_command_line_notify));
        
        panel_lockdown.disable_lock_screen =
                panel_lockdown_load_bool (&panel_lockdown,
                                          panel_lockdown.lockdown_settings,
                                          LOCKDOWN_DISABLE_LOCK_SCREEN_KEY,
                                          G_CALLBACK (disable_lock_screen_notify));

        panel_lockdown.disable_log_out =
                panel_lockdown_load_bool (&panel_lockdown,
                                          panel_lockdown.panel_settings,
                                          PANEL_DISABLE_LOG_OUT_KEY,
                                          G_CALLBACK (disable_log_out_notify));

        panel_lockdown.disable_force_quit =
                panel_lockdown_load_bool (&panel_lockdown,
                                          panel_lockdown.panel_settings,
                                          PANEL_DISABLE_FORCE_QUIT_KEY,
                                          G_CALLBACK (disable_force_quit_notify));

        panel_lockdown.disabled_applets =
                panel_lockdown_load_disabled_applets (&panel_lockdown,
                                                      panel_lockdown.panel_settings);

        panel_lockdown.initialized = TRUE;
}
void
panel_lockdown_init (void)
{
        GConfClient *client;
        int          i = 0;

        client = panel_gconf_get_client ();

        gconf_client_add_dir (client,
                              DESKTOP_GNOME_LOCKDOWN_DIR,
                              GCONF_CLIENT_PRELOAD_ONELEVEL,
                              NULL);

        gconf_client_add_dir (client,
                              PANEL_GLOBAL_LOCKDOWN_DIR,
                              GCONF_CLIENT_PRELOAD_ONELEVEL,
                              NULL);

        panel_lockdown.locked_down =
                panel_lockdown_load_bool (&panel_lockdown,
                                          client,
                                          PANEL_GLOBAL_LOCKED_DOWN_KEY,
                                          (GConfClientNotifyFunc) locked_down_notify,
                                          i++);

        panel_lockdown.disable_command_line =
                panel_lockdown_load_bool (&panel_lockdown,
                                          client,
                                          DISABLE_COMMAND_LINE_KEY,
                                          (GConfClientNotifyFunc) disable_command_line_notify,
                                          i++);
        
        panel_lockdown.disable_lock_screen =
                panel_lockdown_load_bool (&panel_lockdown,
                                          client,
                                          DISABLE_LOCK_SCREEN_KEY,
                                          (GConfClientNotifyFunc) disable_lock_screen_notify,
                                          i++);

        panel_lockdown.disable_log_out =
                panel_lockdown_load_bool (&panel_lockdown,
                                          client,
                                          DISABLE_LOG_OUT_KEY,
                                          (GConfClientNotifyFunc) disable_log_out_notify,
                                          i++);

        panel_lockdown.disable_force_quit =
                panel_lockdown_load_bool (&panel_lockdown,
                                          client,
                                          DISABLE_FORCE_QUIT_KEY,
                                          (GConfClientNotifyFunc) disable_force_quit_notify,
                                          i++);

        panel_lockdown.disabled_applets =
                panel_lockdown_load_disabled_applets (&panel_lockdown,
                                                      client,
                                                      i++);

        g_assert (i == N_LISTENERS);

        panel_lockdown.initialized = TRUE;
}