add another platform switch

This commit is contained in:
Hylke Bons 2010-05-21 09:49:41 +01:00
parent 8b6e719fd2
commit fb80989511
4 changed files with 70 additions and 45 deletions

View file

@ -102,15 +102,7 @@ namespace SparkleShare {
public void CloneRepo (object o, EventArgs args) {
Remove (Child);
VBox Box = new VBox (false, 24);
SparkleSpinner Spinner = new SparkleSpinner ();
Label Label = new Label (_("Downloading files,\n") +
_("this may take a while..."));
Box.PackStart (Spinner, false, false, 0);
Box.PackStart (Label, false, false, 0);
BorderWidth = 30;
Add (Box);
Destroy ();
string RepoRemoteUrl = RemoteUrlCombo.Entry.Text;
string RepoName =
@ -121,8 +113,7 @@ namespace SparkleShare {
Process.StartInfo.RedirectStandardOutput = true;
Process.StartInfo.UseShellExecute = false;
Process.StartInfo.FileName = "git";
Process.StartInfo.WorkingDirectory =
SparklePaths.SparkleTmpPath;
Process.StartInfo.WorkingDirectory = SparklePaths.SparkleTmpPath;
Process.StartInfo.Arguments = "clone ";
Process.StartInfo.Arguments +=
@ -130,6 +121,10 @@ namespace SparkleShare {
Process.Start ();
SparkleBubble SparkleBubble =
new SparkleBubble ("Downloading " + RepoName + "",
"You will be notified when this is done");
// Move the folder to the SparkleShare folder when done cloning
Process.Exited += delegate {
Directory.Move (
@ -138,8 +133,21 @@ namespace SparkleShare {
SparkleHelpers.CombineMore (SparklePaths.SparklePath,
RepoName)
);
SparkleBubble =
new SparkleBubble ("Successfully added the folder" +
" " + RepoName + "",
"Now make great stuff happen!");
SparkleBubble.AddAction ("", "Open Folder",
delegate {
Process.StartInfo.FileName = "xdg-open";
Process.StartInfo.Arguments =
SparkleHelpers.CombineMore (
SparklePaths.SparklePath, RepoName);
Process.Start();
} );
Destroy ();
};
}

View file

@ -388,13 +388,21 @@ namespace SparkleShare {
// Add a button to open the folder where the changed file is
if (ShowButtons)
StuffChangedBubble.AddAction ("", "Open Folder",
delegate {
Process.StartInfo.FileName = "xdg-open";
Process.StartInfo.Arguments = LocalPath;
Process.Start();
Process.StartInfo.FileName = "git";
} );
StuffChangedBubble.AddAction
("", "Open Folder",
delegate {
switch (SparklePlatform.Name) {
case "GNOME":
Process.StartInfo.FileName = "xdg-open";
break;
case "OSX":
Process.StartInfo.FileName = "open";
break;
}
Process.StartInfo.Arguments = LocalPath;
Process.Start();
Process.StartInfo.FileName = "git";
} );
}

View file

@ -38,29 +38,36 @@ namespace SparkleShare {
// Create 'SparkleShare' folder in the user's home folder
// if it's not there already
if (!Directory.Exists (SparklePath)) {
Directory.CreateDirectory (SparklePath);
Console.WriteLine ("[Config] Created '" + SparklePath + "'");
if (SparklePlatform.Name.Equals ("GNOME")) {
// Add a special icon to the SparkleShare folder
Process.StartInfo.FileName = "gvfs-set-attribute";
Process.StartInfo.Arguments = SparklePath +
" metadata::custom-icon " +
"file:///usr/share/icons/hicolor/" +
"48x48/places/" +
"folder-sparkleshare.png";
Process.Start();
// Add a special icon to the SparkleShare folder
switch (SparklePlatform.Name) {
case "GNOME":
Process.StartInfo.FileName = "gvfs-set-attribute";
Process.StartInfo.Arguments = SparklePath +
" metadata::custom-icon " +
"file:///usr/share/icons/hicolor/" +
"48x48/places/" +
"folder-sparkleshare.png";
break;
}
Process.Start();
// Add the SparkleShare folder to the bookmarks
string BookmarksFileName =
Path.Combine (SparklePaths.HomePath, ".gtk-bookmarks");
if (File.Exists (BookmarksFileName)) {
TextWriter TextWriter = File.AppendText (BookmarksFileName);
TextWriter.WriteLine ("file://" + SparklePath + " SparkleShare");
TextWriter.Close();
}
// Add the SparkleShare folder to the bookmarks
switch (SparklePlatform.Name) {
case "GNOME":
string BookmarksFileName =
Path.Combine (SparklePaths.HomePath, ".gtk-bookmarks");
if (File.Exists (BookmarksFileName)) {
TextWriter TextWriter = File.AppendText (BookmarksFileName);
TextWriter.WriteLine ("file://" + SparklePath + " SparkleShare");
TextWriter.Close();
}
break;
}
}
@ -79,14 +86,16 @@ namespace SparkleShare {
i++;
// Attach emblems
if (SparklePlatform.Name.Equals ("GNOME")) {
Process.StartInfo.FileName = "gvfs-set-attribute";
Process.StartInfo.Arguments = " file://" + Folder +
" metadata::emblems " +
"[synced]";
Process.Start();
switch (SparklePlatform.Name) {
case "GNOME":
Process.StartInfo.FileName = "gvfs-set-attribute";
Process.StartInfo.Arguments = " file://" + Folder +
" metadata::emblems " +
"[synced]";
break;
}
Process.Start();
}
}

View file

@ -2,7 +2,7 @@
mkdir -p locale
if [ $# -ne 1 ]; then
echo "Usage: ./create-po-file [LOCALE].po"
echo "Usage: ./create-po-file [LOCALE].pot"
else
xgettext -a --from-code=UTF-8 SparkleShare/*.cs -o locale/$1
echo "Created locale/$1."