[baobab/wip/vala: 16/65] Use on_signal_name convention for the handlers
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/wip/vala: 16/65] Use on_signal_name convention for the handlers
- Date: Thu, 5 Apr 2012 12:16:18 +0000 (UTC)
commit c9209c8db1c8405908a73d926aa9402cb2c417bc
Author: Paolo Borelli <pborelli gnome org>
Date: Fri Jan 6 10:59:08 2012 +0100
Use on_signal_name convention for the handlers
This allows consistent name for all handlers, including the one that
already have the paste tense in the name (e.g. drag_data_received).
Also move data structs at the top.
src/baobab-window.vala | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index 3738ac7..e708d64 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -4,11 +4,20 @@ namespace Baobab {
Chart rings_chart;
Chart treemap;
- enum DndTargets {
+ private const GLib.ActionEntry[] action_entries = {
+ { "scan-home", on_scan_home_activate },
+ { "scan-filesystem", on_scan_filesystem_activate },
+ { "scan-folder", on_scan_folder_activate },
+ { "scan-remote", on_scan_remote_activate },
+ { "stop", on_stop_activate },
+ { "refresh", on_refresh_activate }
+ };
+
+ private enum DndTargets {
URI_LIST
}
- const Gtk.TargetEntry dnd_target_list[1] = {
+ private const Gtk.TargetEntry dnd_target_list[1] = {
{"text/uri-list", 0, DndTargets.URI_LIST}
};
@@ -53,27 +62,27 @@ namespace Baobab {
show ();
}
- void scan_home_activated () {
+ void on_scan_home_activate () {
print ("sh\n");
}
- void scan_filesystem_activated () {
+ void on_scan_filesystem_activate () {
print ("sfs\n");
}
- void scan_folder_activated () {
+ void on_scan_folder_activate () {
print ("sf\n");
}
- void scan_remote_activated () {
+ void on_scan_remote_activate () {
print ("sr\n");
}
- void stop_activated () {
+ void on_stop_activate () {
print ("s\n");
}
- void refresh_activated () {
+ void on_refresh_activate () {
print ("r\n");
}
@@ -108,15 +117,6 @@ namespace Baobab {
Gtk.drag_dest_unset (this);
}
- private const GLib.ActionEntry[] action_entries = {
- { "scan-home", scan_home_activated },
- { "scan-filesystem", scan_filesystem_activated },
- { "scan-folder", scan_folder_activated },
- { "scan-remote", scan_remote_activated },
- { "stop", stop_activated },
- { "refresh", refresh_activated }
- };
-
void message (string primary_msg, string secondary_msg, Gtk.MessageType type) {
var dialog = new Gtk.MessageDialog (this, Gtk.DialogFlags.DESTROY_WITH_PARENT, type,
Gtk.ButtonsType.OK, "%s", primary_msg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]