Commit 816a5fd8 authored by Morten Welinder's avatar Morten Welinder

Dead Kittens: even more pruning of GTK_STOCK_ stuff.

This starts the button part of the mess.
parent 68d1a841
......@@ -29,6 +29,7 @@
#include <gnm-plugin.h>
#include <gnumeric-conf.h>
#include <gui-file.h>
#include <gui-util.h>
#include <gutils.h>
#include <print-cell.h>
#include <print.h>
......@@ -197,7 +198,7 @@ cb_gognm_save (G_GNUC_UNUSED GtkAction *a, WBCGtk *wbcg)
static GtkActionEntry const actions[] = {
/* File */
{ "FileSaveEmbed", GTK_STOCK_SAVE, NULL,
{ "FileSaveEmbed", GNM_N_STOCK_SAVE, NULL,
NULL, N_("Save the embedded workbook"),
G_CALLBACK (cb_gognm_save) }
};
......
......@@ -262,10 +262,8 @@ query_connection_info (const gchar *dsn, const gchar *user, const gchar *passwor
dialog = gtk_dialog_new_with_buttons(_("Database Connection"),
NULL,
GTK_DIALOG_MODAL,
GTK_STOCK_OK,
GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT,
GNM_STOCK_OK, GTK_RESPONSE_ACCEPT,
GNM_STOCK_CANCEL, GTK_RESPONSE_REJECT,
NULL);
login = gdaui_login_new (NULL);
......
......@@ -305,6 +305,7 @@ src/gnm-so-polygon.c
src/gui-clipboard.c
src/gui-file.c
src/gui-util.c
src/gui-util.h
src/gutils.c
src/history.c
src/hlink.c
......
This diff is collapsed.
......@@ -2,6 +2,7 @@
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include "dialogs.h"
#include "gui-util.h"
static void
cb_accept_password (G_GNUC_UNUSED GtkWidget *IGNORED, GtkDialog *d)
......@@ -37,8 +38,8 @@ dialog_get_password (GtkWindow *parent, const char *filename)
d = gtk_dialog_new_with_buttons ("", parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
GNM_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GNM_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL);
gtk_window_set_resizable (GTK_WINDOW (d), FALSE);
hb = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
......
......@@ -157,8 +157,8 @@ dialog_so_styled (WBCGtk *wbcg,
gnumeric_init_help_button (help, "sect-graphics-drawings");
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
GNM_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GNM_STOCK_OK, GTK_RESPONSE_OK,
NULL);
editor = go_style_get_editor (orig, default_style,
......
......@@ -690,7 +690,7 @@ run_solver (SolverState *state, GnmSolverParameters *param)
state->run.ok_button =
go_gtk_dialog_add_button (dialog,
_("OK"),
GNM_STOCK_OK,
GTK_STOCK_OK,
GTK_RESPONSE_YES);
......
......@@ -205,8 +205,8 @@ cb_format_clicked (GtkButton *widget, gpointer _i)
(_("Format Selector"),
GTK_WINDOW (pagedata->dialog),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
GNM_STOCK_OK, GTK_RESPONSE_ACCEPT,
GNM_STOCK_CANCEL, GTK_RESPONSE_REJECT,
NULL);
GOFormatSel *format_selector
= GO_FORMAT_SEL (go_format_sel_new_full (TRUE));
......
......@@ -342,8 +342,8 @@ gui_file_open (WBCGtk *wbcg, GnmFileOpenStyle type, char const *default_format)
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (fsel))),
advanced_button, FALSE, TRUE, 6);
gtk_dialog_add_buttons (GTK_DIALOG (fsel),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
GNM_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GNM_STOCK_OPEN, GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (fsel), GTK_RESPONSE_OK);
......@@ -569,8 +569,8 @@ gui_file_save_as (WBCGtk *wbcg, WorkbookView *wb_view, GnmFileSaveAsStyle type,
"title", title,
NULL));
gtk_dialog_add_buttons (GTK_DIALOG (fsel),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
GNM_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GNM_STOCK_SAVE, GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (fsel), GTK_RESPONSE_OK);
......
......@@ -144,6 +144,28 @@ void
gnm_cell_renderer_text_copy_background_to_cairo (GtkCellRendererText *crt,
cairo_t *cr);
/*
* These macros exist to replace the old gtk+ stock items. Note, that these only
* cover strings with mnemonics. I.e., you must handle icons and accelerators
* in some other way. (So why do we have them in the first place? To ensure
* the user interface is as consistent as possible.)
*/
#define GNM_STOCK_OPEN g_dpgettext2(GETTEXT_PACKAGE, "Stock label", GNM_N_STOCK_OPEN)
#define GNM_N_STOCK_OPEN NC_("Stock label", "_Open")
#define GNM_STOCK_SAVE g_dpgettext2(GETTEXT_PACKAGE, "Stock label", GNM_N_STOCK_SAVE)
#define GNM_N_STOCK_SAVE NC_("Stock label", "_Save")
#define GNM_STOCK_SAVE_AS g_dpgettext2(GETTEXT_PACKAGE, "Stock label", GNM_N_STOCK_SAVE_AS)
#define GNM_N_STOCK_SAVE_AS NC_("Stock label", "Save _As")
#define GNM_STOCK_CANCEL g_dpgettext2(GETTEXT_PACKAGE, "Stock label", GNM_N_STOCK_CANCEL)
#define GNM_N_STOCK_CANCEL NC_("Stock label", "_Cancel")
#define GNM_STOCK_OK g_dpgettext2(GETTEXT_PACKAGE, "Stock label", GNM_N_STOCK_OK)
#define GNM_N_STOCK_OK NC_("Stock label", "_OK")
G_END_DECLS
#endif /* _GNM_GUI_UTIL_H_ */
......@@ -194,8 +194,8 @@ soc_cb_save_as (SheetObject *so, SheetControl *sc)
GtkWidget *dlg = gtk_file_chooser_dialog_new (_("Save as"),
GTK_WINDOW (wbcg_toplevel (wbcg)),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GNM_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
GNM_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
NULL);
GtkFileFilter *filter = gtk_file_filter_new ();
gtk_file_filter_add_mime_type (filter, go_component_get_mime_type (soc->component));
......@@ -267,8 +267,8 @@ static void
gnm_soc_populate_menu (SheetObject *so, GPtrArray *actions)
{
static SheetObjectAction const soc_actions[] = {
{ GTK_STOCK_SAVE_AS, N_("_Save As"), NULL, 0, soc_cb_save_as },
{ GTK_STOCK_SAVE_AS, N_("_Save As Image"), NULL, 0, soc_cb_save_as_image }
{ "document-save", GNM_N_STOCK_SAVE, NULL, 0, soc_cb_save_as },
{ "document-save-as", N_("_Save As Image"), NULL, 0, soc_cb_save_as_image }
};
unsigned int i;
......
......@@ -396,9 +396,9 @@ static void
gnm_sog_populate_menu (SheetObject *so, GPtrArray *actions)
{
static SheetObjectAction const sog_actions[] = {
{ GTK_STOCK_SAVE_AS, N_("_Save As Image"), NULL, 0, sog_cb_save_as, NULL },
{ NULL, N_("Open in _New Window"), NULL, 0, sog_cb_open_in_new_window, NULL },
{ NULL, N_("Copy to New Graph S_heet"), NULL, 0, sog_cb_copy_to_new_sheet, NULL }
{ "document-save-as", N_("_Save As Image"), NULL, 0, sog_cb_save_as, NULL },
{ NULL, N_("Open in _New Window"), NULL, 0, sog_cb_open_in_new_window, NULL },
{ NULL, N_("Copy to New Graph S_heet"), NULL, 0, sog_cb_copy_to_new_sheet, NULL }
};
unsigned int i;
......
......@@ -361,7 +361,7 @@ static void
gnm_soi_populate_menu (SheetObject *so, GPtrArray *actions)
{
static SheetObjectAction const soi_action =
{ GTK_STOCK_SAVE_AS, N_("_Save As Image"), NULL, 0, soi_cb_save_as };
{ "document-save-as", N_("_Save As Image"), NULL, 0, soi_cb_save_as };
gnm_soi_parent_class->populate_menu (so, actions);
go_ptr_array_insert (actions, (gpointer) &soi_action, 1);
}
......
......@@ -232,7 +232,7 @@ sheet_object_populate_menu_real (SheetObject *so, GPtrArray *actions)
static SheetObjectAction const so_actions [] = {
{ "gtk-properties", NULL, NULL, 0, sheet_object_get_editor, sheet_object_can_prop},
{ NULL, NULL, NULL, 0, NULL, NULL },
{ "gtk-copy", NULL, NULL, 0, cb_so_copy, NULL },
{ "edit-copy", N_("_Copy"), NULL, 0, cb_so_copy, NULL },
};
for (i = 0 ; i < G_N_ELEMENTS (so_actions); i++)
g_ptr_array_add (actions, (gpointer) (so_actions + i));
......@@ -240,6 +240,7 @@ sheet_object_populate_menu_real (SheetObject *so, GPtrArray *actions)
static SheetObjectAction const so_actions [] = {
{ GTK_STOCK_PROPERTIES, NULL, NULL, 0, sheet_object_get_editor, sheet_object_can_prop},
{ NULL, NULL, NULL, 0, NULL, NULL },
#warning "Two high dubious icon names here"
{ GTK_STOCK_LEAVE_FULLSCREEN, N_("Size _& Position"), NULL, 0, cb_so_size_position, NULL },
{ GTK_STOCK_FULLSCREEN, N_("_Snap to Grid"), NULL, 0, cb_so_snap_to_grid, NULL },
{ NULL, N_("_Order"), NULL, 1, NULL, NULL },
......@@ -249,11 +250,11 @@ sheet_object_populate_menu_real (SheetObject *so, GPtrArray *actions)
{ NULL, N_("Pus_h to Back"), NULL, 0, cb_so_push_to_back, NULL },
{ NULL, NULL, NULL, -1, NULL, NULL },
{ NULL, NULL, NULL, 0, NULL, NULL },
{ GTK_STOCK_CUT, NULL, NULL, 0, cb_so_cut, NULL },
{ GTK_STOCK_COPY, NULL, NULL, 0, cb_so_copy, NULL },
{ GTK_STOCK_DELETE, NULL, NULL, 0, cb_so_delete, NULL },
{ "edit-cut", N_("Cu_t"), NULL, 0, cb_so_cut, NULL },
{ "edit-copy", N_("_Copy"), NULL, 0, cb_so_copy, NULL },
{ "edit-delete", N_("_Delete"), NULL, 0, cb_so_delete, NULL },
{ NULL, NULL, NULL, 0, NULL, NULL },
{ GTK_STOCK_PRINT, NULL, NULL, 0, cb_so_print, sheet_object_can_print},
{ "document-print", N_("Print"), NULL, 0, cb_so_print, sheet_object_can_print},
};
for (i = 0; i < G_N_ELEMENTS (so_actions); i++)
g_ptr_array_add (actions, (gpointer) (so_actions + i));
......@@ -1356,7 +1357,7 @@ sheet_object_build_menu (SheetObjectView *view,
if (a->label != NULL) {
item = gtk_image_menu_item_new_with_mnemonic (_(a->label));
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item),
gtk_image_new_from_stock (a->icon, GTK_ICON_SIZE_MENU));
gtk_image_new_from_icon_name (a->icon, GTK_ICON_SIZE_MENU));
} else
item = gtk_image_menu_item_new_from_stock (a->icon, NULL);
} else if (a->label != NULL)
......
......@@ -12,6 +12,7 @@
#include "workbook-control.h"
#include "gnm-marshalers.h"
#include "dao.h"
#include "gui-util.h"
#include "gnm-i18n.h"
#include <gsf/gsf-impl-utils.h>
#include <gsf/gsf-output-stdio.h>
......@@ -2047,7 +2048,7 @@ gnm_sub_solver_locate_binary (const char *binary, const char *solver,
NULL));
g_free (title);
gtk_dialog_add_buttons (GTK_DIALOG (fsel),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GNM_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_EXECUTE, GTK_RESPONSE_OK,
NULL);
g_object_ref (fsel);
......
......@@ -1394,8 +1394,8 @@ static GNM_ACTION_DEF (cb_launch_go_component_from_file)
GtkWidget *dlg = gtk_file_chooser_dialog_new (_("Choose object file"),
GTK_WINDOW (wbcg_toplevel (wbcg)),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GNM_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
GNM_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
NULL);
go_components_add_filter (GTK_FILE_CHOOSER (dlg));
if (gtk_dialog_run (GTK_DIALOG (dlg)) == GTK_RESPONSE_ACCEPT) {
......@@ -2000,13 +2000,13 @@ static GtkActionEntry const permanent_actions[] = {
{ "FileNew", "document-new", N_("_New"),
"<control>n", N_("Create a new workbook"),
G_CALLBACK (cb_file_new) },
{ "FileOpen", "document-open", N_("_Open"),
{ "FileOpen", "document-open", GNM_N_STOCK_OPEN,
"<control>o", N_("Open a file"),
G_CALLBACK (cb_file_open) },
{ "FileSave", "document-save", N_("_Save"),
{ "FileSave", "document-save", GNM_N_STOCK_SAVE,
"<control>s", N_("Save the current workbook"),
G_CALLBACK (cb_file_save) },
{ "FileSaveAs", "document-save-as", N_("Save _As"),
{ "FileSaveAs", "document-save-as", GNM_N_STOCK_SAVE_AS,
"<control><shift>s", N_("Save the current workbook with a different name"),
G_CALLBACK (cb_file_save_as) },
{ "FileSend", "gnumeric-link-email", N_("Sen_d To..."),
......
......@@ -899,7 +899,7 @@ wbcg_edit_start (WBCGtk *wbcg,
go_gtk_dialog_add_button
(GTK_DIALOG (d), _("Remove format"), GTK_STOCK_REMOVE,
GNM_RESPONSE_REMOVE);
gtk_dialog_add_button (GTK_DIALOG (d), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (GTK_DIALOG (d), GNM_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_set_default_response (GTK_DIALOG (d), GTK_RESPONSE_CANCEL);
check = gtk_check_button_new_with_label (_("Show this dialog next time."));
......
......@@ -1794,9 +1794,9 @@ wbcg_show_save_dialog (WBCGtk *wbcg, Workbook *wb)
go_gtk_dialog_add_button (GTK_DIALOG(d), _("Discard"),
GTK_STOCK_DELETE, GTK_RESPONSE_NO);
go_gtk_dialog_add_button (GTK_DIALOG(d), _("Don't close"),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
GNM_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (GTK_DIALOG(d), GTK_STOCK_SAVE, GTK_RESPONSE_YES);
gtk_dialog_add_button (GTK_DIALOG(d), GNM_STOCK_SAVE, GTK_RESPONSE_YES);
gtk_dialog_set_default_response (GTK_DIALOG (d), GTK_RESPONSE_YES);
ret = go_gtk_dialog_run (GTK_DIALOG (d), wbcg_toplevel (wbcg));
g_free (msg);
......@@ -2893,7 +2893,7 @@ wbcg_validation_msg (WorkbookControl *wbc, ValidationStyle v,
break;
case GNM_VALIDATION_STYLE_INFO :
res0 = GNM_VALIDATION_STATUS_VALID;
btn0 = GTK_STOCK_OK;
btn0 = GNM_STOCK_OK;
btn1 = NULL;
type = GTK_MESSAGE_INFO;
break;
......
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