3
using System.Diagnostics;
12
public partial class PreferencesWindow : Gtk.Dialog
14
public PreferencesWindow()
20
MainWindow.client.AddNotify (MainWindow.GCONF_APP_PATH, new NotifyEventHandler (GConf_Changed));
22
//notifications | sensitivity
23
//notifications toggled event
24
EnableNotifyCheckButton.Toggled += new EventHandler(this.EnableNotifyCheckButtonToggled);
26
if (EnableNotifyCheckButton.Active == true)
28
NotifyOnDirect.Sensitive = true;
29
NotifyOnPublicFriends.Sensitive = true;
30
NotifyOnBoth.Sensitive = true;
36
void UpdateFromGConf () {
40
SourceCombobox.Active = (int) MainWindow.client.Get (MainWindow.SOURCE_KEY);
42
UsernameEntry.Text = (string) MainWindow.client.Get (MainWindow.USERNAME_KEY);
43
PasswordEntry.Text = (string) MainWindow.client.Get (MainWindow.PASSWORD_KEY);
45
RefreshCombobox.Active = (int) MainWindow.client.Get (MainWindow.REFRESH_KEY);
47
HiddenCheckbutton.Active = (bool) MainWindow.client.Get (MainWindow.HIDDEN_KEY);
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);
57
if (MainClass.debug) {
58
Console.WriteLine("Preferences Window GConf exception: PreferencesWindow.cs - UpdateFromGConf()");
59
Console.WriteLine(ex.StackTrace);
64
public void GConf_Changed (object sender, NotifyEventArgs args) {
70
protected virtual void OnOkButtonClicked(object sender, System.EventArgs e)
72
MainWindow.client.Set (MainWindow.SOURCE_KEY, SourceCombobox.Active);
74
MainWindow.client.Set (MainWindow.USERNAME_KEY, UsernameEntry.Text);
75
MainWindow.client.Set (MainWindow.PASSWORD_KEY, PasswordEntry.Text);
77
MainWindow.client.Set (MainWindow.REFRESH_KEY, RefreshCombobox.Active);
79
MainWindow.client.Set (MainWindow.HIDDEN_KEY, HiddenCheckbutton.Active);
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);
87
ClearCacheLabel.Text = "";
92
protected virtual void OnDeleteEvent(object o, Gtk.DeleteEventArgs args)
94
ClearCacheLabel.Text = "";
100
protected virtual void OnClearCacheButtonClicked(object sender, System.EventArgs e)
102
Directory.Delete(gtwitter.MainWindow.configDir + "images/", true);
104
Directory.CreateDirectory(gtwitter.MainWindow.configDir + "images");
106
ClearCacheLabel.Text = Catalog.GetString("Done!");
109
// call the GNOME Default browser to open the Twitter.com signup url
110
protected virtual void OnSignUpClicked(object sender, System.EventArgs e)
112
Gnome.Url.Show ("http://twitter.com/signup");
115
//Toggle notifications event
116
protected virtual void EnableNotifyCheckButtonToggled(object sender, System.EventArgs e)
118
if(EnableNotifyCheckButton.Active == true)
120
MainWindow.client.Set (MainWindow.NOTIFY_KEY, EnableNotifyCheckButton.Active);
122
NotifyOnDirect.Sensitive = true;
123
NotifyOnPublicFriends.Sensitive = true;
124
NotifyOnBoth.Sensitive = true;
128
MainWindow.client.Set (MainWindow.NOTIFY_KEY, EnableNotifyCheckButton.Active);
130
NotifyOnDirect.Sensitive = false;
131
NotifyOnPublicFriends.Sensitive = false;
132
NotifyOnBoth.Sensitive = false;
b'\\ No newline at end of file'