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

modified the lock to use the same tile as logout, and make the name of

Wed May 26 20:39:20 1999  George Lebl  <jirka@5z.com>

        * panel-types.h,panel_config_global.c,logout.c: modified the
          lock to use the same tile as logout, and make the name of that
          tile "Miscellaneous" in the global properties

Mon May 17 15:22:28 1999  Robert Brady  <rwb197@ecs.soton.ac.uk>

        * applet.h, logout.c, menu.c, menu.h, panel-types.h, panel.c,
          session.c : Added a menu option to create a "Lock Screen"
          button on the panel, similar to the "Logout" button.
parent dc97b05c
Wed May 26 20:39:20 1999 George Lebl <jirka@5z.com>
* panel-types.h,panel_config_global.c,logout.c: modified the
lock to use the same tile as logout, and make the name of that
tile "Miscellaneous" in the global properties
Mon May 17 15:22:28 1999 Robert Brady <rwb197@ecs.soton.ac.uk>
* applet.h, logout.c, menu.c, menu.h, panel-types.h, panel.c,
session.c : Added a menu option to create a "Lock Screen"
button on the panel, similar to the "Logout" button.
Sun May 02 21:04:53 1999 George Lebl <jirka@5z.com>
* applet-widget.[ch]: added two new functions,
......
Wed May 26 20:39:20 1999 George Lebl <jirka@5z.com>
* panel-types.h,panel_config_global.c,logout.c: modified the
lock to use the same tile as logout, and make the name of that
tile "Miscellaneous" in the global properties
Mon May 17 15:22:28 1999 Robert Brady <rwb197@ecs.soton.ac.uk>
* applet.h, logout.c, menu.c, menu.h, panel-types.h, panel.c,
session.c : Added a menu option to create a "Lock Screen"
button on the panel, similar to the "Logout" button.
Sun May 02 21:04:53 1999 George Lebl <jirka@5z.com>
* applet-widget.[ch]: added two new functions,
......
......@@ -13,6 +13,7 @@ BEGIN_GNOME_DECLS
#define SWALLOW_ID "Swallow"
#define EXTERN_ID "Extern"
#define LAUNCHER_ID "Launcher"
#define LOCK_ID "Lock"
typedef enum {
APPLET_EXTERN,
......@@ -23,7 +24,8 @@ typedef enum {
APPLET_LOGOUT,
APPLET_SWALLOW,
APPLET_LAUNCHER,
APPLET_EMPTY
APPLET_EMPTY,
APPLET_LOCK,
} AppletType;
typedef struct _AppletUserMenu AppletUserMenu;
......
......@@ -45,7 +45,7 @@ create_logout_widget(void)
pixmap_name = gnome_pixmap_file("gnome-term-night.png");
button = button_widget_new_from_file(pixmap_name,
LOGOUT_TILE,
MISC_TILE,
FALSE,
ORIENT_UP,
_("Log out"));
......@@ -69,3 +69,37 @@ load_logout_applet(PanelWidget *panel, int pos)
register_toy(logout, NULL, panel, pos, APPLET_LOGOUT);
}
static GtkWidget *
create_lock_widget(void)
{
GtkWidget *button;
GtkWidget *pixmap;
char *pixmap_name;
pixmap_name = gnome_pixmap_file("gnome-lockscreen.png");
button = button_widget_new_from_file(pixmap_name,
MISC_TILE,
FALSE,
ORIENT_UP,
_("Lock screen"));
g_free(pixmap_name);
gtk_tooltips_set_tip (panel_tooltips,button,_("Lock screen"),NULL);
gtk_signal_connect(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(panel_lock), NULL);
return button;
}
void
load_lock_applet(PanelWidget *panel, int pos)
{
GtkWidget *lock;
lock = create_lock_widget();
if(lock)
register_toy(lock, NULL, panel, pos, APPLET_LOCK);
}
......@@ -1336,6 +1336,12 @@ add_logout_to_panel (GtkWidget *widget, void *data)
load_logout_applet(current_panel, 0);
}
static void
add_lock_to_panel (GtkWidget *widget, void *data)
{
load_lock_applet(current_panel, 0);
}
static void
add_applet (GtkWidget *w, char *item_loc)
{
......@@ -2403,6 +2409,16 @@ make_panel_submenu (GtkWidget *menu, int fake_submenus)
NULL);
setup_internal_applet_drag(menuitem, "LOGOUT:NEW");
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Add lock button"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
GTK_SIGNAL_FUNC(add_lock_to_panel),
NULL);
setup_internal_applet_drag(menuitem, "LOCK:NEW");
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Add swallowed app"));
......@@ -2465,7 +2481,7 @@ make_panel_submenu (GtkWidget *menu, int fake_submenus)
create_add_panel_submenu());
}
static void
void
panel_lock (GtkWidget *widget, void *data)
{
gboolean lock = gnome_config_get_bool_with_default ("Screensaver/Default/password", FALSE);
......
......@@ -52,6 +52,7 @@ void menu_properties(Menu *menu);
void applet_menu_position (GtkMenu *menu, int *x, int *y, gpointer data);
void panel_menu_position (GtkMenu *menu, int *x, int *y, gpointer data);
void panel_lock (GtkWidget *widget, void *data);
/*to be called on startup to load in some of the directories*/
void init_menus(void);
......
......@@ -13,7 +13,7 @@ typedef enum {
LAUNCHER_TILE=0,
DRAWER_TILE,
MENU_TILE,
LOGOUT_TILE,
MISC_TILE,
LAST_TILE
} PanelTileType;
......
......@@ -1035,6 +1035,8 @@ panel_widget_dnd_drop_internal (GtkWidget *widget,
load_drawer_applet(-1,NULL,NULL, panel, pos);
} else if(strcmp(applet_type,"LOGOUT:NEW")==0) {
load_logout_applet(panel, pos);
} else if(strcmp(applet_type,"LOCK:NEW")==0) {
load_lock_applet(panel, pos);
} else if(strcmp(applet_type,"SWALLOW:ASK")==0) {
ask_about_swallowing(panel,pos);
} else if(strcmp(applet_type,"LAUNCHER:ASK")==0) {
......
......@@ -568,7 +568,7 @@ panel_config_global(void)
N_("Launcher icon"),
N_("Drawer icon"),
N_("Menu icon"),
N_("Logout icon")};
N_("Miscellaneous icon")};
int i;
/* return if the window is already up. */
......
......@@ -321,6 +321,9 @@ save_applet_configuration(AppletInfo *info)
case APPLET_LOGOUT:
gnome_config_set_string("id", LOGOUT_ID);
break;
case APPLET_LOCK:
gnome_config_set_string("id", LOCK_ID);
break;
default:
g_assert_not_reached();
}
......@@ -711,6 +714,8 @@ init_user_applets(void)
g_free(params);
} else if(strcmp(applet_name,LOGOUT_ID) == 0) {
load_logout_applet(panel,pos);
} else if(strcmp(applet_name,LOCK_ID) == 0) {
load_lock_applet(panel,pos);
} else if(strcmp(applet_name,SWALLOW_ID) == 0) {
char *path = gnome_config_get_string("execpath=");
char *params = gnome_config_get_string("parameters=");
......
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