Add a broken 'Added' event in sparklerepo
This commit is contained in:
parent
7c42ba2cde
commit
7befe3ee43
|
@ -69,34 +69,37 @@ namespace SparkleShare {
|
|||
|
||||
VBox layout_vertical = new VBox (false, 0);
|
||||
|
||||
Label introduction = new Label ("<span size='x-large'><b>Welcome to SparkleShare!</b></span>");
|
||||
introduction.UseMarkup = true;
|
||||
introduction.Xalign = 0;
|
||||
Label introduction = new Label ("<span size='x-large'><b>Welcome to SparkleShare!</b></span>") {
|
||||
UseMarkup = true,
|
||||
Xalign = 0
|
||||
};
|
||||
|
||||
Label information = new Label ("Before we can create a SparkleShare folder on this " +
|
||||
"computer, we need a few bits of information from you.");
|
||||
information.Xalign = 0;
|
||||
information.Wrap = true;
|
||||
|
||||
|
||||
Entry name_entry = new Entry ("");
|
||||
Label name_label = new Label (_("<b>Full Name:</b>"));
|
||||
"computer, we need a few bits of information from you.") {
|
||||
Xalign = 0,
|
||||
Wrap = true
|
||||
};
|
||||
|
||||
UnixUserInfo unix_user_info = new UnixUserInfo (UnixEnvironment.UserName);
|
||||
|
||||
name_entry.Text = unix_user_info.RealName;
|
||||
name_label.UseMarkup = true;
|
||||
name_label.Xalign = 0;
|
||||
Label name_label = new Label (_("<b>Full Name:</b>")) {
|
||||
Text = unix_user_info.RealName,
|
||||
UseMarkup = true,
|
||||
Xalign = 0
|
||||
};
|
||||
|
||||
Entry name_entry = new Entry ("");
|
||||
|
||||
Table table = new Table (6, 2, true);
|
||||
table.RowSpacing = 6;
|
||||
Table table = new Table (6, 2, true) {
|
||||
RowSpacing = 6
|
||||
};
|
||||
|
||||
|
||||
Entry email_entry = new Entry ("");
|
||||
Label email_label = new Label (_("<b>Email:</b>"));
|
||||
email_label.UseMarkup = true;
|
||||
email_label.Xalign = 0;
|
||||
Label email_label = new Label (_("<b>Email:</b>")) {
|
||||
UseMarkup = true,
|
||||
Xalign = 0
|
||||
};
|
||||
|
||||
Entry server_entry = new Entry ("ssh://gitorious.org/sparkleshare");
|
||||
Label server_label = new Label (_("<b>Folder Address:</b>"));
|
||||
|
|
|
@ -45,6 +45,11 @@ namespace SparkleShare {
|
|||
public string UserEmail;
|
||||
public string UserName;
|
||||
|
||||
|
||||
public delegate void AddedEventHandler (object o, SparkleEventArgs args);
|
||||
public event AddedEventHandler Added;
|
||||
|
||||
|
||||
public static string _ (string s)
|
||||
{
|
||||
return Catalog.GetString (s);
|
||||
|
@ -311,6 +316,10 @@ namespace SparkleShare {
|
|||
// SparkleUI.NotificationIcon.SetSyncingState ();
|
||||
// SparkleUI.NotificationIcon.SetIdleState ();
|
||||
|
||||
SparkleEventArgs args = new SparkleEventArgs ("add test");
|
||||
if (Added != null)
|
||||
Added (this, args);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -637,4 +646,15 @@ namespace SparkleShare {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -24,13 +24,12 @@ using System.IO;
|
|||
|
||||
namespace SparkleShare {
|
||||
|
||||
public class SparkleUI
|
||||
{
|
||||
public class SparkleUI {
|
||||
|
||||
private Process Process;
|
||||
|
||||
// Short alias for the translations
|
||||
public static string _ (string s)
|
||||
public static string _(string s)
|
||||
{
|
||||
return Catalog.GetString (s);
|
||||
}
|
||||
|
@ -217,6 +216,10 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
|
||||
public void Test (object o, SparkleEventArgs args) {
|
||||
Console.WriteLine ("AAAAAAAAAAAAAAAAAA");
|
||||
}
|
||||
|
||||
public void UpdateRepositories ()
|
||||
{
|
||||
|
||||
|
@ -251,11 +254,31 @@ namespace SparkleShare {
|
|||
|
||||
}
|
||||
|
||||
SparkleRepo a = TmpRepos [0];
|
||||
a.Added += new SparkleRepo.AddedEventHandler (Test);
|
||||
|
||||
|
||||
SparkleShare.Repositories = new SparkleRepo [FolderCount];
|
||||
Array.Copy (TmpRepos, SparkleShare.Repositories, FolderCount);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public class SparkleEventArgs : System.EventArgs {
|
||||
|
||||
private string message;
|
||||
|
||||
|
||||
public SparkleEventArgs (string s)
|
||||
{
|
||||
this.message = s;
|
||||
}
|
||||
|
||||
public string Message ()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue