@@ -24,33 +24,7 @@ namespace Scratch.Widgets {
2424 enum CaseSensitiveMode {
2525 NEVER ,
2626 MIXED ,
27- ALWAYS ;
28-
29- public string to_string () {
30- switch (this ) {
31- case NEVER :
32- return " Never" ;
33- case MIXED :
34- return " Mixed Case" ;
35- case ALWAYS :
36- return " Always" ;
37- default:
38- assert_not_reached ();
39- }
40- }
41-
42- public static CaseSensitiveMode from_string (string s ) {
43- switch (s) {
44- case " Never" :
45- return NEVER ;
46- case " Mixed Case" :
47- return MIXED ;
48- case " Always" :
49- return ALWAYS ;
50- default:
51- assert_not_reached ();
52- }
53- }
27+ ALWAYS
5428 }
5529
5630 public weak MainWindow window { get ; construct; }
@@ -125,9 +99,9 @@ namespace Scratch.Widgets {
12599 cycle_search_button = new Granite .SwitchModelButton (_(" Cyclic Search" ));
126100
127101 case_sensitive_search_button = new Gtk .ComboBoxText ();
128- case_sensitive_search_button. append (null , _(" Never" ));
129- case_sensitive_search_button. append (null , _(" Mixed Case" ));
130- case_sensitive_search_button. append (null , _(" Always" ));
102+ case_sensitive_search_button. append (" never " , _(" Never" ));
103+ case_sensitive_search_button. append (" mixed " , _(" Mixed Case" ));
104+ case_sensitive_search_button. append (" always " , _(" Always" ));
131105 case_sensitive_search_button. active = 1 ;
132106
133107 var case_sensitive_search_label = new Gtk .Label (_(" Case Sensitive" ));
@@ -171,20 +145,7 @@ namespace Scratch.Widgets {
171145 Scratch.settings.bind ("cyclic -search ", cycle_search_button , "active ", SettingsBindFlags .DEFAULT );
172146 Scratch.settings.bind ("wholeword -search ", whole_word_search_button , "active ", SettingsBindFlags .DEFAULT );
173147 Scratch.settings.bind ("regex -search ", regex_search_button , "active ", SettingsBindFlags .DEFAULT );
174- Scratch.settings.bind_with_mapping (
175- "case -sensitive -search ",
176- case_sensitive_search_button , "active ",
177- SettingsBindFlags .DEFAULT ,
178- (to_val , from_variant ) => {
179- to_val. set_int (CaseSensitiveMode . from_string (from_variant. get_string ()));
180- return true ;
181- },
182- (from_val, vartype) = > {
183- var mode_s = ((CaseSensitiveMode )(from_val. get_int ())). to_string ();
184- return new Variant .string (mode_s);
185- },
186- null , null
187- );
148+ Scratch.settings.bind ("case -sensitive -search ", case_sensitive_search_button , "active -id ", SettingsBindFlags .DEFAULT );
188149
189150 var search_box = new Gtk .Box (Gtk . Orientation . HORIZONTAL , 0 ) {
190151 margin_top = 3 ,
0 commit comments