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

minor fix to the forbidden handeling

Thu May 07 00:18:23 1998  George Lebl  <jirka@5z.com>

        * panel-widget.c: minor fix to the forbidden handeling

        * panel.c, main.c, panel_config_global.[ch]: added a "really
          log out" dialog and an option for it

OH yeah .. and I've enabled drawers again .. since we're the release is
already out ... swallows will follow soon ... I will still need to work
on them before having people ask me questions about em :)
-George
parent 0db9e42b
Thu May 07 00:18:23 1998 George Lebl <jirka@5z.com>
* panel-widget.c: minor fix to the forbidden handeling
* panel.c, main.c, panel_config_global.[ch]: added a "really
log out" dialog and an option for it
Tue May 05 12:17:38 1998 George Lebl <jirka@5z.com>
* panel_config.c: we set state BEFORE we connect the toggled
......
Thu May 07 00:18:23 1998 George Lebl <jirka@5z.com>
* panel-widget.c: minor fix to the forbidden handeling
* panel.c, main.c, panel_config_global.[ch]: added a "really
log out" dialog and an option for it
Tue May 05 12:17:38 1998 George Lebl <jirka@5z.com>
* panel_config.c: we set state BEFORE we connect the toggled
......
......@@ -3,8 +3,9 @@
## We require new-style dependency handling.
AUTOMAKE_OPTIONS = 1.2f
#enable drawers and swallows for testing only, not for release!
#CFLAGS += -DDRAWER_AND_SWALLOW
#enable swallows for testing only, not for release!
#CFLAGS += -D_SWALLOW_
CFLAGS += -D_DRAWER_
CXX = mico-c++
## We set this to force the values in mico-c++ to be used. Otherwise,
......
......@@ -10,7 +10,7 @@ typedef void (*AppletWidgetOrientSignal) (GtkObject * object,
PanelOrientType orient,
gpointer data);
typedef void (*AppletWidgetSaveSignal) (GtkObject * object,
typedef gint (*AppletWidgetSaveSignal) (GtkObject * object,
char *cfgpath,
char *globcfgpath,
gpointer data);
......@@ -70,12 +70,15 @@ gtk_applet_widget_marshal_signal_save (GtkObject * object,
GtkArg * args)
{
AppletWidgetSaveSignal rfunc;
gint *retval;
rfunc = (AppletWidgetSaveSignal) func;
(*rfunc) (object, GTK_VALUE_STRING (args[0]),
GTK_VALUE_STRING (args[0]),
func_data);
retval = GTK_RETLOC_BOOL(args[2]);
*retval = (*rfunc) (object, GTK_VALUE_STRING (args[0]),
GTK_VALUE_STRING (args[1]),
func_data);
}
static void
......
......@@ -277,6 +277,8 @@ load_applet(char *id_str, char *params, int pos, int panel, char *cfgpath)
panel_widget_pop_up(panelarr[1]);
reposition_drawer(drawer);
panel_widget_add_forbidden(PANEL_WIDGET(drawer->drawer));
} else if(strcmp(id_str,SWALLOW_ID) == 0) {
Swallow *swallow;
......@@ -937,27 +939,36 @@ main(int argc, char **argv)
/*set up global options*/
g_snprintf(buf,256,"%sConfig/tooltips_enabled=TRUE",
old_panel_cfg_path);
global_config.tooltips_enabled = gnome_config_get_bool(buf);
g_snprintf(buf,256,"%sConfig/show_small_icons=TRUE",
old_panel_cfg_path);
global_config.show_small_icons = gnome_config_get_bool(buf);
g_snprintf(buf,256,"%sConfig/auto_hide_step_size=%d",
old_panel_cfg_path, DEFAULT_AUTO_HIDE_STEP_SIZE);
g_snprintf(buf,256,"%sConfig/",old_panel_cfg_path);
gnome_config_push_prefix(buf);
global_config.tooltips_enabled =
gnome_config_get_bool("tooltips_enabled=TRUE");
global_config.show_small_icons =
gnome_config_get_bool("show_small_icons=TRUE");
global_config.prompt_for_logout =
gnome_config_get_bool("prompt_for_logout=TRUE");
g_snprintf(buf,256,"auto_hide_step_size=%d",
DEFAULT_AUTO_HIDE_STEP_SIZE);
global_config.auto_hide_step_size=gnome_config_get_int(buf);
g_snprintf(buf,256,"%sConfig/explicit_hide_step_size=%d",
old_panel_cfg_path, DEFAULT_EXPLICIT_HIDE_STEP_SIZE);
g_snprintf(buf,256,"explicit_hide_step_size=%d",
DEFAULT_EXPLICIT_HIDE_STEP_SIZE);
global_config.explicit_hide_step_size=gnome_config_get_int(buf);
g_snprintf(buf,256,"%sConfig/minimize_delay=%d",old_panel_cfg_path,
DEFAULT_MINIMIZE_DELAY);
g_snprintf(buf,256,"minimize_delay=%d", DEFAULT_MINIMIZE_DELAY);
global_config.minimize_delay=gnome_config_get_int(buf);
g_snprintf(buf,256,"%sConfig/minimized_size=%d",old_panel_cfg_path,
DEFAULT_MINIMIZED_SIZE);
g_snprintf(buf,256,"minimized_size=%d", DEFAULT_MINIMIZED_SIZE);
global_config.minimized_size=gnome_config_get_int(buf);
g_snprintf(buf,256,"%sConfig/movement_type=%d",old_panel_cfg_path,
PANEL_SWITCH_MOVE);
g_snprintf(buf,256,"movement_type=%d", PANEL_SWITCH_MOVE);
global_config.movement_type=gnome_config_get_int(buf);
gnome_config_pop_prefix();
init_main_menu();
init_user_panels();
......
......@@ -434,14 +434,16 @@ create_panel_submenu (GtkWidget *app_menu)
(GtkSignalFunc) add_applet_to_panel_data,
MENU_ID);
#ifdef DRAWER_AND_SWALLOW
#ifdef _DRAWER_
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Add drawer"));
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
(GtkSignalFunc) add_applet_to_panel_data,
DRAWER_ID);
#endif
#ifdef _SWALLOW_
menuitem = gtk_menu_item_new ();
setup_menuitem (menuitem, 0, _("Add swallowed app"));
gtk_menu_append (GTK_MENU (menu), menuitem);
......
......@@ -11,6 +11,7 @@ struct _GlobalConfig {
gint minimize_delay;
gint tooltips_enabled;
gint show_small_icons;
gint prompt_for_logout;
PanelMovementType movement_type;
};
......
......@@ -2536,7 +2536,7 @@ add_panel_to_forbidden(PanelWidget *panel, PanelWidget *r)
panel = gtk_object_get_data(GTK_OBJECT(panel->master_widget),
PANEL_APPLET_PARENT_KEY);
if(panel)
remove_panel_from_forbidden(panel, r);
add_panel_to_forbidden(panel, r);
}
static gint
......
......@@ -273,6 +273,8 @@ panel_session_save (GnomeClient *client,
global_config.tooltips_enabled);
gnome_config_set_bool("show_small_icons",
global_config.show_small_icons);
gnome_config_set_bool("prompt_for_logout",
global_config.prompt_for_logout);
gnome_config_pop_prefix ();
gnome_config_sync();
......@@ -315,17 +317,71 @@ panel_session_save (GnomeClient *client,
return TRUE;
}
static gint
panel_really_logout(GtkWidget *w, gint button, gpointer data)
{
GtkWidget **box=data;
if(button!=0)
gnome_dialog_close(GNOME_DIALOG(w));
else {
if (! GNOME_CLIENT_CONNECTED (client)) {
panel_session_save (client, 1, GNOME_SAVE_BOTH, 1,
GNOME_INTERACT_NONE, 0, NULL);
} else {
/* We request a completely interactive, full,
slow shutdown. */
gnome_client_request_save (client, GNOME_SAVE_BOTH, 1,
GNOME_INTERACT_ANY, 0, 1);
}
}
if(box)
*box = NULL;
return TRUE;
}
static void
ask_next_time(GtkWidget *w,gpointer data)
{
global_config.prompt_for_logout = GTK_TOGGLE_BUTTON(w)->active == TRUE;
}
void
panel_quit(void)
{
if (! GNOME_CLIENT_CONNECTED (client)) {
panel_session_save (client, 1, GNOME_SAVE_BOTH, 1,
GNOME_INTERACT_NONE, 0, NULL);
} else {
/* We request a completely interactive, full, slow shutdown. */
gnome_client_request_save (client, GNOME_SAVE_BOTH, 1,
GNOME_INTERACT_ANY, 0, 1);
static GtkWidget *box = NULL;
GtkWidget *but = NULL;
if(!global_config.prompt_for_logout) {
panel_really_logout(NULL,0,NULL);
return;
}
if(box) {
gdk_window_raise(box->window);
return;
}
box = gnome_message_box_new (_("Really log out?"),
GNOME_MESSAGE_BOX_QUESTION,
GNOME_STOCK_BUTTON_YES,
GNOME_STOCK_BUTTON_NO,
NULL);
gtk_signal_connect (GTK_OBJECT (box), "clicked",
GTK_SIGNAL_FUNC (panel_really_logout), &box);
but = gtk_check_button_new_with_label(_("Ask next time"));
gtk_widget_show(but);
gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(box)->vbox),but,
FALSE, TRUE, GNOME_PAD_SMALL);
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(but),TRUE);
gtk_signal_connect(GTK_OBJECT(but),"toggled",
GTK_SIGNAL_FUNC(ask_next_time),NULL);
/* gnome_dialog_set_modal (GNOME_DIALOG(box)); */
/* gnome_dialog_close_hides(GNOME_DIALOG(box), TRUE); */
gtk_widget_show (box);
}
static void
......
#include <gtk/gtk.h>
#include <string.h>
#include <config.h>
#include <gnome.h>
#include "panel.h"
......@@ -43,14 +44,7 @@ set_toggle_button_value (GtkWidget *widget, gpointer data)
static void
config_apply (GtkWidget *widget, int page, gpointer data)
{
global_config.minimize_delay = temp_config.minimize_delay;
global_config.minimized_size = temp_config.minimized_size;
global_config.auto_hide_step_size = temp_config.auto_hide_step_size;
global_config.explicit_hide_step_size =
temp_config.explicit_hide_step_size;
global_config.tooltips_enabled = temp_config.tooltips_enabled;
global_config.show_small_icons = temp_config.show_small_icons;
global_config.movement_type = temp_config.movement_type;
memcpy(&global_config,&temp_config,sizeof(GlobalConfig));
apply_global_config();
}
......@@ -239,6 +233,27 @@ misc_notebook_page(void)
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE,
CONFIG_PADDING_SIZE);
/* Logout frame */
frame = gtk_frame_new (_("Log Out"));
gtk_container_border_width(GTK_CONTAINER (frame), CONFIG_PADDING_SIZE);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE,
CONFIG_PADDING_SIZE);
/* vbox for frame */
box = gtk_vbox_new (FALSE, CONFIG_PADDING_SIZE);
gtk_container_border_width(GTK_CONTAINER (box), CONFIG_PADDING_SIZE);
gtk_container_add (GTK_CONTAINER (frame), box);
/* Small Icons */
button = gtk_check_button_new_with_label (_("Prompt before logout"));
if (temp_config.prompt_for_logout)
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button), TRUE);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
GTK_SIGNAL_FUNC (set_toggle_button_value),
&(temp_config.prompt_for_logout));
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE,
CONFIG_PADDING_SIZE);
return (vbox);
}
......@@ -257,14 +272,7 @@ panel_config_global(void)
if (config_window)
return;
temp_config.minimize_delay = global_config.minimize_delay;
temp_config.minimized_size = global_config.minimized_size;
temp_config.auto_hide_step_size = global_config.auto_hide_step_size;
temp_config.explicit_hide_step_size =
global_config.explicit_hide_step_size;
temp_config.tooltips_enabled = global_config.tooltips_enabled;
temp_config.show_small_icons = global_config.show_small_icons;
temp_config.movement_type = global_config.movement_type;
memcpy(&temp_config,&global_config,sizeof(GlobalConfig));
/* main window */
config_window = gnome_property_box_new ();
......
......@@ -11,6 +11,7 @@ struct _GlobalConfig {
gint minimize_delay;
gint tooltips_enabled;
gint show_small_icons;
gint prompt_for_logout;
PanelMovementType movement_type;
};
......
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