Commit 6af6d568 authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz
Browse files

new file, containing defines for all named icons we use. So that the names

2007-05-12  Vincent Untz  <vuntz@gnome.org>

	* panel-icon-names.h: new file, containing defines for all named icons
	we use. So that the names are easy to change.
	* Makefile.am: add new file
	* drawer.c: (create_drawer_applet):
	* drawer.h:
	* gnome-desktop-item-edit.c: (main):
	* launcher.c: (setup_button):
	* main.c: (main):
	* menu.c: (create_submenu_entry):
	* panel-action-button.c:
	* panel-addto.c:
	* panel-context-menu.c: (panel_context_menu_show_about_dialog):
	* panel-ditem-editor.c: (setup_icon_entry):
	* panel-force-quit.c: (display_popup_window):
	* panel-force-quit.h:
	* panel-logout.c: (panel_logout_new):
	* panel-menu-bar.c: (panel_menu_bar_init):
	* panel-menu-bar.h:
	* panel-menu-button.c: (panel_menu_button_get_icon):
	* panel-menu-button.h:
	* panel-menu-items.c: (panel_place_menu_item_append_gtk_bookmarks),
	(panel_place_menu_item_create_menu), (panel_place_menu_item_new):
	* panel-run-dialog.c: (panel_run_dialog_set_default_icon):
	* panel-run-dialog.h:
	* panel-separator.h:
	* panel-stock-icons.c:
	* panel.c: (drop_url), (drop_urilist), (panel_receive_dnd_data):
	Update to use the new macros

svn path=/trunk/; revision=10353
parent d21b3186
2007-05-12 Vincent Untz <vuntz@gnome.org>
* panel-icon-names.h: new file, containing defines for all named icons
we use. So that the names are easy to change.
* Makefile.am: add new file
* drawer.c: (create_drawer_applet):
* drawer.h:
* gnome-desktop-item-edit.c: (main):
* launcher.c: (setup_button):
* main.c: (main):
* menu.c: (create_submenu_entry):
* panel-action-button.c:
* panel-addto.c:
* panel-context-menu.c: (panel_context_menu_show_about_dialog):
* panel-ditem-editor.c: (setup_icon_entry):
* panel-force-quit.c: (display_popup_window):
* panel-force-quit.h:
* panel-logout.c: (panel_logout_new):
* panel-menu-bar.c: (panel_menu_bar_init):
* panel-menu-bar.h:
* panel-menu-button.c: (panel_menu_button_get_icon):
* panel-menu-button.h:
* panel-menu-items.c: (panel_place_menu_item_append_gtk_bookmarks),
(panel_place_menu_item_create_menu), (panel_place_menu_item_new):
* panel-run-dialog.c: (panel_run_dialog_set_default_icon):
* panel-run-dialog.h:
* panel-separator.h:
* panel-stock-icons.c:
* panel.c: (drop_url), (drop_urilist), (panel_receive_dnd_data):
Update to use the new macros
2007-05-12 Vincent Untz <vuntz@gnome.org>
 
