1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00
Commit Graph

33 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
a5e321cb2b Make instances of struct hierbox_browser_button const.
And explicitly disable the "Save" buttons in anonymous mode,
even though they are currently inside #if 0.
2007-02-04 13:54:07 +02:00
Kalle Olavi Niemitalo
5b6dbcc879 default_listbox_ops_messages: Make static and const. 2007-01-28 14:52:09 +02:00
Miciah Dashiel Butler Masters
81b4f8b917 done_listbox_item: if_assert_failed return 2006-06-16 21:13:32 +00:00
Miciah Dashiel Butler Masters
6f98f5fd96 Bookmarks: Fix update after move
do_move_bookmark was only updating the selection in the bookmarks manager
window in which the Move button was pressed. Now all windows are updated.

This patch also prevents a crash when the first item that was displayed
in a box was the last child of a folder and was being moved (the comment
removed in this patch was incorrect in assuming that bm->box->next must
be valid because it neglected to account for non-root children).

This change required that I move the definition of struct
hierbox_dialog_list_item from src/bfu/hierbox.c to src/bfu/hierbox.h.

Thanks to Kalle Olavi Niemitalo for finding both the update problem
and the crash.
2006-06-16 21:13:31 +00:00
Miciah Dashiel Butler Masters
143398f09d Unwrap a line in query_delete_selected_item. 2006-02-19 07:22:51 +00:00
Miciah Dashiel Butler Masters
b8063709c0 Query whether to delete the selected hierbox item if the user answers
no to confirmation to delete the marked item.
2006-02-19 07:19:35 +00:00
Miciah Dashiel Butler Masters
b97508e48a Simplify query_delete_selected_item
Check whether the item can be deleted before allocating the context so
as to save a free in the case that the item cannot be deleted.
2006-02-19 07:15:27 +00:00
Miciah Dashiel Butler Masters
e9799a2265 Reflow the control flow in push_hierbox_delete_button 2006-02-19 07:13:37 +00:00
Miciah Dashiel Butler Masters
6683f14bc1 Factor query_delete_selected_item out of push_hierbox_delete_button. 2006-02-19 07:11:51 +00:00
Miciah Dashiel Butler Masters
d87a90da6b Drop temporary variables when using listbox_message 2006-02-19 06:46:05 +00:00
Miciah Dashiel Butler Masters
a3fb98f499 src/bfu
Inconsequential change to push_hierbox_delete_button

Use item instead of context->item.
2006-02-19 06:22:12 +00:00
Kalle Olavi Niemitalo
93714a3e35 Merge with http://elinks.cz/elinks.git 2006-01-06 02:13:11 +02:00
Miciah Dashiel Butler Masters
a645bb2ead Do return EVENT_NOT_PROCESSED from hierbox_ev_init and hierbox_ev_abort
hierbox_ev_init and hierbox_ev_abort must return EVENT_NOT_PROCESSED
so that the generic dialog code runs and initialises the widgets and stuff.
This commit reverts commit f8310de64b to fix
a segfault and also adds comments to explain the unintuitive return value.
2006-01-05 23:41:18 +00:00
Laurent MONIN
77156c021a Drop unused listbox widget height stuff. 2006-01-05 11:50:42 +01:00
Laurent MONIN
f8310de64b hierbox_ev_[init|abort](): it makes more sense to return EVENT_PROCESSED. 2006-01-05 11:44:29 +01:00
Laurent MONIN
a05b6c0636 hierbox_ev_kbd(): use a switch(). 2006-01-05 11:41:26 +01:00
Kalle Olavi Niemitalo
345ba7afcd Merge with http://elinks.cz/elinks.git 2006-01-01 19:05:44 +02:00
Kalle Olavi Niemitalo
4c2831677a Here is a framework that detects cases where a PO file assigns
the same accelerator key to multiple buttons in a dialog box or
to multiple items in a menu.  ELinks already has some support for
this but it requires the translator to run ELinks and manually
scan through all menus and dialogs.  The attached changes make it
possible to quickly detect and list any conflicts, including ones
that can only occur on operating systems or configurations that
the translator is not currently using.

The changes have no immediate effect on the elinks executable or
the MO files.  PO files become larger, however.

The scheme works like this:

- Like before, accelerator keys in translatable strings are
  tagged with the tilde (~) character.

- Whenever a C source file defines an accelerator key, it must
  assign one or more named "contexts" to it.  The translations in
  the PO files inherit these contexts.  If multiple strings use
  the same accelerator (case insensitive) in the same context,
  that's a conflict and can be detected automatically.

- The contexts are defined with "gettext_accelerator_context"
  comments in source files.  These comments delimit regions where
  all translatable strings containing tildes are given the same
  contexts.  There must be one special comment at the top of the
  region; it lists the contexts assigned to that region.  The
  region automatically ends at the end of the function (found
  with regexp /^\}/), but it can also be closed explicitly with
  another special comment.  The comments are formatted like this:

    /* [gettext_accelerator_context(foo, bar, baz)]
         begins a region that uses the contexts "foo", "bar", and "baz".
         The comma is the delimiter; whitespace is optional.

       [gettext_accelerator_context()]
         ends the region.  */

  The scripts don't currently check whether this syntax occurs
  inside or outside comments.

