summaryrefslogtreecommitdiff
path: root/src/actionGroups
diff options
context:
space:
mode:
authorAlessandro Ghedini <al3xbio@gmail.com>2012-01-21 19:14:06 +0100
committerAlessandro Ghedini <al3xbio@gmail.com>2012-01-21 19:19:46 +0100
commitc05883f47c498be4e11893e5178c5bc37ffd9f4a (patch)
treedbd3cd7ad3d7771405ad63af2f1e9d14d4ae5a35 /src/actionGroups
parent31539042f11bc210a29e923f45586779c3ad46b2 (diff)
parent60560a030fda3c539ff9dc1563b9926414a193da (diff)
Merge commit 'upstream/0.4.0'
Diffstat (limited to 'src/actionGroups')
-rw-r--r--src/actionGroups/actionGroup.vala21
-rw-r--r--src/actionGroups/bookmarkGroup.vala11
-rw-r--r--src/actionGroups/clipboardGroup.vala11
-rw-r--r--src/actionGroups/devicesGroup.vala11
-rw-r--r--src/actionGroups/groupRegistry.vala86
-rw-r--r--src/actionGroups/menuGroup.vala11
-rw-r--r--src/actionGroups/sessionGroup.vala11
-rw-r--r--src/actionGroups/windowListGroup.vala11
8 files changed, 106 insertions, 67 deletions
diff --git a/src/actionGroups/actionGroup.vala b/src/actionGroups/actionGroup.vala
index a6b52ff..c54be2f 100644
--- a/src/actionGroups/actionGroup.vala
+++ b/src/actionGroups/actionGroup.vala
@@ -70,6 +70,27 @@ public class ActionGroup : GLib.Object {
public void delete_all() {
actions.clear();
}
+
+ /////////////////////////////////////////////////////////////////////
+ /// Makes all contained Slices no Quick Actions.
+ /////////////////////////////////////////////////////////////////////
+
+ public void disable_quickactions() {
+ foreach (var action in actions)
+ action.is_quickaction = false;
+ }
+
+ /////////////////////////////////////////////////////////////////////
+ /// Returns true, if one o the contained Slices is a Quick Action
+ /////////////////////////////////////////////////////////////////////
+
+ public bool has_quickaction() {
+ foreach (var action in actions)
+ if (action.is_quickaction)
+ return true;
+
+ return false;
+ }
}
}
diff --git a/src/actionGroups/bookmarkGroup.vala b/src/actionGroups/bookmarkGroup.vala
index 389b14a..0a560c5 100644
--- a/src/actionGroups/bookmarkGroup.vala
+++ b/src/actionGroups/bookmarkGroup.vala
@@ -31,10 +31,13 @@ public class BookmarkGroup : ActionGroup {
/// the pies.conf file for this kind of ActionGroups.
/////////////////////////////////////////////////////////////////////
- public static void register(out string name, out string icon, out string settings_name) {
- name = _("Bookmarks");
- icon = "user-bookmarks";
- settings_name = "bookmarks";
+ public static GroupRegistry.TypeDescription register() {
+ var description = new GroupRegistry.TypeDescription();
+ description.name = _("Group: Bookmarks");
+ description.icon = "user-bookmarks";
+ description.description = _("Shows a Slice for each of your directory Bookmarks.");
+ description.id = "bookmarks";
+ return description;
}
/////////////////////////////////////////////////////////////////////
diff --git a/src/actionGroups/clipboardGroup.vala b/src/actionGroups/clipboardGroup.vala
index cd1da36..836c927 100644
--- a/src/actionGroups/clipboardGroup.vala
+++ b/src/actionGroups/clipboardGroup.vala
@@ -59,10 +59,13 @@ public class ClipboardGroup : ActionGroup {
/// the pies.conf file for this kind of ActionGroups.
/////////////////////////////////////////////////////////////////////
- public static void register(out string name, out string icon, out string settings_name) {
- name = _("Clipboard");
- icon = "edit-paste";
- settings_name = "clipboard";
+ public static GroupRegistry.TypeDescription register() {
+ var description = new GroupRegistry.TypeDescription();
+ description.name = _("Group: Clipboard");
+ description.icon = "edit-paste";
+ description.description = _("Manages your Clipboard.");
+ description.id = "clipboard";
+ return description;
}
/////////////////////////////////////////////////////////////////////
diff --git a/src/actionGroups/devicesGroup.vala b/src/actionGroups/devicesGroup.vala
index 3d2ced0..dee6a6e 100644
--- a/src/actionGroups/devicesGroup.vala
+++ b/src/actionGroups/devicesGroup.vala
@@ -30,10 +30,13 @@ public class DevicesGroup : ActionGroup {
/// the pies.conf file for this kind of ActionGroups.
/////////////////////////////////////////////////////////////////////
- public static void register(out string name, out string icon, out string settings_name) {
- name = _("Devices");
- icon = "harddrive";
- settings_name = "devices";
+ public static GroupRegistry.TypeDescription register() {
+ var description = new GroupRegistry.TypeDescription();
+ description.name = _("Group: Devices");
+ description.icon = "harddrive";
+ description.description = _("Shows a Slice for each plugged in devices, like USB-Sticks.");
+ description.id = "devices";
+ return description;
}
/////////////////////////////////////////////////////////////////////
diff --git a/src/actionGroups/groupRegistry.vala b/src/actionGroups/groupRegistry.vala
index a9f8d06..7510a03 100644
--- a/src/actionGroups/groupRegistry.vala
+++ b/src/actionGroups/groupRegistry.vala
@@ -27,67 +27,67 @@ public class GroupRegistry : GLib.Object {
/// A list containing all available ActionGroup types.
/////////////////////////////////////////////////////////////////////
- public static Gee.ArrayList<Type> types { get; private set; }
+ public static Gee.ArrayList<string> types { get; private set; }
/////////////////////////////////////////////////////////////////////
- /// Three maps associating a displayable name for each ActionGroup,
+ /// A map associating a displayable name for each ActionGroup,
/// an icon name and a name for the pies.conf file with it's type.
/////////////////////////////////////////////////////////////////////
- public static Gee.HashMap<Type, string> names { get; private set; }
- public static Gee.HashMap<Type, string> icons { get; private set; }
- public static Gee.HashMap<Type, string> settings_names { get; private set; }
+ public static Gee.HashMap<string, TypeDescription?> descriptions { get; private set; }
+
+ public class TypeDescription {
+ public string name { get; set; default=""; }
+ public string icon { get; set; default=""; }
+ public string description { get; set; default=""; }
+ public string id { get; set; default=""; }
+ }
/////////////////////////////////////////////////////////////////////
/// Registers all ActionGroup types.
/////////////////////////////////////////////////////////////////////
public static void init() {
- types = new Gee.ArrayList<Type>();
+ types = new Gee.ArrayList<string>();
+ descriptions = new Gee.HashMap<string, TypeDescription?>();
- names = new Gee.HashMap<Type, string>();
- icons = new Gee.HashMap<Type, string>();
- settings_names = new Gee.HashMap<Type, string>();
-
- string name = "";
- string icon = "";
- string settings_name = "";
+ TypeDescription type_description;
- BookmarkGroup.register(out name, out icon, out settings_name);
- types.add(typeof(BookmarkGroup));
- names.set(typeof(BookmarkGroup), name);
- icons.set(typeof(BookmarkGroup), icon);
- settings_names.set(typeof(BookmarkGroup), settings_name);
+ type_description = BookmarkGroup.register();
+ types.add(typeof(BookmarkGroup).name());
+ descriptions.set(typeof(BookmarkGroup).name(), type_description);
- DevicesGroup.register(out name, out icon, out settings_name);
- types.add(typeof(DevicesGroup));
- names.set(typeof(DevicesGroup), name);
- icons.set(typeof(DevicesGroup), icon);
- settings_names.set(typeof(DevicesGroup), settings_name);
+ type_description = DevicesGroup.register();
+ types.add(typeof(DevicesGroup).name());
+ descriptions.set(typeof(DevicesGroup).name(), type_description);
- MenuGroup.register(out name, out icon, out settings_name);
- types.add(typeof(MenuGroup));
- names.set(typeof(MenuGroup), name);
- icons.set(typeof(MenuGroup), icon);
- settings_names.set(typeof(MenuGroup), settings_name);
+ type_description = MenuGroup.register();
+ types.add(typeof(MenuGroup).name());
+ descriptions.set(typeof(MenuGroup).name(), type_description);
- SessionGroup.register(out name, out icon, out settings_name);
- types.add(typeof(SessionGroup));
- names.set(typeof(SessionGroup), name);
- icons.set(typeof(SessionGroup), icon);
- settings_names.set(typeof(SessionGroup), settings_name);
+ type_description = SessionGroup.register();
+ types.add(typeof(SessionGroup).name());
+ descriptions.set(typeof(SessionGroup).name(), type_description);
- WindowListGroup.register(out name, out icon, out settings_name);
- types.add(typeof(WindowListGroup));
- names.set(typeof(WindowListGroup), name);
- icons.set(typeof(WindowListGroup), icon);
- settings_names.set(typeof(WindowListGroup), settings_name);
+ type_description = WindowListGroup.register();
+ types.add(typeof(WindowListGroup).name());
+ descriptions.set(typeof(WindowListGroup).name(), type_description);
+ }
+
+ /////////////////////////////////////////////////////////////////////
+ /// Creates a Group for a given type name.
+ /////////////////////////////////////////////////////////////////////
+
+ public static ActionGroup? create_group(string type_id, string parent_id) {
+ switch (type_id) {
+ case "bookmarks": return new BookmarkGroup(parent_id);
+ case "devices": return new DevicesGroup(parent_id);
+ case "menu": return new MenuGroup(parent_id);
+ case "session": return new SessionGroup(parent_id);
+ case "window_list": return new WindowListGroup(parent_id);
+ }
-// ClipboardGroup.register(out name, out icon, out settings_name);
-// types.add(typeof(ClipboardGroup));
-// names.set(typeof(ClipboardGroup), name);
-// icons.set(typeof(ClipboardGroup), icon);
-// settings_names.set(typeof(ClipboardGroup), settings_name);
+ return null;
}
}
diff --git a/src/actionGroups/menuGroup.vala b/src/actionGroups/menuGroup.vala
index 07a4bd1..247376d 100644
--- a/src/actionGroups/menuGroup.vala
+++ b/src/actionGroups/menuGroup.vala
@@ -30,10 +30,13 @@ public class MenuGroup : ActionGroup {
/// the pies.conf file for this kind of ActionGroups.
/////////////////////////////////////////////////////////////////////
- public static void register(out string name, out string icon, out string settings_name) {
- name = _("Main menu");
- icon = "gnome-main-menu";
- settings_name = "menu";
+ public static GroupRegistry.TypeDescription register() {
+ var description = new GroupRegistry.TypeDescription();
+ description.name = _("Group: Main menu");
+ description.icon = "gnome-main-menu";
+ description.description = _("Displays your main menu structure.");
+ description.id = "menu";
+ return description;
}
/////////////////////////////////////////////////////////////////////
diff --git a/src/actionGroups/sessionGroup.vala b/src/actionGroups/sessionGroup.vala
index 0b3f249..26f8ebc 100644
--- a/src/actionGroups/sessionGroup.vala
+++ b/src/actionGroups/sessionGroup.vala
@@ -30,10 +30,13 @@ public class SessionGroup : ActionGroup {
/// the pies.conf file for this kind of ActionGroups.
/////////////////////////////////////////////////////////////////////
- public static void register(out string name, out string icon, out string settings_name) {
- name = _("Session Control");
- icon = "gnome-logout";
- settings_name = "session";
+ public static GroupRegistry.TypeDescription register() {
+ var description = new GroupRegistry.TypeDescription();
+ description.name = _("Group: Session Control");
+ description.icon = "gnome-logout";
+ description.description = _("Shows a Slice for Shutdown, Reboot, and Hibernate.");
+ description.id = "session";
+ return description;
}
/////////////////////////////////////////////////////////////////////
diff --git a/src/actionGroups/windowListGroup.vala b/src/actionGroups/windowListGroup.vala
index b12f188..18bf55b 100644
--- a/src/actionGroups/windowListGroup.vala
+++ b/src/actionGroups/windowListGroup.vala
@@ -29,10 +29,13 @@ public class WindowListGroup : ActionGroup {
/// the pies.conf file for this kind of ActionGroups.
/////////////////////////////////////////////////////////////////////
- public static void register(out string name, out string icon, out string settings_name) {
- name = _("Window List");
- icon = "window-manager";
- settings_name = "window_list";
+ public static GroupRegistry.TypeDescription register() {
+ var description = new GroupRegistry.TypeDescription();
+ description.name = _("Group: Window List");
+ description.icon = "window-manager";
+ description.description = _("Shows a Slice for each of your opened Windows. Almost like Alt-Tab.");
+ description.id = "window_list";
+ return description;
}
/////////////////////////////////////////////////////////////////////