rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=7b7e7a532cb505a183397373691899a26fcaccb0

commit 7b7e7a532cb505a183397373691899a26fcaccb0
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Fri Mar 25 10:13:40 2016 +0200

    main_window: add quit shortcut (CTRL+Q)
---
 src/bin/common/signals.h         | 1 +
 src/bin/ui/main_window.c         | 1 +
 src/bin/ui/shortcuts/shortcuts.c | 4 ++++
 src/bin/ui/shortcuts/shortcuts.h | 1 +
 4 files changed, 7 insertions(+)

diff --git a/src/bin/common/signals.h b/src/bin/common/signals.h
index 889f787..fe9f0e4 100644
--- a/src/bin/common/signals.h
+++ b/src/bin/common/signals.h
@@ -447,6 +447,7 @@ typedef struct {
  *
  * @ingroup Window
  */
+#define SIGNAL_SHORTCUT_QUIT "SIGNAL_SHORTCUT_QUIT"
 #define SIGNAL_SHORTCUT_UNDO "SIGNAL_SHORTCUT_UNDO"
 #define SIGNAL_SHORTCUT_REDO "SIGNAL_SHORTCUT_REDO"
 #define SIGNAL_SHORTCUT_SAVE "SIGNAL_SHORTCUT_SAVE"
diff --git a/src/bin/ui/main_window.c b/src/bin/ui/main_window.c
index fb1c9bb..28945e5 100644
--- a/src/bin/ui/main_window.c
+++ b/src/bin/ui/main_window.c
@@ -198,6 +198,7 @@ ui_main_window_add(void)
    evas_object_smart_callback_add(ap.win, SIGNAL_STYLE_EDITOR_TAB_CLICKED, 
_hide_history, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_COLOR_EDITOR_TAB_CLICKED, 
_hide_history, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_TAB_CHANGED, _show_history, 
NULL);
+   evas_object_smart_callback_add(ap.win, SIGNAL_SHORTCUT_QUIT, _on_done, 
NULL);
 
    ap.block.property = ui_property_add(ap.win);
    elm_layout_content_set(ap.block.right_top, "elm.swallow.property", 
ap.block.property);
diff --git a/src/bin/ui/shortcuts/shortcuts.c b/src/bin/ui/shortcuts/shortcuts.c
index accf1f4..47f63b5 100644
--- a/src/bin/ui/shortcuts/shortcuts.c
+++ b/src/bin/ui/shortcuts/shortcuts.c
@@ -135,6 +135,7 @@ _shortcut_handle(Shortcut_Type type)
 
    switch (type)
      {
+        SHORTCUT(QUIT);
         SHORTCUT(REDO);
         SHORTCUT(UNDO);
         SHORTCUT(SAVE);
@@ -341,6 +342,9 @@ _default_shortcuts_add()
 {
    assert(ap.shortcuts != NULL);
 
+   _add_shortcut(SHORTCUT_TYPE_QUIT, SHORTCUT_TYPE_NONE,
+                 MOD_CTRL, 24/*q*/);
+
    _add_shortcut(SHORTCUT_TYPE_UNDO, SHORTCUT_TYPE_NONE,
                  MOD_CTRL, 52/*z*/);
    _add_shortcut(SHORTCUT_TYPE_REDO, SHORTCUT_TYPE_NONE,
diff --git a/src/bin/ui/shortcuts/shortcuts.h b/src/bin/ui/shortcuts/shortcuts.h
index 93833f4..c6144bb 100644
--- a/src/bin/ui/shortcuts/shortcuts.h
+++ b/src/bin/ui/shortcuts/shortcuts.h
@@ -80,6 +80,7 @@ typedef enum {
    SHORTCUT_TYPE_TAB_SOUND_MANAGER,
    SHORTCUT_TYPE_TAB_COLOR_CLASS_MANAGER,
    SHORTCUT_TYPE_TAB_STYLE_MANAGER,
+   SHORTCUT_TYPE_QUIT,
 
    SHORTCUT_TYPE_LAST,
 } Shortcut_Type;

-- 


Reply via email to