4
* GNOME Do is the legal property of its developers, whose names are too numerous
5
* to list here. Please refer to the COPYRIGHT file distributed with this
8
* This program is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
using System.Threading;
30
public partial class Configuration : Gtk.Bin
32
public Configuration()
35
string username, password;
37
GConf.Client gconf = new GConf.Client ();
39
username = gconf.Get (TwitterAction.GConfKeyBase + "username") as string;
40
password = gconf.Get (TwitterAction.GConfKeyBase + "password") as string;
41
} catch (GConf.NoSuchKeyException) {
46
username_entry.Text = username;
47
passwd_entry.Text = password;
50
protected virtual void OnNewAcctClicked (object sender, System.EventArgs e)
52
Util.Environment.Open ("https://twitter.com/signup");
55
protected virtual void OnApplyBtnClicked (object sender, System.EventArgs e)
57
string username = username_entry.Text.Trim ();
58
string password = passwd_entry.Text.Trim ();
60
apply_btn.Label = "Validating...";
61
apply_btn.Sensitive = false;
63
new Thread ((ThreadStart) delegate {
64
bool valid = TwitterAction.TryConnect (username, password);
66
Gtk.Application.Invoke (delegate {
68
valid_lbl.Markup = "<i>Account validation succeeded</i>!";
69
TwitterAction.SetAccountData (username, password);
71
valid_lbl.Markup = "<i>Account validation failed!</i>";
73
apply_btn.Label = "Apply";
74
apply_btn.Sensitive = true;