1
1

1999-04-06 Jonathan Blandford <jrb@redhat.com>

* gscreen.c: make sure that we bring up an open_with if
	open it.

	* gcmd.c (gnome_select): new selection dialog.

	* gdesktop-init.c (desktop_init_at): do not use access for it is
	poor when you are root.

1999-04-07  Jonathan Blandford  <jrb@redhat.com>

	* screen.c (do_enter_on_file_entry): added a consistent behaviour
	for GNOME stuff.
Этот коммит содержится в:
Jonathan Blandford 1999-04-07 23:26:49 +00:00
родитель 34f790657c
Коммит a92adc1479
11 изменённых файлов: 126 добавлений и 22 удалений

Просмотреть файл

@ -1,3 +1,13 @@
1999-04-06 Jonathan Blandford <jrb@redhat.com>
* gscreen.c: make sure that we bring up an open_with if
open it.
* gcmd.c (gnome_select): new selection dialog.
* gdesktop-init.c (desktop_init_at): do not use access for it is
poor when you are root.
1999-04-06 Federico Mena Quintero <federico@nuclecu.unam.mx>
* glayout.c (create_container): Use gtk_window_set_default_size(),

Просмотреть файл

@ -87,6 +87,7 @@ gmc_open_filename (char *fname, GList *args)
if (entry){
gnome_desktop_entry_launch (entry);
gnome_desktop_entry_free (entry);
return 1;
}
}

Просмотреть файл

@ -672,7 +672,7 @@ gnome_filter_cmd (GtkWidget *widget, WPanel *panel)
gtk_entry_set_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))), text3);
if (easy_patterns)
label = gtk_label_new (_("Enter a filter here for files in the panel view.\n\nFor example:\n*.gif will show just gif images"));
label = gtk_label_new (_("Enter a filter here for files in the panel view.\n\nFor example:\n*.png will show just png images"));
else
label = gtk_label_new (_("Enter a Regular Expression to filter files in the panel view."));
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
@ -808,3 +808,78 @@ gnome_new_launcher (GtkWidget *widget, WPanel *panel)
}
void
gnome_select (GtkWidget *widget, WPanel *panel)
{
char *reg_exp, *reg_exp_t;
int i;
int c;
int dirflag = 0;
GtkWidget *select_dialog;
GtkWidget *entry;
GtkWidget *label;
select_dialog = gnome_dialog_new (_("Select File"), GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL, NULL);
gtk_window_set_position (GTK_WINDOW (select_dialog), GTK_WIN_POS_MOUSE);
entry = gnome_entry_new ("mc_select");
gtk_entry_set_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))), easy_patterns ? "*" : ".");
gnome_entry_load_history (GNOME_ENTRY (entry));
if (easy_patterns)
label = gtk_label_new (_("Enter a filter here to select files in the panel view with.\n\nFor example:\n*.png will select all png images"));
else
label = gtk_label_new (_("Enter a regular expression here to select files in the panel view with."));
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (select_dialog)->vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (select_dialog)->vbox), entry, FALSE, FALSE, 0);
gtk_widget_show_all (GNOME_DIALOG (select_dialog)->vbox);
reg_exp = NULL;
if (gnome_dialog_run (GNOME_DIALOG (select_dialog)) == 0) {
gtk_widget_hide (select_dialog);
reg_exp = g_strdup (gtk_entry_get_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry)))));
}
gtk_widget_destroy (select_dialog);
if ((reg_exp == NULL) || (*reg_exp == '\000')) {
g_free (reg_exp);
return;
}
reg_exp_t = reg_exp;
/* Check if they specified a directory */
if (*reg_exp_t == PATH_SEP){
dirflag = 1;
reg_exp_t++;
}
if (reg_exp_t [strlen(reg_exp_t) - 1] == PATH_SEP){
dirflag = 1;
reg_exp_t [strlen(reg_exp_t) - 1] = 0;
}
for (i = 0; i < panel->count; i++){
if (!strcmp (panel->dir.list [i].fname, ".."))
continue;
if (S_ISDIR (panel->dir.list [i].buf.st_mode)){
if (!dirflag)
continue;
} else {
if (dirflag)
continue;
}
c = regexp_match (reg_exp_t, panel->dir.list [i].fname, match_file);
if (c == -1){
message (1, MSG_ERROR, _(" Malformed regular expression "));
g_free (reg_exp);
return;
}
if (c){
do_file_mark (panel, i, 1);
}
}
paint_panel (panel);
g_free (reg_exp);
}

Просмотреть файл

@ -24,5 +24,6 @@ void gnome_run_new (GtkWidget *widget, GnomeDesktopEntry *gde);
void gnome_mkdir_cmd (GtkWidget *widget, WPanel *panel);
void gnome_new_launcher (GtkWidget *widget, WPanel *panel);
void gnome_reverse_selection_cmd_panel (WPanel *panel);
void gnome_select (GtkWidget *widget, WPanel *panel);
#endif /* __GCMD_H */

