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

added one more special applet icon for the gnome-run thing. To make it

Sun Apr 02 15:43:23 2000  George Lebl <jirka@5z.com>

	* gnome-run.[ch],menu.c,sesssion.c,applet.h: added one more special
	  applet icon for the gnome-run thing.  To make it consistent and be
  	  able to drag it onto the panel just like logout or lock

  	* foobar-widget.c: just move gnome-run.h below all the includes
parent bccac607
Sun Apr 02 15:43:23 2000 George Lebl <jirka@5z.com>
* gnome-run.[ch],menu.c,sesssion.c,applet.h: added one more special
applet icon for the gnome-run thing. To make it consistent and be
able to drag it onto the panel just like logout or lock
* foobar-widget.c: just move gnome-run.h below all the includes
2000-04-02 Martin Baulig <martin@home-of-linux.org>
* help/C/figures/Makefile.am: Moved $(figs_DATA) stuff here. This
......
Sun Apr 02 15:43:23 2000 George Lebl <jirka@5z.com>
* gnome-run.[ch],menu.c,sesssion.c,applet.h: added one more special
applet icon for the gnome-run thing. To make it consistent and be
able to drag it onto the panel just like logout or lock
* foobar-widget.c: just move gnome-run.h below all the includes
2000-04-02 Martin Baulig <martin@home-of-linux.org>
* help/C/figures/Makefile.am: Moved $(figs_DATA) stuff here. This
......
......@@ -141,6 +141,10 @@ applet_callback_callback(GtkWidget *widget, gpointer data)
if (strcmp (menu->name, "help") == 0)
panel_pbox_help_cb (NULL, 0, "specialobjects.html#STATUSDOC");
break;
case APPLET_RUN:
if (strcmp (menu->name, "help") == 0)
panel_pbox_help_cb (NULL, 0, "specialobjects.html#RUN");
break;
default: break;
}
}
......
......@@ -15,6 +15,7 @@ BEGIN_GNOME_DECLS
#define LAUNCHER_ID "Launcher"
#define LOCK_ID "Lock"
#define STATUS_ID "Status"
#define RUN_ID "Run"
typedef enum {
APPLET_EXTERN,
......@@ -27,7 +28,8 @@ typedef enum {
APPLET_LAUNCHER,
APPLET_EMPTY,
APPLET_LOCK,
APPLET_STATUS
APPLET_STATUS,
APPLET_RUN
} AppletType;
typedef struct _AppletUserMenu AppletUserMenu;
......
......@@ -14,7 +14,6 @@
#include "foobar-widget.h"
#include "gnome-run.h"
#include "menu.h"
#include "menu-util.h"
#include "session.h"
......@@ -24,6 +23,7 @@
#include "panel_config_global.h"
#include "panel-util.h"
#include "drawer-widget.h"
#include "gnome-run.h"
#define SMALL_ICON_SIZE 20
......
......@@ -24,11 +24,12 @@
#include <gnome.h>
#include <errno.h>
#include "gnome-run.h"
#include "panel-include.h"
#include "panel_config_global.h"
#include "panel-util.h"
#include "gnome-run.h"
extern GSList *applets_last;
extern GtkTooltips *panel_tooltips;
extern GlobalConfig global_config;
static void
......@@ -232,3 +233,43 @@ show_run_dialog ()
gtk_widget_show_all (dialog);
panel_set_dialog_layer (dialog);
}
static GtkWidget *
create_run_widget(void)
{
GtkWidget *button;
char *pixmap_name;
pixmap_name = gnome_pixmap_file("gnome-run.png");
button = button_widget_new(pixmap_name,-1,
MISC_TILE,
FALSE,
ORIENT_UP,
_("Run..."));
g_free(pixmap_name);
gtk_tooltips_set_tip (panel_tooltips, button, _("Run..."), NULL);
gtk_signal_connect(GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(show_run_dialog), NULL);
return button;
}
void
load_run_applet(PanelWidget *panel, int pos, gboolean exactpos)
{
GtkWidget *run;
run = create_run_widget();
if(!run)
return;
if (!register_toy(run, NULL, panel,
pos, exactpos, APPLET_RUN))
return;
applet_add_callback(applets_last->data, "help",
GNOME_STOCK_PIXMAP_HELP,
_("Help"));
}
......@@ -25,4 +25,6 @@
void show_run_dialog (void);
void load_run_applet(PanelWidget *panel, int pos, gboolean exactpos);
#endif /*__GNOME_RUN_H__*/
......@@ -1581,6 +1581,13 @@ add_lock_to_panel (GtkWidget *widget, gpointer data)
{
load_lock_applet(get_panel_from_menu_data(widget), 0, FALSE);
}
static void
add_run_to_panel (GtkWidget *widget, gpointer data)
{
load_run_applet(get_panel_from_menu_data(widget), 0, FALSE);
}
static void
try_add_status_to_panel (GtkWidget *widget, gpointer data)
{
......@@ -3612,6 +3619,17 @@ make_add_submenu (GtkWidget *menu, gboolean fake_submenus)
NULL);
setup_internal_applet_drag(menuitem, "LOCK:NEW");
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem_try_pixmap (menuitem,
"gnome-run.png",
_("Run button"), SMALL_ICON_SIZE);
gtk_menu_append (GTK_MENU (menu), menuitem);
gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
GTK_SIGNAL_FUNC(add_run_to_panel),
NULL);
setup_internal_applet_drag(menuitem, "RUN:NEW");
menuitem = gtk_menu_item_new ();
gtk_widget_lock_accelerators (menuitem);
setup_menuitem (menuitem,
......@@ -4194,7 +4212,7 @@ create_root_menu(gboolean fake_submenus, int flags, gboolean tearoff,
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (run_cb), NULL);
gtk_menu_append (GTK_MENU (root_menu), menuitem);
setup_internal_applet_drag(menuitem, "RUN:NEW");
if (((has_inline && !has_subs) || has_subs) && has_subs2)
add_menu_separator (root_menu);
......
......@@ -17,6 +17,7 @@
#include <gnome.h>
#include "panel-include.h"
#include "gnome-run.h"
#include "gnome-panel.h"
#define PANEL_EVENT_MASK (GDK_BUTTON_PRESS_MASK | \
......@@ -955,6 +956,8 @@ drop_internal_applet(PanelWidget *panel, int pos, char *applet_type)
ask_about_launcher(NULL, panel, pos, TRUE);
} else if(strcmp(applet_type,"STATUS:TRY")==0) {
load_status_applet(panel, pos, TRUE);
} else if(strcmp(applet_type,"RUN:NEW")==0) {
load_run_applet(panel, pos, TRUE);
}
}
......
......@@ -15,6 +15,7 @@
#include <gdk/gdkx.h>
#include <X11/keysym.h>
#include "panel-include.h"
#include "gnome-run.h"
#include "global-keys.h"
/*#define PANEL_DEBUG 1*/
......@@ -438,6 +439,9 @@ save_applet_configuration(AppletInfo *info)
case APPLET_STATUS:
gnome_config_set_string("id", STATUS_ID);
break;
case APPLET_RUN:
gnome_config_set_string("id", RUN_ID);
break;
default:
g_warning ("Unknown applet type encountered: %d; ignoring.",
info->type);
......@@ -881,6 +885,8 @@ init_user_applets(void)
load_lock_applet(panel, pos, TRUE);
} else if(strcmp(applet_name, STATUS_ID) == 0) {
load_status_applet(panel, pos, TRUE);
} else if(strcmp(applet_name, RUN_ID) == 0) {
load_run_applet(panel, pos, TRUE);
} else if(strcmp(applet_name, SWALLOW_ID) == 0) {
char *path = gnome_config_get_string("execpath=");
char *params = gnome_config_get_string("parameters=");
......
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