This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
  discards  f5a14b9fd22a866a58e3ff7dfccac53a27d62d56 (commit)
  discards  2bd63949e99e978e9009f567b5081b21abad64db (commit)
  discards  aa6d7ac7c61d2a23986f4046cda6e5231717a316 (commit)
  discards  705bf49c7383f2d9017159939608bd1b974538f6 (commit)
       via  3ae34b958c8519618f0fbd648eee10118a783ed2 (commit)
       via  809c536879ebe339a5e4388669a389cb26835b3d (commit)
       via  69d2e5187613a41b0f883885fb3575a43f7f2226 (commit)
       via  171eca8b64a024e6f08c1026dd49599a6742ccac (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (f5a14b9fd22a866a58e3ff7dfccac53a27d62d56)
                         N -- N -- N (3ae34b958c8519618f0fbd648eee10118a783ed2)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/3ae34b958c8519618f0fbd648eee10118a783ed2

commit 3ae34b958c8519618f0fbd648eee10118a783ed2
Author: Rodolfo García Peñas (kix) <k...@kix.es>
Date:   Tue Jan 17 21:43:58 2012 +0100

    WPrefs: Remove duplicated function captureShortcut()
    
    The function captureShortcut() is implemented in both files 
KeyboardShortcuts.c
    and Menu.c, with just a minor difference regarding the conversion to upper 
case.
    
    To unify them, define a new function which includes a new boolean 
paramenter to
    dictate whether the upper case conversion should be done or not.

diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c
index 4ea7fa4..4fd5305 100644
--- a/WPrefs.app/KeyboardShortcuts.c
+++ b/WPrefs.app/KeyboardShortcuts.c
@@ -52,7 +52,7 @@ typedef struct _Panel {
        WMColor *gray;
        WMFont *font;
 
-        /**/ char capturing;
+       Bool capturing;
        char **shortcuts;
        int actionCount;
 } _Panel;
@@ -230,23 +230,27 @@ static void XConvertCase(register KeySym sym, KeySym * 
lower, KeySym * upper)
 }
 #endif
 
-static char *captureShortcut(Display * dpy, _Panel * panel)
+char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case)
 {
        XEvent ev;
        KeySym ksym, lksym, uksym;
        char buffer[64];
        char *key = NULL;
 
-       while (panel->capturing) {
+       while (*capturing) {
                XAllowEvents(dpy, AsyncKeyboard, CurrentTime);
                WMNextEvent(dpy, &ev);
                if (ev.type == KeyPress && ev.xkey.keycode != 0) {
                        ksym = XKeycodeToKeysym(dpy, ev.xkey.keycode, 0);
                        if (!IsModifierKey(ksym)) {
-                               XConvertCase(ksym, &lksym, &uksym);
-                               key = XKeysymToString(uksym);
-
-                               panel->capturing = 0;
+                               if (convert_case) {
+                                       XConvertCase(ksym, &lksym, &uksym);
+                                       key = XKeysymToString(uksym);
+                               } else {
+                                       key = XKeysymToString(ksym);
+                               }
+
+                               *capturing = 0;
                                break;
                        }
                }
@@ -296,7 +300,7 @@ static void captureClick(WMWidget * w, void *data)
                WMSetLabelText(panel->instructionsL,
                               _("Press the desired shortcut key(s) or click 
Cancel to stop capturing."));
                XGrabKeyboard(dpy, WMWidgetXID(panel->parent), True, 
GrabModeAsync, GrabModeAsync, CurrentTime);
-               shortcut = captureShortcut(dpy, panel);
+               shortcut = capture_shortcut(dpy, &panel->capturing, 1);
                if (shortcut) {
                        int row = WMGetListSelectedItemRow(panel->actLs);
 
diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c
index 21a9fe1..6784c47 100644
--- a/WPrefs.app/Menu.c
+++ b/WPrefs.app/Menu.c
@@ -176,6 +176,8 @@ static Bool shouldRemoveItem(struct WEditMenuDelegate 
*delegate, WEditMenu * men
 
 static void freeItemData(ItemData * data);
 
+extern char *capture_shortcut(Display *dpy, Bool *capturing, Bool 
convert_case);
+
 static WEditMenuDelegate menuDelegate = {
        NULL,
        menuItemCloned,
@@ -254,58 +256,6 @@ static void browseForFile(WMWidget * self, void 
*clientData)
        wfree(oldprog);
 }
 
-static char *captureShortcut(Display * dpy, _Panel * panel)
-{
-       XEvent ev;
-       KeySym ksym;
-       char buffer[64];
-       char *key = NULL;
-
-       while (panel->capturing) {
-               XAllowEvents(dpy, AsyncKeyboard, CurrentTime);
-               WMNextEvent(dpy, &ev);
-               if (ev.type == KeyPress && ev.xkey.keycode != 0) {
-                       ksym = XKeycodeToKeysym(dpy, ev.xkey.keycode, 0);
-                       if (!IsModifierKey(ksym)) {
-                               key = XKeysymToString(ksym);
-                               panel->capturing = 0;
-                               break;
-                       }
-               }
-               WMHandleEvent(&ev);
-       }
-
-       if (!key)
-               return NULL;
-
-       buffer[0] = 0;
-
-       if (ev.xkey.state & ControlMask) {
-               strcat(buffer, "Control+");
-       }
-       if (ev.xkey.state & ShiftMask) {
-               strcat(buffer, "Shift+");
-       }
-       if (ev.xkey.state & Mod1Mask) {
-               strcat(buffer, "Mod1+");
-       }
-       if (ev.xkey.state & Mod2Mask) {
-               strcat(buffer, "Mod2+");
-       }
-       if (ev.xkey.state & Mod3Mask) {
-               strcat(buffer, "Mod3+");
-       }
-       if (ev.xkey.state & Mod4Mask) {
-               strcat(buffer, "Mod4+");
-       }
-       if (ev.xkey.state & Mod5Mask) {
-               strcat(buffer, "Mod5+");
-       }
-       strcat(buffer, key);
-
-       return wstrdup(buffer);
-}
-
 static void sgrabClicked(WMWidget * w, void *data)
 {
        _Panel *panel = (_Panel *) data;
@@ -322,7 +272,7 @@ static void sgrabClicked(WMWidget * w, void *data)
                panel->capturing = 1;
                WMSetButtonText(w, _("Cancel"));
                XGrabKeyboard(dpy, WMWidgetXID(panel->parent), True, 
GrabModeAsync, GrabModeAsync, CurrentTime);
-               shortcut = captureShortcut(dpy, panel);
+               shortcut = capture_shortcut(dpy, &panel->capturing, 0);
                if (shortcut) {
                        WMSetTextFieldText(panel->shortT, shortcut);
                        updateMenuItem(panel, panel->currentItem, 
panel->shortT);

-----------------------------------------------------------------------

Summary of changes:


repo.or.cz automatic notification. Contact project admin crma...@gmail.com
if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to