]> git.sur5r.net Git - glabels/blobdiff - glabels2/src/ui-commands.c
2009-09-22 Jim Evins <evins@snaught.com>
[glabels] / glabels2 / src / ui-commands.c
index c4cc1d19f6e1cb24903003b4060dd6ff4c2ff9be..a8e2bbd3b2f8ab5ff588e5603e390ed11650db35 100644 (file)
@@ -1,25 +1,21 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
-
 /*
- *  (GLABELS) Label and Business Card Creation program for GNOME
- *
- *  ui-commands.c:  GLabels UI commands module
- *
+ *  ui-commands.c
  *  Copyright (C) 2001-2009  Jim Evins <evins@snaught.com>.
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  This file is part of gLabels.
+ *
+ *  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-commands.h"
 
 #include <glib/gi18n.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtkaboutdialog.h>
+#include <gtk/gtk.h>
 
 #include "view.h"
 #include "file.h"
 #include "template-designer.h"
-#include "print-op.h"
+#include "print-op-dialog.h"
 #include "prefs.h"
 #include "prefs-dialog.h"
 #include "recent.h"
 #include "debug.h"
 
 
-\f
 /****************************************************************************/
 /** File/New command.                                                       */
 /****************************************************************************/
@@ -58,6 +52,7 @@ gl_ui_cmd_file_new (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** File/Properties command.                                                */
 /****************************************************************************/
@@ -75,6 +70,7 @@ gl_ui_cmd_file_properties (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** File/Template-Designer command.                                         */
 /****************************************************************************/
@@ -96,6 +92,7 @@ gl_ui_cmd_file_template_designer (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** File/Open command.                                                      */
 /****************************************************************************/
@@ -113,6 +110,7 @@ gl_ui_cmd_file_open (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** File/Open-Recent command.                                               */
 /****************************************************************************/
@@ -142,6 +140,7 @@ gl_ui_cmd_file_open_recent (GtkRecentChooser *chooser,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** File/Save command.                                                      */
 /****************************************************************************/
@@ -159,6 +158,7 @@ gl_ui_cmd_file_save (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** File/Save-as command.                                                   */
 /****************************************************************************/
@@ -176,6 +176,7 @@ gl_ui_cmd_file_save_as (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** File/Print command.                                                     */
 /****************************************************************************/
@@ -183,7 +184,7 @@ void
 gl_ui_cmd_file_print (GtkAction *action,
                       glWindow  *window)
 {
-        glPrintOp               *op;
+        glPrintOpDialog         *op;
         GtkPrintOperationResult  result;
 
         gl_debug (DEBUG_COMMANDS, "START");
@@ -191,11 +192,11 @@ gl_ui_cmd_file_print (GtkAction *action,
         g_return_if_fail (action && GTK_IS_ACTION(action));
         g_return_if_fail (window && GL_IS_WINDOW(window));
 
-        op = gl_print_op_new (GL_VIEW(window->view)->label);
+        op = gl_print_op_dialog_new (GL_VIEW(window->view)->label);
 
         if (window->print_settings)
         {
-                gl_print_op_set_settings (op, window->print_settings);
+                gl_print_op_set_settings (GL_PRINT_OP (op), window->print_settings);
         }
 
         result = gtk_print_operation_run (GTK_PRINT_OPERATION (op),
@@ -206,12 +207,13 @@ gl_ui_cmd_file_print (GtkAction *action,
         if ( result == GTK_PRINT_OPERATION_RESULT_APPLY )
         {
                 gl_print_op_free_settings (window->print_settings);
-                window->print_settings = gl_print_op_get_settings (op);
+                window->print_settings = gl_print_op_get_settings (GL_PRINT_OP (op));
         }
 
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** File/Close command.                                                     */
 /****************************************************************************/
@@ -229,6 +231,7 @@ gl_ui_cmd_file_close (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** File/Quit command.                                                      */
 /****************************************************************************/
@@ -264,6 +267,7 @@ gl_ui_cmd_edit_cut (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** Edit/Copy command.                                                      */
 /****************************************************************************/
@@ -281,6 +285,7 @@ gl_ui_cmd_edit_copy (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** Edit/Paste command.                                                     */
 /****************************************************************************/
@@ -334,6 +339,7 @@ gl_ui_cmd_edit_select_all (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** Edit/Unselect-all command.                                              */
 /****************************************************************************/
@@ -351,6 +357,7 @@ gl_ui_cmd_edit_unselect_all (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** Edit/Preferences command.                                               */
 /****************************************************************************/
@@ -385,6 +392,7 @@ gl_ui_cmd_edit_preferences (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** View/Property-bar-toggle command.                                        */
 /*****************************************************************************/
@@ -444,6 +452,7 @@ gl_ui_cmd_view_grid_toggle (GtkToggleAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** View/Markup-toggle command.                                              */
 /*****************************************************************************/
@@ -475,6 +484,7 @@ gl_ui_cmd_view_markup_toggle (GtkToggleAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** View/Zoom-in command.                                                    */
 /*****************************************************************************/
@@ -495,6 +505,7 @@ gl_ui_cmd_view_zoomin (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** View/Zoom-out command.                                                   */
 /*****************************************************************************/
@@ -515,6 +526,7 @@ gl_ui_cmd_view_zoomout (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** View/Zoom-1:1 command.                                                   */
 /*****************************************************************************/
@@ -535,6 +547,7 @@ gl_ui_cmd_view_zoom1to1 (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** View/Zoom-to-fit command.                                                */
 /*****************************************************************************/
@@ -555,6 +568,7 @@ gl_ui_cmd_view_zoom_to_fit (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Arrow-mode command.                                              */
 /*****************************************************************************/
@@ -574,6 +588,7 @@ gl_ui_cmd_objects_arrow_mode (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Create-text object command.                                      */
 /*****************************************************************************/
@@ -595,6 +610,7 @@ gl_ui_cmd_objects_create_text (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Create-box object command.                                       */
 /*****************************************************************************/
@@ -616,6 +632,7 @@ gl_ui_cmd_objects_create_box (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Create-line object command.                                      */
 /*****************************************************************************/
@@ -637,6 +654,7 @@ gl_ui_cmd_objects_create_line (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Create-ellipse object command.                                   */
 /*****************************************************************************/
@@ -658,6 +676,7 @@ gl_ui_cmd_objects_create_ellipse (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Create-image object command.                                     */
 /*****************************************************************************/
@@ -679,6 +698,7 @@ gl_ui_cmd_objects_create_image (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Create-barcode object command.                                   */
 /*****************************************************************************/
@@ -700,6 +720,7 @@ gl_ui_cmd_objects_create_barcode (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Raise command.                                                   */
 /*****************************************************************************/
@@ -720,6 +741,7 @@ gl_ui_cmd_objects_raise (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Lower command.                                                   */
 /*****************************************************************************/
@@ -740,6 +762,7 @@ gl_ui_cmd_objects_lower (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Rotate-left-90-degrees command.                                  */
 /*****************************************************************************/
@@ -760,6 +783,7 @@ gl_ui_cmd_objects_rotate_left (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Rotate-right-90-degrees command.                                 */
 /*****************************************************************************/
@@ -780,6 +804,7 @@ gl_ui_cmd_objects_rotate_right (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Flip-horizontally command.                                       */
 /*****************************************************************************/
@@ -800,6 +825,7 @@ gl_ui_cmd_objects_flip_horiz (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Flip-vertically command.                                         */
 /*****************************************************************************/
@@ -820,6 +846,7 @@ gl_ui_cmd_objects_flip_vert (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Align-left command.                                              */
 /*****************************************************************************/
@@ -840,6 +867,7 @@ gl_ui_cmd_objects_align_left (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Align-right command.                                             */
 /*****************************************************************************/
@@ -860,6 +888,7 @@ gl_ui_cmd_objects_align_right (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Align-horizontal-center command.                                 */
 /*****************************************************************************/
@@ -880,6 +909,7 @@ gl_ui_cmd_objects_align_hcenter (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Align-top command.                                               */
 /*****************************************************************************/
@@ -900,6 +930,7 @@ gl_ui_cmd_objects_align_top (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Align-bottom command.                                            */
 /*****************************************************************************/
@@ -920,6 +951,7 @@ gl_ui_cmd_objects_align_bottom (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Align-vertical center command.                                   */
 /*****************************************************************************/
@@ -940,6 +972,7 @@ gl_ui_cmd_objects_align_vcenter (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Center-horizontally command.                                     */
 /*****************************************************************************/
@@ -960,6 +993,7 @@ gl_ui_cmd_objects_center_horiz (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Center-vertically command.                                       */
 /*****************************************************************************/
@@ -980,6 +1014,7 @@ gl_ui_cmd_objects_center_vert (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /*****************************************************************************/
 /** Objects/Edit- merge-properties command.                                  */
 /*****************************************************************************/
@@ -1017,6 +1052,7 @@ gl_ui_cmd_objects_merge_properties (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
 /****************************************************************************/
 /** Help/Contents command.                                                  */
 /****************************************************************************/
@@ -1087,14 +1123,15 @@ gl_ui_cmd_help_about (GtkAction *action,
         const gchar *translator_credits = _("translator-credits");
 
         const gchar *license = _(
-              "Glabels is free software; you can redistribute it and/or modify it\n"
-              "under the terms of the GNU General Public License as published by\n"
-              "the Free Software Foundation; either version 2 of the License, or\n"
-              "(at your option) any later version.\n" "\n"
-              "This program is distributed in the hope that it will be useful, but\n"
-              "WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-              "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See\n"
-              "the GNU General Public License for more details.\n");
+                "gLabels is free software: you can redistribute it and/or modify\n"
+                "it under the terms of the GNU General Public License as published by\n"
+                "the Free Software Foundation, either version 3 of the License, or\n"
+                "(at your option) any later version.\n"
+                "\n"
+                "gLabels is distributed in the hope that it will be useful,\n"
+                "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+                "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
+                "GNU General Public License for more details.\n");
 
         gl_debug (DEBUG_COMMANDS, "START");
 
@@ -1113,15 +1150,15 @@ gl_ui_cmd_help_about (GtkAction *action,
                 pixbuf = gdk_pixbuf_new_from_file (GLABELS_PIXMAP_DIR "glabels-splash.png", NULL);
 
                 about = gtk_about_dialog_new ();
-                gtk_about_dialog_set_name      (GTK_ABOUT_DIALOG(about), _("glabels"));
-                gtk_about_dialog_set_version   (GTK_ABOUT_DIALOG(about), VERSION);
-                gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG(about), copy_text);
-                gtk_about_dialog_set_comments  (GTK_ABOUT_DIALOG(about), about_text);
-                gtk_about_dialog_set_website   (GTK_ABOUT_DIALOG(about), url);
-                gtk_about_dialog_set_logo      (GTK_ABOUT_DIALOG(about), pixbuf);
-
-                gtk_about_dialog_set_authors   (GTK_ABOUT_DIALOG(about), authors);
-                gtk_about_dialog_set_artists   (GTK_ABOUT_DIALOG(about), artists);
+                gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG(about), _("glabels"));
+                gtk_about_dialog_set_version      (GTK_ABOUT_DIALOG(about), VERSION);
+                gtk_about_dialog_set_copyright    (GTK_ABOUT_DIALOG(about), copy_text);
+                gtk_about_dialog_set_comments     (GTK_ABOUT_DIALOG(about), about_text);
+                gtk_about_dialog_set_website      (GTK_ABOUT_DIALOG(about), url);
+                gtk_about_dialog_set_logo         (GTK_ABOUT_DIALOG(about), pixbuf);
+
+                gtk_about_dialog_set_authors      (GTK_ABOUT_DIALOG(about), authors);
+                gtk_about_dialog_set_artists      (GTK_ABOUT_DIALOG(about), artists);
                 gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG(about),
                                                          translator_credits);
                 gtk_about_dialog_set_license   (GTK_ABOUT_DIALOG(about), license);
@@ -1146,3 +1183,13 @@ gl_ui_cmd_help_about (GtkAction *action,
         gl_debug (DEBUG_COMMANDS, "END");
 }
 
+
+
+/*
+ * Local Variables:       -- emacs
+ * mode: C                -- emacs
+ * c-basic-offset: 8      -- emacs
+ * tab-width: 8           -- emacs
+ * indent-tabs-mode: nil  -- emacs
+ * End:                   -- emacs
+ */