- The names of contexts consist of C identifiers delimited with
  periods.  I typically used the name of a function that sets
  up a dialog, or the name of an array where the items of a
  menu are listed.  There is a special feature for static
  functions: if the name begins with a period, then the period
  will be replaced with the name of the source file and a colon.

- If a menu is programmatically generated from multiple parts,
  of which some are never used together, so that it is safe to
  use the same accelerators in them, then it is necessary to
  define multiple contexts for the same menu.  link_menu() in
  src/viewer/text/link.c is the most complex example of this.

- During make update-po:

  - A Perl script (po/gather-accelerator-contexts.pl) reads
    po/elinks.pot, scans the source files listed in it for
    "gettext_accelerator_context" comments, and rewrites
    po/elinks.pot with "accelerator_context" comments that
    indicate the contexts of each msgid: the union of all
    contexts of all of its uses in the source files.  It also
    removes any "gettext_accelerator_context" comments that
    xgettext --add-comments has copied to elinks.pot.

  - If po/gather-accelerator-contexts.pl does not find any
    contexts for some use of an msgid that seems to contain an
    accelerator (because it contains a tilde), it warns.  If the
    tilde refers to e.g. "~/.elinks" and does not actually mark
    an accelerator, the warning can be silenced by specifying the
    special context "IGNORE", which the script otherwise ignores.

  - msgmerge copies the "accelerator_context" comments from
    po/elinks.pot to po/*.po.  Translators do not edit those
    comments.

- During make check-po:

  - Another Perl script (po/check-accelerator-contexts.pl) reads
    po/*.po and keeps track of which accelerators have been bound
    in each context.  It warns about any conflicts it finds.
    This script does not access the C source files; thus it does
    not matter if the line numbers in "#:" lines are out of date.

This implementation is not perfect and I am not proposing to
add it to the main source tree at this time.  Specifically:

- It introduces compile-time dependencies on Perl and Locale::PO.
  There should be a configure-time or compile-time check so that
  the new features are skipped if the prerequisites are missing.

- When the scripts include msgstr strings in warnings, they
  should transcode them from the charset of the PO file to the
  one specified by the user's locale.

- It is not adequately documented (well, except perhaps here).

- po/check-accelerator-contexts.pl reports the same conflict
  multiple times if it occurs in multiple contexts.

- The warning messages should include line numbers, so that users
  of Emacs could conveniently edit the conflicting part of the PO
  file.  This is not feasible with the current version of
  Locale::PO.

- Locale::PO does not understand #~ lines and spews warnings
  about them.  There is an ugly hack to hide these warnings.

- Jonas Fonseca suggested the script could propose accelerators
  that are still available.  This has not been implemented.

There are three files attached:

- po/gather-accelerator-contexts.pl: Augments elinks.pot with
  context information.

- po/check-accelerator-contexts.pl: Checks conflicts.

- accelerator-contexts.diff: Makes po/Makefile run the scripts,
  and adds special comments to source files.
2006-01-01 18:55:18 +02:00
Miciah Dashiel Butler Masters
227150d100 Merge the definition and initialisation of msg in 2006-01-01 08:07:14 +00:00
Miciah Dashiel Butler Masters
127b27bd49 Use listbox_message. 2006-01-01 08:07:14 +00:00
Miciah Dashiel Butler Masters
2ee5b85b9e Introduce and use local variable ops, assigned the value of box->ops, 2006-01-01 08:07:14 +00:00
Miciah Dashiel Butler Masters
985efb99b6 Introduce a macro listbox_message(msg) that tries ops->messages->msg 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
6114066803 Replace unsigned char *delete_messages[2][DELETE_ERRORS] with struct 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
4e83efb6d3 Drop a comment that should have gone with revision 1.129. 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
eeed2cd4a8 Use the local variable item instead of context->item, which is assigned 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
247fe95fea In hierbox_ev_kbd, use the local variable selected, which is assigned 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
4eb0cbf271 Introduce and use local variable item, assigned the value of 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
5042a48750 Re-indent recursively_goto_listbox. 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
6aed6ff96f Factor recursively_goto_listbox out of recursively_goto_each_listbox. 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
a4209b02fe Rename recursively_goto_listbox to recursively_goto_each_listbox. 2006-01-01 08:07:13 +00:00
Miciah Dashiel Butler Masters
963452c65f Rename done_listbox_item parameter box_item to item. 2006-01-01 08:07:13 +00:00
Laurent MONIN
df065ead80 Remove now useless $Id: lines. 2005-10-21 09:14:07 +02:00
Petr Baudis
0f6d4310ad Initial commit of the HEAD branch of the ELinks CVS repository, as of
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00