xapantu has proposed merging lp:~xapantu/marlin/settings into lp:marlin.

Requested reviews:
  The elementary Project (elementaryproject)

For more details, see:
https://code.launchpad.net/~xapantu/marlin/settings/+merge/58038

Add a settings dialog, http://pix.toile-libre.org/upload/original/1303058956.png
-- 
https://code.launchpad.net/~xapantu/marlin/settings/+merge/58038
Your team The elementary Project is requested to review the proposed merge of 
lp:~xapantu/marlin/settings into lp:marlin.
=== modified file 'src/Makefile.am'
--- src/Makefile.am	2011-04-10 21:52:44 +0000
+++ src/Makefile.am	2011-04-17 16:50:50 +0000
@@ -32,6 +32,7 @@
 
 marlin_VALASOURCES = \
     log.vala        	                    \
+    View/SettingsDialog.vala                \
     View/Window.vala 	                    \
     View/Resources.vala	                    \
     View/DbusTags.vala	                    \

=== modified file 'src/View/Chrome/AdvancedMenuToolButton.vala'
--- src/View/Chrome/AdvancedMenuToolButton.vala	2011-04-13 17:13:56 +0000
+++ src/View/Chrome/AdvancedMenuToolButton.vala	2011-04-17 16:50:50 +0000
@@ -2,7 +2,7 @@
 
 namespace Gtk {
 
-    public abstract class AdvancedMenuToolButton : ToolButton
+    public abstract class AdvancedMenuToolButton : ToggleToolButton
     {
         public delegate Menu MenuFetcher();
 

=== added file 'src/View/SettingsDialog.vala'
--- src/View/SettingsDialog.vala	1970-01-01 00:00:00 +0000
+++ src/View/SettingsDialog.vala	2011-04-17 16:50:50 +0000
@@ -0,0 +1,111 @@
+/*
+ *  Marlin
+ *
+ *  This library 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 library 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 library; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *  Authors : Lucas Baudin <[email protected]>
+ *
+ */
+
+
+namespace Marlin.View
+{
+    public class SettingsDialog : Gtk.Dialog
+    {
+        public SettingsDialog(Window win)
+        {
+            set_title(N_("Marlin Settings"));
+            /*height_request = 600;*/
+            width_request = 500;
+            set_resizable(false);
+
+            var main_notebook = new Gtk.Notebook();
+
+            var first_vbox = new Gtk.VBox(false, 3);
+            first_vbox.border_width = 5;
+
+
+            /* Single click */
+            var hbox_single_click = new Gtk.HBox(false, 0);
+            var checkbox = new Gtk.CheckButton();
+
+            Preferences.settings.bind("single-click", checkbox , "active", SettingsBindFlags.DEFAULT);
+
+            var label = new Gtk.Label(N_("Single click to open:"));
+            label.set_alignment(0, 0.5f);
+
+            hbox_single_click.pack_start(label);
+            hbox_single_click.pack_start(checkbox, false, false);
+
+            first_vbox.pack_start(hbox_single_click, false);
+
+            /* Mouse selection speed */
+            var spin_click_speed = new Gtk.HScale.with_range(50, 1000, 1);
+
+            hbox_single_click = new Gtk.HBox(false, 0);
+
+            label = new Gtk.Label(N_("Mouse selection speed:"));
+            label.set_alignment(0, 0.5f);
+
+            hbox_single_click.pack_start(label);
+            hbox_single_click.pack_start(spin_click_speed, true, true);
+
+            Preferences.settings.bind("single-click", hbox_single_click, "sensitive", SettingsBindFlags.DEFAULT);
+
+            Preferences.settings.bind("single-click-timeout", spin_click_speed.get_adjustment(), "value", SettingsBindFlags.DEFAULT);
+            
+            first_vbox.pack_start(hbox_single_click, false);
+            
+            /* Sidebar icon size */
+            var spin_icon_size = new Gtk.SpinButton.with_range(4, 128, 1);
+
+            hbox_single_click = new Gtk.HBox(false, 0);
+
+            label = new Gtk.Label(N_("Sidebar icon size:"));
+            label.set_alignment(0, 0.5f);
+
+            hbox_single_click.pack_start(label);
+            hbox_single_click.pack_start(spin_icon_size, false, false);
+
+            Preferences.settings.bind("sidebar-icon-size", spin_icon_size, "value", SettingsBindFlags.DEFAULT);
+            
+            first_vbox.pack_start(hbox_single_click, false);
+
+            
+            
+            main_notebook.append_page(first_vbox, new Gtk.Label(N_("Misc")));
+
+            ((Gtk.HBox)get_content_area()).pack_start(main_notebook);
+
+            this.show_all();
+
+            this.delete_event.connect(() => { destroy(); return true; });
+
+            add_buttons("gtk-close", Gtk.ResponseType.DELETE_EVENT);
+            
+            run();
+        }
+
+        public override void response(int id)
+        {
+            switch(id)
+            {
+            case Gtk.ResponseType.DELETE_EVENT:
+                destroy();
+                break;
+            }
+        }
+    }
+}

=== modified file 'src/View/Window.vala'
--- src/View/Window.vala	2011-04-10 20:40:48 +0000
+++ src/View/Window.vala	2011-04-17 16:50:50 +0000
@@ -364,7 +364,11 @@
             }
         }
 
-        private void action_new_tab (Gtk.Action action) {
+       private void action_marlin_settings_callback (Gtk.Action action) {
+            new SettingsDialog(this);
+        }
+
+       private void action_new_tab (Gtk.Action action) {
             add_tab(File.new_for_commandline_arg(Environment.get_home_dir()));
         }
 
@@ -490,7 +494,11 @@
                                  N_("Customize _Toolbar"),
                                  null, N_("Easily edit the toolbar layout"),
                                  action_toolbar_editor_callback },
-                               /*{ Chrome.ColorAction, null, "ColorAction"),
+                               { "MarlinSettings", Stock.PREFERENCES,
+                                 N_("Settings"),
+                                 null, N_("Change Marlin's settings"),
+                                 action_marlin_settings_callback },
+                             /*{ Chrome.ColorAction, null, "ColorAction"),
                                  null, null,
                                  null },*/
                                { "Up", Stock.GO_UP, N_("Open _Parent"),

=== modified file 'src/marlin-ui.xml'
--- src/marlin-ui.xml	2011-03-28 00:45:43 +0000
+++ src/marlin-ui.xml	2011-04-17 16:50:50 +0000
@@ -18,6 +18,7 @@
 		<separator/>
 		<!--<placeholder name="Select Items"/>-->
 		<menuitem name="ToolbarEditor" 	  action="ToolbarEditor"/>
+		<menuitem name="MarlinSettings"   action="MarlinSettings"/>
 		<separator/>
                 <!--<menu action="ColorMenu">-->
                 <!--    <menuitem action="set-color-clear" />
@@ -115,6 +116,7 @@
 	<menuitem name="Reset to Defaults" action="Reset to Defaults"/>-->
     <menuitem name="Show Hidden Files" action="Show Hidden Files"/>
 	<separator/>
+    <menuitem name="MarlinSettings" action="MarlinSettings"/>
     <menuitem name="Show Hide Menubar" action="Show Hide Menubar"/>
 	<separator/>
     <menuitem name="About" action="About"/>

_______________________________________________
Mailing list: https://launchpad.net/~elementaryweb
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~elementaryweb
More help   : https://help.launchpad.net/ListHelp

Reply via email to