make gnome platform stuff conditional

This commit is contained in:
Hylke Bons 2010-05-13 23:51:01 +01:00
parent f25b2e1866
commit 1fdb48415c

View file

@ -44,18 +44,18 @@ namespace SparkleShare {
Directory.CreateDirectory (SparklePath); Directory.CreateDirectory (SparklePath);
Console.WriteLine ("[Config] Created '" + SparklePath + "'"); Console.WriteLine ("[Config] Created '" + SparklePath + "'");
// Linux/GNOME specific: 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 the SparkleShare folder to the bookmarks
if (SparklePlatform.Name.Equals ("GNOME")) { 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 the SparkleShare folder to the bookmarks
string BookmarksFileName = string BookmarksFileName =
Path.Combine (SparklePaths.HomePath, ".gtk-bookmarks"); Path.Combine (SparklePaths.HomePath, ".gtk-bookmarks");
if (File.Exists (BookmarksFileName)) { if (File.Exists (BookmarksFileName)) {
@ -63,6 +63,7 @@ namespace SparkleShare {
TextWriter.WriteLine ("file://" + SparklePath + " SparkleShare"); TextWriter.WriteLine ("file://" + SparklePath + " SparkleShare");
TextWriter.Close(); TextWriter.Close();
} }
} }
} }
@ -77,12 +78,14 @@ namespace SparkleShare {
Repositories [i] = new SparkleRepo (Folder); Repositories [i] = new SparkleRepo (Folder);
i++; i++;
// Linux/GNOME only: attach emblems // Attach emblems
Process.StartInfo.FileName = "gvfs-set-attribute"; if (SparklePlatform.Name.Equals ("GNOME")) {
Process.StartInfo.Arguments = " file://" + Folder + Process.StartInfo.FileName = "gvfs-set-attribute";
" metadata::emblems " + Process.StartInfo.Arguments = " file://" + Folder +
"[synced]"; " metadata::emblems " +
Process.Start(); "[synced]";
Process.Start();
}
} }