]> git.sur5r.net Git - glabels/blobdiff - glabels2/src/ui.c
2009-09-17 Jim Evins <evins@snaught.com>
[glabels] / glabels2 / src / ui.c
index 8f96432a8e04db49fbd6580e4cabdac13909f0e5..62b67d4ecc56a87d56b837be2da05e7f1172e8c6 100644 (file)
@@ -1,37 +1,30 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
-
 /*
- *  (GLABELS) Label and Business Card Creation program for GNOME
- *
- *  ui.c:  GLabels ui module
+ *  ui.c
+ *  Copyright (C) 2001-2009  Jim Evins <evins@snaught.com>.
  *
- *  Copyright (C) 2001-2002  Jim Evins <evins@snaught.com>.
+ *  This file is part of gLabels.
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  gLabels 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
+ *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
- *  This program is distributed in the hope that it will be useful,
+ *  gLabels 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
+ *  along with gLabels.  If not, see <http://www.gnu.org/licenses/>.
  */
+
 #include <config.h>
 
 #include "ui.h"
 
 #include <glib/gi18n.h>
 #include <gconf/gconf-client.h>
-#include <gtk/gtkrecentchoosermenu.h>
-#include <gtk/gtkmenuitem.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtktoolbar.h>
-#include <gtk/gtkstatusbar.h>
+#include <gtk/gtk.h>
 #include <string.h>
 
 #include "ui-util.h"
 
 #include "debug.h"
 
+
 /*==========================================================================*/
 /* Private macros and constants.                                            */
 /*==========================================================================*/
 
+
 /*==========================================================================*/
 /* Private types.                                                           */
 /*==========================================================================*/
@@ -439,14 +434,6 @@ static GtkToggleActionEntry toggle_entries[] = {
          G_CALLBACK (gl_ui_cmd_view_property_bar_toggle),
          TRUE },
 
-       { "ViewPropertyToolBarToolTips",
-         NULL,
-         N_("Show tooltips"),
-         NULL,
-         N_("Show tooltips for property toolbar"),
-         G_CALLBACK (gl_ui_cmd_view_property_bar_tips_toggle),
-         TRUE },
-
        { "ViewGrid",
          NULL,
          N_("Grid"),
@@ -484,22 +471,6 @@ static GtkToggleActionEntry ui_toggle_entries[] = {
          G_CALLBACK (view_ui_item_toggled_cb),
          TRUE },
 
-       { "ViewMainToolBarToolTips",
-         NULL,
-         N_("Show tooltips"),
-         NULL,
-         N_("Show tooltips for main toolbar"),
-         G_CALLBACK (view_ui_item_toggled_cb),
-         TRUE },
-
-       { "ViewDrawingToolBarToolTips",
-         NULL,
-         N_("Show tooltips"),
-         NULL,
-         N_("Show tooltips for drawing toolbar"),
-         G_CALLBACK (view_ui_item_toggled_cb),
-         TRUE },
-
 };
 static guint n_ui_toggle_entries = G_N_ELEMENTS (ui_toggle_entries);
 
@@ -539,16 +510,6 @@ static const gchar *ui_info =
 "                      <menuitem action='ViewDrawingToolBar' />"
 "                      <menuitem action='ViewPropertyToolBar' />"
 "                      <separator />"
-"                      <menu action='ViewMainToolBarMenu'>"
-"                              <menuitem action='ViewMainToolBarToolTips' />"
-"                      </menu>"
-"                      <menu action='ViewDrawingToolBarMenu'>"
-"                              <menuitem action='ViewDrawingToolBarToolTips' />"
-"                      </menu>"
-"                      <menu action='ViewPropertyToolBarMenu'>"
-"                              <menuitem action='ViewPropertyToolBarToolTips' />"
-"                      </menu>"
-"                      <separator />"
 "                      <menuitem action='ViewGrid' />"
 "                      <menuitem action='ViewMarkup' />"
 "                      <separator />"
