diff --git a/SparkleShare/SparklePreferencesDialog.cs b/SparkleShare/SparklePreferencesDialog.cs deleted file mode 100644 index c1f41f29..00000000 --- a/SparkleShare/SparklePreferencesDialog.cs +++ /dev/null @@ -1,119 +0,0 @@ -// 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 Gtk; -using Mono.Unix; -using SparkleShare; -using System; -using System.Diagnostics; -using System.IO; - -namespace SparkleShare { - - // A dialog where the user can enter a folder - // name and url to sync changes with - public class SparklePreferencesDialog : Window { - - // Short alias for the translations - public static string _ (string s) { - return Catalog.GetString (s); - } - - public SparklePreferencesDialog (SparkleWindow SparkleWindow, - SparkleRepo SparkleRepo) : base ("") { - - BorderWidth = 12; - IconName = "folder-sparkleshare"; - Resizable = false; - SetPosition (WindowPosition.Center); - Title = _("Preferences"); - TransientFor = SparkleWindow; - - VBox LayoutVertical = new VBox (false, 0); - - Label InfoLabel = new Label (); - InfoLabel.Text = _("The folder ") + - "" + SparkleRepo.LocalPath + "" + - _("\nis linked to ") + - "" + SparkleRepo.RemoteOriginUrl + ""; - - InfoLabel.Xalign = 0; - InfoLabel.UseMarkup = true; - - CheckButton NotifyChangesCheckButton = - new CheckButton (_("Notify me when something changes")); - - string NotifyChangesFileName = - SparkleHelpers.CombineMore (SparkleRepo.LocalPath, - ".git", "sparkleshare.notify"); - - if (File.Exists (NotifyChangesFileName)) - NotifyChangesCheckButton.Active = true; - - NotifyChangesCheckButton.Toggled += delegate { - if (File.Exists (NotifyChangesFileName)) { - SparkleRepo.NotifyChanges = false; - File.Delete (NotifyChangesFileName); - } else { - SparkleRepo.NotifyChanges = true; - File.Create (NotifyChangesFileName); - } - }; - - CheckButton SyncChangesCheckButton = - new CheckButton (_("Synchronize my changes")); - - string SyncChangesFileName = - SparkleHelpers.CombineMore (SparkleRepo.LocalPath, - ".git", "sparkleshare.sync"); - - if (File.Exists (SyncChangesFileName)) - SyncChangesCheckButton.Active = true; - - SyncChangesCheckButton.Toggled += delegate { - if (File.Exists (SyncChangesFileName)) { - SparkleRepo.SyncChanges = false; - File.Delete (SyncChangesFileName); - } else { - SparkleRepo.SyncChanges = true; - File.Create (SyncChangesFileName); - } - }; - - HButtonBox DialogButtons = new HButtonBox (); - DialogButtons.Layout = ButtonBoxStyle.End; - DialogButtons.BorderWidth = 0; - - Button CloseButton = new Button (Stock.Close); - CloseButton.Clicked += delegate (object o, EventArgs args) { - Destroy (); - }; - DialogButtons.Add (CloseButton); - - LayoutVertical.PackStart (InfoLabel, false, false, 0); - LayoutVertical.PackStart (new Label (), false, false, 0); - LayoutVertical.PackStart (NotifyChangesCheckButton, false, false, 0); - LayoutVertical.PackStart (SyncChangesCheckButton, false, false, 3); - LayoutVertical.PackStart (new Label (), false, false, 0); - LayoutVertical.PackStart (DialogButtons, false, false, 0); - - Add (LayoutVertical); - - } - - } - -} diff --git a/SparkleShare/SparkleShare.csproj b/SparkleShare/SparkleShare.csproj index eb35b0d8..ae2552c2 100644 --- a/SparkleShare/SparkleShare.csproj +++ b/SparkleShare/SparkleShare.csproj @@ -39,7 +39,6 @@ - diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 0119a20b..6428ee15 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -39,7 +39,7 @@ namespace SparkleShare { StatusItem.Sensitive = false; Menu.Add (StatusItem); Menu.Add (new SeparatorMenuItem ()); - + MenuItem [] FolderItems = new MenuItem [SparkleShare.Repositories.Length]; @@ -64,6 +64,33 @@ namespace SparkleShare { Menu.Add (AddItem); Menu.Add (new SeparatorMenuItem ()); + CheckMenuItem NotifyCheckMenuItem = + new CheckMenuItem (_("Show notifications")); + Menu.Add (NotifyCheckMenuItem); + Menu.Add (new SeparatorMenuItem ()); + +/* + + string NotifyChangesFileName = + SparkleHelpers.CombineMore (SparkleRepo.LocalPath, + ".git", "sparkleshare.notify"); + + if (File.Exists (NotifyChangesFileName)) + NotifyChangesCheckButton.Active = true; + + NotifyChangesCheckButton.Toggled += delegate { + if (File.Exists (NotifyChangesFileName)) { + SparkleRepo.NotifyChanges = false; + File.Delete (NotifyChangesFileName); + } else { + SparkleRepo.NotifyChanges = true; + File.Create (NotifyChangesFileName); + } + }; + + +*/ + MenuItem OpenFolderItem = new MenuItem (_("Open Sharing Folder")); OpenFolderItem.Activated += delegate { Process Process = new Process ();