From 5ae2d0f4bb7b2d29aca46139292207252616ac1f Mon Sep 17 00:00:00 2001 From: aurelien Date: Tue, 13 Nov 2012 16:42:17 +0100 Subject: humm be --- pcr/gnome-rdp/PKGBUILD | 46 ++++++++ pcr/gnome-rdp/appindicator.patch | 249 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 295 insertions(+) create mode 100644 pcr/gnome-rdp/PKGBUILD create mode 100644 pcr/gnome-rdp/appindicator.patch (limited to 'pcr/gnome-rdp') diff --git a/pcr/gnome-rdp/PKGBUILD b/pcr/gnome-rdp/PKGBUILD new file mode 100644 index 000000000..67a96bb7f --- /dev/null +++ b/pcr/gnome-rdp/PKGBUILD @@ -0,0 +1,46 @@ +# Contributor: György Balló +# Contributor: Hyperair +# Contributor: kumico +# Contributor: adamruss +# Maintainer : Parabola GNU / Linux-libre Aurelien Desbrieres + +pkgname=gnome-rdp +pkgver=0.3.1.0 +pkgrel=1 +pkgdesc="Remote desktop client for the GNOME Desktop with RDP/VNC/SSH capabilities, written in C Sharp" +arch=('any') +url="http://sourceforge.net/projects/gnome-rdp/" +license=('GPL' 'LGPL') +depends=('gtk-sharp-2' 'gnome-keyring-sharp') +optdepends=('openssh: SSH client' + 'gnome-terminal: required for the SSH client' + 'rdesktop: RDP client' + 'tightvnc: VNC client') +source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz + appindicator.patch) +md5sums=('3c1329702914f8b1c213c0bb00d078cf' + '7bbe98eadfe199c5664fd69a4531fb3d') + +build() { + cd "$srcdir/$pkgname-$pkgver" + sed -i 's/tight-vncviewer/vncviewer/' Sessions/SessionCollection.cs + patch -R -Np3 -i "$srcdir/appindicator.patch" + sed -i 's/pkglib_SCRIPTS/programfiles_SCRIPTS/' Makefile.include + sed -i 's|@expanded_libdir@|@prefix@/@libdir@|' gnome-rdp.in + + autoreconf -fi + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + make DESTDIR="$pkgdir/" install + + # Install desktop and icon files + install -Dm644 Menu/$pkgname.desktop "$pkgdir/usr/share/applications/$pkgname.desktop" + install -Dm644 Menu/$pkgname.png "$pkgdir/usr/share/pixmaps/$pkgname.png" +} +md5sums=('3c1329702914f8b1c213c0bb00d078cf' + '7bbe98eadfe199c5664fd69a4531fb3d') diff --git a/pcr/gnome-rdp/appindicator.patch b/pcr/gnome-rdp/appindicator.patch new file mode 100644 index 000000000..4cb4d7a65 --- /dev/null +++ b/pcr/gnome-rdp/appindicator.patch @@ -0,0 +1,249 @@ +Index: /trunk/gnome-rdp/configure.ac +=================================================================== +--- /trunk/gnome-rdp/configure.ac (revision 263) ++++ /trunk/gnome-rdp/configure.ac (revision 264) +@@ -50,6 +50,7 @@ + PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0]) + PKG_CHECK_MODULES([GLADE_SHARP_20], [glade-sharp-2.0]) + PKG_CHECK_MODULES([GNOME_KEYRING_SHARP_10], [gnome-keyring-sharp-1.0]) ++PKG_CHECK_MODULES([APPINDICATOR_SHARP_01], [appindicator-sharp-0.1]) + + dnl package checks, per config + +Index: /trunk/gnome-rdp/MainWindow.cs +=================================================================== +--- /trunk/gnome-rdp/MainWindow.cs (revision 257) ++++ /trunk/gnome-rdp/MainWindow.cs (revision 264) +@@ -31,14 +31,18 @@ + using GnomeRDP.Vnc; + ++using AppIndicator; ++ + namespace GnomeRDP + { + public partial class MainWindow: Gtk.Window + { +- private StatusIcon statusIcon; ++ private ApplicationIndicator applicationIndicator; + private Gtk.Action actionQuit; ++ private Gtk.Action actionToggleVisible; ++ private bool hideOnDelete = false; + + private const string sessionKey = "Session"; + +- public MainWindow(): base (Gtk.WindowType.Toplevel) ++ public MainWindow (): base (Gtk.WindowType.Toplevel) + { + Build (); +@@ -46,72 +50,80 @@ + this.DeleteEvent += (s, e) => + { +- Visible = false; +- e.RetVal = true; ++ if (hideOnDelete) ++ { ++ Visible = false; ++ e.RetVal = true; ++ } + }; + +- this.actionQuit = new Gtk.Action("QuitAction", "Quit"); +- this.actionQuit.Activated+= (s, e) => Application.Quit(); ++ this.actionQuit = new Gtk.Action ("QuitAction", "Quit"); ++ this.actionQuit.Activated += (s, e) => Application.Quit (); ++ ++ this.actionToggleVisible = new Gtk.Action("ToggleVisibleAction", "Show/Hide"); ++ this.actionToggleVisible.Activated += (s, e) => { this.Visible = !this.Visible; }; ++ ++ this.applicationIndicator = new ApplicationIndicator ("gnome-rdp", "gnome-rdp", Category.ApplicationStatus); ++ this.applicationIndicator.ConnectionChanged += (s, e) => { hideOnDelete = this.applicationIndicator.Connected; }; + +- this.statusIcon = new StatusIcon(ResourceLoader.Find(ResourceLoader.Icons.gnomeRdp)); +- this.statusIcon.Visible = true; +- this.statusIcon.Tooltip = "GnomeRDP"; +- this.statusIcon.Activate += OnStatusIcon_Activate; +- this.statusIcon.PopupMenu += OnStatusIcon_PopupMenu; +- ++ this.applicationIndicator.Menu = CreateMenu(); ++ this.applicationIndicator.Status = Status.Active; ++ + this.Icon = ResourceLoader.Find(ResourceLoader.Icons.gnomeRdp); + } +- +- private void OnStatusIcon_Activate(object sender, EventArgs e) ++ ++ public void UpdateMenu() + { +- Visible = !Visible; ++ Menu oldMenu = this.applicationIndicator.Menu; ++ ++ this.applicationIndicator.Menu = CreateMenu(); ++ ++ oldMenu.Dispose(); + } +- +- private void OnStatusIcon_PopupMenu(object sender, PopupMenuArgs e) ++ ++ private Menu CreateMenu() + { +- try +- { +- Menu topMenu = new Menu(); +- topMenu.Popup(); ++ Menu topMenu = new Menu(); ++ ++ topMenu.Append(actionToggleVisible.CreateMenuItem()); ++ topMenu.Append(new SeparatorMenuItem()); + +- foreach (var group in Program.SessionCollection.Groups) +- { +- MenuItem groupMenu = new MenuItem(group); +- topMenu.Append(groupMenu); +- +- Menu subMenu = new Menu(); +- foreach(var session in Program.SessionCollection.Items.Where(s => s.Group == group).OrderBy(s => s.Server)) +- { +- MenuItem menuItem = new MenuItem(session.MenuFormat); +- menuItem.TooltipText = session.Tooltip; +- menuItem.Activated += PopupMenuItem_Activated; +- menuItem.Data[sessionKey] = session; +- +- subMenu.Append(menuItem); +- } +- groupMenu.Submenu = subMenu; +- } +- +- topMenu.Append(new SeparatorMenuItem()); +- +- foreach (var session in Program.SessionCollection.Items.Where(s => string.IsNullOrEmpty(s.Group)).OrderBy(s => s.Server)) ++ foreach (var group in Program.SessionCollection.Groups) ++ { ++ MenuItem groupMenu = new MenuItem(group); ++ ++ Menu subMenu = new Menu(); ++ foreach(var session in Program.SessionCollection.Items.Where(s => s.Group == group).OrderBy(s => s.Server)) + { + MenuItem menuItem = new MenuItem(session.MenuFormat); + menuItem.TooltipText = session.Tooltip; + menuItem.Activated += PopupMenuItem_Activated; +- menuItem.Data[sessionKey] = session; +- +- topMenu.Append(menuItem); ++ menuItem.Data[sessionKey] = session; ++ ++ subMenu.Append(menuItem); + } ++ groupMenu.Submenu = subMenu; ++ ++ topMenu.Append(groupMenu); ++ } ++ ++ topMenu.Append(new SeparatorMenuItem()); ++ ++ foreach (var session in Program.SessionCollection.Items.Where(s => string.IsNullOrEmpty(s.Group)).OrderBy(s => s.Server)) ++ { ++ MenuItem menuItem = new MenuItem(session.MenuFormat); ++ menuItem.TooltipText = session.Tooltip; ++ menuItem.Activated += PopupMenuItem_Activated; ++ menuItem.Data[sessionKey] = session; + +- topMenu.Append(new SeparatorMenuItem()); +- topMenu.Append(actionQuit.CreateMenuItem()); +- topMenu.ShowAll(); +-// topMenu.Popup(); ++ topMenu.Append(menuItem); + } +- catch +- { +- } +- } +- ++ ++ topMenu.Append(new SeparatorMenuItem()); ++ topMenu.Append(actionQuit.CreateMenuItem()); ++ ++ topMenu.ShowAll(); ++ return topMenu; ++ } ++ + private void PopupMenuItem_Activated(object sender, EventArgs e) + { +@@ -126,20 +138,4 @@ + } + } +- +- protected virtual void OnNewRdpActionActivated (object sender, System.EventArgs e) +- { +- } +- +- protected virtual void OnNewVncActionActivated (object sender, System.EventArgs e) +- { +- } +- +- protected virtual void OnNewSshActionActivated (object sender, System.EventArgs e) +- { +- } +- +- +- +- + } + } +Index: /trunk/gnome-rdp/ChangeLog +=================================================================== +--- /trunk/gnome-rdp/ChangeLog (revision 262) ++++ /trunk/gnome-rdp/ChangeLog (revision 264) +@@ -1,2 +1,11 @@ ++2011-11-02 James P Michels III ++ ++ * Program.cs: ++ * gnome-rdp.sln: ++ * MainWindow.cs: ++ * gnome-rdp.csproj: ++ * gui.stetic: ++ * SessionsWidget.cs: Changes to support AppIndicator ++ + 2011-05-22 James P Michels III + +Index: /trunk/gnome-rdp/Sessions/SessionsWidget.cs +=================================================================== +--- /trunk/gnome-rdp/Sessions/SessionsWidget.cs (revision 257) ++++ /trunk/gnome-rdp/Sessions/SessionsWidget.cs (revision 264) +@@ -205,4 +205,5 @@ + } + ++ Program.UpdateMainWindowMenu(); + } + catch (Exception ex) +Index: /trunk/gnome-rdp/gtk-gui/gui.stetic +=================================================================== +--- /trunk/gnome-rdp/gtk-gui/gui.stetic (revision 261) ++++ /trunk/gnome-rdp/gtk-gui/gui.stetic (revision 264) +@@ -7,5 +7,6 @@ + + +- ++ ++ + + +Index: /trunk/gnome-rdp/Program.cs +=================================================================== +--- /trunk/gnome-rdp/Program.cs (revision 261) ++++ /trunk/gnome-rdp/Program.cs (revision 264) +@@ -196,5 +196,14 @@ + }); + } +- ++ ++ public static void UpdateMainWindowMenu() ++ { ++ GLib.Timeout.Add(0, () => ++ { ++ mainWindow.UpdateMenu(); ++ return false; ++ }); ++ } ++ + public static void SetMainWindowVisible(bool visible) + { -- cgit v1.2.3