@@ -711,7 +672,7 @@ static gchar* doc_verbs [] = {
 };
 
 static gchar* doc_modified_verbs [] = {
-       "/ui/MenuBar/FileMenu/Save",
+       "/ui/MenuBar/FileMenu/FileSave",
 
        NULL
 };
@@ -775,6 +736,7 @@ gl_ui_new (glWindow *window)
                          G_CALLBACK (disconnect_proxy_cb), window);
 
        actions = gtk_action_group_new ("Actions");
+        gtk_action_group_set_translation_domain (actions, NULL);
        gtk_action_group_add_actions (actions, entries, n_entries, GTK_WINDOW (window));
        gtk_action_group_add_toggle_actions (actions, 
                                             toggle_entries, n_toggle_entries, 
@@ -814,6 +776,7 @@ gl_ui_new (glWindow *window)
        return ui;
 }
 
+
 /*****************************************************************************/
 /** Unref wrapper.                                                           */
 /*****************************************************************************/
@@ -827,6 +790,7 @@ gl_ui_unref (GtkUIManager *ui)
        gl_debug (DEBUG_UI, "END");
 }
 
+
 /*****************************************************************************/
 /** Update all verbs of given UI component.                                  */
 /*****************************************************************************/
@@ -869,6 +833,7 @@ gl_ui_update_all (GtkUIManager *ui,
        gl_debug (DEBUG_UI, "END");
 }
 
+
 /*****************************************************************************/
 /** Update all verbs of given UI component to "no document" state.           */
 /*****************************************************************************/
@@ -882,6 +847,7 @@ gl_ui_update_nodoc (GtkUIManager *ui)
        gl_debug (DEBUG_UI, "END");
 }
 
+
 /*****************************************************************************/
 /** Update label modified verbs of given UI component.                       */
 /*****************************************************************************/
@@ -898,6 +864,7 @@ gl_ui_update_modified_verbs (GtkUIManager *ui,
        gl_debug (DEBUG_UI, "END");
 }
 
+
 /*****************************************************************************/
 /** Update verbs associated with selection state of given UI component.      */
 /*****************************************************************************/
@@ -920,6 +887,7 @@ gl_ui_update_selection_verbs (GtkUIManager *ui,
        gl_debug (DEBUG_UI, "END");
 }
 
+
 /*****************************************************************************/
 /** Update verbs associated with zoom level of given UI component.           */
 /*****************************************************************************/
@@ -937,6 +905,7 @@ gl_ui_update_zoom_verbs (GtkUIManager *ui,
        gl_debug (DEBUG_UI, "END");
 }
 
+
 /*****************************************************************************/
 /** Update undo/redo verbs of given UI component.                            */
 /*****************************************************************************/
@@ -955,6 +924,7 @@ gl_ui_update_undo_redo_verbs (GtkUIManager *ui,
        gl_debug (DEBUG_UI, "END");
 }
 
+
 /*---------------------------------------------------------------------------*/
 /** PRIVATE.  View menu item toggled callback.                               */
 /*---------------------------------------------------------------------------*/
@@ -981,13 +951,6 @@ view_ui_item_toggled_cb (GtkToggleAction *action,
                gl_prefs_model_save_settings (gl_prefs);
        }
 
-       if (strcmp (name, "ViewMainToolBarToolTips") == 0)
-       {
-               gl_prefs->main_toolbar_view_tooltips = state;
-               set_app_main_toolbar_style (ui);
-               gl_prefs_model_save_settings (gl_prefs);
-       }
-
        if (strcmp (name, "ViewDrawingToolBar") == 0)
        {
                gl_prefs->drawing_toolbar_visible = state;
@@ -995,16 +958,10 @@ view_ui_item_toggled_cb (GtkToggleAction *action,
                gl_prefs_model_save_settings (gl_prefs);
        }
 
-       if (strcmp (name, "ViewDrawingToolBarToolTips") == 0)
-       {
-               gl_prefs->drawing_toolbar_view_tooltips = state;
-               set_app_drawing_toolbar_style (ui);
-               gl_prefs_model_save_settings (gl_prefs);
-       }
-
        gl_debug (DEBUG_UI, "");
 }
 