Просмотреть файл

@ -81,6 +81,7 @@ desktop_init_at (const char *dir)
{
DIR *d;
struct dirent *dent;
struct stat s;
const int links_extlen = sizeof (".links")-1;
d = opendir (dir);
@ -92,11 +93,16 @@ desktop_init_at (const char *dir)
char *fname;
fname = g_concat_dir_and_file (dir, dent->d_name);
/*
* If it is an executable
*/
if (access (fname, X_OK) == 0){
if (stat (fname, &s) < 0) {
g_free (fname);
continue;
}
if (S_ISDIR (s.st_mode)) {
g_free (fname);
continue;
}
if (is_exe (s.st_mode)) {
/* let's try running it */
char *desktop_quoted;
char *command;

Просмотреть файл

@ -1152,6 +1152,7 @@ desktop_icon_info_open (DesktopIconInfo *dii)
new_panel_at (point);
g_free (point);
} else {
#if 0
if (S_ISDIR (fe->buf.st_mode) || link_isdir (fe))
new_panel_at (filename);
else {
@ -1185,6 +1186,12 @@ desktop_icon_info_open (DesktopIconInfo *dii)
} else
gmc_open_filename (filename, NULL);
}
#endif
/* we need to special case the new dir. Otherwise we'd try to cd */
if (S_ISDIR (fe->buf.st_mode) || link_isdir (fe))
new_panel_at (filename);
else
do_enter_on_file_entry (fe);
}
out:

Просмотреть файл

@ -395,7 +395,7 @@ GnomeUIInfo gnome_panel_file_menu [] = {
GnomeUIInfo gnome_panel_edit_menu [] = {
{ GNOME_APP_UI_ITEM, N_("Select _All"), N_("Select all files in the current Panel"), gnome_select_all_cmd,
NULL, NULL, 0, NULL, 'a', GDK_CONTROL_MASK },
GNOMEUIINFO_ITEM_NONE(N_("_Select Files..."), N_("Select a group of files"), select_cmd),
GNOMEUIINFO_ITEM_NONE(N_("_Select Files..."), N_("Select a group of files"), gnome_select),
GNOMEUIINFO_ITEM_NONE(N_("_Invert Selection"), N_("Reverses the list of tagged files"), reverse_selection_cmd),
GNOMEUIINFO_SEPARATOR,
{ GNOME_APP_UI_ITEM, N_("Search"), N_("Search for a file in the current Panel"), gnome_start_search,

Просмотреть файл

@ -573,12 +573,13 @@ gpopup_do_popup2 (GdkEventButton *event, WPanel *panel, DesktopIconInfo *dii)
static void
handle_open (GtkWidget *widget, WPanel *panel)
{
gchar *full_name;
DesktopIconInfo *dii;
full_name = get_full_filename (panel);
if (is_a_desktop_panel (panel)) {
gchar *full_name;
DesktopIconInfo *dii;
full_name = get_full_filename (panel);
dii = desktop_icon_info_get_by_filename (x_basename (full_name));
g_assert (dii != NULL);
@ -586,11 +587,7 @@ handle_open (GtkWidget *widget, WPanel *panel)
g_free (full_name);
return;
}
if (gmc_open_filename (full_name, 0))
return;
gmc_open_with (full_name);
g_free (full_name);
do_enter (panel);
}
static void

Просмотреть файл

@ -645,7 +645,7 @@ panel_configure_file_list (WPanel *panel, GtkWidget *sw, GtkWidget *file_list)
gtk_clist_set_selection_mode (GTK_CLIST (file_list), GTK_SELECTION_EXTENDED);
for (i = 0, format = panel->format; format; format = format->next) {
GtkJustification just;
GtkJustification just = GTK_JUSTIFY_LEFT;
if (!format->use_in_gui)
continue;
@ -1434,8 +1434,9 @@ panel_icon_list_select_icon (GtkWidget *widget, int index, GdkEvent *event, WPan
break;
case GDK_2BUTTON_PRESS:
if (event->button.button == 1)
if (event->button.button == 1) {
do_enter (panel);
}
break;
default:

Просмотреть файл

@ -1,3 +1,8 @@
1999-04-07 Jonathan Blandford <jrb@redhat.com>
* screen.c (do_enter_on_file_entry): added a consistent behaviour
for GNOME stuff.
1999-04-06 David Martin <dmartina@usa.net>
* info.c (text out of box and locale layout).

Просмотреть файл

@ -2084,20 +2084,21 @@ do_enter_on_file_entry (file_entry *fe)
#endif /* USE_VFS */
return 1;
} else {
char *p;
#ifdef HAVE_GNOME
if (gmc_open (fe))
return 1;
else
if (gmc_open (fe) == 0) {
return (gmc_open_with (fe->fname));
} else
return 0;
#else
char *p;
p = regex_command (fe->fname, "Open", NULL, 0);
#endif
if (p && (strcmp (p, "Success") == 0))
return 1;
else
return 0;
#endif
}
}
}