[Rawstudio-commit] r3296 - trunk/src

Anders Brander anders at brander.dk
Thu Apr 1 20:17:44 CEST 2010


Author: abrander
Date: 2010-04-01 20:17:44 +0200 (Thu, 01 Apr 2010)
New Revision: 3296

Modified:
   trunk/src/gtk-interface.c
   trunk/src/rs-actions.c
   trunk/src/rs-toolbox.c
   trunk/src/rs-toolbox.h
   trunk/src/ui.xml
Log:
Added shortcuts and menu entries for selecting snapshot.

Modified: trunk/src/gtk-interface.c
===================================================================
--- trunk/src/gtk-interface.c	2010-04-01 18:16:29 UTC (rev 3295)
+++ trunk/src/gtk-interface.c	2010-04-01 18:17:44 UTC (rev 3296)
@@ -1081,9 +1081,12 @@
 
 	rs->store = RS_STORE(rs->iconbox);
 
+	rs_get_core_action_group(rs);
+
 	/* Build toolbox */
 	rs->tools = tools = rs_toolbox_new();
 	g_signal_connect(tools, "snapshot-changed", G_CALLBACK(snapshot_changed), rs);
+	rs_toolbox_register_actions(RS_TOOLBOX(tools));
 
 	batchbox = make_batchbox(rs->queue);
 

Modified: trunk/src/rs-actions.c
===================================================================
--- trunk/src/rs-actions.c	2010-04-01 18:16:29 UTC (rev 3295)
+++ trunk/src/rs-actions.c	2010-04-01 18:17:44 UTC (rev 3296)
@@ -1012,6 +1012,7 @@
 	{ "HelpMenu", NULL, _("_Help") },
 	{ "DebugMenu", NULL, "_Debug" },
 	{ "PreviewPopup", NULL, NULL, NULL, NULL, ACTION_CB(preview_popup) },
+	{ "SnapshotMenu", NULL, "_Snapshot" },
 
 	/* File menu */
 	{ "Open", GTK_STOCK_OPEN, _("_Open Directory"), "<control>O", NULL, ACTION_CB(open) },

Modified: trunk/src/rs-toolbox.c
===================================================================
--- trunk/src/rs-toolbox.c	2010-04-01 18:16:29 UTC (rev 3295)
+++ trunk/src/rs-toolbox.c	2010-04-01 18:17:44 UTC (rev 3296)
@@ -36,6 +36,7 @@
 #include "rs-actions.h"
 #include "rs-lens-db-editor.h"
 #include "rs-profile-camera.h"
+#include "rs-actions.h"
 
 /* Some helpers for creating the basic sliders */
 typedef struct {
@@ -1068,3 +1069,43 @@
 		rs_curve_set_input(RS_CURVE_WIDGET(toolbox->curve[i]), input, display_color_space);
 	
 }
+
+static void
+action_changed(GtkRadioAction *radioaction, GtkRadioAction *current, RSToolbox *toolbox)
+{
+	gtk_notebook_set_current_page(GTK_NOTEBOOK(toolbox->notebook), gtk_radio_action_get_current_value(radioaction));
+}
+
+static void
+action_previous(GtkAction *action, RSToolbox *toolbox)
+{
+	gtk_notebook_prev_page(GTK_NOTEBOOK(toolbox->notebook));
+}
+
+static void
+action_next(GtkAction *action, RSToolbox *toolbox)
+{
+	gtk_notebook_next_page(GTK_NOTEBOOK(toolbox->notebook));
+}
+
+extern void
+rs_toolbox_register_actions(RSToolbox *toolbox)
+{
+	g_assert(RS_IS_TOOLBOX(toolbox));
+
+	GtkRadioActionEntry select_snapshot[] = {
+	{ "SnapshotA", NULL, _(" A "), NULL, NULL, 0 },
+	{ "SnapshotB", NULL, _(" B "), NULL, NULL, 1 },
+	{ "SnapshotC", NULL, _(" C "), NULL, NULL, 2 },
+	};
+	static guint n_select_snapshot = G_N_ELEMENTS (select_snapshot);
+
+	GtkActionEntry actionentries[] = {
+	{ "SnapshotPrevious", GTK_STOCK_GO_BACK, _("_Previous"), "<control>Page_Up", NULL, G_CALLBACK(action_previous) },
+	{ "SnapshotNext", GTK_STOCK_GO_FORWARD, _("_Next"), "<control>Page_Down", NULL, G_CALLBACK(action_next) },
+	};
+	static guint n_actionentries = G_N_ELEMENTS (actionentries);
+
+	rs_core_action_group_add_radio_actions(select_snapshot, n_select_snapshot, 0, G_CALLBACK(action_changed), toolbox);
+	rs_core_action_group_add_actions(actionentries, n_actionentries, toolbox);
+}
\ No newline at end of file

Modified: trunk/src/rs-toolbox.h
===================================================================
--- trunk/src/rs-toolbox.h	2010-04-01 18:16:29 UTC (rev 3295)
+++ trunk/src/rs-toolbox.h	2010-04-01 18:17:44 UTC (rev 3296)
@@ -62,6 +62,9 @@
 extern void
 rs_toolbox_set_histogram_input(RSToolbox *toolbox, RSFilter *input, RSColorSpace *display_color_space);
 
+extern void
+rs_toolbox_register_actions(RSToolbox *toolbox);
+
 G_END_DECLS
 
 #endif /* RS_TOOLBOX_H */

Modified: trunk/src/ui.xml
===================================================================
--- trunk/src/ui.xml	2010-04-01 18:16:29 UTC (rev 3295)
+++ trunk/src/ui.xml	2010-04-01 18:17:44 UTC (rev 3296)
@@ -56,6 +56,14 @@
    </menu>
    <separator />
    <menuitem action="ZommToFit" />
+   <menu action="SnapshotMenu">
+    <menuitem action="SnapshotA" />
+    <menuitem action="SnapshotB" />
+    <menuitem action="SnapshotC" />
+    <separator />
+    <menuitem action="SnapshotPrevious" />
+    <menuitem action="SnapshotNext" />
+   </menu>
    <separator />
    <menuitem action="Iconbox" />
    <menuitem action="Toolbox" />




More information about the Rawstudio-commit mailing list