[baobab/wip/vala: 16/53] 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/53] Use on_signal_name convention for the handlers
- Date: Thu, 5 Apr 2012 22:02:54 +0000 (UTC)
commit 4c5f9b766e6d7edfee4edf4df5505bdb3c572b90
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 29cdf4b..48b1865 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -24,11 +24,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}
};
@@ -73,27 +82,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");
}
@@ -128,15 +137,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]