#include "grip.h"
-static gint KillSession(GnomeClient* client, gpointer client_data);
-static gint SaveSession(GnomeClient *client, gint phase,
- GnomeSaveStyle save_style,
- gint is_shutdown, GnomeInteractStyle interact_style,
- gint is_fast, gpointer client_data);
static gint TimeOut(gpointer data);
gboolean do_debug=TRUE;
int Cmain(int argc, char* argv[])
{
- GnomeClient *client;
-
/* Unbuffer stdout */
setvbuf(stdout, 0, _IONBF, 0);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF8");
setenv("CHARSET","UTF-8",1);
- /* Session Management */
-
- client=gnome_master_client();
- gtk_signal_connect(GTK_OBJECT(client),"save_yourself",
- GTK_SIGNAL_FUNC(SaveSession),argv[0]);
- gtk_signal_connect(GTK_OBJECT(client),"die",
- GTK_SIGNAL_FUNC(KillSession),NULL);
-
-
do_debug=verbose;
if(scsi_device) printf("scsi=[%s]\n",scsi_device);
return 0;
}
-/* Save the session */
-static gint SaveSession(GnomeClient *client, gint phase,
- GnomeSaveStyle save_style,
- gint is_shutdown, GnomeInteractStyle interact_style,
- gint is_fast, gpointer client_data)
-{
- gchar** argv;
- guint argc;
-
- /* allocate 0-filled, so it will be NULL-terminated */
- argv = g_malloc0(sizeof(gchar*)*4);
- argc = 1;
-
- argv[0] = client_data;
-
- gnome_client_set_clone_command(client, argc, argv);
- gnome_client_set_restart_command(client, argc, argv);
-
- return TRUE;
-}
-
-/* Kill Session */
-static gint KillSession(GnomeClient* client, gpointer client_data)
-{
- gtk_main_quit();
-
- return TRUE;
-}
-
static gint TimeOut(gpointer data)
{
GripUpdate(grip_app);