[latexila] Remove number of most used symbols setting
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] Remove number of most used symbols setting
- Date: Sun, 8 Jul 2012 15:24:47 +0000 (UTC)
commit 7b2231b85de59a72b8d18c0feca0bbc9e3461132
Author: SÃbastien Wilmet <swilmet src gnome org>
Date: Sun Jul 8 17:23:16 2012 +0200
Remove number of most used symbols setting
Anyway, the most used symbols are sorted.
data/org.gnome.latexila.gschema.xml | 5 ----
src/most_used_symbols.vala | 27 +---------------------
src/preferences_dialog.vala | 8 ------
src/ui/preferences_dialog.ui | 43 -----------------------------------
4 files changed, 1 insertions(+), 82 deletions(-)
---
diff --git a/data/org.gnome.latexila.gschema.xml b/data/org.gnome.latexila.gschema.xml
index 1a5d19a..5203423 100644
--- a/data/org.gnome.latexila.gschema.xml
+++ b/data/org.gnome.latexila.gschema.xml
@@ -79,11 +79,6 @@
<summary>Highlight Matching Brackets</summary>
<description>Whether LaTeXila should highlight matching brackets.</description>
</key>
- <key name="nb-most-used-symbols" type="u">
- <range min="1" max="50" />
- <default>15</default>
- <summary>Number of most used symbols</summary>
- </key>
<key name="spell-checking" type="b">
<default>false</default>
<summary>Spell checking</summary>
diff --git a/src/most_used_symbols.vala b/src/most_used_symbols.vala
index 916bfa8..c8badd6 100644
--- a/src/most_used_symbols.vala
+++ b/src/most_used_symbols.vala
@@ -24,26 +24,16 @@ using Gtk;
public class MostUsedSymbols : GLib.Object
{
private static MostUsedSymbols _instance = null;
- private GLib.Settings _settings;
private bool _modified = false;
-
private ListStore _store;
- private TreeModelFilter _model_filter;
// The column containing the number of times a symbol has been used.
private static const int SYMBOL_COLUMN_NUM = SymbolColumn.N_COLUMNS;
private MostUsedSymbols ()
{
- _settings = new GLib.Settings ("org.gnome.latexila.preferences.editor");
-
init_models ();
load_data ();
-
- _settings.changed["nb-most-used-symbols"].connect (() =>
- {
- _model_filter.refilter ();
- });
}
// singleton
@@ -66,26 +56,11 @@ public class MostUsedSymbols : GLib.Object
);
_store.set_sort_column_id (SYMBOL_COLUMN_NUM, SortType.DESCENDING);
-
- _model_filter = new TreeModelFilter (_store, null);
- _model_filter.set_visible_func ((model, iter) =>
- {
- TreePath? path = _store.get_path (iter);
- if (path == null)
- return false;
-
- int pos = path.get_indices ()[0];
-
- uint max;
- _settings.get ("nb-most-used-symbols", "u", out max);
-
- return pos < max;
- });
}
public TreeModel get_model ()
{
- return _model_filter as TreeModel;
+ return _store as TreeModel;
}
public void clear ()
diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala
index 564cde0..56018e8 100644
--- a/src/preferences_dialog.vala
+++ b/src/preferences_dialog.vala
@@ -307,19 +307,11 @@ public class PreferencesDialog : Dialog
private void init_other_tab (Builder builder)
{
- GLib.Settings settings =
- new GLib.Settings ("org.gnome.latexila.preferences.editor");
GLib.Settings latex_settings =
new GLib.Settings ("org.gnome.latexila.preferences.latex");
GLib.Settings fb_settings =
new GLib.Settings ("org.gnome.latexila.preferences.file-browser");
- var nb_most_used_symbols =
- builder.get_object ("nb_most_used_symbols") as SpinButton;
- set_spin_button_range (nb_most_used_symbols, settings, "nb-most-used-symbols");
- settings.bind ("nb-most-used-symbols", nb_most_used_symbols, "value",
- SettingsBindFlags.DEFAULT);
-
var confirm_clean_up_checkbutton =
builder.get_object ("confirm_clean_up_checkbutton");
latex_settings.bind ("no-confirm-clean", confirm_clean_up_checkbutton, "active",
diff --git a/src/ui/preferences_dialog.ui b/src/ui/preferences_dialog.ui
index f7c830d..a0cc895 100644
--- a/src/ui/preferences_dialog.ui
+++ b/src/ui/preferences_dialog.ui
@@ -611,49 +611,6 @@
<property name="border_width">8</property>
<property name="row_spacing">18</property>
<child>
- <object class="GtkGrid" id="grid14">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="column_spacing">5</property>
- <child>
- <object class="GtkLabel" id="label10">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Number of most used symbols:</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="nb_most_used_symbols">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">â</property>
- <property name="invisible_char_set">True</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
<object class="GtkGrid" id="grid15">
<property name="visible">True</property>
<property name="can_focus">False</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]