~ubuntu-branches/ubuntu/karmic/gtwitter/karmic

« back to all changes in this revision

Viewing changes to gtwitter/PreferencesWindow.cs

  • Committer: Bazaar Package Importer
  • Author(s): Michael Janssen
  • Date: 2007-08-09 17:14:13 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20070809171413-28ppa0f2oxmr6qyt
Tags: upstream-1.0~beta
ImportĀ upstreamĀ versionĀ 1.0~beta

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
1
using System;
3
2
using System.IO;
4
3
using System.Diagnostics;
5
4
using Gtk;
6
5
using GConf;
 
6
using Gnome;
 
7
using Mono.Unix;
7
8
 
8
9
namespace gtwitter
9
10
{
17
18
                        //read from gconf
18
19
                        UpdateFromGConf();
19
20
                        MainWindow.client.AddNotify (MainWindow.GCONF_APP_PATH, new NotifyEventHandler (GConf_Changed));
 
21
                        
 
22
                        //notifications | sensitivity
 
23
                        //notifications toggled event
 
24
                        EnableNotifyCheckButton.Toggled += new EventHandler(this.EnableNotifyCheckButtonToggled);
 
25
                        
 
26
                        if (EnableNotifyCheckButton.Active == true)
 
27
                        {
 
28
                                NotifyOnDirect.Sensitive = true;
 
29
                                NotifyOnPublicFriends.Sensitive = true;
 
30
                                NotifyOnBoth.Sensitive = true;
 
31
                        }
 
32
                        
20
33
                }
21
34
                
22
35
                //gconf update
32
45
                                RefreshCombobox.Active = (int) MainWindow.client.Get (MainWindow.REFRESH_KEY);
33
46
                                
34
47
                                HiddenCheckbutton.Active = (bool) MainWindow.client.Get (MainWindow.HIDDEN_KEY);
 
48
                                
 
49
                                //Notification options
 
50
                                EnableNotifyCheckButton.Active = (bool) MainWindow.client.Get (MainWindow.NOTIFY_KEY);
 
51
                                NotifyOnDirect.Active = (bool) MainWindow.client.Get (MainWindow.NOTIFY_DIRECT_KEY);
 
52
                                NotifyOnPublicFriends.Active = (bool) MainWindow.client.Get (MainWindow.NOTIFY_PUBFRIE_KEY);
 
53
                                NotifyOnBoth.Active = (bool) MainWindow.client.Get (MainWindow.NOTIFY_ALL_KEY);
35
54
                        }
36
55
                        catch (Exception ex)
37
56
                        {
59
78
                        
60
79
                        MainWindow.client.Set (MainWindow.HIDDEN_KEY, HiddenCheckbutton.Active);
61
80
                        
 
81
                        //notifications
 
82
                        MainWindow.client.Set (MainWindow.NOTIFY_KEY, EnableNotifyCheckButton.Active);
 
83
                        MainWindow.client.Set (MainWindow.NOTIFY_DIRECT_KEY, NotifyOnDirect.Active);
 
84
                        MainWindow.client.Set (MainWindow.NOTIFY_PUBFRIE_KEY, NotifyOnPublicFriends.Active);
 
85
                        MainWindow.client.Set (MainWindow.NOTIFY_ALL_KEY, NotifyOnBoth.Active);
 
86
                        
62
87
                        ClearCacheLabel.Text = "";
63
88
 
64
89
                        this.Hide();
78
103
                        
79
104
                        Directory.CreateDirectory(gtwitter.MainWindow.configDir + "images");
80
105
                        
81
 
                        ClearCacheLabel.Text = "Done!";
 
106
                        ClearCacheLabel.Text = Catalog.GetString("Done!");
 
107
                }
 
108
 
 
109
                // call the GNOME Default browser to open the Twitter.com signup url
 
110
                protected virtual void OnSignUpClicked(object sender, System.EventArgs e)
 
111
                {
 
112
                        Gnome.Url.Show ("http://twitter.com/signup");
 
113
                }
 
114
                
 
115
                //Toggle notifications event
 
116
                protected virtual void EnableNotifyCheckButtonToggled(object sender, System.EventArgs e)
 
117
                {
 
118
                        if(EnableNotifyCheckButton.Active == true)
 
119
                        {
 
120
                                MainWindow.client.Set (MainWindow.NOTIFY_KEY, EnableNotifyCheckButton.Active);
 
121
                                
 
122
                                NotifyOnDirect.Sensitive = true;
 
123
                                NotifyOnPublicFriends.Sensitive = true;
 
124
                                NotifyOnBoth.Sensitive = true;
 
125
                        }
 
126
                        else
 
127
                        {
 
128
                                MainWindow.client.Set (MainWindow.NOTIFY_KEY, EnableNotifyCheckButton.Active);
 
129
                                
 
130
                                NotifyOnDirect.Sensitive = false;
 
131
                                NotifyOnPublicFriends.Sensitive = false;
 
132
                                NotifyOnBoth.Sensitive = false;
 
133
                        }
82
134
                }
83
135
 
84
136
        }