SparkleDialog: update coding style
This commit is contained in:
parent
75d770eb02
commit
57f02b92d2
|
@ -28,15 +28,16 @@ namespace SparkleShare {
|
||||||
public class SparkleDialog : Window {
|
public class SparkleDialog : Window {
|
||||||
|
|
||||||
// Short alias for the translations
|
// Short alias for the translations
|
||||||
public static string _ (string s) {
|
public static string _ (string s)
|
||||||
|
{
|
||||||
return Catalog.GetString (s);
|
return Catalog.GetString (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Button AddButton;
|
private Button AddButton;
|
||||||
private ComboBoxEntry RemoteUrlCombo;
|
private ComboBoxEntry RemoteUrlCombo;
|
||||||
|
|
||||||
public SparkleDialog (string Url) : base ("") {
|
public SparkleDialog (string Url) : base ("")
|
||||||
|
{
|
||||||
BorderWidth = 12;
|
BorderWidth = 12;
|
||||||
IconName = "folder-sparkleshare";
|
IconName = "folder-sparkleshare";
|
||||||
WidthRequest = 320;
|
WidthRequest = 320;
|
||||||
|
@ -46,8 +47,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
VBox VBox = new VBox (false, 0);
|
VBox VBox = new VBox (false, 0);
|
||||||
|
|
||||||
Label RemoteUrlLabel =
|
Label RemoteUrlLabel = new Label (_("Address of remote SparkleShare folder:"));
|
||||||
new Label (_("Address of remote SparkleShare folder:"));
|
|
||||||
RemoteUrlLabel.Xalign = 0;
|
RemoteUrlLabel.Xalign = 0;
|
||||||
|
|
||||||
ListStore Defaults = new ListStore (typeof (string));
|
ListStore Defaults = new ListStore (typeof (string));
|
||||||
|
@ -121,16 +121,14 @@ namespace SparkleShare {
|
||||||
else
|
else
|
||||||
RepoName = RepoRemoteUrl.Substring (ColumnPos + 1);
|
RepoName = RepoRemoteUrl.Substring (ColumnPos + 1);
|
||||||
|
|
||||||
|
SparkleBubble SyncingBubble;
|
||||||
SparkleBubble SyncingBubble =
|
SyncingBubble = new SparkleBubble (String.Format(_("Syncing folder ‘{0}’"), RepoName),
|
||||||
new SparkleBubble (String.Format(_("Syncing folder ‘{0}’"), RepoName),
|
|
||||||
_("SparkleShare will notify you when this is done."));
|
_("SparkleShare will notify you when this is done."));
|
||||||
|
|
||||||
SyncingBubble.AddAction ("", _("Dismiss"),
|
SyncingBubble.AddAction ("", _("Dismiss"),
|
||||||
delegate {
|
delegate {
|
||||||
SyncingBubble.Close ();
|
SyncingBubble.Close ();
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
SyncingBubble.Show ();
|
SyncingBubble.Show ();
|
||||||
|
|
||||||
|
@ -139,8 +137,7 @@ namespace SparkleShare {
|
||||||
Process.StartInfo.RedirectStandardOutput = true;
|
Process.StartInfo.RedirectStandardOutput = true;
|
||||||
Process.StartInfo.UseShellExecute = false;
|
Process.StartInfo.UseShellExecute = false;
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Config",
|
SparkleHelpers.DebugInfo ("Config", "[" + RepoName + "] Cloning repository...");
|
||||||
"[" + RepoName + "] Cloning repository...");
|
|
||||||
|
|
||||||
// Clone into the system's temporary folder
|
// Clone into the system's temporary folder
|
||||||
Process.StartInfo.FileName = "git";
|
Process.StartInfo.FileName = "git";
|
||||||
|
@ -154,40 +151,36 @@ namespace SparkleShare {
|
||||||
|
|
||||||
if (Process.ExitCode != 0) {
|
if (Process.ExitCode != 0) {
|
||||||
|
|
||||||
SparkleBubble ErrorBubble =
|
SparkleBubble ErrorBubble;
|
||||||
new SparkleBubble (String.Format(_("Something went wrong while syncing ‘{0}’"), RepoName),
|
ErrorBubble = new SparkleBubble (String.Format(_("Something went wrong while syncing ‘{0}’"), RepoName),
|
||||||
"Please double check the address and\n" +
|
"Please double check the address and\n" +
|
||||||
"network connection.");
|
"network connection.");
|
||||||
|
|
||||||
ErrorBubble.AddAction ("", _("Try Again…"),
|
ErrorBubble.AddAction ("", _("Try Again…"),
|
||||||
delegate {
|
delegate {
|
||||||
SparkleDialog SparkleDialog =
|
SparkleDialog SparkleDialog = new SparkleDialog (RepoRemoteUrl);
|
||||||
new SparkleDialog (RepoRemoteUrl);
|
|
||||||
SparkleDialog.ShowAll ();
|
SparkleDialog.ShowAll ();
|
||||||
}
|
});
|
||||||
);
|
|
||||||
ErrorBubble.Show ();
|
ErrorBubble.Show ();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
SparkleHelpers.DebugInfo ("Git", "[" + RepoName + "] Repository cloned");
|
||||||
SparkleShare.SparkleUI.UpdateRepositories ();
|
SparkleShare.SparkleUI.UpdateRepositories ();
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Git",
|
|
||||||
"[" + RepoName + "] Repository cloned");
|
|
||||||
// Show a confirmation notification
|
// Show a confirmation notification
|
||||||
SparkleBubble FinishedBubble =
|
SparkleBubble FinishedBubble;
|
||||||
new SparkleBubble (String.Format(_("Successfully synced folder ‘{0}’"), RepoName),
|
FinishedBubble = new SparkleBubble (String.Format(_("Successfully synced folder ‘{0}’"), RepoName),
|
||||||
_("Now make great stuff happen!"));
|
_("Now make great stuff happen!"));
|
||||||
|
|
||||||
FinishedBubble.AddAction ("", _("Open Folder"),
|
FinishedBubble.AddAction ("", _("Open Folder"),
|
||||||
delegate {
|
delegate {
|
||||||
Process.StartInfo.FileName = "xdg-open";
|
Process.StartInfo.FileName = "xdg-open";
|
||||||
Process.StartInfo.Arguments =
|
Process.StartInfo.Arguments = SparkleHelpers.CombineMore (SparklePaths.SparklePath, RepoName);
|
||||||
SparkleHelpers.CombineMore (
|
|
||||||
SparklePaths.SparklePath, RepoName);
|
|
||||||
Process.Start ();
|
Process.Start ();
|
||||||
} );
|
} );
|
||||||
FinishedBubble.Show ();
|
FinishedBubble.Show ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue