From 0bcb01ba21f417fadcce925db95ce153c6dcc765 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 8 Jul 2011 22:52:55 +0100 Subject: [PATCH] save --- SparkleShare/Makefile.am | 9 ++-- .../{SparkleBubble.cs => SparkleBubbles.cs} | 35 +++++++++---- SparkleShare/SparkleInfobar.cs | 50 ------------------- .../{SparkleIntro.cs => SparkleSetup.cs} | 0 ...SparkleWindow.cs => SparkleSetupWindow.cs} | 0 SparkleShare/SparkleShare.csproj | 7 ++- 6 files changed, 32 insertions(+), 69 deletions(-) rename SparkleShare/{SparkleBubble.cs => SparkleBubbles.cs} (52%) delete mode 100644 SparkleShare/SparkleInfobar.cs rename SparkleShare/{SparkleIntro.cs => SparkleSetup.cs} (100%) rename SparkleShare/{SparkleWindow.cs => SparkleSetupWindow.cs} (100%) diff --git a/SparkleShare/Makefile.am b/SparkleShare/Makefile.am index 6dcb8645..1b4f1754 100644 --- a/SparkleShare/Makefile.am +++ b/SparkleShare/Makefile.am @@ -13,23 +13,22 @@ endif SOURCES = \ SparkleAbout.cs \ - SparkleBubble.cs \ + SparkleBubbles.cs \ SparkleBubblesController.cs \ SparkleController.cs \ SparkleEntry.cs \ SparkleEventLog.cs \ SparkleEventLogController.cs \ - SparkleInfobar.cs \ - SparkleIntro.cs \ SparkleLinController.cs \ + SparkleSetup.cs \ SparkleSetupController.cs \ + SparkleSetupWindow.cs \ SparkleShare.cs \ SparkleSpinner.cs \ SparkleStatusIcon.cs \ SparkleStatusIconController.cs \ SparkleUI.cs \ - SparkleUIHelpers.cs \ - SparkleWindow.cs + SparkleUIHelpers.cs include $(top_srcdir)/build/build.mk diff --git a/SparkleShare/SparkleBubble.cs b/SparkleShare/SparkleBubbles.cs similarity index 52% rename from SparkleShare/SparkleBubble.cs rename to SparkleShare/SparkleBubbles.cs index 61275449..1b2aa9fd 100644 --- a/SparkleShare/SparkleBubble.cs +++ b/SparkleShare/SparkleBubbles.cs @@ -16,26 +16,41 @@ using System; + +using Gtk; using Notifications; namespace SparkleShare { - public class SparkleBubble : Notification { + public class SparkleBubbles { - public SparkleBubble (string title, string subtext) : base (title, subtext) + public SparkleBubblesController Controller = new SparkleBubblesController (); + + + public SparkleBubbles () { - IconName = "folder-sparkleshare"; - Timeout = 4500; - Urgency = Urgency.Low; + Controller.ShowBubbleEvent += delegate (string title, string subtext, string image_path) { + Notification notification = new Notification () { + Timeout = 5 * 1000; + Urgency = Urgency.Low; + } + + if (image_path != null) + Icon = new Gdk.Pixbuf (image_path); + else + IconName = "folder-sparkleshare"; + + notification.Show (); + }; } // Checks whether the system allows adding buttons to a notification, // prevents error messages in Ubuntu. - new public void AddAction (string action, string label, ActionHandler handler) - { - if (Array.IndexOf (Notifications.Global.Capabilities, "actions") > -1) - base.AddAction (action, label, handler); - } +// new public void AddAction (string action, string label, ActionHandler handler) +// { +// if (Array.IndexOf (Notifications.Global.Capabilities, "actions") > -1) +// base.AddAction (action, label, handler); +// } } } diff --git a/SparkleShare/SparkleInfobar.cs b/SparkleShare/SparkleInfobar.cs deleted file mode 100644 index b211771f..00000000 --- a/SparkleShare/SparkleInfobar.cs +++ /dev/null @@ -1,50 +0,0 @@ -// SparkleShare, a collaboration and sharing tool. -// 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; - -namespace SparkleShare { - - // An infobar - public class SparkleInfobar : EventBox { - - public SparkleInfobar (string icon_name, string title, string text) - { - Window window = new Window (WindowType.Popup) { - Name = "gtk-tooltip" - }; - - window.EnsureStyle (); - Style = window.Style; - - Label label = new Label () { - Markup = "" + title + "\n" + text - }; - - HBox hbox = new HBox (false, 12) { - BorderWidth = 12 - }; - - hbox.PackStart (new Image (SparkleUIHelpers.GetIcon (icon_name, 24)), - false, false, 0); - - hbox.PackStart (label, false, false, 0); - - Add (hbox); - } - } -} diff --git a/SparkleShare/SparkleIntro.cs b/SparkleShare/SparkleSetup.cs similarity index 100% rename from SparkleShare/SparkleIntro.cs rename to SparkleShare/SparkleSetup.cs diff --git a/SparkleShare/SparkleWindow.cs b/SparkleShare/SparkleSetupWindow.cs similarity index 100% rename from SparkleShare/SparkleWindow.cs rename to SparkleShare/SparkleSetupWindow.cs diff --git a/SparkleShare/SparkleShare.csproj b/SparkleShare/SparkleShare.csproj index bfb9ee63..814ce518 100644 --- a/SparkleShare/SparkleShare.csproj +++ b/SparkleShare/SparkleShare.csproj @@ -38,17 +38,13 @@ - - - - @@ -56,6 +52,9 @@ + + +