From 2600f8a43fb82ecc2365aba556686a3ac196a5ac Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 2 Nov 2014 13:23:32 +0000 Subject: [PATCH] linux note: Add template for Linux UI for adding a note --- News.txt | 1 + SparkleShare/Linux/Makefile.am | 2 + SparkleShare/Linux/SparkleNote.cs | 73 +++++++++++++++++++++++++++++++ SparkleShare/Mac/SparkleNote.cs | 1 - 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100755 SparkleShare/Linux/SparkleNote.cs diff --git a/News.txt b/News.txt index 523090c8..96c1548a 100755 --- a/News.txt +++ b/News.txt @@ -7,6 +7,7 @@ - Update certificate for Gravatar - Resizable "Recent Changes" window on Windows - Several stability fixes + - Improvements to filesystem watcher and exclude list 1.4.0 for Linux, Mac and Windows (Sun Apr 20, 2014): diff --git a/SparkleShare/Linux/Makefile.am b/SparkleShare/Linux/Makefile.am index 5c7ad307..b54a3922 100644 --- a/SparkleShare/Linux/Makefile.am +++ b/SparkleShare/Linux/Makefile.am @@ -19,6 +19,7 @@ SOURCES = \ ../SparkleExtensions.cs \ ../SparkleInvite.cs \ ../SparkleKeys.cs \ + ../SparkleNoteController.cs \ ../SparklePlugin.cs \ ../SparkleSetupController.cs \ ../SparkleStatusIconController.cs \ @@ -26,6 +27,7 @@ SOURCES = \ SparkleBubbles.cs \ SparkleController.cs \ SparkleEventLog.cs \ + SparkleNote.cs \ SparkleSetup.cs \ SparkleSetupWindow.cs \ SparkleStatusIcon.cs \ diff --git a/SparkleShare/Linux/SparkleNote.cs b/SparkleShare/Linux/SparkleNote.cs new file mode 100755 index 00000000..45dd5065 --- /dev/null +++ b/SparkleShare/Linux/SparkleNote.cs @@ -0,0 +1,73 @@ +// SparkleShare, a collaboration and sharing tool. +// Copyright (C) 2010 Hylke Bons (hylkebons@gmail.com) +// +// 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 (http://www.gnu.org/licenses/). + + +using System; +using Gtk; + +namespace SparkleShare { + + public class SparkleAbout : Window { + + public SparkleNoteController Controller = new SparkleNoteController (); + + + public SparkleAbout () : base ("Sync") + { + SetWmclass ("SparkleShare", "SparkleShare"); + + IconName = "sparkleshare"; + Resizable = false; + WindowPosition = WindowPosition.Center; + + SetSizeRequest (480, 240); + + + DeleteEvent += delegate (object o, DeleteEventArgs args) { + Controller.WindowClosed (); + args.RetVal = true; + }; + + KeyPressEvent += delegate (object o, KeyPressEventArgs args) { + if (args.Event.Key == Gdk.Key.Escape || + (args.Event.State == Gdk.ModifierType.ControlMask && args.Event.Key == Gdk.Key.w)) { + + Controller.WindowClosed (); + } + }; + + Controller.HideWindowEvent += delegate { + Application.Invoke (delegate { Hide (); }); + }; + + Controller.ShowWindowEvent += delegate { + Application.Invoke (delegate { + CreateNote (); + ShowAll (); + Present (); + }); + }; + + CreateNote (); + } + + + private void CreateNote () + { + // TODO + } + } +} diff --git a/SparkleShare/Mac/SparkleNote.cs b/SparkleShare/Mac/SparkleNote.cs index 9726032d..7d50ab30 100755 --- a/SparkleShare/Mac/SparkleNote.cs +++ b/SparkleShare/Mac/SparkleNote.cs @@ -17,7 +17,6 @@ using System; using System.Drawing; -using System.IO; using MonoMac.AppKit; using MonoMac.Foundation;