/*
 *  Contains Gnome/GTK+ gui functions for DVD store
 *
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <gnome.h>
#include "session.h"
#include "dvd_gui.h"
#include "misc.h"

gint
save_session (GnomeClient *client, gint phase, GnomeSaveStyle save_style,
	      gint is_shutdown, GnomeInteractStyle interact_style,
	      gint is_fast, gpointer client_data)
{
  gchar **argv;
  guint argc;

  argv = g_malloc0(sizeof(gchar*)*4);
  argc = 1;

  argv[0] = client_data;

  if (user && passwd)
    {
      argv[1] = "--username";
      argv[2] = user;
      argv[3] = "--password";
      argv[4] = passwd;
      argc = 5;
    }
  gnome_client_set_clone_command (client, argc, argv);
  gnome_client_set_restart_command (client, argc, argv);

  return TRUE;
}

gint
session_die (GnomeClient *client, gpointer client_data)
{
  exit_dvdstore();
  return TRUE;
}

















