Commit 2f30b080 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

logout finally added as an internal applet type, since we now have the

Thu May 07 02:11:28 1998  George Lebl  <jirka@5z.com>

        * logout.[ch], main.c, menu.c: logout finally added as an internal
          applet type, since we now have the fish testing applet which is
          far cooler then logout
parent 5f581388
Thu May 07 02:11:28 1998 George Lebl <jirka@5z.com>
* logout.[ch], main.c, menu.c: logout finally added as an internal
applet type, since we now have the fish testing applet which is
far cooler then logout
Thu May 07 01:59:18 1998 George Lebl <jirka@5z.com>
* panel-widget.[ch],main.c, panel.c, panel_global_config.[ch]:
......
Thu May 07 02:11:28 1998 George Lebl <jirka@5z.com>
* logout.[ch], main.c, menu.c: logout finally added as an internal
applet type, since we now have the fish testing applet which is
far cooler then logout
Thu May 07 01:59:18 1998 George Lebl <jirka@5z.com>
* panel-widget.[ch],main.c, panel.c, panel_global_config.[ch]:
......
......@@ -20,9 +20,7 @@ INCLUDES = -I. -I$(srcdir) \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I$(includedir) $(GNOME_INCLUDEDIR)
## FIXME: logout should really be an internal applets since it is just
## too trivial
bin_PROGRAMS = panel logout_applet fish_applet #launcher_applet
bin_PROGRAMS = panel fish_applet #launcher_applet
CORBA_SOURCES = \
gnome-panel.cc \
......@@ -80,6 +78,8 @@ panel_SOURCES = \
panel-util.c \
launcher.c \
launcher.h \
logout.c \
logout.h \
$(CORBA_SOURCES)
panel_LDADD = $(GNOME_LIBDIR) $(MICO_LIBS) -lXt $(GNOMEUI_LIBS) $(INTLLIBS)
......@@ -101,16 +101,6 @@ fish_applet_LINK = $(CXXLINK)
fish_applet_LDADD = libpanel_applet.la $(GNOME_LIBDIR) $(MICO_LIBS) \
-lXt $(GNOMEUI_LIBS) $(INTLLIBS)
logout_applet_SOURCES = \
logout.c
## Must define linker for logout_applet -- it needs a C++ linker, but
## automake doesn't discover that automatically.
logout_applet_LINK = $(CXXLINK)
logout_applet_LDADD = libpanel_applet.la $(GNOME_LIBDIR) $(MICO_LIBS) \
-lXt $(GNOMEUI_LIBS) $(INTLLIBS)
data_DATA = panelrc
## Why not just make this via configure? Because @datadir@ will be
......
/* logout.c - Panel applet to end current session. */
/* Original author unknown. CORBAized by Elliot Lee */
/* uncorbized by George Lebl */
#include "gnome.h"
#include "applet-lib.h"
#include "applet-widget.h"
GtkWidget *applet;
static gint
destroy_applet(GtkWidget *widget, gpointer data)
{
gtk_exit(0);
return FALSE;
}
#include <gnome.h>
#include "panel.h"
static void
logout(void)
{
gnome_panel_quit();
panel_quit();
}
static GtkWidget *
GtkWidget *
create_logout_widget(void)
{
GtkWidget *button;
......@@ -37,37 +28,13 @@ create_logout_widget(void)
g_free(pixmap_name);
gtk_container_add(GTK_CONTAINER(button), pixmap);
gtk_widget_show(pixmap);
gtk_widget_set_usize(button, pixmap->requisition.width,
pixmap->requisition.height);
gtk_widget_set_usize(button, 48, 48);
/*gtk_widget_set_usize(button, pixmap->requisition.width,
pixmap->requisition.height);*/
}
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(logout), NULL);
gtk_signal_connect(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(logout), NULL);
return button;
}
int
main(int argc, char *argv[])
{
GtkWidget *logout;
panel_corba_register_arguments();
gnome_init("logout_applet", NULL, argc, argv, 0, NULL);
applet = applet_widget_new(argv[0]);
if (!applet)
g_error("Can't create applet!\n");
logout = create_logout_widget();
gtk_widget_show(logout);
applet_widget_add(APPLET_WIDGET(applet), logout);
gtk_widget_show(applet);
gtk_signal_connect(GTK_OBJECT(applet),"destroy",
GTK_SIGNAL_FUNC(destroy_applet),
NULL);
applet_widget_gtk_main();
return 0;
}
/*
* GNOME panel logout module.
*
* Original author unknown. CORBAized by Elliot Lee *
* de-CORBAized by George Lebl
*/
#ifndef LOGOUT_H
#define LOGOUT_H
GtkWidget * create_logout_widget (void);
#endif
......@@ -17,6 +17,7 @@
#include "menu.h"
#include "drawer.h"
#include "swallow.h"
#include "logout.h"
#include "mico-glue.h"
#include "mico-parse.h"
#include "panel-util.h"
......@@ -286,6 +287,13 @@ load_applet(char *id_str, char *params, int pos, int panel, char *cfgpath)
register_toy(swallow->table,NULL,swallow,SWALLOW_ID,params,pos,
panel,NULL,APPLET_SWALLOW);
} else if(strcmp(id_str,LOGOUT_ID) == 0) {
GtkWidget *logout;
logout = create_logout_widget();
register_toy(logout,NULL,NULL,LOGOUT_ID,params,pos,
panel,NULL,APPLET_LOGOUT);
}
}
......
......@@ -434,6 +434,13 @@ create_panel_submenu (GtkWidget *app_menu)
(GtkSignalFunc) add_applet_to_panel_data,
MENU_ID);
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Add log out button"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) add_applet_to_panel_data,
LOGOUT_ID);
#ifdef _DRAWER_
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Add drawer"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment