[cheese/three-point-oh] Split the GTKBuilder UI file into multiple files so that they are more easily manageable



commit 1669efa1abfc49c6c7e8314ca4d9608b30c69e67
Author: Yuvaraj Pandian T <yuvipanda gmail com>
Date:   Mon May 31 00:28:53 2010 +0530

    Split the GTKBuilder UI file into multiple files so that they are more easily manageable

 data/Makefile.am           |    4 +-
 data/cheese-about.ui       |   57 ++++++
 data/cheese-actions.ui     |  278 ++++++++++++++++++++++++++
 data/cheese-main-window.ui |  147 ++++++++++++++
 data/cheese.ui             |  474 --------------------------------------------
 valasrc/cheese-window.vala |    4 +-
 6 files changed, 488 insertions(+), 476 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 118f558..bc4e23c 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -23,7 +23,9 @@ $(service_DATA): $(service_in_files) Makefile
 	@sed -e "s|\ bindir\@|$(bindir)|" $< > $@
 
 pkgdata_DATA = \
-	cheese.ui	\
+	cheese-main-window.ui	\
+	cheese-about.ui \
+	cheese-actions.ui \
 	cheese-prefs.ui
 
 EXTRA_DIST = \
diff --git a/data/cheese-about.ui b/data/cheese-about.ui
new file mode 100644
index 0000000..14dd770
--- /dev/null
+++ b/data/cheese-about.ui
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16" />
+  <object class="GtkAboutDialog" id="aboutdialog">
+    <property name="program_name">Cheese</property>
+    <property name="comments">Take photos and videos with your webcam, with fun graphical effects</property>
+    <property name="copyright">Copyright © 2007 - 2009
+daniel g. siegel &lt;dgsiegel gnome org&gt;</property>
+    <property name="website">http://projects.gnome.org/cheese</property>
+    <property name="website-label">Cheese Website</property>
+    <property name="wrap-license">True</property>
+    <property name="logo-icon-name">cheese</property>
+    <property name="translator-credits" translatable="true">translator-credits</property>
+    <property name="license" translatable="true">This program 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 (at your option) any later version.
+
+This program 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, see &lt;http://www.gnu.org/licenses/&gt;.
+</property>
+    <property name="authors">daniel g. siegel &lt;dgsiegel gnome org&gt;
+Jaap A. Haitsma &lt;jaap haitsma org&gt;
+Filippo Argiolas &lt;fargiolas gnome org&gt;
+
+Aidan Delaney &lt;a j delaney brighton ac uk&gt;
+Alex "weej" Jones &lt;alex weej com&gt;
+Andrea Cimitan &lt;andrea cimitan gmail com&gt;
+Baptiste Mille-Mathias &lt;bmm80 free fr&gt;
+Cosimo Cecchi &lt;anarki lilik it&gt;
+Diego Escalante Urrelo &lt;dieguito gmail com&gt;
+Felix Kaser &lt;f kaser gmx net&gt;
+Gintautas Miliauskas &lt;gintas akl lt&gt;
+Hans de Goede &lt;jwrdegoede fedoraproject org&gt;
+James Liggett &lt;jrliggett cox net&gt;
+Luca Ferretti &lt;elle uca libero it&gt;
+Mirco "MacSlow" Müller &lt;macslow bangang de&gt;
+Patryk Zawadzki &lt;patrys pld-linux org&gt;
+Ryan Zeigler &lt;zeiglerr gmail com&gt;
+Sebastian Keller &lt;sebastian-keller gmx de&gt;
+Steve Magoun &lt;steve magoun canonical com&gt;
+Thomas Perl &lt;thp thpinfo com&gt;
+Tim Philipp Müller &lt;tim centricular net&gt;
+Todd Eisenberger &lt;teisenberger gmail com&gt;
+Tommi Vainikainen &lt;thv iki fi&gt;
+    </property>
+    <property name="documenters">Joshua Henderson &lt;joshhendo gmail com&gt;
+Jaap A. Haitsma &lt;jaap haitsma org&gt;
+Felix Kaser &lt;f kaser gmx net&gt;
+    </property>
+    <property name="artists">Andreas Nilsson &lt;andreas andreasn se&gt;
+Josef Vybíral &lt;josef vybiral gmail com&gt;
+Kalle Persson &lt;kalle kallepersson se&gt;
+Lapo Calamandrei &lt;calamandrei gmail com&gt;
+Or Dvory &lt;gnudles nana co il&gt;
+Ulisse Perusin &lt;ulisail yahoo it&gt;
+    </property>
+  </object>
+</interface>
\ No newline at end of file
diff --git a/data/cheese-actions.ui b/data/cheese-actions.ui
new file mode 100644
index 0000000..a982be3
--- /dev/null
+++ b/data/cheese-actions.ui
@@ -0,0 +1,278 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16" />
+
+  <object class="GtkUIManager" id="menu_ui_man">
+    <child>
+      <object class="GtkActionGroup" id="main_actions">
+	<child>
+	  <object class="GtkAction" id="cheese_action">
+	    <property name="name">Cheese</property>
+	    <property name="label">_Cheese</property>
+	  </object>
+	</child>
+
+	<child>
+	  <object class="GtkAction" id="edit_action">
+	    <property name="name">Edit</property>
+	    <property name="label">_Edit</property>
+	  </object>
+	</child>
+
+	<child>
+	  <object class="GtkAction" id="help_action">
+	    <property name="name">Help</property>
+	    <property name="label">_Help</property>
+	  </object>
+	</child>
+
+	<child>
+	  <object class="GtkAction" id="quit">
+	    <property name="name">Quit</property>
+	    <property name="label">_Quit</property>
+	    <signal name="activate" handler="cheese_main_window_on_quit" />
+	  </object>
+	  <accelerator key="q" modifiers="GDK_CONTROL_MASK" />
+	</child>	
+      </object>
+    </child>
+
+    <child>
+      <object class="GtkActionGroup" id="help_actions">
+	<child>
+	  <object class="GtkAction" id="help_contents">
+	    <property name="name">HelpContents</property>
+	    <property name="label">Help _Contents</property>
+	    <property name="stock_id">gtk-help</property>
+	    <signal name="activate" handler="cheese_main_window_on_help_contents" />
+	  </object>
+	  <accelerator key="F1" />	  
+	</child>	
+
+	<child>
+	  <object class="GtkAction" id="about">
+	    <property name="name">About</property>
+	    <property name="label">_About</property>
+	    <property name="stock_id">gtk-about</property>
+	    <signal name="activate" handler="cheese_main_window_on_help_about" />
+	  </object>
+	</child>	
+	
+      </object>
+    </child>
+    <child>      
+      <object class="GtkActionGroup" id="file_actions">
+	<child>
+	  <object class="GtkAction" id="open">
+	    <property name="name">Open</property>
+	    <property name="label">_Open</property>
+	    <property name="stock_id">gtk-open</property>
+	    <signal name="activate" handler="cheese_main_window_on_file_open" />
+	  </object>
+	  <accelerator key="O" modifiers="GDK_CONTROL_MASK" />
+	</child>
+
+	<child>
+	  <object class="GtkAction" id="save_as">
+	    <property name="name">SaveAs</property>
+	    <property name="label">Save _As</property>
+	    <property name="stock_id">gtk-save-as</property>
+	    <signal name="activate" handler="cheese_main_window_on_file_save_as" />
+	  </object>
+	  <accelerator key="S" modifiers="GDK_CONTROL_MASK" />
+	</child>
+
+	<child>
+	  <object class="GtkAction" id="move_to_trash">
+	    <property name="name">MoveToTrash</property>
+	    <property name="label">Move to _Trash</property>
+	    <property name="icon_name">user-trash</property>
+	    <signal name="activate" handler="cheese_main_window_on_file_move_to_trash" />
+	  </object>
+	  <accelerator key="Delete" modifiers="" />
+	</child>
+
+	<child>
+	  <object class="GtkAction" id="delete">
+	    <property name="name">Delete</property>
+	    <property name="label">_Delete</property>
+	    <signal name="activate" handler="cheese_main_window_on_file_delete" />
+	  </object>
+	  <accelerator key="Delete" modifiers="GDK_SHIFT_MASK" />
+	</child>
+
+	<child>
+	  <object class="GtkAction" id="move_all_to_trash">
+	    <property name="name">RemoveAll</property>
+	    <property name="label">Move All to Trash</property>
+	    <signal name="activate" handler="cheese_main_window_on_file_delete" />
+	  </object>
+	</child>	
+      </object>      
+    </child>
+
+    <child>
+      <object class="GtkActionGroup" id="layout_actions">
+	<child>
+	  <object class="GtkToggleAction" id="fullscreen">
+	    <property name="name">Fullscreen</property>
+	    <property name="label">Fullscreen</property>
+	    <property name="stock_id">gtk-fullscreen</property>
+	    <signal name="activate" handler="cheese_main_window_on_layout_fullscreen" />
+	  </object>
+	  <accelerator key="F11" modifiers="" />
+	</child>
+
+	<child>
+	  <object class="GtkToggleAction" id="wide_mode">
+	    <property name="name">WideMode</property>
+	    <property name="label">_Wide Mode</property>
+	    <signal name="activate" handler="cheese_main_window_on_layout_wide_mode" />
+	  </object>
+	</child>	
+      </object>
+    </child>
+
+    <child>
+      <object class="GtkActionGroup" id="">
+	<child>
+	  <object class="GtkToggleAction" id="flash">
+	    <property name="name">Flash</property>
+	    <property name="label">Flash</property>
+	    <signal name="activate" handler="cheese_main_window_on_flash_toggle" />
+	  </object>
+	</child>
+
+	<child>
+	  <object class="GtkToggleAction" id="countdown">
+	    <property name="name">Countdown</property>
+	    <property name="label">Countdown</property>
+	    <signal name="activate" handler="cheese_main_window_on_countdown_toggle" />
+	  </object>
+	</child>	
+      </object>
+    </child>
+
+    
+    <child>
+      <object class="GtkActionGroup" id="take_actions">
+	<child>
+	  <object class="GtkAction" id="take_photo">
+	    <property name="name">TakePhoto</property>
+	    <property name="label">_Take a Photo</property>
+	    <signal name="activate" handler="cheese_main_window_on_take_action" />
+	  </object>
+	  <accelerator key="space" modifiers="" />
+	</child>
+
+	<child>
+	  <object class="GtkAction" id="take_video">
+	    <property name="name">TakeVideo</property>
+	    <property name="label">_Record a Video</property>
+	    <signal name="activate" handler="cheese_main_window_on_take_action" />
+	  </object>
+	  <accelerator key="space" modifiers="" />
+	</child>
+
+	<child>
+	  <object class="GtkAction" id="take_burst">
+	    <property name="name">TakeBurst</property>
+	    <property name="label">Take _Multiple Photos</property>
+	    <signal name="activate" handler="cheese_main_window_on_take_action" />
+	  </object>
+	  <accelerator key="space" modifiers="" />
+	</child>
+	
+      </object>
+    </child>
+
+    <child>
+      <object class="GtkActionGroup" id="mode_actions">
+	<child>
+	  <object class="GtkRadioAction" id="photo_mode">
+	    <property name="name">Photo</property>
+	    <property name="label">_Photo</property>
+	    <property name="group">photo_mode</property>
+	    <signal name="activate" handler="cheese_main_window_on_mode_change" />
+	  </object>
+	</child>
+
+	<child>
+	  <object class="GtkRadioAction" id="video_mode">
+	    <property name="name">Video</property>
+	    <property name="label">_Video</property>
+	    <property name="group">photo_mode</property>
+	    <signal name="activate" handler="cheese_main_window_on_mode_change" />
+	  </object>
+	</child>
+
+	<child>
+	  <object class="GtkRadioAction" id="burst_mode">
+	    <property name="name">Burst</property>
+	    <property name="label">Burst</property>
+	    <property name="group">photo_mode</property>
+	    <signal name="activate" handler="cheese_main_window_on_mode_change" />
+	  </object>
+	</child>	
+      </object>
+    </child>
+
+    <child>
+      <object class="GtkActionGroup" id="effects_actions">
+	<child>
+	  <object class="GtkToggleAction" id="effects">
+	    <property name="name">Effects</property>
+	    <property name="label">_Effects</property>
+	    <signal name="activate" handler="cheese_main_window_on_effects_toggle" />
+	  </object>
+	</child>	
+      </object>      
+    </child>
+
+    <child>
+      <object class="GtkActionGroup" id="preferences_actions">
+	<child>
+	  <object class="GtkToggleAction" id="preferences">
+	    <property name="name">Preferences</property>
+	    <property name="label">_Preferences</property>
+	    <signal name="activate" handler="cheese_main_window_on_preferences_dialog" />
+	  </object>
+	</child>
+      </object>
+    </child>
+    
+    <ui>
+      <menubar name="main_menubar">
+	<menu action="cheese_action">
+	  <menuitem action="flash" />
+	  <menuitem action="countdown" />
+	  <separator />
+	  <menuitem action="take_photo" />
+	  <menuitem action="take_video" />
+	  <menuitem action="take_burst" />
+	  <separator />
+	  <menuitem action="photo_mode" />
+	  <menuitem action="video_mode" />
+	  <menuitem action="burst_mode" />
+	  <separator />
+	  <menuitem action="fullscreen" />
+	  <menuitem action="wide_mode" />
+	  <separator />
+	  <menuitem action="quit" />
+	</menu>
+	<menu action="edit_action">
+	  <menuitem action="effects" />
+	  <separator />
+	  <menuitem action="move_to_trash" />
+	  <menuitem action="move_all_to_trash" />
+	  <separator />
+	  <menuitem action="preferences" />
+	</menu>
+	<menu action="help_action">
+	  <menuitem action="help_contents" />
+	  <menuitem action="about" />
+	</menu>
+      </menubar>
+    </ui>
+  </object>
+</interface>
\ No newline at end of file
diff --git a/data/cheese-main-window.ui b/data/cheese-main-window.ui
new file mode 100644
index 0000000..da1a3e1
--- /dev/null
+++ b/data/cheese-main-window.ui
@@ -0,0 +1,147 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16" />  
+
+  <object class="GtkImage" id="video_image">
+    <property name="icon_name">video-x-generic</property>
+  </object>
+  <object class="GtkImage" id="burst_image">
+    <property name="icon_name">cheese-take-burst</property>
+  </object>
+  <object class="GtkImage" id="record_image">
+    <property name="icon_name">gtk-media-record</property>
+  </object>
+  
+  <object class="GtkVBox" id="mainbox_normal">
+    <property name="homogeneous">False</property>    
+    <child>
+      <object class="GtkMenuBar" id="main_menubar" constructor="menu_ui_man">
+      </object>
+      <packing>
+	<property name="expand">False</property>
+	<property name="fill">False</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkHBox" id="content_area">
+	<child>
+	  <object class="GtkVBox" id="view_area">
+	    <child>
+	      <object class="GtkClutterEmbed" id="viewport">
+		<property name="height_request">450</property>
+		<property name="width_request">600</property>
+	      </object>
+	      <packing>
+		<property name="expand">True</property>
+		<property name="fill">True</property>
+	      </packing>
+	    </child>
+	    <child>
+	      <object class="GtkHBox" id="action_buttons_area">
+		<child>		  
+		  <object class="GtkHBox" id="mode_toggle_buttons">
+		    <property name="homogeneous">True</property>
+		    <property name="spacing">2</property>		    
+		    <child>
+		      <object class="GtkToggleButton" id="photo_toggle_button">
+			<property name="image">photo_image</property>
+		      </object>
+		    </child>
+		    <child>
+		      <object class="GtkToggleButton" id="video_toggle_button">
+			<property name="image">video_image</property>
+		      </object>
+		    </child>
+		    <child>
+		      <object class="GtkToggleButton" id="burst_toggle_button">
+			<property name="image">burst_image</property>
+		      </object>
+		    </child>		    
+		  </object>
+		  <packing>
+		    <property name="expand">False</property>
+		    <property name="fill">False</property>		    
+		  </packing>		  
+		</child>
+
+		<child>
+		  <object class="GtkAlignment" id="action_button_alignment">
+		    <property name="xscale">0</property>
+		    <property name="yscale">0</property>
+		    <child>
+		      <object class="GtkButton" id="take_action_button">
+			<child>
+			  <object class="GtkHBox" id="take_action_button_internal_hbox">
+			    <property name="spacing">2</property>
+			    <child>
+			      <object class="GtkImage" id="take_action_button_internal_image">
+				<property name="icon_name">gtk-media-record</property>				
+			      </object>
+			      <packing>
+				<property name="padding">2</property>
+			      </packing>
+			    </child>
+			    <child>
+			      <object class="GtkLabel" id="take_action_button_internal_label">
+				<property name="label" translatable="yes">_Take Photo</property>
+				<property name="use_underline">True</property>
+			      </object>
+			      <packing>
+				  <property name="padding">15</property>
+			      </packing>
+			    </child>
+			  </object>
+			</child>
+		      </object>
+		    </child>
+		    
+		  </object>
+		</child>
+		
+		<child>
+		  <object class="GtkToggleButton" id="effects_button">
+		    <child>
+		      <object class="GtkHBox" id="effects_button_internal_hbox">
+			<property name="visible">True</property>
+			<property name="spacing">2</property>
+			<child>
+			  <object class="GtkImage" id="effects_button_internal_image">
+			    <property name="icon_name">browse-webcam-effects</property>
+			  </object>
+			</child>
+			<child>
+			  <object class="GtkLabel" id="effects_button_internal_label">
+			    <property name="label" translatable="yes">_Effects</property>
+			    <property name="use_underline">True</property>
+			  </object>
+			</child>
+		      </object>
+		    </child>
+		  </object>
+		  <packing>
+		    <property name="expand">False</property>
+		    <property name="fill">False</property>		    
+		  </packing>		  		  
+		</child>
+	      </object>
+	      
+	      <packing>
+		<property name="expand">False</property>
+		<property name="fill">False</property>
+	      </packing>
+	    </child>
+	  </object>
+	</child>
+	<child>
+	  <object class="GtkFrame" id="thumbnails">
+	    <property name="width_request">140</property>
+	  </object>
+	  <packing>
+	    <property name="expand">False</property>
+	  </packing>
+	</child>
+      </object>
+    </child>
+  </object>
+
+</interface>
\ No newline at end of file
diff --git a/valasrc/cheese-window.vala b/valasrc/cheese-window.vala
index 96d492e..98e704c 100644
--- a/valasrc/cheese-window.vala
+++ b/valasrc/cheese-window.vala
@@ -39,7 +39,9 @@ public class Cheese.MainWindow : Gtk.Window {
 	public	void setup_ui () {
 		builder = new Builder();
 		VBox main_vbox;
-		builder.add_from_file (GLib.Path.build_filename ("../data/", "cheese.ui"));
+		builder.add_from_file (GLib.Path.build_filename ("../data/", "cheese-actions.ui"));
+		builder.add_from_file (GLib.Path.build_filename ("../data/", "cheese-about.ui"));
+		builder.add_from_file (GLib.Path.build_filename ("../data/", "cheese-main-window.ui"));
 		builder.connect_signals(this);
 		
 		main_vbox = (VBox) builder.get_object ("mainbox_normal");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]