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

Remove favourites menu. It is useless with the current push towards

Sat Dec 08 23:16:39 2001  George Lebl <jirka@5z.com>

	* menu.[ch], menu-fentry.h, menu-util.c, menu-properties.c,
	  session.c, main.c, gnome-run.c:  Remove favourites menu.  It is
	  useless with the current push towards editable menus.  Also instead
	  of running gedit, run nautilus on programs:/ as a menu editor.

	* panel-widget.c: fix warning.

	* applet.c, foobar-widget.c: use gtk image menu items instead of
	  normal items where appropriate.
parent a12a1341
Sat Dec 08 23:16:39 2001 George Lebl <jirka@5z.com>
* menu.[ch], menu-fentry.h, menu-util.c, menu-properties.c,
session.c, main.c, gnome-run.c: Remove favourites menu. It is
useless with the current push towards editable menus. Also instead
of running gedit, run nautilus on programs:/ as a menu editor.
* panel-widget.c: fix warning.
* applet.c, foobar-widget.c: use gtk image menu items instead of
normal items where appropriate.
Sat Dec 08 11:28:37 2001 George Lebl <jirka@5z.com>
* gnome-run.c, launcher.c, menu.c, swallow.c: Use the new desktop
......
......@@ -363,7 +363,7 @@ setup_an_item(AppletUserMenu *menu,
GtkWidget *submenu,
int is_submenu)
{
menu->menuitem = gtk_menu_item_new ();
menu->menuitem = gtk_image_menu_item_new ();
g_signal_connect (G_OBJECT (menu->menuitem), "destroy",
G_CALLBACK (gtk_widget_destroyed),
&menu->menuitem);
......@@ -477,7 +477,7 @@ applet_setup_panel_menu (gboolean is_basep)
GtkWidget *panel_menu;
gchar *pixmap_path;
menuitem = gtk_menu_item_new ();
menuitem = gtk_image_menu_item_new ();
pixmap_path = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP,
"gnome-panel.png", TRUE, NULL);
......@@ -514,7 +514,7 @@ panel_applet_create_menu (AppletInfo *info,
if (!commie_mode) {
GtkWidget *image;
menuitem = gtk_menu_item_new ();
menuitem = gtk_image_menu_item_new ();
image = gtk_image_new_from_stock (GTK_STOCK_REMOVE,
GTK_ICON_SIZE_MENU);
......@@ -528,7 +528,7 @@ panel_applet_create_menu (AppletInfo *info,
gtk_menu_shell_append (GTK_MENU_SHELL (info->menu), menuitem);
menuitem = gtk_menu_item_new();
menuitem = gtk_image_menu_item_new();
/*
* FIXME: should have a "Move" pixmap.
......@@ -548,7 +548,7 @@ panel_applet_create_menu (AppletInfo *info,
gtk_menu_shell_append (GTK_MENU_SHELL (info->menu), menuitem);
if (info->user_menu) {
menuitem = gtk_menu_item_new ();
menuitem = gtk_image_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (info->menu), menuitem);
......
......@@ -323,7 +323,7 @@ append_gmc_item (GtkWidget *menu, const char *label, char *flag)
{
GtkWidget *item;
item = gtk_menu_item_new_with_label (label);
item = gtk_image_menu_item_new_with_label (label);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (gmc_client), flag);
......@@ -403,7 +403,7 @@ append_desktop_menu (GtkWidget *menu_bar)
for (i=0; arrange[i]; i+=2)
append_gmc_item (menu, _(arrange[i]), arrange[i+1]);
item = gtk_menu_item_new_with_label (_("Arrange Icons"));
item = gtk_image_menu_item_new_with_label (_("Arrange Icons"));
gmc_menu_items = g_list_prepend (gmc_menu_items, item);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu);
......@@ -529,15 +529,9 @@ append_folder_menu (GtkWidget *menu_bar, const char *label,
menu = create_fake_menu_at (path,
FALSE /* applets */,
FALSE /* launcher_add */,
FALSE /* favourites_add */,
label /* dir_name */,
NULL /* pixmap_name */,
FALSE /* title */);
#ifdef FIXME /*EVIL!!*/
if (path != NULL && strcmp (path, "apps") == 0)
/* This will add the add submenu thingie */
start_favourites_menu (menu, TRUE /* fake_submenus */);
#endif
if (menu == NULL) {
g_warning (_("menu wasn't created"));
......@@ -570,7 +564,7 @@ append_folder_menu (GtkWidget *menu_bar, const char *label,
static void
append_gnomecal_item (GtkWidget *menu, const char *label, const char *flag)
{
GtkWidget *item = gtk_menu_item_new_with_label (label);
GtkWidget *item = gtk_image_menu_item_new_with_label (label);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (gnomecal_client), flag);
......@@ -665,7 +659,7 @@ append_format_item (GtkWidget *menu, const char *format)
}
hour[sizeof(hour)-1] = '\0'; /* just for sanity */
item = gtk_menu_item_new_with_label (hour);
item = gtk_image_menu_item_new_with_label (hour);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (set_fooclock_format),
......@@ -711,7 +705,7 @@ append_clock_menu (FoobarWidget *foo, GtkWidget *menu_bar)
menu = gtk_menu_new ();
#if 0 /* put back when evolution can do this */
item = gtk_menu_item_new_with_label (_("Add appointement..."));
item = gtk_image_menu_item_new_with_label (_("Add appointement..."));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
add_menu_separator (menu);
......@@ -719,7 +713,7 @@ append_clock_menu (FoobarWidget *foo, GtkWidget *menu_bar)
time_admin_path = g_find_program_in_path ("time-admin");
if (time_admin_path) {
item = gtk_menu_item_new_with_label (_("Set Time"));
item = gtk_image_menu_item_new_with_label (_("Set Time"));
g_signal_connect (G_OBJECT (item), "activate",
G_CALLBACK (set_time_cb), time_admin_path);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
......@@ -737,7 +731,7 @@ append_clock_menu (FoobarWidget *foo, GtkWidget *menu_bar)
add_tearoff (GTK_MENU_SHELL (menu2));
item = gtk_menu_item_new_with_label (_("Format"));
item = gtk_image_menu_item_new_with_label (_("Format"));
gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu2);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
......@@ -1216,9 +1210,6 @@ foobar_widget_instance_init (FoobarWidget *foo)
FALSE /* strech_right */);
#if 0
foo->favorites =
append_folder_menu(menu_bar, _("Favorites"), NULL,
"favorites:/");
foo->settings =
append_folder_menu(menu_bar, _("Settings"), NULL,
"programs:/Settings/");
......@@ -1391,9 +1382,6 @@ foobar_widget_force_menu_remake (void)
if (foo->settings != NULL)
gtk_object_set_data (GTK_OBJECT(foo->settings),
"need_reread", GINT_TO_POINTER(1));
if (foo->favorites != NULL)
gtk_object_set_data (GTK_OBJECT(foo->favorites),
"need_reread", GINT_TO_POINTER(1));
}
}
......
......@@ -37,7 +37,6 @@ struct _FoobarWidget
guint clock_timeout;
GtkWidget *programs;
GtkWidget *favorites;
GtkWidget *settings;
GHashTable *tasks;
......
......@@ -201,8 +201,6 @@ run_dialog_response (GtkWidget *w, int response, gpointer data)
char **envv = NULL;
int envc;
gboolean use_advanced;
gboolean add_to_favourites;
GtkWidget *favorites;
use_advanced = gnome_config_get_bool ("/panel/State/"ADVANCED_DIALOG_KEY"=false");
......@@ -217,9 +215,6 @@ run_dialog_response (GtkWidget *w, int response, gpointer data)
clist = gtk_object_get_data (GTK_OBJECT (run_dialog), "dentry_list");
terminal = GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT(w),
"terminal"));
favorites = gtk_object_get_data (GTK_OBJECT (run_dialog), "favorites");
add_to_favourites = GTK_TOGGLE_BUTTON (favorites)->active;
if (gtk_object_get_data (GTK_OBJECT (run_dialog), "use_list")) {
char *name;
......@@ -259,8 +254,6 @@ run_dialog_response (GtkWidget *w, int response, gpointer data)
}
if (ditem != NULL) {
if (add_to_favourites)
panel_add_favourite (name);
gnome_desktop_item_unref (ditem);
}
}
......@@ -917,11 +910,6 @@ unset_selected (GtkWidget *dialog)
gtk_clist_set_selection_mode (GTK_CLIST (clist),
GTK_SELECTION_SINGLE);
gtk_clist_unselect_all (GTK_CLIST (clist));
/* Can't add non-listed items to favorites for now. */
gtk_widget_set_sensitive (gtk_object_get_data (GTK_OBJECT (dialog),
"favorites"),
FALSE);
}
static void
......@@ -987,11 +975,6 @@ select_row_handler (GtkCList *clist,
}
sync_list_to_entry (dialog);
/* Allow adding to favorites */
gtk_widget_set_sensitive (gtk_object_get_data (GTK_OBJECT (dialog),
"favorites"),
TRUE);
}
static GtkWidget*
......@@ -1003,7 +986,6 @@ create_simple_contents (void)
GtkWidget *pixmap;
GtkWidget *clist;
GtkWidget *hbox;
GtkWidget *favorites;
char *titles[2];
vbox = gtk_vbox_new (FALSE, 1);
......@@ -1062,10 +1044,6 @@ create_simple_contents (void)
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
#endif
favorites = gtk_check_button_new_with_label (_("Add this program to Favorites"));
gtk_object_set_data (GTK_OBJECT (run_dialog), "favorites", favorites);
gtk_box_pack_start (GTK_BOX (vbox), favorites, FALSE, FALSE, 0);
unset_selected (run_dialog);
w = create_toggle_advanced_button ("");
......@@ -1222,66 +1200,3 @@ show_run_dialog_with_text (const char *text)
gtk_entry_set_text(GTK_ENTRY(entry), text);
}
static void
drag_data_get_cb (GtkWidget *widget,
GdkDragContext *context,
GtkSelectionData *selection_data,
guint info,
guint time,
gpointer data)
{
char *foo;
foo = g_strdup_printf ("RUN:%d", find_applet (widget));
gtk_selection_data_set (selection_data,
selection_data->target, 8, (guchar *)foo,
strlen (foo));
g_free (foo);
}
static GtkWidget *
create_run_widget(void)
{
static GtkTargetEntry dnd_targets[] = {
{ "application/x-panel-applet-internal", 0, 0 }
};
GtkWidget *button;
char *pixmap_name;
pixmap_name = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP,
"gnome-run.png", TRUE, NULL);
button = button_widget_new(pixmap_name,-1,
MISC_POBJECT,
FALSE,
PANEL_ORIENT_UP,
_("Run..."));
/*A hack since this function only pretends to work on window
widgets (which we actually kind of are) this will select
some (already selected) events on the panel instead of
the button window (where they are also selected) but
we don't mind*/
GTK_WIDGET_UNSET_FLAGS (button, GTK_NO_WINDOW);
gtk_drag_source_set (button,
GDK_BUTTON1_MASK,
dnd_targets, 1,
GDK_ACTION_COPY | GDK_ACTION_MOVE);
GTK_WIDGET_SET_FLAGS (button, GTK_NO_WINDOW);
g_signal_connect (G_OBJECT (button), "drag_data_get",
G_CALLBACK (drag_data_get_cb),
NULL);
g_free(pixmap_name);
gtk_tooltips_set_tip (panel_tooltips, button, _("Run..."), NULL);
g_signal_connect(G_OBJECT(button), "clicked",
G_CALLBACK(show_run_dialog), NULL);
return button;
}
......@@ -16,7 +16,6 @@ struct _MenuFinfo {
char *menudir;
gboolean applets;
gboolean launcher_add;
gboolean favourites_add;
char *dir_name;
char *pixmap_name;
gboolean fake_menu;
......
......@@ -41,8 +41,6 @@ struct _MenuDialogInfo {
GtkWidget *global_main;
GtkWidget *system;
GtkWidget *system_sub;
GtkWidget *user;
GtkWidget *user_sub;
GtkWidget *applets;
GtkWidget *applets_sub;
GtkWidget *distribution;
......@@ -109,29 +107,6 @@ get_pixmap (const char *menudir, gboolean main_menu)
return pixmap_name;
}
static gboolean
got_gmenu (void)
{
static gboolean checked = FALSE;
static gboolean got_it = FALSE;
char *tmp;
if (checked)
return got_it;
tmp = g_find_program_in_path ("gmenu");
if (tmp != NULL)
got_it = TRUE;
else
got_it = FALSE;
g_free (tmp);
checked = TRUE;
return got_it;
}
static void
properties_apply_callback (Menu *menu)
{
......@@ -178,9 +153,7 @@ properties_apply_callback (Menu *menu)
GTK_TOGGLE_BUTTON (menu->dialog_info->global_main)->active) {
menu->main_menu = TRUE;
if (got_gmenu ()) {
need_edit_menus = TRUE;
}
need_edit_menus = TRUE;
} else {
s = gnome_file_entry_get_full_path (GNOME_FILE_ENTRY (menu->dialog_info->pathentry),
TRUE);
......@@ -223,11 +196,6 @@ properties_apply_callback (Menu *menu)
else if (GTK_TOGGLE_BUTTON(menu->dialog_info->system)->active)
menu->main_menu_flags |= MAIN_MENU_SYSTEM;
if(GTK_TOGGLE_BUTTON(menu->dialog_info->user_sub)->active)
menu->main_menu_flags |= MAIN_MENU_USER_SUB;
else if (GTK_TOGGLE_BUTTON (menu->dialog_info->user)->active)
menu->main_menu_flags |= MAIN_MENU_USER;
if(GTK_TOGGLE_BUTTON(menu->dialog_info->applets_sub)->active)
menu->main_menu_flags |= MAIN_MENU_APPLETS_SUB;
else if (GTK_TOGGLE_BUTTON (menu->dialog_info->applets)->active)
......@@ -532,13 +500,6 @@ create_properties_dialog (Menu *menu)
&menu->dialog_info->system_sub,
menu->main_menu_flags & MAIN_MENU_SYSTEM,
menu->main_menu_flags & MAIN_MENU_SYSTEM_SUB);
add_menu_type_options(menu,
GTK_OBJECT(dialog), GTK_TABLE(table),1,
_("Favorites: "),
&menu->dialog_info->user,
&menu->dialog_info->user_sub,
menu->main_menu_flags & MAIN_MENU_USER,
menu->main_menu_flags & MAIN_MENU_USER_SUB);
add_menu_type_options(menu,
GTK_OBJECT(dialog), GTK_TABLE(table),2,
_("Applets: "),
......
......@@ -28,7 +28,7 @@ add_menu_separator (GtkWidget *menu)
{
GtkWidget *menuitem;
menuitem = gtk_menu_item_new ();
menuitem = gtk_separator_menu_item_new ();
gtk_widget_set_sensitive (menuitem, FALSE);
gtk_widget_show (menuitem);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
......@@ -186,9 +186,8 @@ get_default_menu_flags (void)
{
DistributionType distribution = get_distribution_type();
int flags = MAIN_MENU_SYSTEM_SUB | MAIN_MENU_USER_SUB |
MAIN_MENU_APPLETS_SUB | MAIN_MENU_PANEL_SUB |
MAIN_MENU_DESKTOP;
int flags = MAIN_MENU_SYSTEM_SUB | MAIN_MENU_APPLETS_SUB |
MAIN_MENU_PANEL_SUB | MAIN_MENU_DESKTOP;
/*guess distribution menus*/
if (distribution != DISTRIBUTION_UNKNOWN)
......
This diff is collapsed.
......@@ -7,17 +7,14 @@
G_BEGIN_DECLS
enum {
MAIN_MENU_USER = 1<<0,
MAIN_MENU_USER_SUB = 1<<1,
/* FIXME: should we move this array or keep the bitvalues
* the same??? */
MAIN_MENU_SYSTEM = 1<<2,
MAIN_MENU_SYSTEM_SUB = 1<<3,
MAIN_MENU_DISTRIBUTION = 1<<4,
MAIN_MENU_DISTRIBUTION_SUB = 1<<5,
MAIN_MENU_KDE = 1<<6,
MAIN_MENU_KDE_SUB = 1<<7,
/* keep this for compatibility. */
MAIN_MENU_OBSOLETE_DEBIAN = 1<<8,
MAIN_MENU_OBSOLETE_DEBIAN_SUB = 1<<9,
MAIN_MENU_APPLETS = 1<<10,
MAIN_MENU_APPLETS_SUB = 1<<11,
MAIN_MENU_PANEL = 1<<12,
......@@ -92,7 +89,6 @@ GtkWidget * create_menu_at (GtkWidget *menu,
const char *menudir,
gboolean applets,
gboolean launcher_add,
gboolean favourites_add,
const char *dir_name,
const char *pixmap_name,
gboolean fake_submenus,
......@@ -101,12 +97,9 @@ GtkWidget * create_menu_at (GtkWidget *menu,
GtkWidget * create_fake_menu_at (const char *menudir,
gboolean applets,
gboolean launcher_add,
gboolean favourites_add,
const char *dir_name,
const char *pixmap_name,
gboolean title);
GtkWidget * start_favourites_menu (GtkWidget *menu,
gboolean fake_submenus);
void submenu_to_display (GtkWidget *menuw, gpointer data);
gboolean menu_need_reread (GtkWidget *menuw);
......@@ -123,8 +116,6 @@ GtkWidget * create_root_menu (GtkWidget *root_menu,
/* some gtk code cut-n-paste action */
void our_gtk_menu_position (GtkMenu *menu);
void panel_add_favourite (const char *source_dentry);
/* perhaps into basep-widget.h? */
enum {
HIDEBUTTONS_PIXMAP,
......
......@@ -948,7 +948,6 @@ make_background(PanelWidget *panel, guchar *rgb_buf,
}
} else {
int i, j;
int size;
int r,g,b;
guchar *p;
if(panel->back_type != PANEL_BACK_COLOR) {
......
......@@ -880,7 +880,7 @@ drop_url(PanelWidget *panel, int pos, const char *url)
static void
drop_menu (PanelWidget *panel, int pos, const char *dir)
{
int flags = MAIN_MENU_SYSTEM | MAIN_MENU_USER;
int flags = MAIN_MENU_SYSTEM;
DistributionType distribution = get_distribution_type ();
/*guess distribution menus*/
......
......@@ -97,14 +97,6 @@ apply_global_config (void)
static int old_avoid_collisions = -1;
GSList *li;
#ifdef FIXME
panel_widget_change_global (global_config.hiding_step_size,
global_config.minimized_size,
global_config.minimize_delay,
global_config.maximize_delay,
global_config.movement_type,
global_config.disable_animations);
#endif
if (global_config.tooltips_enabled)
gtk_tooltips_enable (panel_tooltips);
else
......@@ -210,16 +202,6 @@ apply_global_config (void)
}
#ifdef FIXME /* Keep this code until a new one is done for applets */
static void
timeout_dlg_realized (GtkWidget *dialog)
{
#if FIXME
/* always make top layer */
gnome_win_hints_set_layer (GTK_WIDGET(dialog),
WIN_LAYER_ABOVE_DOCK);
#endif
}
static gboolean
session_save_timeout (gpointer data)
{
......@@ -253,10 +235,6 @@ session_save_timeout (gpointer data)
_("Continue waiting"),
2); /* FIXME: GNOME_STOCK_PIXMAP_TIMER */
g_signal_connect_after (G_OBJECT(ss_timeout_dlg), "realize",
G_CALLBACK (timeout_dlg_realized),
NULL);
if (1 == gtk_dialog_run (GTK_DIALOG (ss_timeout_dlg))) {
ss_cookie++;
g_warning(_("Timed out on sending session save to an applet"));
......
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