Sync to laptop - Federico

This commit is contained in:
Miguel de Icaza 1998-11-25 23:58:43 +00:00
parent 414c7569f2
commit b7f32b7c2e
4 changed files with 57 additions and 5 deletions

View File

@ -1,3 +1,12 @@
1998-11-25 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gpopup.c (gpopup_do_popup): Hide the edit/view separator if
those items were disabled, too.
* gdesktop-icon.c (desktop_icon_realize): Added
WIN_STATE_FIXED_POSITION and WIN_STATE_ARRANGE_IGNORE to the
window hints for the desktop icons.
1998-11-24 Federico Mena Quintero <federico@nuclecu.unam.mx> 1998-11-24 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdesktop.c (desktop_icon_info_event): Run the popup menu for the * gdesktop.c (desktop_icon_info_event): Run the popup menu for the

View File

@ -166,6 +166,7 @@ desktop_icon_realize (GtkWidget *widget)
if (gnome_win_hints_wm_exists ()) { if (gnome_win_hints_wm_exists ()) {
gnome_win_hints_set_layer (widget, WIN_LAYER_DESKTOP); gnome_win_hints_set_layer (widget, WIN_LAYER_DESKTOP);
gnome_win_hints_set_state (widget, WIN_STATE_FIXED_POSITION | WIN_STATE_ARRANGE_IGNORE);
gnome_win_hints_set_hints (widget, gnome_win_hints_set_hints (widget,
(WIN_HINTS_SKIP_FOCUS (WIN_HINTS_SKIP_FOCUS
| WIN_HINTS_SKIP_WINLIST | WIN_HINTS_SKIP_WINLIST

View File

@ -11,6 +11,8 @@
#include "util.h" #include "util.h"
#include <gnome.h> #include <gnome.h>
#include "gpopup.h" #include "gpopup.h"
#define WANT_WIDGETS /* yuck */
#include "main.h"
#include "../vfs/vfs.h" #include "../vfs/vfs.h"
@ -36,7 +38,8 @@ enum {
POPUP_OPEN_WITH_PROGRAM = 2, POPUP_OPEN_WITH_PROGRAM = 2,
POPUP_OPEN_WITH_ARGUMENTS = 3, POPUP_OPEN_WITH_ARGUMENTS = 3,
POPUP_VIEW = 5, POPUP_VIEW = 5,
POPUP_EDIT = 6 POPUP_EDIT = 6,
POPUP_VIEW_EDIT_SEPARATOR = 7
}; };
/* The generic popup menu */ /* The generic popup menu */
@ -64,12 +67,18 @@ static GnomeUIInfo popup_info[] = {
GNOMEUIINFO_END GNOMEUIINFO_END
}; };
struct popup_file_info {
char *filename;
WPanel *panel;
};
int int
gpopup_do_popup (char *filename, int from_panel, GdkEventButton *event) gpopup_do_popup (char *filename, WPanel *from_panel, GdkEventButton *event)
{ {
GtkWidget *popup; GtkWidget *popup;
struct stat s; struct stat s;
int result; int result;
struct popup_file_info pfi;
if (mc_stat (filename, &s) != 0) { if (mc_stat (filename, &s) != 0) {
g_warning ("Could not stat %s, no popup menu will be run", filename); g_warning ("Could not stat %s, no popup menu will be run", filename);
@ -87,6 +96,7 @@ gpopup_do_popup (char *filename, int from_panel, GdkEventButton *event)
gtk_widget_hide (popup_info[POPUP_OPEN_WITH_ARGUMENTS].widget); gtk_widget_hide (popup_info[POPUP_OPEN_WITH_ARGUMENTS].widget);
gtk_widget_hide (popup_info[POPUP_VIEW].widget); gtk_widget_hide (popup_info[POPUP_VIEW].widget);
gtk_widget_hide (popup_info[POPUP_EDIT].widget); gtk_widget_hide (popup_info[POPUP_EDIT].widget);
gtk_widget_hide (popup_info[POPUP_VIEW_EDIT_SEPARATOR].widget);
} else { } else {
gtk_widget_hide (popup_info[POPUP_OPEN_IN_NEW_WINDOW].widget); gtk_widget_hide (popup_info[POPUP_OPEN_IN_NEW_WINDOW].widget);
@ -98,7 +108,10 @@ gpopup_do_popup (char *filename, int from_panel, GdkEventButton *event)
/* Go! */ /* Go! */
result = gnome_popup_menu_do_popup_modal (popup, NULL, NULL, event, filename); pfi.filename = filename;
pfi.panel = from_panel;
result = gnome_popup_menu_do_popup_modal (popup, NULL, NULL, event, &pfi);
gtk_widget_destroy (popup); gtk_widget_destroy (popup);
return result; return result;
@ -107,65 +120,93 @@ gpopup_do_popup (char *filename, int from_panel, GdkEventButton *event)
static void static void
popup_open (GtkWidget *widget, gpointer data) popup_open (GtkWidget *widget, gpointer data)
{ {
/* FIXME */ struct popup_file_info *pfi;
struct stat s;
pfi = data;
if (mc_stat (pfi->filename, &s) != 0) {
g_warning ("Could not stat %s", pfi->filename);
return;
}
if (S_ISDIR (s.st_mode)) {
/* Open the directory in the panel the menu was activated from */
g_assert (pfi->panel != NULL);
do_panel_cd (pfi->panel, pfi->filename, cd_exact);
}
/* FIXME: add other cases */
} }
static void static void
popup_open_new_window (GtkWidget *widget, gpointer data) popup_open_new_window (GtkWidget *widget, gpointer data)
{ {
/* FIXME */ /* FIXME */
g_warning ("Implement this function!");
} }
static void static void
popup_open_with_program (GtkWidget *widget, gpointer data) popup_open_with_program (GtkWidget *widget, gpointer data)
{ {
/* FIXME */ /* FIXME */
g_warning ("Implement this function!");
} }
static void static void
popup_open_with_arguments (GtkWidget *widget, gpointer data) popup_open_with_arguments (GtkWidget *widget, gpointer data)
{ {
/* FIXME */ /* FIXME */
g_warning ("Implement this function!");
} }
static void static void
popup_view (GtkWidget *widget, gpointer data) popup_view (GtkWidget *widget, gpointer data)
{ {
/* FIXME */ /* FIXME */
g_warning ("Implement this function!");
} }
static void static void
popup_edit (GtkWidget *widget, gpointer data) popup_edit (GtkWidget *widget, gpointer data)
{ {
/* FIXME */ /* FIXME */
g_warning ("Implement this function!");
} }
static void static void
popup_move (GtkWidget *widget, gpointer data) popup_move (GtkWidget *widget, gpointer data)
{ {
/* FIXME */ /* FIXME */
g_warning ("Implement this function!");
} }
static void static void
popup_copy (GtkWidget *widget, gpointer data) popup_copy (GtkWidget *widget, gpointer data)
{ {
/* FIXME */ /* FIXME */
g_warning ("Implement this function!");
} }
static void static void
popup_link (GtkWidget *widget, gpointer data) popup_link (GtkWidget *widget, gpointer data)
{ {
/* FIXME */ /* FIXME */
g_warning ("Implement this function!");
} }
static void static void
popup_delete (GtkWidget *widget, gpointer data) popup_delete (GtkWidget *widget, gpointer data)
{ {
/* FIXME */ /* FIXME */
g_warning ("Implement this function!");
} }
static void static void
popup_properties (GtkWidget *widget, gpointer data) popup_properties (GtkWidget *widget, gpointer data)
{ {
/* FIXME */ /* FIXME */
g_warning ("Implement this function!");
} }

View File

@ -11,9 +11,10 @@
#include <gdk/gdktypes.h> #include <gdk/gdktypes.h>
#include "panel.h"
int gpopup_do_popup (char *filename, int from_panel, GdkEventButton *event); int gpopup_do_popup (char *filename, WPanel *from_panel, GdkEventButton *event);
#endif #endif