From 877f476198562db5a61f3055ad0c68e39f384174 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 15 Jul 2006 03:29:03 +0000 Subject: [PATCH] Added toolbar icons. Hopefully somebody will contribute some better ones. --- src/ui/gui/ChangeLog | 5 ++++ src/ui/gui/automake.mk | 8 ++++++- src/ui/gui/psppire.c | 52 +++++++++++++++++++++++++++++++++++++++- src/ui/gui/psppire.glade | 7 ++++++ 4 files changed, 70 insertions(+), 2 deletions(-) diff --git a/src/ui/gui/ChangeLog b/src/ui/gui/ChangeLog index f97d5651..e2555263 100644 --- a/src/ui/gui/ChangeLog +++ b/src/ui/gui/ChangeLog @@ -1,3 +1,8 @@ +Sat Jul 15 11:27:15 WST 2006 John Darrington + + * psppire.c psppire.glade automake.mk icons/* : Added toolbar icons where + there's no suitable gtk stock icon. + Tue Jul 4 09:08:38 WST 2006 John Darrington * psppire.c: Fixed --help and --version options. diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index 5115a642..a89df05b 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -22,7 +22,13 @@ src_ui_gui_psppiredir = $(pkgdatadir) dist_src_ui_gui_psppire_DATA = \ $(top_srcdir)/src/ui/gui/psppire.glade \ $(top_srcdir)/src/ui/gui/psppicon.png \ - $(top_srcdir)/src/ui/gui/pspplogo.png + $(top_srcdir)/src/ui/gui/pspplogo.png \ + $(top_srcdir)/src/ui/gui/icons/value-labels.png \ + $(top_srcdir)/src/ui/gui/icons/goto-variable.png\ + $(top_srcdir)/src/ui/gui/icons/insert-case.png \ + $(top_srcdir)/src/ui/gui/icons/split-file.png \ + $(top_srcdir)/src/ui/gui/icons/select-cases.png \ + $(top_srcdir)/src/ui/gui/icons/weight-cases.png src_ui_gui_psppire_SOURCES = \ diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index 78b56752..162f5bbc 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -71,6 +71,8 @@ give_help(void) PsppireVarStore *var_store = 0; +void create_icon_factory (void); + int main(int argc, char *argv[]) { @@ -106,7 +108,6 @@ main(int argc, char *argv[]) return 0; } - glade_init(); @@ -127,6 +128,8 @@ main(int argc, char *argv[]) data_store = psppire_data_store_new(the_dictionary); + create_icon_factory(); + /* load the interface */ xml = glade_xml_new(PKGDATADIR "/psppire.glade", NULL, NULL); @@ -218,3 +221,50 @@ parse_command_line (int *argc, char ***argv, gchar **filename, GError **err) } + +void +create_icon_factory (void) +{ + GtkIconFactory *factory = gtk_icon_factory_new(); + + GtkIconSet *icon_set; + + GdkPixbuf *pixbuf; + + pixbuf = gdk_pixbuf_new_from_file (PKGDATADIR "/value-labels.png", 0); + icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + gtk_icon_factory_add ( factory, "pspp-value-labels", icon_set); + + pixbuf = gdk_pixbuf_new_from_file (PKGDATADIR "/weight-cases.png", 0); + icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + gtk_icon_factory_add ( factory, "pspp-weight-cases", icon_set); + + pixbuf = gdk_pixbuf_new_from_file (PKGDATADIR "/goto-variable.png", 0); + icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + gtk_icon_factory_add ( factory, "pspp-goto-variable", icon_set); + + pixbuf = gdk_pixbuf_new_from_file (PKGDATADIR "/insert-variable.png", 0); + icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + gtk_icon_factory_add ( factory, "pspp-insert-variable", icon_set); + + pixbuf = gdk_pixbuf_new_from_file (PKGDATADIR "/insert-case.png", 0); + icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + gtk_icon_factory_add ( factory, "pspp-insert-case", icon_set); + + pixbuf = gdk_pixbuf_new_from_file (PKGDATADIR "/split-file.png", 0); + icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + gtk_icon_factory_add ( factory, "pspp-split-file", icon_set); + + pixbuf = gdk_pixbuf_new_from_file (PKGDATADIR "/select-cases.png", 0); + icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + gtk_icon_factory_add ( factory, "pspp-select-cases", icon_set); + + gtk_icon_factory_add_default (factory); +} diff --git a/src/ui/gui/psppire.glade b/src/ui/gui/psppire.glade index 2124f484..798e6216 100644 --- a/src/ui/gui/psppire.glade +++ b/src/ui/gui/psppire.glade @@ -547,6 +547,7 @@ True Variables + pspp-goto-variable True True @@ -604,6 +605,7 @@ True Insert Case + pspp-insert-case True True @@ -620,6 +622,7 @@ True Insert Variable + pspp-insert-variable True True @@ -649,6 +652,7 @@ True Split File + pspp-split-file True True @@ -665,6 +669,7 @@ True Weight Cases + pspp-weight-cases True True @@ -681,6 +686,7 @@ True Select Cases + pspp-select-cases True True @@ -710,6 +716,7 @@ True Value Labels + pspp-value-labels True True -- 2.30.2