Menu

#219 [PATCH] flexible auto-copy functionality

open
nobody
None
5
2011-01-09
2011-01-09
No

now xchat automatically puts the selected text into clipboard upon selection. color codes are copied if the ctrl key is pressed. timestamps are copied if shift is pressed.

this patch modifies this in the following way:
- a new set variable, text_auto_copy_text. when it's 1 (by default, the current behaviour). the xtext selection is automatically put in the clipboard. when it's 0, you have to press alt (remember, ctrl and shift are already used) during selection to put it into the clipboard, otherwise the clipboard remans untouched.
- a new set variable, text_auto_copy_color. if it's 0 (default), color codes are only copied if you press ctrl during selection. if it's 1, color codes are always copied regardless of ctrl.
- a new set variable, text_auto_copy_stamp. when it's 0 (default), timestamps are only copied when shift is pressed during selection. if it's 1, timestamps are always selected and copied regardless of shift.

patch made for r1479.

Discussion

  • Berke Viktor

    Berke Viktor - 2011-01-10

    i'v updated the patch, mostly with the additions made by richro. so credit is definitely due for him too. please disregard the first version, this is the current one.

    changes:
    - alt key is no longer a shortcut. instead, ctrl+shift+c copies the selection after the selection is done. this is done this way so that one can still copy just the topic or the input box text with ctrl+c.
    - there's also an entry in window for manually copying the text.
    - there are toggles in preferences/text box for toggling the new 3 set variables.

     
  • Berke Viktor

    Berke Viktor - 2011-01-10

    i've updated the patch once again, this one's really some minor cosmetics. change "timestamp" to "time stamp" in setup.c as it's used that way on the same pane.

     
  • Berke Viktor

    Berke Viktor - 2011-01-10

    version 3 of autocopy patch

     
  • Berke Viktor

    Berke Viktor - 2011-01-10

    as a side note, this would fix 2978346.

     
  • Richard Hitt

    Richard Hitt - 2011-01-27

    See the file attached to artifact 3166296, sigh.

    This patch, xchat-autocopy-v4.patch, replaces xchat-autocopy-v3.patch.
    It makes all the changes that patch made and in addition controls
    the new Windows-menu item "Copy Selection". While the set variable
    text_auto_copy_text is TRUE, the "Copy Selection" item is hidden.
    When FALSE, the "Copy Selection" item is shown. It is greyed-out when
    no selection is present; otherwise it is sensitive.

    To implement this, new macro MENU_ID_COPY_SELECTION was defined. In order
    to include this variable in xtext.c, new header file menu_id.h was defined,
    the 12 (now 13) #defines in menu.h were moved to it, and menu.h now
    #includes "menu_id.h", and of course now so does xtext.c. I tried merely
    including menu.h in xtext.c but ended up with inscrutable dependencies.
    ---> PLEASE DO: svn add src/fe-gtk/menu_id.h <---

    The v3 patch defines shortcut Shift+Ctrl+C, as noted in previous
    Comment number 3. In order to do that, code in menu.c around new line
    number 2198 was altered to add GDK_SHIFT_MASK for upper-case GDK keys.
    This broke Control-I, for Xchat->Attach/Detach, so this patch changes
    GDK-I to GDK-i, which it should have been all along.

    http://rbh00.dyndns.org/~rbh00/xchat/xchat-autocopy-v4 gives a fuller
    explanation of this change, including a hunk-by-hunk explanation for
    every hunk of the patch.

     

Log in to post a comment.