/*
  Cloned Xunzip
  Copyright (C) 1999 Tero Koskinen

  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., 675 Mass Ave, Cambridge, MA 02139, USA.
 
*/

#include <stdio.h>
#include <config.h>

#include <gnome.h>

#include <string>

#include "app.hh"
#include "callbacks.hh"
#include "prefs.hh"

void create_preferences(App *app)
{
  GtkWidget *w;
  GtkWidget *vbox;
  GtkWidget *label;

  app->saveSizeTmp=app->saveSize;

  w=gnome_property_box_new();
  gtk_window_set_title(GTK_WINDOW(w),_("Properties"));

  vbox=gtk_vbox_new(FALSE,0);
  gtk_container_border_width(GTK_CONTAINER(vbox), GNOME_PAD);

  app->pBtn1=gtk_check_button_new_with_label(_("Remember window size"));
  gtk_box_pack_start(GTK_BOX(vbox),app->pBtn1,FALSE,FALSE,0);
  gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(app->pBtn1),
			      app->saveSizeTmp);

  gtk_signal_connect_object(GTK_OBJECT(app->pBtn1), "toggled",
                            GTK_SIGNAL_FUNC(gnome_property_box_changed),
                            GTK_OBJECT(w));
  gtk_signal_connect(GTK_OBJECT(app->pBtn1), "toggled",
		     GTK_SIGNAL_FUNC(toggled_pBtn1_callback),app);
  label=gtk_label_new(_("General"));
  gtk_widget_show(label);
  gtk_notebook_append_page(GTK_NOTEBOOK(GNOME_PROPERTY_BOX(w)->notebook),
			   vbox,label);

  gnome_dialog_close_hides(GNOME_DIALOG(w), TRUE);

  gtk_signal_connect(GTK_OBJECT(w), "apply",
                     GTK_SIGNAL_FUNC(apply_prefs_callback), app);

  gtk_widget_show_all(w);
}
