[iagno] Remove the preferences dialog



commit 3ca567de86b6b761b07c66fb40fb528b8bdedb29
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Jan 25 15:14:44 2015 -0600

    Remove the preferences dialog
    
    Since there is only one preference left. We need something better than
    this (along the lines of what we did with Mines) to keep themes.
    
    Leave the sun and star theme, for now. You can get to it using
    dconf-editor. At least for now.

 data/Makefile.am          |    1 -
 data/iagno-menus.ui       |    4 --
 data/iagno-preferences.ui |   51 -------------------------
 src/iagno.gresource.xml   |    1 -
 src/iagno.vala            |   92 ---------------------------------------------
 5 files changed, 0 insertions(+), 149 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 89ccf05..89b4f91 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -3,7 +3,6 @@ SUBDIRS = icons
 uidir = $(datadir)/iagno
 ui_DATA = \
        iagno-menus.ui \
-       iagno-preferences.ui \
        iagno.ui
 
 imagedir = $(datadir)/iagno/images
diff --git a/data/iagno-menus.ui b/data/iagno-menus.ui
index c50ba38..56cb8b5 100644
--- a/data/iagno-menus.ui
+++ b/data/iagno-menus.ui
@@ -4,10 +4,6 @@
   <menu id="app-menu">
     <section>
       <item>
-        <attribute name="label" translatable="yes">_Preferences</attribute>
-        <attribute name="action">app.preferences</attribute>
-      </item>
-      <item>
         <attribute name="label" translatable="yes">_Sound</attribute>
         <attribute name="action">app.sound</attribute>
       </item>
diff --git a/src/iagno.gresource.xml b/src/iagno.gresource.xml
index 38029b3..46c3f8b 100644
--- a/src/iagno.gresource.xml
+++ b/src/iagno.gresource.xml
@@ -7,7 +7,6 @@
   </gresource>
   <gresource prefix="/org/gnome/iagno/ui">
     <file alias="iagno.ui" preprocess="xml-stripblanks">../data/iagno.ui</file>
-    <file alias="iagno-preferences.ui" preprocess="xml-stripblanks">../data/iagno-preferences.ui</file>
   </gresource>
   <gresource prefix="/org/gnome/iagno/gtk">
     <file alias="menus.ui" preprocess="xml-stripblanks">../data/iagno-menus.ui</file>
diff --git a/src/iagno.vala b/src/iagno.vala
index 2336530..7ca7bfa 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -38,7 +38,6 @@ public class Iagno : Gtk.Application
     private Gtk.Image mark_icon_light;
     private Gtk.Label dark_score_label;
     private Gtk.Label light_score_label;
-    private Gtk.Dialog propbox;
     private Gtk.Stack main_stack;
 
     private Gtk.Button back_button;
@@ -78,7 +77,6 @@ public class Iagno : Gtk.Application
         {"undo-move", undo_move_cb},
         {"back", back_cb},
 
-        {"preferences", preferences_cb},
         {"help", help_cb},
         {"about", about_cb},
         {"quit", quit}
@@ -474,96 +472,6 @@ public class Iagno : Gtk.Application
         }
     }
 
-    /*\
-    * * Preferences dialog
-    \*/
-
-    private bool propbox_close_cb (Gtk.Widget widget, Gdk.EventAny event)
-    {
-        widget.hide ();
-        return true;
-    }
-
-    private void theme_changed_cb (Gtk.ComboBox widget)
-    {
-        var model = widget.get_model ();
-        Gtk.TreeIter iter;
-        if (!widget.get_active_iter (out iter))
-            return;
-        string tile_set;
-        model.get (iter, 1, out tile_set);
-        settings.set_string ("tileset", tile_set);
-        view.theme = Path.build_filename (DATA_DIRECTORY, "themes", tile_set);
-    }
-
-    private void create_preferences_dialog ()
-    {
-        var builder = new Gtk.Builder.from_resource ("/org/gnome/iagno/ui/iagno-preferences.ui");
-
-        /* the dialog is not in the ui file for the use-header-bar flag to be switchable */
-        propbox = new Gtk.Dialog.with_buttons (_("Preferences"),
-                                               window,
-                                               Gtk.DialogFlags.USE_HEADER_BAR,
-                                               null);
-        var box = (Gtk.Box) propbox.get_content_area ();
-        propbox.resizable = false;
-        propbox.delete_event.connect (propbox_close_cb);
-        var grid = builder.get_object ("main-grid") as Gtk.Grid;
-        box.pack_start (grid, true, true, 0);
-
-        var theme_combo = builder.get_object ("theme-combo") as Gtk.ComboBox;
-        var model = builder.get_object ("liststore-theme") as Gtk.ListStore;
-        Dir dir;
-        List<string> dirlist = new List<string> ();
-
-        /* get sorted list of filenames in the themes directory */
-        try
-        {
-            dir = Dir.open (Path.build_filename (DATA_DIRECTORY, "themes"));
-            while (true)
-            {
-                var filename = dir.read_name ();
-                if (filename == null)
-                    break;
-                dirlist.insert_sorted (filename, strcmp);
-            }
-        }
-        catch (FileError e)
-        {
-            warning ("Failed to load themes: %s", e.message);
-        }
-
-        Gtk.TreeIter iter;
-        foreach (string filename in dirlist)
-        {
-            model.append (out iter);
-
-            /* Create label by replacing underscores with space and stripping extension */
-            var label_text = filename;
-
-            label_text = label_text.replace ("_", " ");
-            var extension_index = label_text.last_index_of_char ('.');
-            if (extension_index > 0)
-                label_text = label_text.substring (0, extension_index);
-
-            model.set (iter, 0, label_text, 1, filename);
-            if (filename == settings.get_string ("tileset"))
-                theme_combo.set_active_iter (iter);
-        }
-        theme_combo.changed.connect (theme_changed_cb);
-    }
-
-    /*\
-    * * App-menu callbacks
-    \*/
-
-    private void preferences_cb ()
-    {
-        if (propbox == null)
-            create_preferences_dialog ();
-        propbox.show_all ();
-    }
-
     private void help_cb ()
     {
         try


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