changeset 94:50dc5a14d37b

Thu Nov 2 17:51:31 2006 John Ellis <johne@verizon.net> * collect.c, img-view.c: Make [Shift]+P printing shortcut work for collections and view windows. * layout_util.c: Fix shortcuts [Control]+N and [Shift]+P, broken by the previous keypress handler code cleanup. Add [Control]+V to view current image in a new image window.
author gqview
date Thu, 02 Nov 2006 23:27:03 +0000
parents f1c8f8632e23
children eb9bb29cbd65
files ChangeLog src/collect.c src/img-view.c src/layout_util.c
diffstat 4 files changed, 86 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Nov 02 19:45:18 2006 +0000
+++ b/ChangeLog	Thu Nov 02 23:27:03 2006 +0000
@@ -1,3 +1,11 @@
+Thu Nov  2 17:51:31 2006  John Ellis  <johne@verizon.net>
+
+	* collect.c, img-view.c: Make [Shift]+P printing shortcut work for
+	collections and view windows.
+	* layout_util.c: Fix shortcuts [Control]+N and [Shift]+P, broken
+	by the previous keypress handler code cleanup. Add [Control]+V to
+	view current image in a new image window.
+
 Thu Nov  2 14:38:54 2006  John Ellis  <johne@verizon.net>
 
 	* view_file_list.c: Fix slow re-sort when updating list by clearing the
--- a/src/collect.c	Thu Nov 02 19:45:18 2006 +0000
+++ b/src/collect.c	Thu Nov 02 23:27:03 2006 +0000
@@ -1,6 +1,6 @@
 /*
  * GQview
- * (C) 2004 John Ellis
+ * (C) 2006 John Ellis
  *
  * Author: John Ellis
  *
@@ -23,6 +23,7 @@
 #include "layout.h"
 #include "layout_image.h"
 #include "pixbuf_util.h"
+#include "print.h"
 #include "utilops.h"
 #include "ui_fileops.h"
 #include "ui_tree_edit.h"
@@ -898,7 +899,21 @@
 				collection_set_sort_method(cw->cd, SORT_SIZE);
 				break;
 			case 'P': case 'p':
-				collection_set_sort_method(cw->cd, SORT_PATH);
+				if (event->state & GDK_SHIFT_MASK)
+					{
+					CollectInfo *info;
+					const gchar *path;
+
+					info = collection_table_get_focus_info(cw->table);
+					path = (info) ? info->path : NULL;
+
+					print_window_new(path, collection_table_selection_get_list(cw->table),
+							 collection_list_to_path_list(cw->cd->list), cw->window);
+					}
+				else
+					{
+					collection_set_sort_method(cw->cd, SORT_PATH);
+					}
 				break;
 			case GDK_Delete: case GDK_KP_Delete:
 				list = g_list_copy(cw->table->selection);
--- a/src/img-view.c	Thu Nov 02 19:45:18 2006 +0000
+++ b/src/img-view.c	Thu Nov 02 23:27:03 2006 +0000
@@ -1,6 +1,6 @@
 /*
  * GQview
- * (C) 2004 John Ellis
+ * (C) 2006 John Ellis
  *
  * Author: John Ellis
  *
@@ -25,6 +25,7 @@
 #include "menu.h"
 #include "pixbuf-renderer.h"
 #include "pixbuf_util.h"
+#include "print.h"
 #include "slideshow.h"
 #include "utilops.h"
 #include "ui_bookmark.h"
@@ -452,6 +453,18 @@
 			case 'G': case 'g':
 				image_alter(imd, ALTER_DESATURATE);
 				break;
+			case 'P': case 'p':
+				{
+				const gchar *path;
+
+				view_fullscreen_toggle(vw, TRUE);
+				imd = view_window_active_image(vw);
+				path = image_get_path(imd);
+				print_window_new(path,
+						 (path) ? g_list_append(NULL, g_strdup(path)) : NULL,
+						 path_list_copy(vw->list), vw->window);
+				}
+				break;
 			default:
 				stop_signal = FALSE;
 				break;
--- a/src/layout_util.c	Thu Nov 02 19:45:18 2006 +0000
+++ b/src/layout_util.c	Thu Nov 02 23:27:03 2006 +0000
@@ -21,6 +21,7 @@
 #include "collect-dlg.h"
 #include "dupe.h"
 #include "editors.h"
+#include "img-view.h"
 #include "info.h"
 #include "layout_image.h"
 #include "pan-view.h"
@@ -118,21 +119,33 @@
 			case GDK_Down: case GDK_KP_Down:
 				y += 1;
 				break;
-			case GDK_BackSpace:
-			case 'B': case 'b':
-				layout_image_prev(lw);
-				break;
-			case GDK_space:
-			case 'N': case 'n':
-				layout_image_next(lw);
-				break;
-			case GDK_Menu:
-				layout_image_menu_popup(lw);
-				break;
 			default:
 				stop_signal = FALSE;
 				break;
 			}
+
+		if (!stop_signal &&
+		    !(event->state & GDK_CONTROL_MASK))
+			{
+			stop_signal = TRUE;
+			switch (event->keyval)
+				{
+				case GDK_BackSpace:
+				case 'B': case 'b':
+					layout_image_prev(lw);
+					break;
+				case GDK_space:
+				case 'N': case 'n':
+					layout_image_next(lw);
+					break;
+				case GDK_Menu:
+					layout_image_menu_popup(lw);
+					break;
+				default:
+					stop_signal = FALSE;
+					break;
+				}
+			}
 		}
 
 	if (x != 0 || y!= 0)
@@ -149,7 +162,20 @@
 
 	if (stop_signal) return stop_signal;
 
-	if (!(event->state & GDK_CONTROL_MASK))
+	if (event->state & GDK_CONTROL_MASK)
+		{
+		stop_signal = TRUE;
+		switch (event->keyval)
+			{
+			case 'v' : case 'V':
+				view_window_new(layout_image_get_path(lw));
+				break;
+			default:
+				stop_signal = FALSE;
+				break;
+			}
+		}
+	else
 		{
 		stop_signal = TRUE;
 		switch (event->keyval)
@@ -216,11 +242,18 @@
 #endif
 				break;
 			case 'P': case 'p':
-				layout_image_slideshow_pause_toggle(lw);
+				if (!event->state & GDK_SHIFT_MASK)
+					{
+					layout_image_slideshow_pause_toggle(lw);
+					}
+				else
+					{
+					stop_signal = FALSE;
+					}
 				break;
 			case 'V': case 'v':
 			case GDK_F11:
-				if (!(event->state & GDK_MOD1_MASK)) layout_image_full_screen_toggle(lw);
+				layout_image_full_screen_toggle(lw);
 				break;
 			default:
 				stop_signal = FALSE;