Commit 52efbb42 authored by Jacob Berkman's avatar Jacob Berkman Committed by Jacob Berkman

call the internal gnome-run instead of the external one

1999-12-11  Jacob Berkman  <jberkman@andrew.cmu.edu>

* global-keys.c (panel_global_keys_filter): call the internal
gnome-run instead of the external one

* gnome-run.[ch] (stolen from gnome-run): pop up a "run program"
dialog

* menu-fentry.c (fr_check_and_reread): plug mem leak found
by memprof
parent cc975e91
1999-12-11 Jacob Berkman <jberkman@andrew.cmu.edu>
* global-keys.c (panel_global_keys_filter): call the internal
gnome-run instead of the external one
* gnome-run.[ch] (stolen from gnome-run): pop up a "run program"
dialog
* menu-fentry.c (fr_check_and_reread): plug mem leak found
by memprof
1999-12-10 Jacob Berkman <jberkman@andrew.cmu.edu>
* panel.c (panel_destroy): reset current_panel if we destroy
......
1999-12-11 Jacob Berkman <jberkman@andrew.cmu.edu>
* global-keys.c (panel_global_keys_filter): call the internal
gnome-run instead of the external one
* gnome-run.[ch] (stolen from gnome-run): pop up a "run program"
dialog
* menu-fentry.c (fr_check_and_reread): plug mem leak found
by memprof
1999-12-10 Jacob Berkman <jberkman@andrew.cmu.edu>
* panel.c (panel_destroy): reset current_panel if we destroy
......
......@@ -128,7 +128,9 @@ panel_SOURCES=\
rgb-stuff.h \
rgb-stuff.c \
global-keys.c \
global-keys.h
global-keys.h \
gnome-run.c \
gnome-run.h
panel_LDADD = libpanel_applet.la $(GNOME_LIBDIR) $(GNORBA_LIBS) $(ORB_LIBS) \
$(GNOMEUI_LIBS) $(INTLLIBS) @PIXBUF_LIBS@
......
......@@ -6,6 +6,7 @@
#include "global-keys.h"
#include "applet.h"
#include "panel-include.h"
#include "gnome-run.h"
extern GSList *panel_list;
......@@ -51,11 +52,8 @@ panel_global_keys_filter(GdkXEvent *gdk_xevent, GdkEvent *event)
switch(ks) {
case XK_R:
case XK_r:
{
char * const mystr[] = {"gnome-run"};
gnome_execute_async (NULL, 1, mystr);
}
break;
show_run_dialog ();
break;
default:
num_subkeys--;
break;
......
/*
* grun: Popup a command dialog. Original version by Elliot Lee,
* bloatware edition by Havoc Pennington. Both versions written in 10
* minutes or less. :-)
* Copyright (C) 1998 Havoc Pennington <hp@pobox.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#include <config.h>
#include <gnome.h>
#include <errno.h>
#include "gnome-run.h"
static void
string_callback (GtkWidget *w, int button_num, gpointer data)
{
GnomeFileEntry *fentry;
GnomeEntry *entry;
char *s, *t;
if (button_num != 0)
return;
fentry = GNOME_FILE_ENTRY (data);
entry = GNOME_ENTRY (gnome_file_entry_gnome_entry (fentry));
s = gtk_editable_get_chars (GTK_EDITABLE (
gnome_file_entry_gtk_entry (fentry)),
0, -1);
gnome_entry_load_history (entry);
gnome_entry_prepend_history (entry, 1, s);
gnome_entry_save_history (entry);
gnome_config_sync ();
if (gnome_execute_shell (NULL, s) >= 0) {
g_free (s);
return;
}
/* this probably will never happen, since most systems have sh */
t = g_strdup_printf(_("Failed to execute command:\n"
"%s\n"
"%s"),
s, g_unix_error_string(errno));
gnome_error_dialog (t);
g_free (s);
g_free (t);
}
void
show_run_dialog ()
{
GtkWidget *dialog;
GtkWidget *fentry;
GtkWidget *entry;
dialog = gnome_dialog_new(_("Run Program"),
_("Run"), _("Cancel"),
NULL);
gnome_dialog_set_default (GNOME_DIALOG (dialog), 0);
gnome_dialog_set_close (GNOME_DIALOG (dialog), TRUE);
fentry = gnome_file_entry_new( "gnome-run",
_("Select a program to run"));
gnome_entry_load_history (GNOME_ENTRY (
gnome_file_entry_gnome_entry (GNOME_FILE_ENTRY (fentry))));
gtk_window_set_focus (GTK_WINDOW (dialog),
gnome_file_entry_gtk_entry (
GNOME_FILE_ENTRY (fentry)));
gtk_signal_connect(GTK_OBJECT (dialog), "clicked",
GTK_SIGNAL_FUNC (string_callback), fentry);
entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (fentry));
gnome_dialog_editable_enters (GNOME_DIALOG (dialog), GTK_EDITABLE (
gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (fentry))));
gtk_container_add (GTK_CONTAINER (GNOME_DIALOG (dialog)->vbox),
GTK_WIDGET (fentry));
gtk_widget_show_all (GTK_WIDGET (dialog));
}
/*
* grun: Popup a command dialog. Original version by Elliot Lee,
* bloatware edition by Havoc Pennington. Both versions written in 10
* minutes or less. :-)
* Copyright (C) 1998 Havoc Pennington <hp@pobox.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#ifndef __GNOME_RUN_H__
#define __GNOME_RUN_H__
void show_run_dialog (void);
#endif __GNOME_RUN_H__
......@@ -335,8 +335,10 @@ fr_check_and_reread(FileRec *fr)
ddr = (DirRec *)ffr;
p = g_concat_dir_and_file(ffr->name,
".directory");
if (ddr->dentrylast_stat >= curtime-1)
if (ddr->dentrylast_stat >= curtime-1) {
g_free (p);
break;
}
if(stat(p,&s)==-1) {
if(dr->dentrymtime) {
g_free(ffr->icon);
......
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