+
 /*---------------------------------------------------------------------------*/
 /** PRIVATE.  Set main toolbar style.                                        */
 /*---------------------------------------------------------------------------*/
@@ -1021,18 +978,8 @@ set_app_main_toolbar_style (GtkUIManager *ui)
        gl_ui_util_set_verb_state (ui, "/ui/ViewMenu/ViewMainToolBar",
                                   gl_prefs->main_toolbar_visible);
 
-       gl_ui_util_set_verb_sensitive (ui, "/ui/ViewMenu/ViewMainToolBarToolTips",
-                                      gl_prefs->main_toolbar_visible);
-
-       gl_ui_util_set_verb_state (ui, "/ui/ViewMenu/ViewMainToolBarToolTips",
-                                  gl_prefs->main_toolbar_view_tooltips);
-
-       
        toolbar = gtk_ui_manager_get_widget (ui, "/MainToolBar");
 
-       gtk_toolbar_set_tooltips (GTK_TOOLBAR (toolbar),
-                                 gl_prefs->main_toolbar_view_tooltips);
-
        if (gl_prefs->main_toolbar_visible) {
                gtk_widget_show_all (toolbar);
        } else {
@@ -1059,18 +1006,8 @@ set_app_drawing_toolbar_style (GtkUIManager *ui)
        gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenu/ViewDrawingToolBar",
                                   gl_prefs->drawing_toolbar_visible);
 
-       gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewDrawingToolBarToolTips",
-                                      gl_prefs->drawing_toolbar_visible);
-
-       gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenuDrawingToolBarToolTips",
-                                  gl_prefs->drawing_toolbar_view_tooltips);
-
-       
        toolbar = gtk_ui_manager_get_widget (ui, "/DrawingToolBar");
 
-       gtk_toolbar_set_tooltips (GTK_TOOLBAR (toolbar),
-                                 gl_prefs->drawing_toolbar_view_tooltips);
-
        gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
 
        if (gl_prefs->drawing_toolbar_visible) {
@@ -1082,6 +1019,7 @@ set_app_drawing_toolbar_style (GtkUIManager *ui)
        gl_debug (DEBUG_UI, "END");
 }
 
+
 /*---------------------------------------------------------------------------*/
 /** PRIVATE.  Set visibility of grid and markup.                             */
 /*---------------------------------------------------------------------------*/
@@ -1101,6 +1039,7 @@ set_view_style (GtkUIManager *ui)
        gl_debug (DEBUG_UI, "END");
 }
 
+
 /*---------------------------------------------------------------------------*/
 /** PRIVATE.  Connect proxy callback.                                        */
 /*---------------------------------------------------------------------------*/
@@ -1119,6 +1058,7 @@ connect_proxy_cb (GtkUIManager *ui,
        }
 }
 
+
 /*---------------------------------------------------------------------------*/
 /** PRIVATE.  Disconnect proxy callback.                                     */
 /*---------------------------------------------------------------------------*/
@@ -1137,6 +1077,7 @@ disconnect_proxy_cb (GtkUIManager *ui,
        }
 }
 
+
 /*---------------------------------------------------------------------------*/
 /** PRIVATE.  Menu item select callback.                                     */
 /*---------------------------------------------------------------------------*/
@@ -1162,6 +1103,7 @@ menu_item_select_cb (GtkMenuItem *proxy,
        }
 }
 
+
 /*---------------------------------------------------------------------------*/
 /** PRIVATE.  Menu item deselect callback.                                   */
 /*---------------------------------------------------------------------------*/
@@ -1176,3 +1118,13 @@ menu_item_deselect_cb (GtkMenuItem *proxy,
                           window->menu_tips_context_id);
 }
 
+
+
+/*
+ * Local Variables:       -- emacs
+ * mode: C                -- emacs
+ * c-basic-offset: 8      -- emacs
+ * tab-width: 8           -- emacs
+ * indent-tabs-mode: nil  -- emacs
+ * End:                   -- emacs
+ */