~d6g/do-plugins/Timer

« back to all changes in this revision

Viewing changes to GoogleSearch/src/InlineGoogleSearchConfig.cs

  • Committer: bcl1713 at gmail
  • Date: 2008-09-21 16:33:10 UTC
  • Revision ID: bcl1713@gmail.com-20080921163310-dxn31n1ufmu79npw
Added "I'm Feeling Lucky!" Action and a LOT of code cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
//This program is free software: you can redistribute it and/or modify
10
10
//it under the terms of the GNU General Public License as published by
11
11
//the Free Software Foundation, either version 3 of the License, or
12
 
//(at your option) any later version.
 
12
// (at your option) any later version.
13
13
//
14
14
//This program is distributed in the hope that it will be useful,
15
15
//but WITHOUT ANY WARRANTY; without even the implied warranty of
28
28
/// Do plug-in that returns search results from google back to gnome-do for 
29
29
/// further processing
30
30
/// </summary>
31
 
namespace InlineGoogleSearch
32
 
{       
 
31
namespace InlineGoogleSearch {  
 
32
        
33
33
        /// <summary>
34
34
        /// Config Dialog for InlineGoogleSearch
35
35
        /// </summary>
36
 
        public partial class InlineGoogleSearchConfig : Gtk.Bin
37
 
        {
 
36
        public partial class InlineGoogleSearchConfig : Gtk.Bin {
38
37
                /// <summary>
39
38
                /// Do.Addins.Util Preferences
40
39
                /// </summary>
47
46
                /// <summary>
48
47
                /// Initializes and calls InlineGoogleSearchConfig Widget
49
48
                /// </summary>
50
 
                public InlineGoogleSearchConfig()
 
49
                public InlineGoogleSearchConfig () 
51
50
                {
52
 
                        this.Build();
 
51
                        this.Build ();
53
52
                        
54
53
                        switch (SearchRestrictions) {
55
54
                        case noss:
64
63
                /// <summary>
65
64
                /// Initializes static preferences
66
65
                /// </summary>
67
 
                static InlineGoogleSearchConfig ()
 
66
                static InlineGoogleSearchConfig () 
68
67
                {
69
 
                        prefs = Do.Addins.Util.GetPreferences("InlineGoogleSearch");
 
68
                        prefs = Do.Addins.Util.GetPreferences (
 
69
                                "InlineGoogleSearch");
70
70
                }
71
71
 
72
72
                /// <value>
73
73
                /// Default Value: 1 "Moderate"
74
74
                /// </value>
75
75
                public static string SearchRestrictions {
76
 
                        get { return prefs.Get<string> ("SearchRestrictions", moderatess); }
77
 
                        set { prefs.Set<string> ("SearchRestrictions", value); }
 
76
                        get { 
 
77
                                return prefs.Get<string> ("SearchRestrictions", 
 
78
                                                          moderatess); 
 
79
                        }
 
80
                        set { prefs.Set<string> ("SearchRestrictions", value); }
78
81
                }
79
82
 
80
83
                /// <summary>
86
89
                /// <param name="e">
87
90
                /// A <see cref="System.EventArgs"/>
88
91
                /// </param>
89
 
        protected virtual void OnNosafeRbtnToggled (object sender, System.EventArgs e)
90
 
        {
91
 
                SearchRestrictions = noss;
92
 
        }
 
92
                
 
93
                protected virtual void OnNosafeRbtnToggled (object sender, 
 
94
                                                            System.EventArgs e) 
 
95
                {
 
96
                        SearchRestrictions = noss;
 
97
                }
93
98
 
94
99
                /// <summary>
95
100
                /// What to do if safe_moderate is clicked
100
105
                /// <param name="e">
101
106
                /// A <see cref="System.EventArgs"/>
102
107
                /// </param>
103
 
        protected virtual void OnModerateRbtnToggled (object sender, System.EventArgs e)
104
 
        {
105
 
                SearchRestrictions = moderatess;
106
 
        }
 
108
                protected virtual void OnModerateRbtnToggled (object sender, 
 
109
                                                              System.EventArgs 
 
110
                                                              e) 
 
111
                {
 
112
                        SearchRestrictions = moderatess;
 
113
                }
107
114
 
108
115
                /// <summary>
109
116
                /// What to do if safe_active is clicked
114
121
                /// <param name="e">
115
122
                /// A <see cref="System.EventArgs"/>
116
123
                /// </param>
117
 
        protected virtual void OnStrictRbtnToggled (object sender, System.EventArgs e)
118
 
        {
119
 
                SearchRestrictions = activess;
120
 
        }
 
124
                protected virtual void OnStrictRbtnToggled (object sender, 
 
125
                                                            System.EventArgs e) 
 
126
                {
 
127
                        SearchRestrictions = activess;
 
128
                }
121
129
        }
122
 
}
 
130
}
 
 
b'\\ No newline at end of file'