* panel-util.[ch]: (panel_util_key_file_ensure_C_key): new
......
......@@ -148,6 +148,7 @@ panel_headers = \
panel-gdm.h \
panel-power-manager.h \
panel-ditem-editor.h \
panel-icon-names.h \
$(NULL)
gnome_panel_SOURCES = \
......
......@@ -29,6 +29,7 @@
#include "xstuff.h"
#include "panel-globals.h"
#include "panel-lockdown.h"
#include "panel-icon-names.h"
static void
drawer_click (GtkWidget *w, Drawer *drawer)
......@@ -334,7 +335,7 @@ create_drawer_applet (PanelToplevel *toplevel,
drawer->toplevel = toplevel;
if (!use_custom_icon || !custom_icon || !custom_icon [0]) {
drawer->button = button_widget_new (PANEL_DRAWER_ICON, TRUE,
drawer->button = button_widget_new (PANEL_ICON_DRAWER, TRUE,
orientation);
} else {
drawer->button = button_widget_new (custom_icon, TRUE,
......
......@@ -5,8 +5,6 @@
G_BEGIN_DECLS
#define PANEL_DRAWER_ICON "gnome-panel-drawer"
#define PANEL_DRAWER_N_LISTENERS 3
typedef struct {
......
......@@ -9,6 +9,7 @@
#include "panel-ditem-editor.h"
#include "panel-util.h"
#include "panel-icon-names.h"
#include "nothing.cP"
......@@ -168,7 +169,7 @@ main (int argc, char * argv[])
GNOME_PARAM_GOPTION_CONTEXT, context,
NULL);
gtk_window_set_default_icon_name ("gnome-panel-launcher");
gtk_window_set_default_icon_name (PANEL_ICON_LAUNCHER);
if (desktops == NULL ||
desktops[0] == NULL) {
......
......@@ -38,6 +38,7 @@
#include "panel-lockdown.h"
#include "panel-compatibility.h"
#include "panel-ditem-editor.h"
#include "panel-icon-names.h"
static GdkScreen *
launcher_get_screen (Launcher *launcher)
......@@ -617,7 +618,7 @@ setup_button (Launcher *launcher)
icon = guess_icon_from_exec (BUTTON_WIDGET (launcher->button)->icon_theme,
launcher->key_file);
if (!icon)
icon = g_strdup ("gnome-panel-launcher");
icon = g_strdup (PANEL_ICON_LAUNCHER);
button_widget_set_icon_name (BUTTON_WIDGET (launcher->button), icon);
g_free (icon);
......
......@@ -25,6 +25,7 @@
#include "panel-stock-icons.h"
#include "panel-action-protocol.h"
#include "panel-lockdown.h"
#include "panel-icon-names.h"
#include "xstuff.h"
#include "nothing.cP"
......@@ -64,7 +65,7 @@ main (int argc, char **argv)
GNOME_PROGRAM_STANDARD_PROPERTIES,
NULL);
gtk_window_set_default_icon_name ("gnome-panel");
gtk_window_set_default_icon_name (PANEL_ICON_PANEL);
if (!panel_shell_register ())
return -1;
......
......@@ -47,6 +47,7 @@
#include "panel-globals.h"
#include "panel-run-dialog.h"
#include "panel-lockdown.h"
#include "panel-icon-names.h"
typedef struct {
GtkWidget *pixmap;
......@@ -1425,7 +1426,7 @@ create_submenu_entry (GtkWidget *menu,
panel_menu_icon_get_size (),
NULL,
gmenu_tree_directory_get_icon (directory),
"gnome-fs-directory");
PANEL_ICON_FOLDER);
setup_menuitem (menuitem,
panel_menu_icon_get_size (),
......
......@@ -47,6 +47,7 @@
#include "panel-logout.h"
#include "panel-compatibility.h"
#include "panel-gdm.h"
#include "panel-icon-names.h"
G_DEFINE_TYPE (PanelActionButton, panel_action_button, BUTTON_TYPE_WIDGET);
......@@ -277,7 +278,7 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_LOCK,
"gnome-lockscreen",
PANEL_ICON_LOCKSCREEN,
N_("Lock Screen"),
N_("Protect your computer from unauthorized use"),
"gospanel-21",
......@@ -289,7 +290,7 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_LOGOUT,
"gnome-logout",
PANEL_ICON_LOGOUT,
/* when changing one of those two strings, don't forget to
* update the ones in panel-menu-items.c (look for
* panel:showusername|1) */
......@@ -302,7 +303,7 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_RUN,
PANEL_RUN_ICON,
PANEL_ICON_RUN,
N_("Run Application..."),
N_("Run an application by typing a command or choosing from a list"),
"gospanel-555",
......@@ -312,7 +313,7 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_SEARCH,
"gnome-searchtool",
PANEL_ICON_SEARCHTOOL,
N_("Search for Files..."),
N_("Locate documents and folders on this computer by name or content"),
"gospanel-554",
......@@ -321,7 +322,7 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_FORCE_QUIT,
PANEL_FORCE_QUIT_ICON,
PANEL_ICON_FORCE_QUIT,
N_("Force Quit"),
N_("Force a misbehaving application to quit"),
"gospanel-563",
......@@ -331,7 +332,7 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_CONNECT_SERVER,
"gnome-globe", //FIXME icon
PANEL_ICON_REMOTE, //FIXME icon
N_("Connect to Server..."),
N_("Connect to a remote computer or shared disk"),
"gospanel-563", //FIXME
......@@ -340,7 +341,7 @@ static PanelAction actions [] = {
},
{
PANEL_ACTION_SHUTDOWN,
"gnome-shutdown",
PANEL_ICON_SHUTDOWN,
N_("Shut Down..."),
N_("Shut down the computer"),
"gospanel-20",
......
......@@ -43,6 +43,7 @@
#include "panel-util.h"
#include "panel-profile.h"
#include "panel-addto.h"
#include "panel-icon-names.h"
typedef struct {
PanelWidget *panel_widget;
......@@ -109,7 +110,7 @@ static PanelAddtoItemInfo special_addto_items [] = {
{ PANEL_ADDTO_LAUNCHER_NEW,
N_("Custom Application Launcher"),
N_("Create a new launcher"),
"gnome-panel-launcher",
PANEL_ICON_LAUNCHER,
PANEL_ACTION_NONE,
NULL,
NULL,
......@@ -120,7 +121,7 @@ static PanelAddtoItemInfo special_addto_items [] = {
{ PANEL_ADDTO_LAUNCHER_MENU,
N_("Application Launcher..."),
N_("Copy a launcher from the applications menu"),
"gnome-panel-launcher",
PANEL_ICON_LAUNCHER,
PANEL_ACTION_NONE,
NULL,
NULL,
......@@ -135,7 +136,7 @@ static PanelAddtoItemInfo internal_addto_items [] = {
{ PANEL_ADDTO_MENU,
N_("Main Menu"),
N_("The main GNOME menu"),
PANEL_MAIN_MENU_ICON,
PANEL_ICON_MAIN_MENU,
PANEL_ACTION_NONE,
NULL,
NULL,
......@@ -146,7 +147,7 @@ static PanelAddtoItemInfo internal_addto_items [] = {
{ PANEL_ADDTO_MENUBAR,
N_("Menu Bar"),
N_("A custom menu bar"),
PANEL_GNOME_LOGO_ICON,
PANEL_ICON_MAIN_MENU,
PANEL_ACTION_NONE,
NULL,
NULL,
......@@ -157,7 +158,7 @@ static PanelAddtoItemInfo internal_addto_items [] = {
{ PANEL_ADDTO_SEPARATOR,
N_("Separator"),
N_("A separator to organize the panel items"),
PANEL_SEPARATOR_ICON,
PANEL_ICON_SEPARATOR,
PANEL_ACTION_NONE,
NULL,
NULL,
......@@ -168,7 +169,7 @@ static PanelAddtoItemInfo internal_addto_items [] = {
{ PANEL_ADDTO_DRAWER,
N_("Drawer"),
N_("A pop out drawer to store other items in"),
PANEL_DRAWER_ICON,
PANEL_ICON_DRAWER,
PANEL_ACTION_NONE,
NULL,
NULL,
......
......@@ -44,6 +44,7 @@
#include "panel-properties-dialog.h"
#include "panel-lockdown.h"
#include "panel-addto.h"
#include "panel-icon-names.h"
static void
panel_context_menu_show_help (GtkWidget *w,
......@@ -131,7 +132,7 @@ panel_context_menu_show_about_dialog (GtkWidget *menuitem)
"authors", authors,
"documenters", documenters,
"translator-credits", _("translator-credits"),
"logo-icon-name", "gnome-panel",
"logo-icon-name", PANEL_ICON_PANEL,
NULL);
gtk_window_set_wmclass (GTK_WINDOW (about), "about_dialog", "Panel");
......
......@@ -33,6 +33,7 @@
#include <libgnomeui/gnome-help.h>
#include <libgnomevfs/gnome-vfs.h>
#include "panel-ditem-editor.h"
#include "panel-icon-names.h"
#include "panel-util.h"
#include "panel-marshal.h"
......@@ -1142,9 +1143,9 @@ setup_icon_entry (PanelDItemEditor *dialog,
if (!icon_name || icon_name[0] == '\0') {
if (panel_ditem_editor_get_item_type (dialog) == PANEL_DITEM_EDITOR_TYPE_DIRECTORY) {
buffer = g_strdup ("folder");
buffer = g_strdup (PANEL_ICON_FOLDER);
} else {
buffer = g_strdup ("gnome-panel-launcher");
buffer = g_strdup (PANEL_ICON_LAUNCHER);
}
} else {
buffer = g_strdup (icon_name);
......
......@@ -32,6 +32,7 @@
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include "panel-icon-names.h"
#include "panel-stock-icons.h"
GdkFilterReturn popup_filter (GdkXEvent *gdk_xevent,
......@@ -66,7 +67,7 @@ display_popup_window (GdkScreen *screen)
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
image = gtk_image_new_from_icon_name (PANEL_FORCE_QUIT_ICON,
image = gtk_image_new_from_icon_name (PANEL_ICON_FORCE_QUIT,
GTK_ICON_SIZE_DIALOG);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.5);
gtk_box_pack_start (GTK_BOX (vbox), image, TRUE, TRUE, 4);
......
......@@ -29,8 +29,6 @@
G_BEGIN_DECLS
#define PANEL_FORCE_QUIT_ICON "gnome-panel-force-quit"
void panel_force_quit (GdkScreen *screen);
G_END_DECLS
......
#ifndef PANEL_ICON_NAMES_H
#define PANEL_ICON_NAMES_H
#define PANEL_ICON_BOOKMARKS "stock_bookmark"
#define PANEL_ICON_DESKTOP "user-desktop"
#define PANEL_ICON_DRAWER "gnome-panel-drawer"
#define PANEL_ICON_FOLDER "folder"
#define PANEL_ICON_FORCE_QUIT "gnome-panel-force-quit"
#define PANEL_ICON_LAUNCHER "gnome-panel-launcher"
#define PANEL_ICON_LOCKSCREEN "system-lock-screen"
#define PANEL_ICON_LOGOUT "gnome-logout"
#define PANEL_ICON_MAIN_MENU "start-here"
#define PANEL_ICON_PANEL "gnome-panel"
#define PANEL_ICON_REMOTE "applications-internet"
#define PANEL_ICON_RUN "system-run"
#define PANEL_ICON_SEPARATOR "gnome-panel-separator"
#define PANEL_ICON_SEARCHTOOL "gnome-searchtool"
#define PANEL_ICON_SHUTDOWN "gnome-shutdown"
#define PANEL_ICON_UNKNOWN "gnome-unknown"
#endif /* PANEL_ICON_NAMES_H */
......@@ -34,6 +34,7 @@
#include "panel-gdm.h"
#include "panel-power-manager.h"
#include "panel-session.h"
#include "panel-icon-names.h"
#define PANEL_LOGOUT_DIALOG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_LOGOUT_DIALOG, PanelLogoutDialogPrivate))
......@@ -311,7 +312,7 @@ panel_logout_new (PanelLogoutDialogType type,
switch (type) {
case PANEL_LOGOUT_DIALOG_LOGOUT:
icon_name = "gnome-logout";
icon_name = PANEL_ICON_LOGOUT;
primary_text = _("Log out of this system now?");
// FIXME need to verify that this response can be used
logout_dialog->priv->default_response = PANEL_LOGOUT_DIALOG_LOGOUT;
......@@ -328,7 +329,7 @@ panel_logout_new (PanelLogoutDialogType type,
PANEL_LOGOUT_RESPONSE_LOGOUT);
break;
case PANEL_LOGOUT_DIALOG_SHUTDOWN:
icon_name = "gnome-shutdown";
icon_name = PANEL_ICON_SHUTDOWN;
primary_text = _("Shut down this system now?");
logout_dialog->priv->default_response = PANEL_LOGOUT_RESPONSE_SHUTDOWN;
......
......@@ -42,6 +42,7 @@
#include "panel-lockdown.h"
#include "panel-stock-icons.h"
#include "panel-typebuiltins.h"
#include "panel-icon-names.h"
G_DEFINE_TYPE (PanelMenuBar, panel_menu_bar, GTK_TYPE_MENU_BAR);
......@@ -182,7 +183,7 @@ panel_menu_bar_init (PanelMenuBar *menubar)
menubar->priv->applications_menu = create_applications_menu ("applications.menu", NULL);
menubar->priv->applications_item = gtk_image_menu_item_new_with_label (_("Applications"));
image = gtk_image_new_from_icon_name (PANEL_GNOME_LOGO_ICON,
image = gtk_image_new_from_icon_name (PANEL_ICON_MAIN_MENU,
panel_menu_bar_icon_get_size ());
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menubar->priv->applications_item),
image);
......
......@@ -30,8 +30,6 @@
G_BEGIN_DECLS
#define PANEL_GNOME_LOGO_ICON "start-here"
#define PANEL_TYPE_MENU_BAR (panel_menu_bar_get_type ())
#define PANEL_MENU_BAR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PANEL_TYPE_MENU_BAR, PanelMenuBar))
#define PANEL_MENU_BAR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PANEL_TYPE_MENU_BAR, PanelMenuBarClass))
......
......@@ -39,6 +39,7 @@
#include "menu.h"
#include "panel-lockdown.h"
#include "panel-a11y.h"
#include "panel-icon-names.h"
G_DEFINE_TYPE (PanelMenuButton, panel_menu_button, BUTTON_TYPE_WIDGET);
......@@ -709,7 +710,7 @@ panel_menu_button_get_icon (PanelMenuButton *button)
}
if (!retval)
retval = g_strdup (PANEL_MAIN_MENU_ICON);
retval = g_strdup (PANEL_ICON_MAIN_MENU);
return retval;
}
......
......@@ -31,8 +31,6 @@
G_BEGIN_DECLS
#define PANEL_MAIN_MENU_ICON "start-here"
#define PANEL_TYPE_MENU_BUTTON (panel_menu_button_get_type ())
#define PANEL_MENU_BUTTON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PANEL_TYPE_MENU_BUTTON, PanelMenuButton))
#define PANEL_MENU_BUTTON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PANEL_TYPE_MENU_BUTTON, PanelMenuButtonClass))
......
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