diff --git a/SparkleShare/SparklePlatform.cs b/SparkleShare/SparklePlatform.cs index e69de29b..ae7ceb85 100644 --- a/SparkleShare/SparklePlatform.cs +++ b/SparkleShare/SparklePlatform.cs @@ -0,0 +1,28 @@ +// SparkleShare, an instant update workflow to Git. +// Copyright (C) 2010 Hylke Bons +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +using System; + +namespace SparkleShare { + + public static class SparklePlatform { + + // Detect OSX, Windows, GNOME or KDE here + public static string Name = "GNOME"; + + } + +} diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index 4f6b8049..c8b208df 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -31,13 +31,13 @@ namespace SparkleShare { public SparkleUI (bool HideUI) { - string SparklePath = SparklePaths.SparklePath; - Process Process = new Process(); Process.EnableRaisingEvents = false; Process.StartInfo.RedirectStandardOutput = true; Process.StartInfo.UseShellExecute = false; + string SparklePath = SparklePaths.SparklePath; + // Create 'SparkleShare' folder in the user's home folder // if it's not there already if (!Directory.Exists (SparklePath)) { @@ -54,19 +54,19 @@ namespace SparkleShare { "folder-sparkleshare.png"; Process.Start(); - // Linux/GNOME specific: 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 + if (SparklePlatform.Name.Equals ("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(); + } } } - // Get all the repos in ~/SparkleShare string [] Repos = Directory.GetDirectories (SparklePath); Repositories = new SparkleRepo [Repos.Length];