[Xfce4-commits] <xfce4-notes-plugin:master> Port code to Vala 0.10

Mike Massonnet noreply at xfce.org
Sat Nov 6 21:52:01 CET 2010


Updating branch refs/heads/master
         to c26515e175810fbc1b7af76c2dc89aac64331086 (commit)
       from eca175f76980644dc8ba3d7e7df20c48523a85cd (commit)

commit c26515e175810fbc1b7af76c2dc89aac64331086
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Fri Nov 5 22:35:14 2010 +0100

    Port code to Vala 0.10

 configure.ac.in               |    2 +-
 lib/application.vala          |   38 +++++++-------
 lib/hypertextview.vala        |   18 +++---
 lib/note.vala                 |    2 +-
 lib/popup.vapi                |    2 +-
 lib/window.vala               |  112 +++++++++++++++++++++--------------------
 src/main-panel-plugin-47.vala |   22 ++++----
 src/main-panel-plugin.vala    |   26 +++++-----
 src/main-status-icon.vala     |   22 ++++----
 src/xfce-autostart.vapi       |    2 +-
 10 files changed, 124 insertions(+), 122 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 37ecc0f..e4e5751 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -59,7 +59,7 @@ XDT_CHECK_OPTIONAL_PACKAGE([LIBXFCE4PANEL47], [libxfce4panel-1.0], [4.7.0], [],
 
 dnl Check for valac
 if test "x$USE_MAINTAINER_MODE" = "xyes" ; then
-	AM_PROG_VALAC([0.7.8])
+	AM_PROG_VALAC([0.10.0])
 	if test "x$VALAC" = "x" ; then
 		AC_MSG_ERROR([Cannot find the "valac" compiler in your PATH])
 	fi
diff --git a/lib/application.vala b/lib/application.vala
index 973014f..ce2033d 100644
--- a/lib/application.vala
+++ b/lib/application.vala
@@ -59,11 +59,11 @@ namespace Xnp {
 			string color = xfconf_channel.get_string ("/global/background-color", "#F7EB96");
 			Xnp.Color.set_background (color);
 
-			xfconf_channel.property_changed += (channel, prop, val) => {
+			xfconf_channel.property_changed.connect ((channel, prop, val) => {
 				if (prop == "/global/background-color") {
 					Xnp.Color.set_background (val.get_string ());
 				}
-			};
+			});
 
 			string name;
 			bool found = false;
@@ -174,7 +174,7 @@ namespace Xnp {
 				typeof (int), window, "tabs-position");
 
 			/* Connect signals */
-			window.action += (win, action) => {
+			window.action.connect ((win, action) => {
 				if (action == "rename") {
 					rename_window (win);
 				}
@@ -191,11 +191,11 @@ namespace Xnp {
 				else if (action == "about") {
 					open_about_dialog ();
 				}
-			};
-			window.save_data += (win, note) => {
+			});
+			window.save_data.connect ((win, note) => {
 				save_note (win, note);
-			};
-			window.note_inserted += (win, note) => {
+			});
+			window.note_inserted.connect ((win, note) => {
 				Xfconf.Property.bind (xfconf_channel, "/global/font-description",
 					typeof (string), note.text_view, "font");
 
@@ -205,12 +205,12 @@ namespace Xnp {
 				}
 				catch (FileError e) {
 				}
-			};
-			window.note_deleted += (win, note) => {
+			});
+			window.note_deleted.connect ((win, note) => {
 				string path = "%s/%s/%s".printf (notes_path, win.name, note.name);
 				GLib.FileUtils.unlink (path);
-			};
-			window.note_renamed += (win, note, old_name) => {
+			});
+			window.note_renamed.connect ((win, note, old_name) => {
 				if (!name_is_valid (note.name)) {
 					note.name = old_name;
 					return;
@@ -218,7 +218,7 @@ namespace Xnp {
 				string old_path = "%s/%s/%s".printf (notes_path, win.name, old_name);
 				string new_path = "%s/%s/%s".printf (notes_path, win.name, note.name);
 				GLib.FileUtils.rename (old_path, new_path);
-			};
+			});
 
 			return window;
 		}
@@ -577,7 +577,7 @@ namespace Xnp {
 		public Gtk.Menu context_menu () {
 			var menu = new Gtk.Menu ();
 
-			menu.show += (menu) => {
+			menu.show.connect (() => {
 				// Clean up menu
 				menu. at foreach ((w) => {
 					w.destroy ();
@@ -587,11 +587,11 @@ namespace Xnp {
 				foreach (var win in this.window_list) {
 					var mi = new Gtk.MenuItem.with_label (win.name);
 					mi.set_data ("window", (void*)win);
-					mi.activate += (i) => {
+					mi.activate.connect ((i) => {
 						// Jump to win
-						var w = (Xnp.Window)i.get_data ("window");
+						var w = i.get_data<Xnp.Window> ("window");
 						w.present ();
-					};
+					});
 					menu.append (mi);
 				}
 
@@ -599,17 +599,17 @@ namespace Xnp {
 				var mi_sep = new Gtk.SeparatorMenuItem ();
 				menu.append (mi_sep);
 				var mi_add = new Gtk.ImageMenuItem.with_mnemonic (_("_Add a new group"));
-				mi_add.activate += () => {
+				mi_add.activate.connect (() => {
 					var new_win = create_window ();
 					new_win.show ();
-				};
+				});
 				var image = new Gtk.Image.from_stock (Gtk.STOCK_ADD, Gtk.IconSize.MENU);
 				mi_add.set_image (image);
 				menu.append (mi_add);
 
 				// Show all items
 				menu.show_all ();
-			};
+			});
 
 			return menu;
 		}
diff --git a/lib/hypertextview.vala b/lib/hypertextview.vala
index 2435b1c..c6fb2cb 100644
--- a/lib/hypertextview.vala
+++ b/lib/hypertextview.vala
@@ -56,12 +56,12 @@ namespace Xnp {
 		public HypertextView () {
 			Gtk.TextIter iter;
 
-			this.button_release_event += button_release_event_cb;
-			this.motion_notify_event += motion_notify_event_cb;
-			this.move_cursor += move_cursor_cb;
-			this.buffer.changed += buffer_changed_cb;
-			this.buffer.insert_text += insert_text_cb;
-			this.buffer.delete_range += delete_range_cb;
+			this.button_release_event.connect (button_release_event_cb);
+			this.motion_notify_event.connect (motion_notify_event_cb);
+			this.move_cursor.connect (move_cursor_cb);
+			this.buffer.changed.connect (buffer_changed_cb);
+			this.buffer.insert_text.connect (insert_text_cb);
+			this.buffer.delete_range.connect (delete_range_cb);
 
 			this.buffer.get_iter_at_offset (out iter, 0);
 			this.buffer.create_mark ("undo-pos", iter, false);
@@ -88,7 +88,7 @@ namespace Xnp {
 		 *
 		 * Event to open links.
 		 */
-		private bool button_release_event_cb (HypertextView hypertextview, Gdk.EventButton event) {
+		private bool button_release_event_cb (Gtk.Widget hypertextview, Gdk.EventButton event) {
 			Gtk.TextIter start, end, iter;
 			string link;
 			int x, y;
@@ -149,7 +149,7 @@ namespace Xnp {
 		 *
 		 * Event to update the cursor of the pointer.
 		 */
-		private bool motion_notify_event_cb (HypertextView hypertextview, Gdk.EventMotion event) {
+		private bool motion_notify_event_cb (Gtk.Widget hypertextview, Gdk.EventMotion event) {
 			Gtk.TextIter iter;
 			Gdk.Window win;
 			bool over_link;
@@ -173,7 +173,7 @@ namespace Xnp {
 		 *
 		 * Destroys existing timeouts and executes the actions immediately.
 		 */
-		private void move_cursor_cb (HypertextView hypertextview, Gtk.MovementStep step, int count, bool extend_selection) {
+		private void move_cursor_cb (Gtk.Widget hypertextview, Gtk.MovementStep step, int count, bool extend_selection) {
 			if (this.undo_timeout > 0) {
 				/* Make an undo snapshot and save cursor_position before it really moves */
 				Source.remove (this.undo_timeout);
diff --git a/lib/note.vala b/lib/note.vala
index d9d4c53..73fc659 100644
--- a/lib/note.vala
+++ b/lib/note.vala
@@ -70,7 +70,7 @@ namespace Xnp {
 			add (this.scrolled_window);
 
 			var buffer = this.text_view.get_buffer ();
-			buffer.changed += buffer_changed_cb;
+			buffer.changed.connect (buffer_changed_cb);
 		}
 
 		~Note () {
diff --git a/lib/popup.vapi b/lib/popup.vapi
index f3ec2b3..c330de2 100644
--- a/lib/popup.vapi
+++ b/lib/popup.vapi
@@ -3,5 +3,5 @@ namespace Xnp.Popup {
 	[CCode (cname = "popup_set_x_selection")]
 	public static bool set_x_selection (Gtk.Widget widget);
 	[CCode (cname = "popup_get_message_from_event")]
-	public static weak string? get_message_from_event (Gdk.EventClient event);
+	public static unowned string? get_message_from_event (Gdk.EventClient event);
 }
diff --git a/lib/window.vala b/lib/window.vala
index 9a0f71b..329d7ee 100644
--- a/lib/window.vala
+++ b/lib/window.vala
@@ -310,57 +310,57 @@ namespace Xnp {
 			this.content_box.pack_start (this.navigation_box, false, false, 1);
 
 			/* Connect mouse click signals */
-			menu_evbox.button_press_event += menu_evbox_pressed_cb;
-			close_box.clicked += () => { hide (); };
-			add_box.clicked += action_new_note;
-			del_box.clicked += action_delete_note;
-			this.goleft_box.clicked += action_prev_note;
-			this.goright_box.clicked += action_next_note;
+			menu_evbox.button_press_event.connect (menu_evbox_pressed_cb);
+			close_box.clicked.connect (() => { hide (); });
+			add_box.clicked.connect (action_new_note);
+			del_box.clicked.connect (action_delete_note);
+			this.goleft_box.clicked.connect (action_prev_note);
+			this.goright_box.clicked.connect (action_next_note);
 
 			/* Connect extra signals */
-			delete_event += () => {
+			delete_event.connect (() => {
 				/* Replace ALT+F4 action */
 				hide ();
 				return true;
-			};
-			focus_in_event += () => {
+			});
+			focus_in_event.connect (() => {
 				title_label.sensitive = true;
 				return false;
-			};
-			focus_out_event += () => {
+			});
+			focus_out_event.connect (() => {
 				title_label.sensitive = false;
 				return false;
-			};
-			leave_notify_event += navigation_leaved_cb;
-			motion_notify_event += navigation_motion_cb;
-			leave_notify_event += window_leaved_cb;
-			motion_notify_event += window_motion_cb;
-			button_press_event += window_pressed_cb;
-			window_state_event += window_state_cb;
-			title_evbox.button_press_event += title_evbox_pressed_cb;
-			title_evbox.scroll_event += title_evbox_scrolled_cb;
-			this.notebook.page_added += (n, c, p) => {
+			});
+			leave_notify_event.connect (navigation_leaved_cb);
+			motion_notify_event.connect (navigation_motion_cb);
+			leave_notify_event.connect (window_leaved_cb);
+			motion_notify_event.connect (window_motion_cb);
+			button_press_event.connect (window_pressed_cb);
+			window_state_event.connect (window_state_cb);
+			title_evbox.button_press_event.connect (title_evbox_pressed_cb);
+			title_evbox.scroll_event.connect (title_evbox_scrolled_cb);
+			this.notebook.page_added.connect ((n, c, p) => {
 				notebook.set_current_page ((int)p);
 				update_navigation_sensitivity ((int)p);
-			};
-			this.notebook.page_removed += (n, c, p) => {
+			});
+			this.notebook.page_removed.connect ((n, c, p) => {
 				update_navigation_sensitivity ((int)p);
-			};
-			this.notebook.switch_page += (n, c, p) => {
+			});
+			this.notebook.switch_page.connect ((n, c, p) => {
 				var note = (Xnp.Note)(notebook.get_nth_page ((int)p));
 				update_title (note.name);
 				update_navigation_sensitivity ((int)p);
-			};
-			notify["name"] += () => {
+			});
+			notify["name"].connect (() => {
 				int page = this.notebook.get_current_page ();
 				if (page == -1)
 					return;
 				var current_note = (Xnp.Note)(this.notebook.get_nth_page (page));
 				update_title (current_note.name);
-			};
-			notify["title"] += () => {
+			});
+			notify["title"].connect (() => {
 				title_label.set_markup ("<b>"+title+"</b>");
-			};
+			});
 		}
 
 		~Window () {
@@ -548,7 +548,7 @@ namespace Xnp {
 		 *
 		 * Raise/lower the window and popup window menu.
 		 */
-		private bool title_evbox_pressed_cb (Gtk.EventBox box, Gdk.EventButton event) {
+		private bool title_evbox_pressed_cb (Gtk.Widget widget, Gdk.EventButton event) {
 			if (event.type != Gdk.EventType.BUTTON_PRESS)
 				return false;
 			if (event.button == 1) {
@@ -574,7 +574,7 @@ namespace Xnp {
 		 *
 		 * Shade/unshade the window and set transparency by holding ALT.
 		 */
-		private bool title_evbox_scrolled_cb (Gtk.EventBox box, Gdk.EventScroll event) {
+		private bool title_evbox_scrolled_cb (Gtk.Widget widget, Gdk.EventScroll event) {
 			if ((bool)(event.state & Gdk.ModifierType.MOD1_MASK)) {
 				if (event.direction == Gdk.ScrollDirection.UP) {
 					opacity += 0.1;
@@ -598,7 +598,8 @@ namespace Xnp {
 		 * note_notify_name_cb:
 		 *
 		 */
-		private void note_notify_name_cb (Xnp.Note note, GLib.ParamSpec pspec) {
+		private void note_notify_name_cb (GLib.Object object, GLib.ParamSpec pspec) {
+			Xnp.Note note = object as Xnp.Note;
 			this.notebook.set_tab_label_text (note, note.name);
 			_notebook_update_tabs_angle ();
 			int page = this.notebook.get_current_page ();
@@ -660,7 +661,7 @@ namespace Xnp {
 		 *
 		 * Popup the window menu.
 		 */
-		private bool menu_evbox_pressed_cb (Gtk.EventBox box, Gdk.EventButton event) {
+		private bool menu_evbox_pressed_cb (Gtk.Widget widget, Gdk.EventButton event) {
 			this.menu.popup (null, null, menu_position, 0, Gtk.get_current_event_time ());
 			return false;
 		}
@@ -706,7 +707,7 @@ namespace Xnp {
 			/* Navigation */
 			var menu_go = new Gtk.Menu ();
 			menu_go.set_accel_group (this.ui.get_accel_group ());
-			menu_go.show += update_menu_go;
+			menu_go.show.connect (update_menu_go);
 			mi.set_submenu (menu_go);
 
 			/* Note items */
@@ -715,24 +716,24 @@ namespace Xnp {
 
 			mi = new Gtk.ImageMenuItem.from_stock (Gtk.STOCK_NEW, null);
 			mi.set_accel_path (this.action_group.get_action ("new-note").get_accel_path ());
-			mi.activate += action_new_note;
+			mi.activate.connect (action_new_note);
 			menu.append (mi);
 
 			mi = new Gtk.ImageMenuItem.from_stock (Gtk.STOCK_DELETE, null);
 			mi.set_accel_path (this.action_group.get_action ("delete-note").get_accel_path ());
-			mi.activate += action_delete_note;
+			mi.activate.connect (action_delete_note);
 			menu.append (mi);
 
 			mi = new Gtk.ImageMenuItem.with_mnemonic (_("_Rename"));
 			var image = new Gtk.Image.from_stock (Gtk.STOCK_EDIT, Gtk.IconSize.MENU);
 			((Gtk.ImageMenuItem)mi).set_image (image);
 			mi.set_accel_path (this.action_group.get_action ("rename-note").get_accel_path ());
-			mi.activate += action_rename_note;
+			mi.activate.connect (action_rename_note);
 			menu.append (mi);
 
 			mi = new Gtk.ImageMenuItem.from_stock (Gtk.STOCK_UNDO, null);
 			mi.set_accel_path (this.action_group.get_action ("cancel").get_accel_path ());
-			mi.activate += action_cancel;
+			mi.activate.connect (action_cancel);
 			menu.append (mi);
 
 			/* Window options */
@@ -741,12 +742,12 @@ namespace Xnp {
 
 			mi = this.mi_above = new Gtk.CheckMenuItem.with_label (_("Always on top"));
 			((Gtk.CheckMenuItem)mi).active = this.above;
-			((Gtk.CheckMenuItem)mi).toggled += (o) => { above = o.active; };
+			((Gtk.CheckMenuItem)mi).toggled.connect ((o) => { above = o.active; });
 			menu.append (mi);
 
 			mi = this.mi_sticky = new Gtk.CheckMenuItem.with_label (_("Sticky window"));
 			((Gtk.CheckMenuItem)mi).active = this.sticky;
-			((Gtk.CheckMenuItem)mi).toggled += (o) => { sticky = o.active; };
+			((Gtk.CheckMenuItem)mi).toggled.connect ((o) => { sticky = o.active; });
 			menu.append (mi);
 
 			/* Settings/About dialog */
@@ -754,11 +755,11 @@ namespace Xnp {
 			menu.append (mi);
 
 			mi = new Gtk.ImageMenuItem.from_stock (Gtk.STOCK_PROPERTIES, null);
-			mi.activate += () => { action ("properties"); };
+			mi.activate.connect (() => { action ("properties"); });
 			menu.append (mi);
 
 			mi = new Gtk.ImageMenuItem.from_stock (Gtk.STOCK_ABOUT, null);
-			mi.activate += () => { action ("about"); };
+			mi.activate.connect (() => { action ("about"); });
 			menu.append (mi);
 
 			return menu;
@@ -769,7 +770,8 @@ namespace Xnp {
 		 *
 		 * Update the menu Go when it is shown.
 		 */
-		private void update_menu_go (Gtk.Menu menu) {
+		private void update_menu_go (Gtk.Widget widget) {
+			Gtk.Menu menu = widget as Gtk.Menu;
 			Gtk.MenuItem mi;
 			Gtk.Image image;
 
@@ -794,10 +796,10 @@ namespace Xnp {
 							((Gtk.ImageMenuItem)mi).set_image (image);
 						}
 						mi.set_data ("page", (void*)p);
-						mi.activate += (i) => {
-							int page = (int)i.get_data ("page");
+						mi.activate.connect ((i) => {
+							int page = i.get_data<int> ("page");
 							notebook.set_current_page (page);
-						};
+						});
 						menu.append (mi);
 					}
 
@@ -807,10 +809,10 @@ namespace Xnp {
 				else {
 					mi = new Gtk.MenuItem.with_label (win.name);
 					mi.set_data ("window", (void*)win);
-					mi.activate += (i) => {
-						var w = (Xnp.Window)i.get_data ("window");
+					mi.activate.connect ((i) => {
+						var w = i.get_data<Xnp.Window> ("window");
 						w.present ();
-					};
+					});
 					menu.append (mi);
 
 					mi = new Gtk.SeparatorMenuItem ();
@@ -822,21 +824,21 @@ namespace Xnp {
 			image = new Gtk.Image.from_stock (Gtk.STOCK_EDIT, Gtk.IconSize.MENU);
 			((Gtk.ImageMenuItem)mi).set_image (image);
 			mi.set_accel_path (this.action_group.get_action ("rename-window").get_accel_path ());
-			mi.activate += action_rename_window;
+			mi.activate.connect (action_rename_window);
 			menu.append (mi);
 
 			mi = new Gtk.ImageMenuItem.with_mnemonic (_("_Delete group"));
 			image = new Gtk.Image.from_stock (Gtk.STOCK_REMOVE, Gtk.IconSize.MENU);
 			((Gtk.ImageMenuItem)mi).set_image (image);
 			mi.set_accel_path (this.action_group.get_action ("delete-window").get_accel_path ());
-			mi.activate += action_delete_window;
+			mi.activate.connect (action_delete_window);
 			menu.append (mi);
 
 			mi = new Gtk.ImageMenuItem.with_mnemonic (_("_Add a new group"));
 			image = new Gtk.Image.from_stock (Gtk.STOCK_ADD, Gtk.IconSize.MENU);
 			((Gtk.ImageMenuItem)mi).set_image (image);
 			mi.set_accel_path (this.action_group.get_action ("new-window").get_accel_path ());
-			mi.activate += action_new_window;
+			mi.activate.connect (action_new_window);
 			menu.append (mi);
 
 			menu.show_all ();
@@ -978,8 +980,8 @@ namespace Xnp {
 			int page = this.notebook.get_current_page () + 1;
 			var note = new Xnp.Note (name);
 
-			note.notify["name"] += note_notify_name_cb;
-			note.save_data += (note) => { save_data (note); };
+			note.notify["name"].connect (note_notify_name_cb);
+			note.save_data.connect ((note) => { save_data (note); });
 
 			note.show ();
 			this.n_pages++;
diff --git a/src/main-panel-plugin-47.vala b/src/main-panel-plugin-47.vala
index 8d6f4aa..a789eff 100644
--- a/src/main-panel-plugin-47.vala
+++ b/src/main-panel-plugin-47.vala
@@ -39,7 +39,7 @@ public class NotesPlugin : Xfce.PanelPlugin {
 		button = Xfce.panel_create_button ();
 		image = new Xfce.PanelImage.from_source ("xfce4-notes-plugin");
 		button.add (image);
-		button.clicked += () => { application.show_hide_notes (); };
+		button.clicked.connect (() => { application.show_hide_notes (); });
 		button.show_all ();
 		add (button);
 		add_action_widget (button);
@@ -55,18 +55,18 @@ public class NotesPlugin : Xfce.PanelPlugin {
 
 		set_x_selection ();
 
-		size_changed += (p, size) => {
+		size_changed.connect ((p, size) => {
 			button.set_size_request (size, size);
 			return true;
-		};
-		save += () => { application.save_windows_configuration (); };
-		free_data += () => {
+		});
+		save.connect (() => { application.save_windows_configuration (); });
+		free_data.connect (() => {
 			application.save_windows_configuration ();
 			application.save_notes ();
-		};
-		configure_plugin += () => { application.open_settings_dialog (); };
-		about += () => { application.open_about_dialog (); };
-		destroy += () => { Gtk.main_quit (); };
+		});
+		configure_plugin.connect (() => { application.open_settings_dialog (); });
+		about.connect (() => { application.open_about_dialog (); });
+		destroy.connect (() => { Gtk.main_quit (); });
 	}
 
 	/**
@@ -79,13 +79,13 @@ public class NotesPlugin : Xfce.PanelPlugin {
 		if (!Xnp.Popup.set_x_selection (invisible)) {
 			return false;
 		}
-		invisible.client_event += (w, event) => {
+		invisible.client_event.connect ((w, event) => {
 			if (Xnp.Popup.get_message_from_event (event) == "SHOW_HIDE") {
 				application.show_hide_notes ();
 				return true;
 			}
 			return false;
-		};
+		});
 		return true;
 	}
 
diff --git a/src/main-panel-plugin.vala b/src/main-panel-plugin.vala
index e2d2f61..7c570ad 100644
--- a/src/main-panel-plugin.vala
+++ b/src/main-panel-plugin.vala
@@ -38,7 +38,7 @@ public class NotesPlugin : GLib.Object {
 		button = Xfce.create_panel_button ();
 		image = new Gtk.Image ();
 		button.add (image);
-		button.clicked += () => { application.show_hide_notes (); };
+		button.clicked.connect (() => { application.show_hide_notes (); });
 		button.show_all ();
 		panel_plugin.add (button);
 		panel_plugin.add_action_widget (button);
@@ -54,7 +54,7 @@ public class NotesPlugin : GLib.Object {
 
 		set_x_selection ();
 
-		panel_plugin.size_changed += (p, size) => {
+		panel_plugin.size_changed.connect ((p, size) => {
 			button.set_size_request (size, size);
 			size -= 2 + 2 * ((button.style.xthickness > button.style.ythickness) ? button.style.xthickness : button.style.ythickness);
 			var pixbuf = Xfce.Icon.load ("xfce4-notes-plugin", size);
@@ -62,20 +62,20 @@ public class NotesPlugin : GLib.Object {
 				pixbuf = Xfce.Icon.load (Gtk.STOCK_EDIT, size);
 			image.set_from_pixbuf (pixbuf);
 			return true;
-		};
-		panel_plugin.save += () => {
+		});
+		panel_plugin.save.connect (() => {
 			application.save_windows_configuration ();
-		};
-		panel_plugin.free_data += () => {
+		});
+		panel_plugin.free_data.connect (() => {
 			application.save_windows_configuration ();
 			application.save_notes ();
-		};
-		panel_plugin.configure_plugin += () => {
+		});
+		panel_plugin.configure_plugin.connect (() => {
 			application.open_settings_dialog ();
-		};
-		panel_plugin.about += () => {
+		});
+		panel_plugin.about.connect (() => {
 			application.open_about_dialog ();
-		};
+		});
 	}
 
 	/**
@@ -88,13 +88,13 @@ public class NotesPlugin : GLib.Object {
 		if (!Xnp.Popup.set_x_selection (invisible)) {
 			return false;
 		}
-		invisible.client_event += (w, event) => {
+		invisible.client_event.connect ((w, event) => {
 			if (Xnp.Popup.get_message_from_event (event) == "SHOW_HIDE") {
 				application.show_hide_notes ();
 				return true;
 			}
 			return false;
-		};
+		});
 		return true;
 	}
 
diff --git a/src/main-status-icon.vala b/src/main-status-icon.vala
index bbff221..c9edeb2 100644
--- a/src/main-status-icon.vala
+++ b/src/main-status-icon.vala
@@ -39,11 +39,11 @@ static void build_plugin () {
 			}
 			return false;
 		});
-	status_icon.activate += () => { application.show_hide_notes (); };
+	status_icon.activate.connect (() => { application.show_hide_notes (); });
 	context_menu = build_context_menu ();
-	status_icon.popup_menu += () => {
+	status_icon.popup_menu.connect (() => {
 		context_menu.popup (null, null, status_icon.position_menu, 0, Gtk.get_current_event_time ());
-	};
+	});
 	set_x_selection ();
 }
 
@@ -59,22 +59,22 @@ static Gtk.Menu build_context_menu () {
 	menu.append (mi);
 
 	mi = new Gtk.ImageMenuItem.from_stock (Gtk.STOCK_PROPERTIES, null);
-	mi.activate += () => { application.open_settings_dialog (); };
+	mi.activate.connect (() => { application.open_settings_dialog (); });
 	menu.append (mi);
 
 	mi = new Gtk.ImageMenuItem.from_stock (Gtk.STOCK_ABOUT, null);
-	mi.activate += () => { application.open_about_dialog (); };
+	mi.activate.connect (() => { application.open_about_dialog (); });
 	menu.append (mi);
 
 	mi = new Gtk.SeparatorMenuItem ();
 	menu.append (mi);
 
 	mi = new Gtk.ImageMenuItem.from_stock (Gtk.STOCK_REMOVE, null);
-	mi.activate += () => {
+	mi.activate.connect (() => {
 		application.save_notes ();
 		Xfce.Autostart. at set ("xfce4-notes-autostart", "xfce4-notes", true);
 		Gtk.main_quit ();
-	};
+	});
 	menu.append (mi);
 
 	menu.show_all ();
@@ -87,13 +87,13 @@ static bool set_x_selection () {
 	if (!Xnp.Popup.set_x_selection (invisible)) {
 		return false;
 	}
-	invisible.client_event += (w, event) => {
+	invisible.client_event.connect ((w, event) => {
 		if (Xnp.Popup.get_message_from_event (event) == "SHOW_HIDE") {
 			application.show_hide_notes ();
 			return true;
 		}
 		return false;
-	};
+	});
 	return true;
 }
 
@@ -106,12 +106,12 @@ static int main (string[] args) {
 			return 0;
 		}
 	}
-	app.message_received += (command, message_data, time_) => {
+	app.message_received.connect ((command, message_data, time_) => {
 		if (command != Unique.Command.ACTIVATE) {
 			return Unique.Response.PASSTHROUGH;
 		}
 		return Unique.Response.OK;
-	};
+	});
 	GLib.Environment.set_application_name (_("Notes"));
 	build_plugin ();
 	Xfce.Autostart. at set ("xfce4-notes-autostart", "xfce4-notes", false);
diff --git a/src/xfce-autostart.vapi b/src/xfce-autostart.vapi
index bf12829..87eb24c 100644
--- a/src/xfce-autostart.vapi
+++ b/src/xfce-autostart.vapi
@@ -1,4 +1,4 @@
-[CCode (cheader_filename = "popup.h")]
+[CCode (cheader_filename = "xfce-autostart.h")]
 namespace Xfce.Autostart {
 	public static void @set (string name, string exec, bool hidden);
 	public static void set_full (string name, string exec, bool hidden, bool terminal, string? comment, string? icon);



More information about the Xfce4-commits mailing list