diff --git a/SparkleShare/Common/AboutController.cs b/SparkleShare/Common/AboutController.cs index 60c4e91a..649f6477 100644 --- a/SparkleShare/Common/AboutController.cs +++ b/SparkleShare/Common/AboutController.cs @@ -23,7 +23,7 @@ using Sparkles; namespace SparkleShare { - public class SparkleAboutController { + public class AboutController { public event Action ShowWindowEvent = delegate { }; public event Action HideWindowEvent = delegate { }; @@ -39,7 +39,7 @@ namespace SparkleShare { public string RunningVersion; - public SparkleAboutController () + public AboutController () { RunningVersion = InstallationInfo.Version; diff --git a/SparkleShare/Common/BaseController.cs b/SparkleShare/Common/BaseController.cs index 4dfa0c88..91a6e5b5 100644 --- a/SparkleShare/Common/BaseController.cs +++ b/SparkleShare/Common/BaseController.cs @@ -278,8 +278,6 @@ namespace SparkleShare { }).Start (); } - - AlertNotificationRaised ("Hello!", "This is a test"); } diff --git a/SparkleShare/Common/BubblesController.cs b/SparkleShare/Common/BubblesController.cs index 7ed3dfaf..542fd6c6 100644 --- a/SparkleShare/Common/BubblesController.cs +++ b/SparkleShare/Common/BubblesController.cs @@ -15,20 +15,18 @@ // along with this program. If not, see . -using System; using System.Text; - using Sparkles; namespace SparkleShare { - public class SparkleBubblesController { + public class BubblesController { public event ShowBubbleEventHandler ShowBubbleEvent = delegate { }; public delegate void ShowBubbleEventHandler (string title, string subtext, string image_path); - public SparkleBubblesController () + public BubblesController () { SparkleShare.Controller.AlertNotificationRaised += delegate (string title, string message) { ShowBubble (title, message, null); diff --git a/SparkleShare/Common/EventLogController.cs b/SparkleShare/Common/EventLogController.cs index acbf4239..51fd4d9c 100644 --- a/SparkleShare/Common/EventLogController.cs +++ b/SparkleShare/Common/EventLogController.cs @@ -28,7 +28,7 @@ using Sparkles; namespace SparkleShare { - public class SparkleEventLogController { + public class EventLogController { public event Action ShowWindowEvent = delegate { }; public event Action HideWindowEvent = delegate { }; @@ -144,7 +144,7 @@ namespace SparkleShare { } - public SparkleEventLogController () + public EventLogController () { SparkleShare.Controller.ShowEventLogWindowEvent += delegate { if (!WindowIsOpen) { diff --git a/SparkleShare/Common/NoteController.cs b/SparkleShare/Common/NoteController.cs index 6edcd82d..8a00de02 100644 --- a/SparkleShare/Common/NoteController.cs +++ b/SparkleShare/Common/NoteController.cs @@ -22,7 +22,7 @@ using Sparkles; namespace SparkleShare { - public class SparkleNoteController { + public class NoteController { public event Action ShowWindowEvent = delegate { }; public event Action HideWindowEvent = delegate { }; @@ -34,7 +34,7 @@ namespace SparkleShare { public string CurrentProject { get; private set; } - public SparkleNoteController () + public NoteController () { SparkleShare.Controller.ShowNoteWindowEvent += OnNoteWindowEvent; diff --git a/SparkleShare/Common/SetupController.cs b/SparkleShare/Common/SetupController.cs index 9897ef0a..d54ff297 100644 --- a/SparkleShare/Common/SetupController.cs +++ b/SparkleShare/Common/SetupController.cs @@ -44,7 +44,7 @@ namespace SparkleShare { } - public class SparkleSetupController { + public class SetupController { public event Action ShowWindowEvent = delegate { }; public event Action HideWindowEvent = delegate { }; @@ -105,7 +105,7 @@ namespace SparkleShare { private bool fetch_prior_history = false; - public SparkleSetupController () + public SetupController () { ChangePageEvent += delegate (PageType page_type, string [] warnings) { this.current_page = page_type; diff --git a/SparkleShare/Common/StatusIconController.cs b/SparkleShare/Common/StatusIconController.cs index bfc3d2e2..d992a5e3 100644 --- a/SparkleShare/Common/StatusIconController.cs +++ b/SparkleShare/Common/StatusIconController.cs @@ -118,7 +118,7 @@ namespace SparkleShare { } - public class SparkleStatusIconController { + public class StatusIconController { public event UpdateIconEventHandler UpdateIconEvent = delegate { }; public delegate void UpdateIconEventHandler (IconState state); @@ -184,7 +184,7 @@ namespace SparkleShare { } - public SparkleStatusIconController () + public StatusIconController () { UpdateFolders (); diff --git a/SparkleShare/Linux/About.cs b/SparkleShare/Linux/About.cs index ddaec56b..c3683c63 100755 --- a/SparkleShare/Linux/About.cs +++ b/SparkleShare/Linux/About.cs @@ -22,7 +22,7 @@ namespace SparkleShare { public class SparkleAbout : Window { - public SparkleAboutController Controller = new SparkleAboutController (); + public AboutController Controller = new AboutController (); private Label updates; diff --git a/SparkleShare/Linux/Bubbles.cs b/SparkleShare/Linux/Bubbles.cs index 8aa3ac6b..5a031f62 100755 --- a/SparkleShare/Linux/Bubbles.cs +++ b/SparkleShare/Linux/Bubbles.cs @@ -24,12 +24,12 @@ using Sparkles; namespace SparkleShare { - public class SparkleBubbles { + public class Bubbles { - public SparkleBubblesController Controller = new SparkleBubblesController (); + public BubblesController Controller = new BubblesController (); - public SparkleBubbles () + public Bubbles () { Controller.ShowBubbleEvent += ShowBubbleEvent; } diff --git a/SparkleShare/Linux/EventLog.cs b/SparkleShare/Linux/EventLog.cs index 002d2ff3..5fe9a298 100755 --- a/SparkleShare/Linux/EventLog.cs +++ b/SparkleShare/Linux/EventLog.cs @@ -23,9 +23,9 @@ using Gtk; namespace SparkleShare { - public class SparkleEventLog : Window { + public class EventLog : Window { - public SparkleEventLogController Controller = new SparkleEventLogController (); + public EventLogController Controller = new EventLogController (); private Label size_label; private Label history_label; @@ -35,13 +35,13 @@ namespace SparkleShare { private HBox layout_horizontal; private ScrolledWindow scrolled_window; private VBox spinner_wrapper; - // private Spinner spinner; + private Spinner spinner; // private WebView web_view; private int pos_x, pos_y; - public SparkleEventLog () : base ("Recent Changes") + public EventLog () : base ("Recent Changes") { SetWmclass ("SparkleShare", "SparkleShare"); @@ -84,8 +84,8 @@ namespace SparkleShare { this.spinner_wrapper.PackStart (new Label(""), true, true, 0); this.spinner_wrapper.PackStart (this.spinner, false, false, 0); this.spinner_wrapper.PackStart (new Label(""), true, true, 0); - // this.spinner.SetSizeRequest (24, 24); - // this.spinner.Start (); + this.spinner.SetSizeRequest (24, 24); + this.spinner.Start (); this.content_wrapper.Add (this.spinner_wrapper); diff --git a/SparkleShare/Linux/Makefile.am b/SparkleShare/Linux/Makefile.am index 235e6f61..e3f0c2e9 100644 --- a/SparkleShare/Linux/Makefile.am +++ b/SparkleShare/Linux/Makefile.am @@ -16,7 +16,6 @@ SOURCES = \ ../Common/BubblesController.cs \ ../Common/BaseController.cs \ ../Common/EventLogController.cs \ - ../Common/Invite.cs \ ../Common/NoteController.cs \ ../Common/SetupController.cs \ ../Common/StatusIconController.cs \ diff --git a/SparkleShare/Linux/Note.cs b/SparkleShare/Linux/Note.cs old mode 100755 new mode 100644 index c37f09b1..f0ed4b7f --- a/SparkleShare/Linux/Note.cs +++ b/SparkleShare/Linux/Note.cs @@ -15,17 +15,16 @@ // along with this program. If not, see (http://www.gnu.org/licenses/). -using System; using Gtk; namespace SparkleShare { - public class SparkleNote : Window { + public class Note : Window { - public SparkleNoteController Controller = new SparkleNoteController (); + public NoteController Controller = new NoteController (); - public SparkleNote () : base ("Add Note") + public Note () : base ("Add Note") { SetWmclass ("SparkleShare", "SparkleShare"); diff --git a/SparkleShare/Linux/Setup.cs b/SparkleShare/Linux/Setup.cs index f2ffb608..24a00419 100755 --- a/SparkleShare/Linux/Setup.cs +++ b/SparkleShare/Linux/Setup.cs @@ -20,14 +20,16 @@ using System; using Gtk; using Mono.Unix; +using Sparkles; + namespace SparkleShare { - public class SparkleSetup : SparkleSetupWindow { + public class Setup : SetupWindow { - public SparkleSetupController Controller = new SparkleSetupController (); + public SetupController Controller = new SetupController (); - public SparkleSetup () : base () + public Setup () { Controller.HideWindowEvent += delegate { Application.Invoke (delegate { Hide (); }); @@ -71,11 +73,11 @@ namespace SparkleShare { ActivatesDefault = true }; - try { + try { UnixUserInfo user_info = UnixUserInfo.GetRealUser (); if (user_info != null && user_info.RealName != null) - // Some systems append a series of "," for some reason + // Some systems append a series of "," for some reason, TODO: Report upstream name_entry.Text = user_info.RealName.TrimEnd (",".ToCharArray ()); } catch (ArgumentException) { @@ -698,7 +700,7 @@ namespace SparkleShare { private void RenderServiceColumn (TreeViewColumn column, CellRenderer cell, - TreeModel model, TreeIter iter) + ITreeModel model, TreeIter iter) { string markup = (string) model.GetValue (iter, 2); TreeSelection selection = (column.TreeView as TreeView).Selection; diff --git a/SparkleShare/Linux/SetupWindow.cs b/SparkleShare/Linux/SetupWindow.cs old mode 100755 new mode 100644 index 35ae4fa3..1761752c --- a/SparkleShare/Linux/SetupWindow.cs +++ b/SparkleShare/Linux/SetupWindow.cs @@ -20,7 +20,7 @@ using Gtk; namespace SparkleShare { - public class SparkleSetupWindow : Window { + public class SetupWindow : Window { private EventBox content_area; private EventBox option_area; @@ -30,7 +30,7 @@ namespace SparkleShare { public string Description; - public SparkleSetupWindow () : base ("SparkleShare Setup") + public SetupWindow () : base ("SparkleShare Setup") { SetWmclass ("SparkleShare", "SparkleShare"); diff --git a/SparkleShare/Linux/StatusIcon.cs b/SparkleShare/Linux/StatusIcon.cs index 0d0967c3..71ac9959 100644 --- a/SparkleShare/Linux/StatusIcon.cs +++ b/SparkleShare/Linux/StatusIcon.cs @@ -27,31 +27,31 @@ using AppIndicator3; namespace SparkleShare { - public class SparkleStatusIcon { + public class StatusIcon { - public SparkleStatusIconController Controller = new SparkleStatusIconController (); + public StatusIconController Controller = new StatusIconController (); - private Menu menu; - private MenuItem recent_events_item; - private MenuItem quit_item; - private MenuItem state_item; - private SparkleMenuItem [] state_menu_items; + Menu menu; + MenuItem recent_events_item; + MenuItem quit_item; + MenuItem state_item; + SparkleMenuItem [] state_menu_items; #if HAVE_APP_INDICATOR - private Indicator indicator; + Indicator indicator; #else - private StatusIcon status_icon; + Gtk.StatusIcon status_icon; #endif - public SparkleStatusIcon () + public StatusIcon () { #if HAVE_APP_INDICATOR this.indicator = new Indicator ("sparkleshare", "sparkleshare", (int) IndicatorCategory.ApplicationStatus); this.indicator.IconName = "process-syncing-idle"; this.indicator.Status = (int) IndicatorStatus.Active; #else - this.status_icon = new StatusIcon (); + this.status_icon = new Gtk.StatusIcon (); this.status_icon.IconName = "org.sparkleshare.SparkleShare"; this.status_icon.Activate += ShowMenu; // Primary mouse button click @@ -281,7 +281,7 @@ namespace SparkleShare { // Makes sure the menu pops up in the right position private void SetPosition (Menu menu, out int x, out int y, out bool push_in) { - StatusIcon.PositionMenu (menu, out x, out y, out push_in, this.status_icon.Handle); + Gtk.StatusIcon.PositionMenu (menu, out x, out y, out push_in, this.status_icon.Handle); } #endif } diff --git a/SparkleShare/Linux/UserInterface.cs b/SparkleShare/Linux/UserInterface.cs index b15b2857..30c118df 100644 --- a/SparkleShare/Linux/UserInterface.cs +++ b/SparkleShare/Linux/UserInterface.cs @@ -17,9 +17,7 @@ using System; -using GLib; using Gtk; - using Sparkles; namespace SparkleShare { @@ -28,22 +26,22 @@ namespace SparkleShare { public static string AssetsPath = InstallationInfo.Directory; - public SparkleStatusIcon StatusIcon; - public SparkleEventLog EventLog; - public SparkleBubbles Bubbles; - public SparkleSetup Setup; + public StatusIcon StatusIcon; + public EventLog EventLog; + public Bubbles Bubbles; + public Setup Setup; public SparkleAbout About; - public SparkleNote Note; + public Note Note; public readonly string SecondaryTextColor; public readonly string SecondaryTextColorSelected; - Gtk.Application application; + Application application; public UserInterface () { - application = new Gtk.Application ("org.sparkleshare.SparkleShare", 0); + application = new Application ("org.sparkleshare.SparkleShare", 0); application.Register (null); application.Activated += ApplicationActivatedDelegate; @@ -82,12 +80,12 @@ namespace SparkleShare { SparkleShare.Controller.HandleReopen (); } else { - Setup = new SparkleSetup (); - EventLog = new SparkleEventLog (); + Setup = new Setup (); + EventLog = new EventLog (); About = new SparkleAbout (); - Bubbles = new SparkleBubbles (); - StatusIcon = new SparkleStatusIcon (); - Note = new SparkleNote (); + Bubbles = new Bubbles (); + StatusIcon = new StatusIcon (); + Note = new Note (); Setup.Application = application; EventLog.Application = application; diff --git a/SparkleShare/Linux/UserInterfaceHelpers.cs b/SparkleShare/Linux/UserInterfaceHelpers.cs index feb8366c..4983469d 100755 --- a/SparkleShare/Linux/UserInterfaceHelpers.cs +++ b/SparkleShare/Linux/UserInterfaceHelpers.cs @@ -57,14 +57,14 @@ namespace SparkleShare { // Example: from "rgb:0,0,0" to "#000000" public static string ColorToHex (Gdk.Color color) { - return String.Format ("#{0:X2}{1:X2}{2:X2}", + return string.Format ("#{0:X2}{1:X2}{2:X2}", (int) Math.Truncate (color.Red / 256.00), (int) Math.Truncate (color.Green / 256.00), (int) Math.Truncate (color.Blue / 256.00)); } - public static Gdk.Color RGBAToColor (Gdk.Rgb rgba) { + public static Gdk.Color RGBAToColor (Gdk.RGBA rgba) { return new Gdk.Color () { Red = (ushort) (rgba.Red * 65535), Green = (ushort) (rgba.Green * 65535), @@ -73,7 +73,7 @@ namespace SparkleShare { } - public static string RGBAToHex (Gdk.Rgb rgba) + public static string RGBAToHex (Gdk.RGBA rgba) { return ColorToHex (RGBAToColor (rgba)); } diff --git a/SparkleShare/Mac/UserInterface/About.cs b/SparkleShare/Mac/UserInterface/About.cs index 36fe100d..edc0f528 100644 --- a/SparkleShare/Mac/UserInterface/About.cs +++ b/SparkleShare/Mac/UserInterface/About.cs @@ -25,7 +25,7 @@ namespace SparkleShare { public class About : NSWindow { - public SparkleAboutController Controller = new SparkleAboutController (); + public AboutController Controller = new AboutController (); private NSTextField version_text_field, updates_text_field, credits_text_field; private SparkleLink website_link, credits_link, report_problem_link, debug_log_link; diff --git a/SparkleShare/Mac/UserInterface/Bubbles.cs b/SparkleShare/Mac/UserInterface/Bubbles.cs index 4f1f6ad0..a89026d5 100755 --- a/SparkleShare/Mac/UserInterface/Bubbles.cs +++ b/SparkleShare/Mac/UserInterface/Bubbles.cs @@ -22,7 +22,7 @@ namespace SparkleShare { public class Bubbles : NSObject { - public SparkleBubblesController Controller = new SparkleBubblesController (); + public BubblesController Controller = new BubblesController (); public Bubbles () @@ -33,9 +33,9 @@ namespace SparkleShare { } - private void ShowBubbleEvent (string title, string subtext, string image_path) { + void ShowBubbleEvent (string title, string subtext, string image_path) { InvokeOnMainThread (() => { - NSUserNotification notification = new NSUserNotification () { + var notification = new NSUserNotification { Title = title, InformativeText = subtext, DeliveryDate = DateTime.Now @@ -43,8 +43,8 @@ namespace SparkleShare { NSUserNotificationCenter center = NSUserNotificationCenter.DefaultUserNotificationCenter; center.ShouldPresentNotification = delegate { return true; }; - center.DidActivateNotification += delegate { Controller.BubbleClicked (); }; + center.DidActivateNotification += delegate { Controller.BubbleClicked (); }; center.ScheduleNotification (notification); }); } diff --git a/SparkleShare/Mac/UserInterface/EventLog.cs b/SparkleShare/Mac/UserInterface/EventLog.cs index ca028386..c0ae83e7 100644 --- a/SparkleShare/Mac/UserInterface/EventLog.cs +++ b/SparkleShare/Mac/UserInterface/EventLog.cs @@ -27,7 +27,7 @@ namespace SparkleShare { public class EventLog : NSWindow { - public SparkleEventLogController Controller = new SparkleEventLogController (); + public EventLogController Controller = new EventLogController (); public float TitlebarHeight; WebView web_view; diff --git a/SparkleShare/Mac/UserInterface/Note.cs b/SparkleShare/Mac/UserInterface/Note.cs index a32f4865..a2a33f4f 100644 --- a/SparkleShare/Mac/UserInterface/Note.cs +++ b/SparkleShare/Mac/UserInterface/Note.cs @@ -25,7 +25,7 @@ namespace SparkleShare { public class Note : NSWindow { - public SparkleNoteController Controller = new SparkleNoteController (); + public NoteController Controller = new NoteController (); private NSImage user_image, balloon_image; private NSImageView user_image_view, balloon_image_view; diff --git a/SparkleShare/Mac/UserInterface/Setup.cs b/SparkleShare/Mac/UserInterface/Setup.cs index 79e8d8ae..ff3014a3 100644 --- a/SparkleShare/Mac/UserInterface/Setup.cs +++ b/SparkleShare/Mac/UserInterface/Setup.cs @@ -31,7 +31,7 @@ namespace SparkleShare { public class Setup : SetupWindow { - public SparkleSetupController Controller = new SparkleSetupController (); + public SetupController Controller = new SetupController (); private NSButton ContinueButton, AddButton, CopyButton, TryAgainButton, CancelButton, SkipTutorialButton, FinishButton, ShowFilesButton; diff --git a/SparkleShare/Mac/UserInterface/StatusIcon.cs b/SparkleShare/Mac/UserInterface/StatusIcon.cs index 4f6e222d..fe4abf6a 100644 --- a/SparkleShare/Mac/UserInterface/StatusIcon.cs +++ b/SparkleShare/Mac/UserInterface/StatusIcon.cs @@ -25,7 +25,7 @@ namespace SparkleShare { public class StatusIcon { - public SparkleStatusIconController Controller = new SparkleStatusIconController (); + public StatusIconController Controller = new StatusIconController (); private NSStatusItem status_item = NSStatusBar.SystemStatusBar.CreateStatusItem (28); private NSMenu menu, submenu, link_code_submenu;