mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Retire dialog
This is the last remaining piece of GPL software in the base system. The installer transitioned to bsddialog four years ago, and the last remaining dialog consumer, dpv, was turned off more than two years ago. Retire dpv, libdpv, libfigpar (used only by dpv), and dialog itself. (cherry picked from commit 73bb4a92985d747462d866248c1e7623f7ff1a7f)
This commit is contained in:
1 parent
e6467516f5
commit
5b2bdadeb6
390 files changed
+27
-95070
No files matched your search
@@ -58,9 +58,7 @@ fusefs(4) asomers Pre-commit review requested.
|
||||
geli pjd Pre-commit review requested (both sys/geom/eli/ and sbin/geom/class/eli/).
|
||||
iwm(4) adrian Pre-commit review requested, send to [email protected]
|
||||
iwn(4) adrian Pre-commit review requested, send to [email protected]
|
||||
libdpv dteske Pre-commit review requested. Keep in sync with dpv(1).
|
||||
libfetch des Pre-commit review requested.
|
||||
libfigpar dteske Pre-commit review requested.
|
||||
libm freebsd-numerics Send email with patches to freebsd-numerics@
|
||||
libpam des Pre-commit review requested.
|
||||
linprocfs des Pre-commit review requested.
|
||||
@@ -120,7 +118,6 @@ tools/build imp,jrtc27 Pre-commit review requested, especially to fix bootstrap
|
||||
top(1) eadler Pre-commit review requested.
|
||||
ufshci(4) jaeyoon Pre-commit review requested.
|
||||
usr.sbin/bsdconfig dteske Pre-commit phabricator review requested.
|
||||
usr.sbin/dpv dteske Pre-commit review requested. Keep in sync with libdpv.
|
||||
usr.sbin/pkg pkg@ Please coordinate behavior or flag changes with pkg team.
|
||||
usr.sbin/sysrc dteske Pre-commit phabricator review requested. Keep in sync with bsdconfig(8) sysrc.subr.
|
||||
vmm(4) #bhyve Pre-commit review requested via #bhyve phabricator group.
|
||||
|
||||
@@ -3345,7 +3345,6 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \
|
||||
lib/libbz2 ${_libcom_err} lib/libcrypt \
|
||||
lib/libc++ \
|
||||
lib/libelf lib/libexpat \
|
||||
lib/libfigpar \
|
||||
${_lib_libgssapi} \
|
||||
lib/libjail \
|
||||
lib/libkiconv lib/libkldelf lib/libkvm \
|
||||
@@ -3384,11 +3383,6 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \
|
||||
${_secure_lib_libcrypto} ${_secure_lib_libssl} \
|
||||
${_lib_libldns} ${_secure_lib_libssh}
|
||||
|
||||
.if ${MK_DIALOG} != "no"
|
||||
_prebuild_libs+= gnu/lib/libdialog
|
||||
gnu/lib/libdialog__L: lib/msun__L lib/ncurses/tinfo__L lib/ncurses/ncurses__L
|
||||
.endif
|
||||
|
||||
.if ${MK_GOOGLETEST} != "no"
|
||||
_prebuild_libs+= lib/libregex
|
||||
.endif
|
||||
|
||||
@@ -51,6 +51,32 @@
|
||||
# xargs -n1 | sort | uniq -d;
|
||||
# done
|
||||
|
||||
# 20260628: Removed dialog, figpar, dpv
|
||||
OLD_FILES+=usr/bin/dialog
|
||||
OLD_FILES+=usr/bin/dpv
|
||||
OLD_FILES+=usr/lib/libdialog.a
|
||||
OLD_FILES+=usr/lib/libdialog.so
|
||||
OLD_LIBS+=usr/lib/libdialog.so.10
|
||||
OLD_FILES+=usr/lib/libdpv.a
|
||||
OLD_FILES+=usr/lib/libdpv.so
|
||||
OLD_LIBS+=usr/lib/libdpv.so.3
|
||||
OLD_FILES+=usr/lib/libfigpar.a
|
||||
OLD_FILES+=usr/lib/libfigpar.so
|
||||
OLD_LIBS+=usr/lib/libfigpar.so.0
|
||||
OLD_FILES+=usr/share/man/man1/dialog.1.gz
|
||||
OLD_FILES+=usr/share/man/man1/dpv.1.gz
|
||||
OLD_FILES+=usr/share/man/man3/dialog.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/dpv.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/dpv_free.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/figpar.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/get_config_option.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/parse_config.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/replaceall.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/strcount.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/strexpand.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/strexpandnl.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/strtolower.3.gz
|
||||
|
||||
# 20260602: Removed by 0a36787e4c1f on 20210723
|
||||
OLD_FILES+=usr/share/locale/hr_HR.ISO8859-2/LC_MESSAGES
|
||||
OLD_FILES+=usr/share/locale/nl_BE.ISO8859-1/LC_MESSAGES
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,504 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
-(1999-12-25)-------------------------------------------------------------------
|
||||
This version of dialog, formerly known as cdialog is based on the Debian
|
||||
package for dialog 0.9a (see CHANGES for recent modifications)
|
||||
- T.Dickey <[email protected]>
|
||||
|
||||
-(1996-01-15)-------------------------------------------------------------------
|
||||
I have uploaded cdialog-0.9a.tar.gz to sunsite. It should be moved
|
||||
to pub/Linux/utils/shell, I think.
|
||||
|
||||
Starting point for cdialog v.0.9a was dialog-0.6c. Many new features
|
||||
like as Resolution-independence, Auto-sizing, Maximizing, more widget
|
||||
on the same screen (multi-widget), etc. were added. New widget are
|
||||
tailbox and tailbox-in-background. Here are the options:
|
||||
|
||||
Usage: dialog <Common options> <Box options>
|
||||
{ --and-widget <Common options> <Box options> }
|
||||
|
||||
Common options: <Global options>
|
||||
[--backtitle <backtitle>] [--sleep <secs>] [--beep] [--beep-after]
|
||||
[--clear] [--begin <y> <x>] [--aspect <ratio>] [--print-size]
|
||||
[--print-maxsize] [--size-err] [--separate-output] [--cr-wrap]
|
||||
[--tab-len <n>] [--tab-correct] [--print-version] [--no-kill]
|
||||
[--title <title>]
|
||||
|
||||
Global options: [--shadow] [--no-shadow] [--separate-widget "<str>"]
|
||||
|
||||
At the moment, mouse support with libgpm can't be added because it
|
||||
does't implement the wtimeout() function of ncurses. Wtimeout() is
|
||||
needed to have more widgets (es.tailbox) cooperating on the same
|
||||
screen... I don't know if with newer versions of libgpm it's possible.
|
||||
|
||||
I have no more time to write docs for this new version...Is there
|
||||
anyone, that looking at the code, can do it??? Ouch! :-)
|
||||
Don't flame me!
|
||||
|
||||
For the future, if any volunteer want, the way to evolve cdialog is to
|
||||
1) make a daemon for a better support of multi-tasking or implementing
|
||||
multithreading.
|
||||
2) add an option that could permit to read commands (--options) from a
|
||||
file, like as in a normal programming language, but maintaining
|
||||
compatibility with older version of dialog.
|
||||
|
||||
I no longer could maintain cdialog...
|
||||
Executable and library name of cdialog are the same of dialog, for
|
||||
compatibility.
|
||||
|
||||
I think that only one directive should be follow: don't use a resource
|
||||
like stdin, stdout when you'll write new options for cdialog; these
|
||||
resources have to be shared from all widgets on the command line.
|
||||
Guage uses stdin :-/ so that can't be mixed for example with an inputbox,
|
||||
but it was made before of multi-widget. However this is not a big problem!
|
||||
|
||||
THERE ARE NO *KNOWN* BUGS. If anyone has much time and can find the way
|
||||
to add wtimeout() support to libgpm, also mouse could be supported.
|
||||
|
||||
Please use ncurses-1.9.4 or newer.
|
||||
|
||||
| __ | [email protected]:~$ make Linux | more > UserFriendly;
|
||||
| /__) | /~~ _ _ _ _ /~\ _ / . _ |
|
||||
|/ ako | (___ (_) | ) ) (-' (__/ | ) /__ | | ) (_| >< . coordinator.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
15:0:0 1.3 20210117
|
||||
Vendored
-7150
File diff suppressed because it is too large.
Load diff
@@ -1,168 +0,0 @@
|
||||
/*
|
||||
* $Id: argv.c,v 1.13 2020/03/26 02:55:37 tom Exp $
|
||||
*
|
||||
* argv - Reusable functions for argv-parsing.
|
||||
*
|
||||
* Copyright 2011-2018,2020 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* Convert a string to an argv[], returning a char** index (which must be
|
||||
* freed by the caller). The string is modified (replacing gaps between
|
||||
* tokens with nulls).
|
||||
*/
|
||||
char **
|
||||
dlg_string_to_argv(char *blob)
|
||||
{
|
||||
size_t n, k;
|
||||
int pass;
|
||||
size_t length = strlen(blob);
|
||||
char **result = 0;
|
||||
|
||||
#ifdef HAVE_DLG_TRACE
|
||||
if (dialog_state.trace_output) {
|
||||
DLG_TRACE(("# dlg_string_to_argv:\n"));
|
||||
DLG_TRACE(("# given:\n"));
|
||||
for (n = k = 0; n < length; ++n) {
|
||||
if (blob[n] == '\n') {
|
||||
DLG_TRACE(("#%s\t%.*s\\n\n",
|
||||
k ? "+" : "",
|
||||
(int) (n - k), blob + k));
|
||||
k = n + 1;
|
||||
}
|
||||
}
|
||||
if (n > k) {
|
||||
DLG_TRACE(("#%s\t%.*s\n",
|
||||
k ? "+" : "",
|
||||
(int) (n - k), blob + k));
|
||||
}
|
||||
DLG_TRACE(("# result:\n"));
|
||||
}
|
||||
#endif
|
||||
for (pass = 0; pass < 2; ++pass) {
|
||||
bool inparm = FALSE;
|
||||
bool quoted = FALSE;
|
||||
char *param = blob;
|
||||
size_t count = 0;
|
||||
|
||||
for (n = 0; n < length; ++n) {
|
||||
if (quoted && blob[n] == '"') {
|
||||
quoted = FALSE;
|
||||
} else if (blob[n] == '"') {
|
||||
quoted = TRUE;
|
||||
if (!inparm) {
|
||||
if (pass) {
|
||||
result[count] = param;
|
||||
}
|
||||
++count;
|
||||
inparm = TRUE;
|
||||
}
|
||||
} else if (!quoted && isspace(UCH(blob[n]))) {
|
||||
if (inparm) {
|
||||
if (pass) {
|
||||
*param = '\0';
|
||||
}
|
||||
++param;
|
||||
inparm = FALSE;
|
||||
}
|
||||
} else {
|
||||
if (blob[n] == '\\') {
|
||||
size_t n1 = (n + 1);
|
||||
bool ignore = FALSE;
|
||||
if (n1 == length) {
|
||||
break; /* The string is terminated by a backslash */
|
||||
} else if ((blob[n1] == '\\') ||
|
||||
(blob[n1] == '"') ||
|
||||
(ignore = (blob[n1] == '\n'))) {
|
||||
/* eat the backslash */
|
||||
if (pass) {
|
||||
--length;
|
||||
for (k = n; k < length; ++k)
|
||||
blob[k] = blob[k + 1];
|
||||
blob[length] = '\0';
|
||||
} else {
|
||||
++param; /* pretend I ate it */
|
||||
}
|
||||
if (ignore)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!inparm) {
|
||||
if (pass) {
|
||||
result[count] = param;
|
||||
}
|
||||
++count;
|
||||
inparm = TRUE;
|
||||
}
|
||||
if (pass) {
|
||||
*param = blob[n];
|
||||
}
|
||||
++param;
|
||||
}
|
||||
}
|
||||
|
||||
if (pass) {
|
||||
*param = '\0';
|
||||
} else {
|
||||
if (count) {
|
||||
result = dlg_calloc(char *, count + 1);
|
||||
assert_ptr(result, "string_to_argv");
|
||||
} else {
|
||||
break; /* no tokens found */
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_DLG_TRACE
|
||||
if (result != 0) {
|
||||
for (n = 0; result[n] != 0; ++n) {
|
||||
DLG_TRACE(("#\targv[%d] = %s\n", (int) n, result[n]));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Count the entries in an argv list.
|
||||
*/
|
||||
int
|
||||
dlg_count_argv(char **argv)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (argv != 0) {
|
||||
while (argv[result] != 0)
|
||||
++result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
dlg_eat_argv(int *argcp, char ***argvp, int start, int count)
|
||||
{
|
||||
int k;
|
||||
|
||||
*argcp -= count;
|
||||
for (k = start; k <= *argcp; k++)
|
||||
(*argvp)[k] = (*argvp)[k + count];
|
||||
(*argvp)[*argcp] = 0;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1,277 +0,0 @@
|
||||
/*
|
||||
* $Id: arrows.c,v 1.53 2019/07/24 23:04:14 tom Exp $
|
||||
*
|
||||
* arrows.c -- draw arrows to indicate end-of-range for lists
|
||||
*
|
||||
* Copyright 2000-2018,2019 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
|
||||
#ifdef USE_WIDE_CURSES
|
||||
#if defined(CURSES_WACS_ARRAY) && !defined(CURSES_WACS_SYMBOLS)
|
||||
/* workaround for NetBSD 5.1 curses */
|
||||
#undef WACS_DARROW
|
||||
#undef WACS_UARROW
|
||||
#define WACS_DARROW &(CURSES_WACS_ARRAY['.'])
|
||||
#define WACS_UARROW &(CURSES_WACS_ARRAY['-'])
|
||||
#endif
|
||||
#define add_acs(win, code) wadd_wch(win, W ## code)
|
||||
#else
|
||||
#define add_acs(win, code) waddch(win, dlg_boxchar(code))
|
||||
#endif
|
||||
|
||||
/* size of decorations */
|
||||
#define ON_LEFT 4
|
||||
#define ON_RIGHT 3
|
||||
|
||||
#ifdef HAVE_COLOR
|
||||
static chtype
|
||||
merge_colors(chtype foreground, chtype background)
|
||||
{
|
||||
chtype result = foreground;
|
||||
if ((foreground & A_COLOR) != (background & A_COLOR)) {
|
||||
short fg_f, bg_f;
|
||||
short fg_b, bg_b;
|
||||
short fg_pair = (short) PAIR_NUMBER(foreground);
|
||||
short bg_pair = (short) PAIR_NUMBER(background);
|
||||
|
||||
if (pair_content(fg_pair, &fg_f, &bg_f) != ERR
|
||||
&& pair_content(bg_pair, &fg_b, &bg_b) != ERR) {
|
||||
result &= ~A_COLOR;
|
||||
result |= dlg_color_pair(fg_f, bg_b);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
#define merge_colors(f,b) (f)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If we have help-line text, e.g., from "--hline", draw it between the other
|
||||
* decorations at the bottom of the dialog window.
|
||||
*/
|
||||
void
|
||||
dlg_draw_helpline(WINDOW *win, bool decorations)
|
||||
{
|
||||
int bottom;
|
||||
|
||||
if (dialog_vars.help_line != 0
|
||||
&& dialog_vars.help_line[0] != 0
|
||||
&& (bottom = getmaxy(win) - 1) > 0) {
|
||||
chtype attr = A_NORMAL;
|
||||
int cols = dlg_count_columns(dialog_vars.help_line);
|
||||
int other = decorations ? (ON_LEFT + ON_RIGHT) : 0;
|
||||
int avail = (getmaxx(win) - other - 2);
|
||||
int limit = dlg_count_real_columns(dialog_vars.help_line) + 2;
|
||||
|
||||
if (limit < avail) {
|
||||
int cur_x, cur_y;
|
||||
|
||||
getyx(win, cur_y, cur_x);
|
||||
other = decorations ? ON_LEFT : 0;
|
||||
(void) wmove(win, bottom, other + (avail - limit) / 2);
|
||||
waddch(win, '[');
|
||||
dlg_print_text(win, dialog_vars.help_line, cols, &attr);
|
||||
waddch(win, ']');
|
||||
wmove(win, cur_y, cur_x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
dlg_draw_arrows2(WINDOW *win,
|
||||
int top_arrow,
|
||||
int bottom_arrow,
|
||||
int x,
|
||||
int top,
|
||||
int bottom,
|
||||
chtype attr,
|
||||
chtype borderattr)
|
||||
{
|
||||
chtype save = dlg_get_attrs(win);
|
||||
int cur_x, cur_y;
|
||||
int limit_x = getmaxx(win);
|
||||
bool draw_top = TRUE;
|
||||
bool is_toplevel = (wgetparent(win) == stdscr);
|
||||
|
||||
getyx(win, cur_y, cur_x);
|
||||
|
||||
/*
|
||||
* If we're drawing a centered title, do not overwrite with the arrows.
|
||||
*/
|
||||
if (dialog_vars.title && is_toplevel && (top - getbegy(win)) < MARGIN) {
|
||||
int have = (limit_x - dlg_count_columns(dialog_vars.title)) / 2;
|
||||
int need = x + 5;
|
||||
if (need > have)
|
||||
draw_top = FALSE;
|
||||
}
|
||||
|
||||
if (draw_top) {
|
||||
(void) wmove(win, top, x);
|
||||
if (top_arrow) {
|
||||
dlg_attrset(win, merge_colors(uarrow_attr, attr));
|
||||
(void) add_acs(win, ACS_UARROW);
|
||||
(void) waddstr(win, "(-)");
|
||||
} else {
|
||||
dlg_attrset(win, attr);
|
||||
(void) whline(win, dlg_boxchar(ACS_HLINE), ON_LEFT);
|
||||
}
|
||||
}
|
||||
mouse_mkbutton(top, x - 1, 6, KEY_PPAGE);
|
||||
|
||||
(void) wmove(win, bottom, x);
|
||||
if (bottom_arrow) {
|
||||
dlg_attrset(win, merge_colors(darrow_attr, borderattr));
|
||||
(void) add_acs(win, ACS_DARROW);
|
||||
(void) waddstr(win, "(+)");
|
||||
} else {
|
||||
dlg_attrset(win, borderattr);
|
||||
(void) whline(win, dlg_boxchar(ACS_HLINE), ON_LEFT);
|
||||
}
|
||||
mouse_mkbutton(bottom, x - 1, 6, KEY_NPAGE);
|
||||
|
||||
(void) wmove(win, cur_y, cur_x);
|
||||
wrefresh(win);
|
||||
|
||||
dlg_attrset(win, save);
|
||||
}
|
||||
|
||||
void
|
||||
dlg_draw_scrollbar(WINDOW *win,
|
||||
long first_data,
|
||||
long this_data,
|
||||
long next_data,
|
||||
long total_data,
|
||||
int left,
|
||||
int right,
|
||||
int top,
|
||||
int bottom,
|
||||
chtype attr,
|
||||
chtype borderattr)
|
||||
{
|
||||
int oldy, oldx;
|
||||
|
||||
chtype save = dlg_get_attrs(win);
|
||||
int top_arrow = (first_data != 0);
|
||||
int bottom_arrow = (next_data < total_data);
|
||||
|
||||
getyx(win, oldy, oldx);
|
||||
|
||||
dlg_draw_helpline(win, TRUE);
|
||||
if (bottom_arrow || top_arrow || dialog_state.use_scrollbar) {
|
||||
char buffer[80];
|
||||
int percent;
|
||||
int len;
|
||||
|
||||
percent = (!total_data
|
||||
? 100
|
||||
: (int) ((next_data * 100)
|
||||
/ total_data));
|
||||
|
||||
if (percent < 0)
|
||||
percent = 0;
|
||||
else if (percent > 100)
|
||||
percent = 100;
|
||||
|
||||
dlg_attrset(win, position_indicator_attr);
|
||||
(void) sprintf(buffer, "%d%%", percent);
|
||||
(void) wmove(win, bottom, right - 7);
|
||||
(void) waddstr(win, buffer);
|
||||
if ((len = dlg_count_columns(buffer)) < 4) {
|
||||
dlg_attrset(win, border_attr);
|
||||
whline(win, dlg_boxchar(ACS_HLINE), 4 - len);
|
||||
}
|
||||
}
|
||||
#define BARSIZE(num) (int) (0.5 + (double) ((all_high * (int) (num)) / (double) total_data))
|
||||
#define ORDSIZE(num) (int) ((double) ((all_high * (int) (num)) / (double) all_diff))
|
||||
|
||||
if (dialog_state.use_scrollbar) {
|
||||
int all_high = (bottom - top - 1);
|
||||
|
||||
this_data = MAX(0, this_data);
|
||||
|
||||
if (total_data > 0 && all_high > 0) {
|
||||
int all_diff = (int) (total_data + 1);
|
||||
int bar_diff = (int) (next_data + 1 - this_data);
|
||||
int bar_high;
|
||||
|
||||
bar_high = ORDSIZE(bar_diff);
|
||||
if (bar_high <= 0)
|
||||
bar_high = 1;
|
||||
|
||||
if (bar_high < all_high) {
|
||||
int bar_last = BARSIZE(next_data);
|
||||
int bar_y;
|
||||
|
||||
wmove(win, top + 1, right);
|
||||
|
||||
dlg_attrset(win, save);
|
||||
wvline(win, ACS_VLINE | A_REVERSE, all_high);
|
||||
|
||||
bar_y = ORDSIZE(this_data);
|
||||
if (bar_y >= bar_last && bar_y > 0)
|
||||
bar_y = bar_last - 1;
|
||||
if (bar_last - bar_y > bar_high && bar_high > 1)
|
||||
++bar_y;
|
||||
bar_last = MIN(bar_last, all_high);
|
||||
|
||||
wmove(win, top + 1 + bar_y, right);
|
||||
|
||||
dlg_attrset(win, position_indicator_attr);
|
||||
dlg_attron(win, A_REVERSE);
|
||||
#if defined(WACS_BLOCK) && defined(NCURSES_VERSION) && defined(USE_WIDE_CURSES)
|
||||
wvline_set(win, WACS_BLOCK, bar_last - bar_y);
|
||||
#else
|
||||
wvline(win, ACS_BLOCK, bar_last - bar_y);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
dlg_draw_arrows2(win,
|
||||
top_arrow,
|
||||
bottom_arrow,
|
||||
left + ARROWS_COL,
|
||||
top,
|
||||
bottom,
|
||||
attr,
|
||||
borderattr);
|
||||
|
||||
dlg_attrset(win, save);
|
||||
wmove(win, oldy, oldx);
|
||||
}
|
||||
|
||||
void
|
||||
dlg_draw_arrows(WINDOW *win,
|
||||
int top_arrow,
|
||||
int bottom_arrow,
|
||||
int x,
|
||||
int top,
|
||||
int bottom)
|
||||
{
|
||||
dlg_draw_helpline(win, TRUE);
|
||||
dlg_draw_arrows2(win,
|
||||
top_arrow,
|
||||
bottom_arrow,
|
||||
x,
|
||||
top,
|
||||
bottom,
|
||||
menubox_border2_attr,
|
||||
menubox_border_attr);
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,833 +0,0 @@
|
||||
/*
|
||||
* $Id: buttons.c,v 1.106 2021/01/17 17:03:16 tom Exp $
|
||||
*
|
||||
* buttons.c -- draw buttons, e.g., OK/Cancel
|
||||
*
|
||||
* Copyright 2000-2020,2021 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
#include <dlg_keys.h>
|
||||
|
||||
#ifdef NEED_WCHAR_H
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
#define MIN_BUTTON (-dialog_state.visit_cols)
|
||||
#define CHR_BUTTON (!dialog_state.plain_buttons)
|
||||
|
||||
static void
|
||||
center_label(char *buffer, int longest, const char *label)
|
||||
{
|
||||
int len = dlg_count_columns(label);
|
||||
int right = 0;
|
||||
|
||||
*buffer = 0;
|
||||
if (len < longest) {
|
||||
int left = (longest - len) / 2;
|
||||
right = (longest - len - left);
|
||||
if (left > 0)
|
||||
sprintf(buffer, "%*s", left, " ");
|
||||
}
|
||||
strcat(buffer, label);
|
||||
if (right > 0)
|
||||
sprintf(buffer + strlen(buffer), "%*s", right, " ");
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse a multibyte character out of the string, set it past the parsed
|
||||
* character.
|
||||
*/
|
||||
static int
|
||||
string_to_char(const char **stringp)
|
||||
{
|
||||
int result;
|
||||
#ifdef USE_WIDE_CURSES
|
||||
const char *string = *stringp;
|
||||
size_t have = strlen(string);
|
||||
size_t len;
|
||||
wchar_t cmp2[2];
|
||||
mbstate_t state;
|
||||
|
||||
memset(&state, 0, sizeof(state));
|
||||
len = mbrlen(string, have, &state);
|
||||
|
||||
if ((int) len > 0 && len <= have) {
|
||||
size_t check;
|
||||
|
||||
memset(&state, 0, sizeof(state));
|
||||
memset(cmp2, 0, sizeof(cmp2));
|
||||
check = mbrtowc(cmp2, string, len, &state);
|
||||
if ((int) check <= 0)
|
||||
cmp2[0] = 0;
|
||||
*stringp += len;
|
||||
} else {
|
||||
cmp2[0] = UCH(*string);
|
||||
*stringp += 1;
|
||||
}
|
||||
result = cmp2[0];
|
||||
#else
|
||||
const char *string = *stringp;
|
||||
result = UCH(*string);
|
||||
*stringp += 1;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
static size_t
|
||||
count_labels(const char **labels)
|
||||
{
|
||||
size_t result = 0;
|
||||
if (labels != 0) {
|
||||
while (*labels++ != 0) {
|
||||
++result;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the latest key should be added to the hotkey list.
|
||||
*/
|
||||
static int
|
||||
was_hotkey(int this_key, int *used_keys, size_t next)
|
||||
{
|
||||
int result = FALSE;
|
||||
|
||||
if (next != 0) {
|
||||
size_t n;
|
||||
for (n = 0; n < next; ++n) {
|
||||
if (used_keys[n] == this_key) {
|
||||
result = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine the hot-keys for a set of button-labels. Normally these are
|
||||
* the first uppercase character in each label. However, if more than one
|
||||
* button has the same first-uppercase, then we will (attempt to) look for
|
||||
* an alternate.
|
||||
*
|
||||
* This allocates data which must be freed by the caller.
|
||||
*/
|
||||
static int *
|
||||
get_hotkeys(const char **labels)
|
||||
{
|
||||
int *result = 0;
|
||||
size_t count = count_labels(labels);
|
||||
|
||||
if ((result = dlg_calloc(int, count + 1)) != 0) {
|
||||
size_t n;
|
||||
|
||||
for (n = 0; n < count; ++n) {
|
||||
const char *label = labels[n];
|
||||
const int *indx = dlg_index_wchars(label);
|
||||
int limit = dlg_count_wchars(label);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < limit; ++i) {
|
||||
int first = indx[i];
|
||||
int check = UCH(label[first]);
|
||||
#ifdef USE_WIDE_CURSES
|
||||
int last = indx[i + 1];
|
||||
if ((last - first) != 1) {
|
||||
const char *temp = (label + first);
|
||||
check = string_to_char(&temp);
|
||||
}
|
||||
#endif
|
||||
if (dlg_isupper(check) && !was_hotkey(check, result, n)) {
|
||||
result[n] = check;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
sFIND_KEY = 0
|
||||
,sHAVE_KEY = 1
|
||||
,sHAD_KEY = 2
|
||||
} HOTKEY;
|
||||
|
||||
/*
|
||||
* Print a button
|
||||
*/
|
||||
static void
|
||||
print_button(WINDOW *win, char *label, int hotkey, int y, int x, int selected)
|
||||
{
|
||||
int i;
|
||||
HOTKEY state = sFIND_KEY;
|
||||
const int *indx = dlg_index_wchars(label);
|
||||
int limit = dlg_count_wchars(label);
|
||||
chtype key_attr = (selected
|
||||
? button_key_active_attr
|
||||
: button_key_inactive_attr);
|
||||
chtype label_attr = (selected
|
||||
? button_label_active_attr
|
||||
: button_label_inactive_attr);
|
||||
|
||||
(void) wmove(win, y, x);
|
||||
dlg_attrset(win, selected
|
||||
? button_active_attr
|
||||
: button_inactive_attr);
|
||||
(void) waddstr(win, "<");
|
||||
dlg_attrset(win, label_attr);
|
||||
for (i = 0; i < limit; ++i) {
|
||||
int check;
|
||||
int first = indx[i];
|
||||
int last = indx[i + 1];
|
||||
|
||||
switch (state) {
|
||||
case sFIND_KEY:
|
||||
check = UCH(label[first]);
|
||||
#ifdef USE_WIDE_CURSES
|
||||
if ((last - first) != 1) {
|
||||
const char *temp = (label + first);
|
||||
check = string_to_char(&temp);
|
||||
}
|
||||
#endif
|
||||
if (check == hotkey) {
|
||||
dlg_attrset(win, key_attr);
|
||||
state = sHAVE_KEY;
|
||||
}
|
||||
break;
|
||||
case sHAVE_KEY:
|
||||
dlg_attrset(win, label_attr);
|
||||
state = sHAD_KEY;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
waddnstr(win, label + first, last - first);
|
||||
}
|
||||
dlg_attrset(win, selected
|
||||
? button_active_attr
|
||||
: button_inactive_attr);
|
||||
(void) waddstr(win, ">");
|
||||
if (!dialog_vars.cursor_off_label) {
|
||||
(void) wmove(win, y, x + ((int) (strspn) (label, " ")) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Count the buttons in the list.
|
||||
*/
|
||||
int
|
||||
dlg_button_count(const char **labels)
|
||||
{
|
||||
int result = 0;
|
||||
while (*labels++ != 0)
|
||||
++result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute the size of the button array in columns. Return the total number of
|
||||
* columns in *length, and the longest button's columns in *longest
|
||||
*/
|
||||
void
|
||||
dlg_button_sizes(const char **labels,
|
||||
int vertical,
|
||||
int *longest,
|
||||
int *length)
|
||||
{
|
||||
int n;
|
||||
|
||||
*length = 0;
|
||||
*longest = 0;
|
||||
for (n = 0; labels[n] != 0; n++) {
|
||||
if (vertical) {
|
||||
*length += 1;
|
||||
*longest = 1;
|
||||
} else {
|
||||
int len = dlg_count_columns(labels[n]);
|
||||
if (len > *longest)
|
||||
*longest = len;
|
||||
*length += len;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* If we can, make all of the buttons the same size. This is only optional
|
||||
* for buttons laid out horizontally.
|
||||
*/
|
||||
if (*longest < 6 - (*longest & 1))
|
||||
*longest = 6 - (*longest & 1);
|
||||
if (!vertical)
|
||||
*length = *longest * n;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute the size of the button array.
|
||||
*/
|
||||
int
|
||||
dlg_button_x_step(const char **labels, int limit, int *gap, int *margin, int *step)
|
||||
{
|
||||
int count = dlg_button_count(labels);
|
||||
int longest;
|
||||
int length;
|
||||
int result;
|
||||
|
||||
*margin = 0;
|
||||
if (count != 0) {
|
||||
int unused;
|
||||
int used;
|
||||
|
||||
dlg_button_sizes(labels, FALSE, &longest, &length);
|
||||
used = (length + (count * 2));
|
||||
unused = limit - used;
|
||||
|
||||
if ((*gap = unused / (count + 3)) <= 0) {
|
||||
if ((*gap = unused / (count + 1)) <= 0)
|
||||
*gap = 1;
|
||||
*margin = *gap;
|
||||
} else {
|
||||
*margin = *gap * 2;
|
||||
}
|
||||
*step = *gap + (used + count - 1) / count;
|
||||
result = (*gap > 0) && (unused >= 0);
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure there is enough space for the buttons
|
||||
*/
|
||||
void
|
||||
dlg_button_layout(const char **labels, int *limit)
|
||||
{
|
||||
int gap, margin, step;
|
||||
|
||||
if (labels != 0 && dlg_button_count(labels)) {
|
||||
int width = 1;
|
||||
|
||||
while (!dlg_button_x_step(labels, width, &gap, &margin, &step))
|
||||
++width;
|
||||
width += (4 * MARGIN);
|
||||
if (width > COLS)
|
||||
width = COLS;
|
||||
if (width > *limit)
|
||||
*limit = width;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Print a list of buttons at the given position.
|
||||
*/
|
||||
void
|
||||
dlg_draw_buttons(WINDOW *win,
|
||||
int y, int x,
|
||||
const char **labels,
|
||||
int selected,
|
||||
int vertical,
|
||||
int limit)
|
||||
{
|
||||
chtype save = dlg_get_attrs(win);
|
||||
int step = 0;
|
||||
int length;
|
||||
int longest;
|
||||
int final_x;
|
||||
int final_y;
|
||||
int gap;
|
||||
int margin;
|
||||
size_t need;
|
||||
|
||||
dlg_mouse_setbase(getbegx(win), getbegy(win));
|
||||
|
||||
getyx(win, final_y, final_x);
|
||||
|
||||
dlg_button_sizes(labels, vertical, &longest, &length);
|
||||
|
||||
if (vertical) {
|
||||
y += 1;
|
||||
step = 1;
|
||||
} else {
|
||||
dlg_button_x_step(labels, limit, &gap, &margin, &step);
|
||||
x += margin;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate a buffer big enough for any label.
|
||||
*/
|
||||
need = (size_t) longest;
|
||||
if (need != 0) {
|
||||
char *buffer;
|
||||
int n;
|
||||
int *hotkeys = get_hotkeys(labels);
|
||||
|
||||
assert_ptr(hotkeys, "dlg_draw_buttons");
|
||||
|
||||
for (n = 0; labels[n] != 0; ++n) {
|
||||
need += strlen(labels[n]) + 1;
|
||||
}
|
||||
buffer = dlg_malloc(char, need);
|
||||
assert_ptr(buffer, "dlg_draw_buttons");
|
||||
|
||||
/*
|
||||
* Draw the labels.
|
||||
*/
|
||||
for (n = 0; labels[n] != 0; n++) {
|
||||
center_label(buffer, longest, labels[n]);
|
||||
mouse_mkbutton(y, x, dlg_count_columns(buffer), n);
|
||||
print_button(win, buffer,
|
||||
CHR_BUTTON ? hotkeys[n] : -1,
|
||||
y, x,
|
||||
(selected == n) || (n == 0 && selected < 0));
|
||||
if (selected == n)
|
||||
getyx(win, final_y, final_x);
|
||||
|
||||
if (vertical) {
|
||||
if ((y += step) > limit)
|
||||
break;
|
||||
} else {
|
||||
if ((x += step) > limit)
|
||||
break;
|
||||
}
|
||||
}
|
||||
(void) wmove(win, final_y, final_x);
|
||||
wrefresh(win);
|
||||
dlg_attrset(win, save);
|
||||
free(buffer);
|
||||
free(hotkeys);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Match a given character against the beginning of the string, ignoring case
|
||||
* of the given character. The matching string must begin with an uppercase
|
||||
* character.
|
||||
*/
|
||||
int
|
||||
dlg_match_char(int ch, const char *string)
|
||||
{
|
||||
if (!dialog_vars.no_hot_list) {
|
||||
if (string != 0) {
|
||||
int cmp2 = string_to_char(&string);
|
||||
#ifdef USE_WIDE_CURSES
|
||||
wint_t cmp1 = dlg_toupper(ch);
|
||||
if (cmp2 != 0 && (wchar_t) cmp1 == (wchar_t) dlg_toupper(cmp2)) {
|
||||
return TRUE;
|
||||
}
|
||||
#else
|
||||
if (ch > 0 && ch < 256) {
|
||||
if (dlg_toupper(ch) == dlg_toupper(cmp2))
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the first uppercase character in the label, which we may use for an
|
||||
* abbreviation.
|
||||
*/
|
||||
int
|
||||
dlg_button_to_char(const char *label)
|
||||
{
|
||||
int cmp = -1;
|
||||
|
||||
while (*label != 0) {
|
||||
int ch = string_to_char(&label);
|
||||
if (dlg_isupper(ch)) {
|
||||
cmp = ch;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return cmp;
|
||||
}
|
||||
|
||||
/*
|
||||
* Given a list of button labels, and a character which may be the abbreviation
|
||||
* for one, find it, if it exists. An abbreviation will be the first character
|
||||
* which happens to be capitalized in the label.
|
||||
*/
|
||||
int
|
||||
dlg_char_to_button(int ch, const char **labels)
|
||||
{
|
||||
int result = DLG_EXIT_UNKNOWN;
|
||||
|
||||
if (labels != 0) {
|
||||
int *hotkeys = get_hotkeys(labels);
|
||||
|
||||
ch = (int) dlg_toupper(dlg_last_getc());
|
||||
|
||||
if (hotkeys != 0) {
|
||||
int j;
|
||||
|
||||
for (j = 0; labels[j] != 0; ++j) {
|
||||
if (ch == hotkeys[j]) {
|
||||
dlg_flush_getc();
|
||||
result = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(hotkeys);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static const char *
|
||||
my_yes_label(void)
|
||||
{
|
||||
return (dialog_vars.yes_label != NULL)
|
||||
? dialog_vars.yes_label
|
||||
: _("Yes");
|
||||
}
|
||||
|
||||
static const char *
|
||||
my_no_label(void)
|
||||
{
|
||||
return (dialog_vars.no_label != NULL)
|
||||
? dialog_vars.no_label
|
||||
: _("No");
|
||||
}
|
||||
|
||||
static const char *
|
||||
my_ok_label(void)
|
||||
{
|
||||
return (dialog_vars.ok_label != NULL)
|
||||
? dialog_vars.ok_label
|
||||
: _("OK");
|
||||
}
|
||||
|
||||
static const char *
|
||||
my_cancel_label(void)
|
||||
{
|
||||
return (dialog_vars.cancel_label != NULL)
|
||||
? dialog_vars.cancel_label
|
||||
: _("Cancel");
|
||||
}
|
||||
|
||||
static const char *
|
||||
my_exit_label(void)
|
||||
{
|
||||
return (dialog_vars.exit_label != NULL)
|
||||
? dialog_vars.exit_label
|
||||
: _("EXIT");
|
||||
}
|
||||
|
||||
static const char *
|
||||
my_extra_label(void)
|
||||
{
|
||||
return (dialog_vars.extra_label != NULL)
|
||||
? dialog_vars.extra_label
|
||||
: _("Extra");
|
||||
}
|
||||
|
||||
static const char *
|
||||
my_help_label(void)
|
||||
{
|
||||
return (dialog_vars.help_label != NULL)
|
||||
? dialog_vars.help_label
|
||||
: _("Help");
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a list of button labels.
|
||||
*/
|
||||
const char **
|
||||
dlg_exit_label(void)
|
||||
{
|
||||
const char **result;
|
||||
DIALOG_VARS save;
|
||||
|
||||
if (dialog_vars.extra_button) {
|
||||
dlg_save_vars(&save);
|
||||
dialog_vars.nocancel = TRUE;
|
||||
result = dlg_ok_labels();
|
||||
dlg_restore_vars(&save);
|
||||
} else {
|
||||
static const char *labels[3];
|
||||
int n = 0;
|
||||
|
||||
if (!dialog_vars.nook)
|
||||
labels[n++] = my_exit_label();
|
||||
if (dialog_vars.help_button)
|
||||
labels[n++] = my_help_label();
|
||||
if (n == 0)
|
||||
labels[n++] = my_exit_label();
|
||||
labels[n] = 0;
|
||||
|
||||
result = labels;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Map the given button index for dlg_exit_label() into our exit-code.
|
||||
*/
|
||||
int
|
||||
dlg_exit_buttoncode(int button)
|
||||
{
|
||||
int result;
|
||||
DIALOG_VARS save;
|
||||
|
||||
dlg_save_vars(&save);
|
||||
dialog_vars.nocancel = TRUE;
|
||||
|
||||
result = dlg_ok_buttoncode(button);
|
||||
|
||||
dlg_restore_vars(&save);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static const char **
|
||||
finish_ok_label(const char **labels, int n)
|
||||
{
|
||||
if (n == 0) {
|
||||
labels[n++] = my_ok_label();
|
||||
dialog_vars.nook = FALSE;
|
||||
dlg_trace_msg("# ignore --nook, since at least one button is needed\n");
|
||||
}
|
||||
|
||||
labels[n] = NULL;
|
||||
return labels;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a list of button labels for the OK (no Cancel) group, used in msgbox
|
||||
* and progressbox.
|
||||
*/
|
||||
const char **
|
||||
dlg_ok_label(void)
|
||||
{
|
||||
static const char *labels[4];
|
||||
int n = 0;
|
||||
|
||||
if (!dialog_vars.nook)
|
||||
labels[n++] = my_ok_label();
|
||||
if (dialog_vars.extra_button)
|
||||
labels[n++] = my_extra_label();
|
||||
if (dialog_vars.help_button)
|
||||
labels[n++] = my_help_label();
|
||||
|
||||
return finish_ok_label(labels, n);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a list of button labels for the OK/Cancel group, used in most widgets
|
||||
* that select an option or data.
|
||||
*/
|
||||
const char **
|
||||
dlg_ok_labels(void)
|
||||
{
|
||||
static const char *labels[5];
|
||||
int n = 0;
|
||||
|
||||
if (!dialog_vars.nook)
|
||||
labels[n++] = my_ok_label();
|
||||
if (dialog_vars.extra_button)
|
||||
labels[n++] = my_extra_label();
|
||||
if (!dialog_vars.nocancel)
|
||||
labels[n++] = my_cancel_label();
|
||||
if (dialog_vars.help_button)
|
||||
labels[n++] = my_help_label();
|
||||
|
||||
return finish_ok_label(labels, n);
|
||||
}
|
||||
|
||||
/*
|
||||
* Map the given button index for dlg_ok_labels() into our exit-code
|
||||
*/
|
||||
int
|
||||
dlg_ok_buttoncode(int button)
|
||||
{
|
||||
int result = DLG_EXIT_ERROR;
|
||||
int n = !dialog_vars.nook;
|
||||
|
||||
if (!dialog_vars.nook && (button <= 0)) {
|
||||
result = DLG_EXIT_OK;
|
||||
} else if (dialog_vars.extra_button && (button == n++)) {
|
||||
result = DLG_EXIT_EXTRA;
|
||||
} else if (!dialog_vars.nocancel && (button == n++)) {
|
||||
result = DLG_EXIT_CANCEL;
|
||||
} else if (dialog_vars.help_button && (button == n)) {
|
||||
result = DLG_EXIT_HELP;
|
||||
}
|
||||
DLG_TRACE(("# dlg_ok_buttoncode(%d) = %d:%s\n",
|
||||
button, result, dlg_exitcode2s(result)));
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Given that we're using dlg_ok_labels() to list buttons, find the next index
|
||||
* in the list of buttons. The 'extra' parameter if negative provides a way to
|
||||
* enumerate extra active areas on the widget.
|
||||
*/
|
||||
int
|
||||
dlg_next_ok_buttonindex(int current, int extra)
|
||||
{
|
||||
int result = current + 1;
|
||||
|
||||
if (current >= 0
|
||||
&& dlg_ok_buttoncode(result) < 0)
|
||||
result = extra;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Similarly, find the previous button index.
|
||||
*/
|
||||
int
|
||||
dlg_prev_ok_buttonindex(int current, int extra)
|
||||
{
|
||||
int result = current - 1;
|
||||
|
||||
if (result < extra) {
|
||||
for (result = 0; dlg_ok_buttoncode(result + 1) >= 0; ++result) {
|
||||
;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the button-index for the "OK" or "Cancel" button, according to
|
||||
* whether --defaultno is given. If --nocancel was given, we always return
|
||||
* the index for the first button (usually "OK" unless --nook was used).
|
||||
*/
|
||||
int
|
||||
dlg_defaultno_button(void)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (dialog_vars.defaultno && !dialog_vars.nocancel) {
|
||||
while (dlg_ok_buttoncode(result) != DLG_EXIT_CANCEL)
|
||||
++result;
|
||||
}
|
||||
DLG_TRACE(("# dlg_defaultno_button() = %d\n", result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the button-index for a button named with --default-button. If the
|
||||
* option was not specified, or if the selected button does not exist, return
|
||||
* the index of the first button (usually "OK" unless --nook was used).
|
||||
*/
|
||||
int
|
||||
dlg_default_button(void)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (dialog_vars.default_button >= 0) {
|
||||
int i, n;
|
||||
|
||||
for (i = 0; (n = dlg_ok_buttoncode(i)) >= 0; i++) {
|
||||
if (n == dialog_vars.default_button) {
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
DLG_TRACE(("# dlg_default_button() = %d\n", result));
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a list of buttons for Yes/No labels.
|
||||
*/
|
||||
const char **
|
||||
dlg_yes_labels(void)
|
||||
{
|
||||
const char **result;
|
||||
|
||||
if (dialog_vars.extra_button) {
|
||||
result = dlg_ok_labels();
|
||||
} else {
|
||||
static const char *labels[4];
|
||||
int n = 0;
|
||||
|
||||
labels[n++] = my_yes_label();
|
||||
labels[n++] = my_no_label();
|
||||
if (dialog_vars.help_button)
|
||||
labels[n++] = my_help_label();
|
||||
labels[n] = 0;
|
||||
|
||||
result = labels;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Map the given button index for dlg_yes_labels() into our exit-code.
|
||||
*/
|
||||
int
|
||||
dlg_yes_buttoncode(int button)
|
||||
{
|
||||
int result = DLG_EXIT_ERROR;
|
||||
|
||||
if (dialog_vars.extra_button) {
|
||||
result = dlg_ok_buttoncode(button);
|
||||
} else if (button == 0) {
|
||||
result = DLG_EXIT_OK;
|
||||
} else if (button == 1) {
|
||||
result = DLG_EXIT_CANCEL;
|
||||
} else if (button == 2 && dialog_vars.help_button) {
|
||||
result = DLG_EXIT_HELP;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the next index in labels[];
|
||||
*/
|
||||
int
|
||||
dlg_next_button(const char **labels, int button)
|
||||
{
|
||||
if (button < -1)
|
||||
button = -1;
|
||||
|
||||
if (labels[button + 1] != 0) {
|
||||
++button;
|
||||
} else {
|
||||
button = MIN_BUTTON;
|
||||
}
|
||||
return button;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the previous index in labels[];
|
||||
*/
|
||||
int
|
||||
dlg_prev_button(const char **labels, int button)
|
||||
{
|
||||
if (button > MIN_BUTTON) {
|
||||
--button;
|
||||
} else {
|
||||
if (button < -1)
|
||||
button = -1;
|
||||
|
||||
while (labels[button + 1] != 0)
|
||||
++button;
|
||||
}
|
||||
return button;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,702 +0,0 @@
|
||||
/*
|
||||
* $Id: checklist.c,v 1.167 2020/11/23 00:37:47 tom Exp $
|
||||
*
|
||||
* checklist.c -- implements the checklist box
|
||||
*
|
||||
* Copyright 2000-2019,2020 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*
|
||||
* An earlier version of this program lists as authors:
|
||||
* Savio Lam (lam836@cs.cuhk.hk)
|
||||
* Stuart Herbert - S.Herbert@sheffield.ac.uk: radiolist extension
|
||||
* Alessandro Rubini - rubini@ipvvis.unipv.it: merged the two
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
#include <dlg_keys.h>
|
||||
|
||||
#define MIN_HIGH (1 + (5 * MARGIN))
|
||||
|
||||
typedef struct {
|
||||
/* the outer-window */
|
||||
WINDOW *dialog;
|
||||
int box_y;
|
||||
int box_x;
|
||||
int check_x;
|
||||
int item_x;
|
||||
int checkflag;
|
||||
int use_height;
|
||||
int use_width;
|
||||
/* the inner-window */
|
||||
WINDOW *list;
|
||||
DIALOG_LISTITEM *items;
|
||||
int item_no;
|
||||
const char *states;
|
||||
} ALL_DATA;
|
||||
|
||||
/*
|
||||
* Print list item. The 'selected' parameter is true if 'choice' is the
|
||||
* current item. That one is colored differently from the other items.
|
||||
*/
|
||||
static void
|
||||
print_item(ALL_DATA * data,
|
||||
WINDOW *win,
|
||||
DIALOG_LISTITEM * item,
|
||||
const char *states,
|
||||
int choice,
|
||||
int selected)
|
||||
{
|
||||
chtype save = dlg_get_attrs(win);
|
||||
int i;
|
||||
bool both = (!dialog_vars.no_tags && !dialog_vars.no_items);
|
||||
bool first = TRUE;
|
||||
int climit = (getmaxx(win) - data->check_x + 1);
|
||||
const char *show = (dialog_vars.no_items
|
||||
? item->name
|
||||
: item->text);
|
||||
|
||||
/* Clear 'residue' of last item */
|
||||
dlg_attrset(win, menubox_attr);
|
||||
(void) wmove(win, choice, 0);
|
||||
for (i = 0; i < data->use_width; i++)
|
||||
(void) waddch(win, ' ');
|
||||
|
||||
(void) wmove(win, choice, data->check_x);
|
||||
dlg_attrset(win, selected ? check_selected_attr : check_attr);
|
||||
(void) wprintw(win,
|
||||
(data->checkflag == FLAG_CHECK) ? "[%c]" : "(%c)",
|
||||
states[item->state]);
|
||||
dlg_attrset(win, menubox_attr);
|
||||
(void) waddch(win, ' ');
|
||||
|
||||
if (both) {
|
||||
dlg_print_listitem(win, item->name, climit, first, selected);
|
||||
first = FALSE;
|
||||
}
|
||||
|
||||
(void) wmove(win, choice, data->item_x);
|
||||
dlg_print_listitem(win, show, climit, first, selected);
|
||||
|
||||
if (selected) {
|
||||
dlg_item_help(item->help);
|
||||
}
|
||||
dlg_attrset(win, save);
|
||||
}
|
||||
|
||||
static void
|
||||
print_list(ALL_DATA * data, int choice, int scrollamt, int max_choice)
|
||||
{
|
||||
int i;
|
||||
int cur_y, cur_x;
|
||||
|
||||
getyx(data->dialog, cur_y, cur_x);
|
||||
for (i = 0; i < max_choice; i++) {
|
||||
print_item(data,
|
||||
data->list,
|
||||
&data->items[i + scrollamt],
|
||||
data->states,
|
||||
i, i == choice);
|
||||
}
|
||||
(void) wnoutrefresh(data->list);
|
||||
|
||||
dlg_draw_scrollbar(data->dialog,
|
||||
(long) (scrollamt),
|
||||
(long) (scrollamt),
|
||||
(long) (scrollamt + max_choice),
|
||||
(long) (data->item_no),
|
||||
data->box_x + data->check_x,
|
||||
data->box_x + data->use_width,
|
||||
data->box_y,
|
||||
data->box_y + data->use_height + 1,
|
||||
menubox_border2_attr,
|
||||
menubox_border_attr);
|
||||
|
||||
(void) wmove(data->dialog, cur_y, cur_x);
|
||||
}
|
||||
|
||||
static bool
|
||||
check_hotkey(DIALOG_LISTITEM * items, int choice)
|
||||
{
|
||||
bool result = FALSE;
|
||||
|
||||
if (dlg_match_char(dlg_last_getc(),
|
||||
(dialog_vars.no_tags
|
||||
? items[choice].text
|
||||
: items[choice].name))) {
|
||||
result = TRUE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is an alternate interface to 'checklist' which allows the application
|
||||
* to read the list item states back directly without putting them in the
|
||||
* output buffer. It also provides for more than two states over which the
|
||||
* check/radio box can display.
|
||||
*/
|
||||
int
|
||||
dlg_checklist(const char *title,
|
||||
const char *cprompt,
|
||||
int height,
|
||||
int width,
|
||||
int list_height,
|
||||
int item_no,
|
||||
DIALOG_LISTITEM * items,
|
||||
const char *states,
|
||||
int flag,
|
||||
int *current_item)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
static DLG_KEYS_BINDING binding[] = {
|
||||
HELPKEY_BINDINGS,
|
||||
ENTERKEY_BINDINGS,
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_FIRST, KEY_HOME ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_LAST, KEY_END ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_LAST, KEY_LL ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_NEXT, '+' ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_DOWN ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_NEXT, CHR_NEXT ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_PREV, '-' ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_UP ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_PREV, CHR_PREVIOUS ),
|
||||
DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ),
|
||||
DLG_KEYS_DATA( DLGK_PAGE_NEXT, DLGK_MOUSE(KEY_NPAGE) ),
|
||||
DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ),
|
||||
DLG_KEYS_DATA( DLGK_PAGE_PREV, DLGK_MOUSE(KEY_PPAGE) ),
|
||||
TOGGLEKEY_BINDINGS,
|
||||
END_KEYS_BINDING
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
int old_height = height;
|
||||
int old_width = width;
|
||||
#endif
|
||||
ALL_DATA all;
|
||||
int i, j, key2, found, x, y, cur_x, cur_y;
|
||||
int key, fkey;
|
||||
int button = dialog_state.visit_items ? -1 : dlg_default_button();
|
||||
int choice = dlg_default_listitem(items);
|
||||
int scrollamt = 0;
|
||||
int max_choice;
|
||||
int use_width, list_width, name_width, text_width;
|
||||
int result = DLG_EXIT_UNKNOWN;
|
||||
int num_states;
|
||||
WINDOW *dialog;
|
||||
char *prompt;
|
||||
const char **buttons = dlg_ok_labels();
|
||||
const char *widget_name;
|
||||
|
||||
DLG_TRACE(("# %s args:\n", flag ? "checklist" : "radiolist"));
|
||||
DLG_TRACE2S("title", title);
|
||||
DLG_TRACE2S("message", cprompt);
|
||||
DLG_TRACE2N("height", height);
|
||||
DLG_TRACE2N("width", width);
|
||||
DLG_TRACE2N("lheight", list_height);
|
||||
DLG_TRACE2N("llength", item_no);
|
||||
/* FIXME dump the items[][] too */
|
||||
DLG_TRACE2S("states", states);
|
||||
DLG_TRACE2N("flag", flag);
|
||||
DLG_TRACE2N("current", *current_item);
|
||||
|
||||
dialog_state.plain_buttons = TRUE;
|
||||
|
||||
memset(&all, 0, sizeof(all));
|
||||
all.items = items;
|
||||
all.item_no = item_no;
|
||||
|
||||
dlg_does_output();
|
||||
|
||||
/*
|
||||
* If this is a radiobutton list, ensure that no more than one item is
|
||||
* selected initially. Allow none to be selected, since some users may
|
||||
* wish to provide this flavor.
|
||||
*/
|
||||
if (flag == FLAG_RADIO) {
|
||||
bool first = TRUE;
|
||||
|
||||
for (i = 0; i < item_no; i++) {
|
||||
if (items[i].state) {
|
||||
if (first) {
|
||||
first = FALSE;
|
||||
} else {
|
||||
items[i].state = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
widget_name = "radiolist";
|
||||
} else {
|
||||
widget_name = "checklist";
|
||||
}
|
||||
#ifdef KEY_RESIZE
|
||||
retry:
|
||||
#endif
|
||||
|
||||
prompt = dlg_strclone(cprompt);
|
||||
dlg_tab_correct_str(prompt);
|
||||
|
||||
all.use_height = list_height;
|
||||
use_width = dlg_calc_list_width(item_no, items) + 10;
|
||||
use_width = MAX(26, use_width);
|
||||
if (all.use_height == 0) {
|
||||
/* calculate height without items (4) */
|
||||
dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, use_width);
|
||||
dlg_calc_listh(&height, &all.use_height, item_no);
|
||||
} else {
|
||||
dlg_auto_size(title, prompt,
|
||||
&height, &width,
|
||||
MIN_HIGH + all.use_height, use_width);
|
||||
}
|
||||
dlg_button_layout(buttons, &width);
|
||||
dlg_print_size(height, width);
|
||||
dlg_ctl_size(height, width);
|
||||
|
||||
/* we need at least two states */
|
||||
if (states == 0 || strlen(states) < 2)
|
||||
states = " *";
|
||||
num_states = (int) strlen(states);
|
||||
all.states = states;
|
||||
|
||||
all.checkflag = flag;
|
||||
|
||||
x = dlg_box_x_ordinate(width);
|
||||
y = dlg_box_y_ordinate(height);
|
||||
|
||||
dialog = dlg_new_window(height, width, y, x);
|
||||
all.dialog = dialog;
|
||||
dlg_register_window(dialog, widget_name, binding);
|
||||
dlg_register_buttons(dialog, widget_name, buttons);
|
||||
|
||||
dlg_mouse_setbase(x, y);
|
||||
|
||||
dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr);
|
||||
dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr);
|
||||
dlg_draw_title(dialog, title);
|
||||
|
||||
dlg_attrset(dialog, dialog_attr);
|
||||
dlg_print_autowrap(dialog, prompt, height, width);
|
||||
|
||||
all.use_width = width - 6;
|
||||
getyx(dialog, cur_y, cur_x);
|
||||
all.box_y = cur_y + 1;
|
||||
all.box_x = (width - all.use_width) / 2 - 1;
|
||||
|
||||
/*
|
||||
* After displaying the prompt, we know how much space we really have.
|
||||
* Limit the list to avoid overwriting the ok-button.
|
||||
*/
|
||||
all.use_height = height - MIN_HIGH - cur_y;
|
||||
if (all.use_height <= 0)
|
||||
all.use_height = 1;
|
||||
|
||||
max_choice = MIN(all.use_height, item_no);
|
||||
max_choice = MAX(max_choice, 1);
|
||||
|
||||
/* create new window for the list */
|
||||
all.list = dlg_sub_window(dialog, all.use_height, all.use_width,
|
||||
y + all.box_y + 1, x + all.box_x + 1);
|
||||
|
||||
/* draw a box around the list items */
|
||||
dlg_draw_box(dialog, all.box_y, all.box_x,
|
||||
all.use_height + 2 * MARGIN,
|
||||
all.use_width + 2 * MARGIN,
|
||||
menubox_border_attr, menubox_border2_attr);
|
||||
|
||||
text_width = 0;
|
||||
name_width = 0;
|
||||
/* Find length of longest item to center checklist */
|
||||
for (i = 0; i < item_no; i++) {
|
||||
text_width = MAX(text_width, dlg_count_columns(items[i].text));
|
||||
name_width = MAX(name_width, dlg_count_columns(items[i].name));
|
||||
}
|
||||
|
||||
/* If the name+text is wider than the list is allowed, then truncate
|
||||
* one or both of them. If the name is no wider than 1/4 of the list,
|
||||
* leave it intact.
|
||||
*/
|
||||
use_width = (all.use_width - 6);
|
||||
if (dialog_vars.no_tags) {
|
||||
list_width = MIN(all.use_width, text_width);
|
||||
} else if (dialog_vars.no_items) {
|
||||
list_width = MIN(all.use_width, name_width);
|
||||
} else {
|
||||
if (text_width >= 0
|
||||
&& name_width >= 0
|
||||
&& use_width > 0
|
||||
&& text_width + name_width > use_width) {
|
||||
int need = (int) (0.25 * use_width);
|
||||
if (name_width > need) {
|
||||
int want = (int) (use_width * ((double) name_width) /
|
||||
(text_width + name_width));
|
||||
name_width = (want > need) ? want : need;
|
||||
}
|
||||
text_width = use_width - name_width;
|
||||
}
|
||||
list_width = (text_width + name_width);
|
||||
}
|
||||
|
||||
all.check_x = (use_width - list_width) / 2;
|
||||
all.item_x = ((dialog_vars.no_tags
|
||||
? 0
|
||||
: (dialog_vars.no_items
|
||||
? 0
|
||||
: (2 + name_width)))
|
||||
+ all.check_x + 4);
|
||||
|
||||
/* ensure we are scrolled to show the current choice */
|
||||
scrollamt = MIN(scrollamt, max_choice + item_no - 1);
|
||||
if (choice >= (max_choice + scrollamt - 1)) {
|
||||
scrollamt = MAX(0, choice - max_choice + 1);
|
||||
choice = max_choice - 1;
|
||||
}
|
||||
print_list(&all, choice, scrollamt, max_choice);
|
||||
|
||||
/* register the new window, along with its borders */
|
||||
dlg_mouse_mkbigregion(all.box_y + 1, all.box_x,
|
||||
all.use_height, all.use_width + 2,
|
||||
KEY_MAX, 1, 1, 1 /* by lines */ );
|
||||
|
||||
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
|
||||
|
||||
dlg_trace_win(dialog);
|
||||
|
||||
while (result == DLG_EXIT_UNKNOWN) {
|
||||
int was_mouse;
|
||||
|
||||
if (button < 0) /* --visit-items */
|
||||
wmove(dialog, all.box_y + choice + 1, all.box_x + all.check_x + 2);
|
||||
|
||||
key = dlg_mouse_wgetch(dialog, &fkey);
|
||||
if (dlg_result_key(key, fkey, &result)) {
|
||||
if (!dlg_button_key(result, &button, &key, &fkey))
|
||||
break;
|
||||
}
|
||||
|
||||
was_mouse = (fkey && is_DLGK_MOUSE(key));
|
||||
if (was_mouse)
|
||||
key -= M_EVENT;
|
||||
|
||||
if (was_mouse && (key >= KEY_MAX)) {
|
||||
getyx(dialog, cur_y, cur_x);
|
||||
i = (key - KEY_MAX);
|
||||
if (i < max_choice) {
|
||||
choice = (key - KEY_MAX);
|
||||
print_list(&all, choice, scrollamt, max_choice);
|
||||
|
||||
key = DLGK_TOGGLE; /* force the selected item to toggle */
|
||||
} else {
|
||||
beep();
|
||||
continue;
|
||||
}
|
||||
fkey = FALSE;
|
||||
} else if (was_mouse && key >= KEY_MIN) {
|
||||
key = dlg_lookup_key(dialog, key, &fkey);
|
||||
}
|
||||
|
||||
/*
|
||||
* A space toggles the item status. We handle either a checklist
|
||||
* (any number of items can be selected) or radio list (zero or one
|
||||
* items can be selected).
|
||||
*/
|
||||
if (key == DLGK_TOGGLE) {
|
||||
int current = scrollamt + choice;
|
||||
int next = items[current].state + 1;
|
||||
|
||||
if (next >= num_states)
|
||||
next = 0;
|
||||
|
||||
if (flag == FLAG_CHECK) { /* checklist? */
|
||||
getyx(dialog, cur_y, cur_x);
|
||||
items[current].state = next;
|
||||
print_item(&all, all.list,
|
||||
&items[scrollamt + choice],
|
||||
states,
|
||||
choice, TRUE);
|
||||
(void) wnoutrefresh(all.list);
|
||||
(void) wmove(dialog, cur_y, cur_x);
|
||||
} else { /* radiolist */
|
||||
for (i = 0; i < item_no; i++) {
|
||||
if (i != current) {
|
||||
items[i].state = 0;
|
||||
}
|
||||
}
|
||||
if (items[current].state) {
|
||||
getyx(dialog, cur_y, cur_x);
|
||||
items[current].state = next ? next : 1;
|
||||
print_item(&all, all.list,
|
||||
&items[current],
|
||||
states,
|
||||
choice, TRUE);
|
||||
(void) wnoutrefresh(all.list);
|
||||
(void) wmove(dialog, cur_y, cur_x);
|
||||
} else {
|
||||
items[current].state = 1;
|
||||
print_list(&all, choice, scrollamt, max_choice);
|
||||
}
|
||||
}
|
||||
continue; /* wait for another key press */
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if key pressed matches first character of any item tag in
|
||||
* list. If there is more than one match, we will cycle through
|
||||
* each one as the same key is pressed repeatedly.
|
||||
*/
|
||||
found = FALSE;
|
||||
if (!fkey) {
|
||||
if (button < 0 || !dialog_state.visit_items) {
|
||||
for (j = scrollamt + choice + 1; j < item_no; j++) {
|
||||
if (check_hotkey(items, j)) {
|
||||
found = TRUE;
|
||||
i = j - scrollamt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
for (j = 0; j <= scrollamt + choice; j++) {
|
||||
if (check_hotkey(items, j)) {
|
||||
found = TRUE;
|
||||
i = j - scrollamt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
dlg_flush_getc();
|
||||
} else if ((j = dlg_char_to_button(key, buttons)) >= 0) {
|
||||
button = j;
|
||||
ungetch('\n');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* A single digit (1-9) positions the selection to that line in the
|
||||
* current screen.
|
||||
*/
|
||||
if (!found
|
||||
&& (key <= '9')
|
||||
&& (key > '0')
|
||||
&& (key - '1' < max_choice)) {
|
||||
found = TRUE;
|
||||
i = key - '1';
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
if (fkey) {
|
||||
found = TRUE;
|
||||
switch (key) {
|
||||
case DLGK_ITEM_FIRST:
|
||||
i = -scrollamt;
|
||||
break;
|
||||
case DLGK_ITEM_LAST:
|
||||
i = item_no - 1 - scrollamt;
|
||||
break;
|
||||
case DLGK_PAGE_PREV:
|
||||
if (choice)
|
||||
i = 0;
|
||||
else if (scrollamt != 0)
|
||||
i = -MIN(scrollamt, max_choice);
|
||||
else
|
||||
continue;
|
||||
break;
|
||||
case DLGK_PAGE_NEXT:
|
||||
i = MIN(choice + max_choice, item_no - scrollamt - 1);
|
||||
break;
|
||||
case DLGK_ITEM_PREV:
|
||||
i = choice - 1;
|
||||
if (choice == 0 && scrollamt == 0)
|
||||
continue;
|
||||
break;
|
||||
case DLGK_ITEM_NEXT:
|
||||
i = choice + 1;
|
||||
if (scrollamt + choice >= item_no - 1)
|
||||
continue;
|
||||
break;
|
||||
default:
|
||||
found = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
if (i != choice) {
|
||||
getyx(dialog, cur_y, cur_x);
|
||||
if (i < 0 || i >= max_choice) {
|
||||
if (i < 0) {
|
||||
scrollamt += i;
|
||||
choice = 0;
|
||||
} else {
|
||||
choice = max_choice - 1;
|
||||
scrollamt += (i - max_choice + 1);
|
||||
}
|
||||
print_list(&all, choice, scrollamt, max_choice);
|
||||
} else {
|
||||
choice = i;
|
||||
print_list(&all, choice, scrollamt, max_choice);
|
||||
}
|
||||
}
|
||||
continue; /* wait for another key press */
|
||||
}
|
||||
|
||||
if (fkey) {
|
||||
switch (key) {
|
||||
case DLGK_ENTER:
|
||||
result = dlg_enter_buttoncode(button);
|
||||
break;
|
||||
case DLGK_LEAVE:
|
||||
result = dlg_ok_buttoncode(button);
|
||||
break;
|
||||
case DLGK_FIELD_PREV:
|
||||
button = dlg_prev_button(buttons, button);
|
||||
dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
|
||||
FALSE, width);
|
||||
break;
|
||||
case DLGK_FIELD_NEXT:
|
||||
button = dlg_next_button(buttons, button);
|
||||
dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
|
||||
FALSE, width);
|
||||
break;
|
||||
#ifdef KEY_RESIZE
|
||||
case KEY_RESIZE:
|
||||
dlg_will_resize(dialog);
|
||||
/* reset data */
|
||||
height = old_height;
|
||||
width = old_width;
|
||||
free(prompt);
|
||||
_dlg_resize_cleanup(dialog);
|
||||
/* repaint */
|
||||
goto retry;
|
||||
#endif
|
||||
default:
|
||||
if (was_mouse) {
|
||||
if ((key2 = dlg_ok_buttoncode(key)) >= 0) {
|
||||
result = key2;
|
||||
break;
|
||||
}
|
||||
beep();
|
||||
}
|
||||
}
|
||||
} else if (key > 0) {
|
||||
beep();
|
||||
}
|
||||
}
|
||||
|
||||
dlg_del_window(dialog);
|
||||
dlg_mouse_free_regions();
|
||||
free(prompt);
|
||||
*current_item = (scrollamt + choice);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display a dialog box with a list of options that can be turned on or off
|
||||
* The `flag' parameter is used to select between radiolist and checklist.
|
||||
*/
|
||||
int
|
||||
dialog_checklist(const char *title,
|
||||
const char *cprompt,
|
||||
int height,
|
||||
int width,
|
||||
int list_height,
|
||||
int item_no,
|
||||
char **items,
|
||||
int flag)
|
||||
{
|
||||
int result;
|
||||
int i, j;
|
||||
DIALOG_LISTITEM *listitems;
|
||||
bool separate_output = ((flag == FLAG_CHECK)
|
||||
&& (dialog_vars.separate_output));
|
||||
bool show_status = FALSE;
|
||||
int current = 0;
|
||||
char *help_result;
|
||||
|
||||
listitems = dlg_calloc(DIALOG_LISTITEM, (size_t) item_no + 1);
|
||||
assert_ptr(listitems, "dialog_checklist");
|
||||
|
||||
for (i = j = 0; i < item_no; ++i) {
|
||||
listitems[i].name = items[j++];
|
||||
listitems[i].text = (dialog_vars.no_items
|
||||
? dlg_strempty()
|
||||
: items[j++]);
|
||||
listitems[i].state = !dlg_strcmp(items[j++], "on");
|
||||
listitems[i].help = ((dialog_vars.item_help)
|
||||
? items[j++]
|
||||
: dlg_strempty());
|
||||
}
|
||||
dlg_align_columns(&listitems[0].text, (int) sizeof(DIALOG_LISTITEM), item_no);
|
||||
|
||||
result = dlg_checklist(title,
|
||||
cprompt,
|
||||
height,
|
||||
width,
|
||||
list_height,
|
||||
item_no,
|
||||
listitems,
|
||||
NULL,
|
||||
flag,
|
||||
¤t);
|
||||
|
||||
switch (result) {
|
||||
case DLG_EXIT_OK: /* FALLTHRU */
|
||||
case DLG_EXIT_EXTRA:
|
||||
show_status = TRUE;
|
||||
break;
|
||||
case DLG_EXIT_HELP:
|
||||
dlg_add_help_listitem(&result, &help_result, &listitems[current]);
|
||||
if ((show_status = dialog_vars.help_status)) {
|
||||
if (separate_output) {
|
||||
dlg_add_string(help_result);
|
||||
dlg_add_separator();
|
||||
} else {
|
||||
dlg_add_quoted(help_result);
|
||||
}
|
||||
} else {
|
||||
dlg_add_string(help_result);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (show_status) {
|
||||
for (i = 0; i < item_no; i++) {
|
||||
if (listitems[i].state) {
|
||||
if (separate_output) {
|
||||
dlg_add_string(listitems[i].name);
|
||||
dlg_add_separator();
|
||||
} else {
|
||||
if (dlg_need_separator())
|
||||
dlg_add_separator();
|
||||
if (flag == FLAG_CHECK)
|
||||
dlg_add_quoted(listitems[i].name);
|
||||
else
|
||||
dlg_add_string(listitems[i].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
dlg_add_last_key(separate_output);
|
||||
}
|
||||
|
||||
dlg_free_columns(&listitems[0].text, (int) sizeof(DIALOG_LISTITEM), item_no);
|
||||
free(listitems);
|
||||
return result;
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
* $Id: columns.c,v 1.11 2019/07/25 00:06:38 tom Exp $
|
||||
*
|
||||
* columns.c -- implements column-alignment
|
||||
*
|
||||
* Copyright 2008-2011,2019 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
|
||||
#define each(row, data) \
|
||||
row = 0, data = target; \
|
||||
row < num_rows; \
|
||||
++row, data = next_row(data, per_row)
|
||||
|
||||
static char *
|
||||
column_separator(void)
|
||||
{
|
||||
char *result = 0;
|
||||
|
||||
if ((result = dialog_vars.column_separator) != 0) {
|
||||
if (*result == '\0')
|
||||
result = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static char **
|
||||
next_row(char **target, int per_row)
|
||||
{
|
||||
char *result = (char *) target;
|
||||
result += per_row;
|
||||
return (char **) (void *) result;
|
||||
}
|
||||
|
||||
static char *
|
||||
next_col(char *source, unsigned offset)
|
||||
{
|
||||
char *mark = column_separator();
|
||||
char *result = source + offset;
|
||||
if (offset)
|
||||
result += strlen(mark);
|
||||
return strstr(result, mark);
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse the source string, storing the offsets and widths of each column in
|
||||
* the corresponding arrays. Return the number of columns.
|
||||
*/
|
||||
static unsigned
|
||||
split_row(char *source, unsigned *offsets, unsigned *widths)
|
||||
{
|
||||
int mark = (int) strlen(column_separator());
|
||||
char *next = 0;
|
||||
unsigned result = 0;
|
||||
unsigned offset = 0;
|
||||
|
||||
do {
|
||||
if (result) {
|
||||
offset = (unsigned) (mark + next - source);
|
||||
widths[result - 1] = offset - offsets[result - 1] - (unsigned) mark;
|
||||
}
|
||||
offsets[result] = offset;
|
||||
++result;
|
||||
} while ((next = next_col(source, offset)) != 0);
|
||||
|
||||
offset = (unsigned) strlen(source);
|
||||
widths[result - 1] = offset - offsets[result - 1];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* The caller passes a pointer to a struct or array containing pointers
|
||||
* to strings that we may want to copy and reformat according to the column
|
||||
* separator.
|
||||
*/
|
||||
void
|
||||
dlg_align_columns(char **target, int per_row, int num_rows)
|
||||
{
|
||||
if (column_separator()) {
|
||||
char **value;
|
||||
unsigned numcols = 1;
|
||||
size_t maxcols = 0;
|
||||
unsigned *widths;
|
||||
unsigned *offsets;
|
||||
unsigned *maxwidth;
|
||||
unsigned realwidth;
|
||||
unsigned n;
|
||||
int row;
|
||||
|
||||
/* first allocate arrays for workspace */
|
||||
for (each(row, value)) {
|
||||
size_t len = strlen(*value);
|
||||
if (maxcols < len)
|
||||
maxcols = len;
|
||||
}
|
||||
++maxcols;
|
||||
widths = dlg_calloc(unsigned, maxcols);
|
||||
offsets = dlg_calloc(unsigned, maxcols);
|
||||
maxwidth = dlg_calloc(unsigned, maxcols);
|
||||
|
||||
assert_ptr(widths, "dlg_align_columns");
|
||||
assert_ptr(offsets, "dlg_align_columns");
|
||||
assert_ptr(maxwidth, "dlg_align_columns");
|
||||
|
||||
/* now, determine the number of columns and the column-widths */
|
||||
for (each(row, value)) {
|
||||
unsigned cols = split_row(*value, offsets, widths);
|
||||
if (numcols < cols)
|
||||
numcols = cols;
|
||||
for (n = 0; n < cols; ++n) {
|
||||
if (maxwidth[n] < widths[n])
|
||||
maxwidth[n] = widths[n];
|
||||
}
|
||||
}
|
||||
realwidth = numcols - 1;
|
||||
for (n = 0; n < numcols; ++n) {
|
||||
realwidth += maxwidth[n];
|
||||
}
|
||||
|
||||
/* finally, construct reformatted strings */
|
||||
for (each(row, value)) {
|
||||
unsigned cols = split_row(*value, offsets, widths);
|
||||
unsigned offset = 0;
|
||||
char *text = dlg_malloc(char, realwidth + 1);
|
||||
|
||||
assert_ptr(text, "dlg_align_columns");
|
||||
|
||||
memset(text, ' ', (size_t) realwidth);
|
||||
for (n = 0; n < cols; ++n) {
|
||||
memcpy(text + offset, *value + offsets[n], (size_t) widths[n]);
|
||||
offset += maxwidth[n] + 1;
|
||||
}
|
||||
text[realwidth] = 0;
|
||||
*value = text;
|
||||
}
|
||||
|
||||
free(widths);
|
||||
free(offsets);
|
||||
free(maxwidth);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Free temporary storage used while making column-aligned data.
|
||||
*/
|
||||
void
|
||||
dlg_free_columns(char **target, int per_row, int num_rows)
|
||||
{
|
||||
if (column_separator()) {
|
||||
int row;
|
||||
char **value;
|
||||
|
||||
for (each(row, value)) {
|
||||
free(*value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
-1687
File diff suppressed because it is too large.
Load diff
@@ -1,4 +0,0 @@
|
||||
/*
|
||||
* The configure script expands this as a set of definitions
|
||||
*/
|
||||
@DEFS@
|
||||
Vendored
-1851
File diff suppressed because it is too large.
Load diff
Vendored
-27284
File diff suppressed because it is too large.
Load diff
@@ -1,285 +0,0 @@
|
||||
dnl $Id: configure.in,v 1.101 2020/11/26 16:21:27 tom Exp $
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Copyright 1999-2019,2020 -- Thomas E. Dickey
|
||||
dnl
|
||||
dnl Permission is hereby granted, free of charge, to any person obtaining a
|
||||
dnl copy of this software and associated documentation files (the
|
||||
dnl "Software"), to deal in the Software without restriction, including
|
||||
dnl without limitation the rights to use, copy, modify, merge, publish,
|
||||
dnl distribute, distribute with modifications, sublicense, and/or sell
|
||||
dnl copies of the Software, and to permit persons to whom the Software is
|
||||
dnl furnished to do so, subject to the following conditions:
|
||||
dnl
|
||||
dnl The above copyright notice and this permission notice shall be included
|
||||
dnl in all copies or portions of the Software.
|
||||
dnl
|
||||
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
||||
dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
dnl
|
||||
dnl Except as contained in this notice, the name(s) of the above copyright
|
||||
dnl holders shall not be used in advertising or otherwise to promote the
|
||||
dnl sale, use or other dealings in this Software without prior written
|
||||
dnl authorization.
|
||||
dnl ---------------------------------------------------------------------------
|
||||
AC_PREREQ(2.52.20200802)
|
||||
AC_INIT(dialog.h)
|
||||
AC_CONFIG_HEADER(dlg_config.h:config.hin)
|
||||
|
||||
AC_ARG_PROGRAM
|
||||
|
||||
DESTDIR=
|
||||
AC_SUBST(DESTDIR)
|
||||
|
||||
dnl
|
||||
dnl Checks for programs.
|
||||
dnl
|
||||
CF_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_INSTALL
|
||||
CF_PROG_LN_S
|
||||
CF_PROG_LINT
|
||||
|
||||
CF_PROG_GROFF
|
||||
test -z "$GROFF_NOTE" && NROFF_NOTE=
|
||||
|
||||
dnl needed for CF_WITH_LIBTOOL
|
||||
CF_AR_FLAGS
|
||||
|
||||
CF_MAKEFLAGS
|
||||
CF_MAKE_TAGS
|
||||
CF_DISABLE_ECHO
|
||||
CF_PROG_EXT
|
||||
CF_PATHSEP
|
||||
CF_LIB_PREFIX
|
||||
CF_XOPEN_SOURCE
|
||||
CF_LARGEFILE
|
||||
|
||||
CF_WITH_INSTALL_PREFIX
|
||||
CF_WITH_SCREEN_PDCURSES
|
||||
CF_ENABLE_WARNINGS(,yes)
|
||||
CF_PKG_CONFIG
|
||||
|
||||
dnl
|
||||
dnl Allow dialog program and library to be renamed.
|
||||
AC_MSG_CHECKING(for this package's name)
|
||||
AC_ARG_WITH(package,
|
||||
[ --with-package=XXX rename dialog to XXX, library to libXXX.a, etc],
|
||||
[PACKAGE=$withval],
|
||||
[PACKAGE=dialog])
|
||||
AC_MSG_RESULT($PACKAGE)
|
||||
CF_VERSION_INFO(dialog,$PACKAGE)
|
||||
|
||||
CFG_ROOTNAME=$PACKAGE
|
||||
HDR_ROOTNAME=$PACKAGE
|
||||
LIB_ROOTNAME=$PACKAGE
|
||||
|
||||
AC_SUBST(CFG_ROOTNAME)
|
||||
AC_SUBST(HDR_ROOTNAME)
|
||||
AC_SUBST(LIB_ROOTNAME)
|
||||
|
||||
dnl
|
||||
dnl If package is renamed, it is useful to have the dlg_XXX headers in a
|
||||
dnl subdirectory (using the package name) so that multiple versions of the
|
||||
dnl headers can coexist.
|
||||
AC_MSG_CHECKING(if we should install dlg_XXX headers to subdirectory)
|
||||
AC_ARG_ENABLE(header-subdir,
|
||||
[ --enable-header-subdir install dlg_XXX headers to subdirectory],
|
||||
[SUB_INC=$enableval],
|
||||
[SUB_INC=no])
|
||||
AC_MSG_RESULT($SUB_INC)
|
||||
AC_SUBST(SUB_INC)
|
||||
|
||||
CF_WITH_MAN2HTML
|
||||
|
||||
dnl
|
||||
dnl Checks for libraries.
|
||||
dnl
|
||||
EXTRAOBJS=""
|
||||
CF_BUNDLED_INTL(makefile,enable)
|
||||
CF_MATH_LIB(,sqrt(x))
|
||||
|
||||
CF_WITH_NO_LEAKS
|
||||
|
||||
CF_ARG_MSG_ENABLE([if you want --trace option],
|
||||
trace,
|
||||
[ --disable-trace do not support --trace option],
|
||||
[EXTRAOBJS="$EXTRAOBJS trace\$o"
|
||||
AC_DEFINE(HAVE_DLG_TRACE,1,[Define to 1 to support --trace option])],,yes)
|
||||
|
||||
CF_ENABLE_RPATH
|
||||
CF_LD_RPATH_OPT
|
||||
CF_WITH_SHARED_OR_LIBTOOL(DIALOG,${VERSION_MAJOR}.${VERSION_MINOR},`echo "$VERSION" |sed -e 's/:/./g'`)
|
||||
|
||||
CF_WITH_CURSES_DIR
|
||||
|
||||
CF_WITH_NCURSES_ETC
|
||||
CF_WIDEC_CURSES
|
||||
|
||||
cf_all_widgets=yes
|
||||
CF_ARG_MSG_ENABLE([if you want extra dialogs],
|
||||
extras,
|
||||
[ --disable-extras do not include extra dialogs],
|
||||
[cf_all_widgets=yes],[cf_all_widgets=no],yes)
|
||||
|
||||
cf_use_dialogrc=yes
|
||||
CF_ARG_MSG_ENABLE([if you want config-file support],
|
||||
rc-file,
|
||||
[ --disable-rc-file do not include config-file support],
|
||||
[EXTRAOBJS="$EXTRAOBJS rc\$o"
|
||||
AC_DEFINE(HAVE_RC_FILE,1,[Define to 1 to include config-file support])],cf_use_dialogrc=no,$cf_all_widgets)
|
||||
|
||||
cf_use_dialogrc2=yes
|
||||
if test "$cf_use_dialogrc" = yes; then
|
||||
CF_ARG_MSG_ENABLE([if you want extra attributes in config-file],
|
||||
rc-file2,
|
||||
[ --disable-rc-file2 do not use extra attributes in config-file],
|
||||
[AC_DEFINE(HAVE_RC_FILE2,1,[Define to 1 to use extra attributes in config-file])],cf_use_dialogrc2=no,$cf_all_widgets)
|
||||
fi
|
||||
|
||||
CF_ARG_MSG_ENABLE([if you want Xdialog-style dialogs],
|
||||
Xdialog,
|
||||
[ --disable-Xdialog do not include Xdialog-style dialogs (1.1)],
|
||||
[EXTRAOBJS="$EXTRAOBJS calendar\$o fselect\$o timebox\$o"
|
||||
AC_DEFINE(HAVE_XDIALOG,1,[Define to 1 to include Xdialog-style dialogs])],,$cf_all_widgets)
|
||||
|
||||
CF_ARG_MSG_ENABLE([if you want extra Xdialog-style dialogs (1.2)],
|
||||
Xdialog2,
|
||||
[ --disable-Xdialog2 do not include extra Xdialog-style dialogs (1.2)],
|
||||
[EXTRAOBJS="$EXTRAOBJS buildlist\$o rangebox\$o treeview\$o"
|
||||
AC_DEFINE(HAVE_XDIALOG2,1,[Define to 1 to include extra Xdialog-style dialogs])],,$cf_all_widgets)
|
||||
|
||||
CF_ARG_MSG_ENABLE([if you want compatibility with whiptail options],
|
||||
whiptail,
|
||||
[ --disable-whiptail do not map extra whiptail options],
|
||||
[AC_DEFINE(HAVE_WHIPTAIL,1,[Define to 1 to include extra whiptail options])],,$cf_all_widgets)
|
||||
|
||||
CF_ARG_MSG_ENABLE([if you want the form dialog],
|
||||
form,
|
||||
[ --disable-form do not include the form dialog],
|
||||
[EXTRAOBJS="$EXTRAOBJS formbox\$o"
|
||||
AC_DEFINE(HAVE_DLG_FORMBOX,1,[Define to 1 to include the form dialog])],,$cf_all_widgets)
|
||||
|
||||
CF_ARG_MSG_ENABLE([if you want the gauge dialog],
|
||||
gauge,
|
||||
[ --disable-gauge do not include the gauge dialogs],
|
||||
[EXTRAOBJS="$EXTRAOBJS guage\$o pause\$o prgbox\$o progressbox\$o"
|
||||
AC_DEFINE(HAVE_DLG_GAUGE,1,[Define to 1 to include the gauge dialogs])],,$cf_all_widgets)
|
||||
|
||||
CF_ARG_MSG_ENABLE([if you want the tailbox dialog],
|
||||
tailbox,
|
||||
[ --disable-tailbox do not include the tailbox dialog],
|
||||
[EXTRAOBJS="$EXTRAOBJS tailbox\$o"
|
||||
AC_DEFINE(HAVE_DLG_TAILBOX,1,[Define to 1 to include the tailbox dialog])],,$cf_all_widgets)
|
||||
|
||||
CF_ARG_MSG_ENABLE([if you want the mixedform dialog],
|
||||
mixedform,
|
||||
[ --disable-mixedform do not include the mixedform dialog],
|
||||
[EXTRAOBJS="$EXTRAOBJS mixedform\$o"
|
||||
AC_DEFINE(HAVE_DLG_MIXEDFORM,1,[Define to 1 to include the mixedform dialog])],,${enable_form:=$cf_all_widgets})
|
||||
|
||||
CF_ARG_MSG_ENABLE([if you want the mixedgauge dialog],
|
||||
mixedgauge,
|
||||
[ --disable-mixedgauge do not include the mixedgauge dialog],
|
||||
[EXTRAOBJS="$EXTRAOBJS mixedgauge\$o"
|
||||
AC_DEFINE(HAVE_MIXEDGAUGE,1,[Define to 1 to include the mixedgauge dialog])],,$cf_all_widgets)
|
||||
|
||||
CF_ARG_MSG_ENABLE([if you want the wide-curses features],
|
||||
widec,
|
||||
[ --enable-widec enable wide-curses features],
|
||||
[AC_DEFINE(USE_WIDE_CURSES,1,[Define to 1 to enable wide-curses features])],,$cf_cv_widec_curses)
|
||||
|
||||
AC_SUBST(EXTRAOBJS)
|
||||
|
||||
dnl
|
||||
dnl Checks for header files.
|
||||
dnl
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_TIME
|
||||
AC_HEADER_DIRENT
|
||||
AC_CHECK_HEADERS(search.h stdint.h sys/param.h unistd.h)
|
||||
CF_CURSES_TERM_H
|
||||
|
||||
dnl
|
||||
dnl Checks for library functions.
|
||||
dnl
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_FUNCS(\
|
||||
btowc \
|
||||
mblen \
|
||||
mbrlen \
|
||||
mbrtowc \
|
||||
mbtowc \
|
||||
strcasecmp \
|
||||
strftime \
|
||||
tsearch \
|
||||
waitpid \
|
||||
wcsrtombs \
|
||||
wcstombs \
|
||||
wctob \
|
||||
wctomb \
|
||||
mktime \
|
||||
)
|
||||
|
||||
CF_CURSES_FUNCS(\
|
||||
flushinp \
|
||||
getattrs \
|
||||
getbegx \
|
||||
getbegy \
|
||||
getbegyx \
|
||||
getcurx \
|
||||
getcury \
|
||||
getmaxx \
|
||||
getmaxy \
|
||||
getmaxyx \
|
||||
getparx \
|
||||
getpary \
|
||||
getparyx \
|
||||
use_default_colors \
|
||||
wchgat \
|
||||
wcursyncup \
|
||||
wget_wch \
|
||||
wsyncup \
|
||||
)
|
||||
|
||||
CF_CURSES_EXIT
|
||||
|
||||
AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR,1,[Define to 1 if (n)curses has start_color function])])
|
||||
CF_CURSES_CHTYPE
|
||||
CF_CURSES_WACS_SYMBOLS
|
||||
CF_CURSES_WGETPARENT
|
||||
CF_FUNC_WAIT
|
||||
CF_MBSTATE_T
|
||||
CF_SIZECHANGE
|
||||
|
||||
CF_HEADERS_SH(DLG,dlg_config.h)
|
||||
|
||||
AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE,1,[Define to 1 if locale feature can be enabled])])
|
||||
CF_NL_LANGINFO_1STDAY
|
||||
|
||||
CF_MERGE_EXTRA_CFLAGS
|
||||
CF_DISABLE_RPATH_HACK
|
||||
|
||||
CF__DEFINE_SHLIB_VARS
|
||||
CF_LD_SEARCHPATH
|
||||
|
||||
AC_OUTPUT(
|
||||
dialog-config
|
||||
makefile
|
||||
$EXTRA_OUTPUT
|
||||
$SUB_MAKEFILE,[
|
||||
CF__ADD_SHLIB_RULES(
|
||||
makefile,
|
||||
$LIB_MODEL,
|
||||
[\${LIB_OBJECT}],
|
||||
[\${LIBS} \${LDFLAGS}])
|
||||
],[
|
||||
CF__INIT_SHLIB_RULES
|
||||
],[sort -u])
|
||||
@@ -1,337 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
# $Id: demo.pl,v 1.23 2018/06/12 21:39:44 tom Exp $
|
||||
################################################################################
|
||||
# Copyright 2018 Thomas E. Dickey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this program; if not, write to
|
||||
# Free Software Foundation, Inc.
|
||||
# 51 Franklin St., Fifth Floor
|
||||
# Boston, MA 02110, USA.
|
||||
################################################################################
|
||||
# This demonstration is provided solely to exercise the sample Perl wrapper for
|
||||
# dialog which is included in its source-code. See libui-dialog-perl for a
|
||||
# more comprehensive binding.
|
||||
#
|
||||
# TODO: modify dialog.pl to use $DIALOG environment variable, drive from GetOpts here
|
||||
# TODO: eliminate constant $scr_lines in dialog.pl
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
use diagnostics;
|
||||
|
||||
use FindBin qw($Bin $Script);
|
||||
use lib "$Bin";
|
||||
|
||||
require "dialog.pl";
|
||||
dialog->import('@dialog_result');
|
||||
our @dialog_result;
|
||||
|
||||
sub tput($$) {
|
||||
my $name = shift;
|
||||
my $default = shift;
|
||||
my $value = `tput "$name"`;
|
||||
chomp $value;
|
||||
$value = $default unless ( $value =~ /^[0-9]+$/ );
|
||||
return $value;
|
||||
}
|
||||
|
||||
sub napms($) {
|
||||
my $msecs = shift;
|
||||
select( undef, undef, undef, $msecs * 0.001 );
|
||||
}
|
||||
|
||||
sub show_results($$) {
|
||||
my $title = shift;
|
||||
my $width = shift;
|
||||
&rhs_msgbox(
|
||||
$title,
|
||||
sprintf(
|
||||
"Resulting text:\\n %s", join( '\\n ', @dialog_result )
|
||||
),
|
||||
$width
|
||||
);
|
||||
}
|
||||
|
||||
sub doit() {
|
||||
my $status = 1;
|
||||
my $RHS_CLEAR = "clear";
|
||||
my $RHS_TEXTBOX = "textbox";
|
||||
my $RHS_MSGBOX = "msgbox";
|
||||
my $RHS_INFOBOX = "infobox";
|
||||
my $RHS_YESNO = "yesno";
|
||||
my $RHS_GAUGE = "gauge";
|
||||
my $RHS_INPUTBOX = "inputbox";
|
||||
my $RHS_MENU = "menu";
|
||||
my $RHS_MENUL = "menul";
|
||||
my $RHS_MENUA = "menua";
|
||||
my $RHS_CHECKLIST = "checklist";
|
||||
my $RHS_CHECKLISTL = "checklistl";
|
||||
my $RHS_CHECKLISTA = "checklista";
|
||||
my $RHS_RADIOLIST = "radiolist";
|
||||
|
||||
my @demo_2col = qw(
|
||||
This that
|
||||
is has
|
||||
a this
|
||||
2-column quoted
|
||||
menu "tag".
|
||||
);
|
||||
my @demo_3col;
|
||||
my @demo_tags;
|
||||
my %demo_hash;
|
||||
|
||||
for ( my $s = 0, my $t = 0 ; $s <= $#demo_2col ; $s += 2, $t += 3 ) {
|
||||
my $d = $s / 2;
|
||||
my $c1 = $demo_2col[$s];
|
||||
my $c2 = $demo_2col[ $s + 1 ];
|
||||
$demo_3col[$t] = $c1;
|
||||
$demo_3col[ $t + 1 ] = $c2;
|
||||
$demo_3col[ $t + 2 ] = ( $c1 =~ /2/ ) ? 1 : 0;
|
||||
$demo_tags[$d] = $c1;
|
||||
$demo_tags[$d] =~ s/2/1/;
|
||||
$demo_tags[ $d + ( $#demo_2col + 1 ) / 2 ] = $c2;
|
||||
$demo_hash{ sprintf( "%d %s", $d, $c1 ) } = $c2;
|
||||
}
|
||||
|
||||
while ( $status > 0 ) {
|
||||
my $lines = &tput( "lines", 24 );
|
||||
my $cols = &tput( "cols", 80 );
|
||||
my $maxcols = $cols - 4;
|
||||
my $mincols = ( $cols > 8 ) ? 8 : $cols;
|
||||
my $midcols = int( ( $cols * 3 ) / 4 );
|
||||
|
||||
@dialog_result = ();
|
||||
$status = &rhs_menu(
|
||||
"My title", "My message",
|
||||
0, 14,
|
||||
$RHS_CLEAR, "clear and exit",
|
||||
$RHS_TEXTBOX, "text-box of this script",
|
||||
$RHS_MSGBOX, "informational-message, OK button",
|
||||
$RHS_INFOBOX, "informational-message, no button",
|
||||
$RHS_YESNO, "message with Yes/No buttons",
|
||||
$RHS_GAUGE, "message with progress-gauge",
|
||||
$RHS_INPUTBOX, "input-box",
|
||||
$RHS_MENU, "menu, with tags and description",
|
||||
$RHS_MENUL, "menu, using only tags",
|
||||
$RHS_MENUA, "alphabetically sorted menu",
|
||||
$RHS_CHECKLIST, "check-list with tags and description",
|
||||
$RHS_CHECKLISTL, "check-list using only tags",
|
||||
$RHS_CHECKLISTA, "alphabetically sorted check-list",
|
||||
$RHS_RADIOLIST, "list of radio-buttons"
|
||||
);
|
||||
if ( $status > 0 and $#dialog_result == 0 ) {
|
||||
|
||||
my $testcase = $dialog_result[0];
|
||||
if ( $testcase eq $RHS_CLEAR ) {
|
||||
&rhs_clear;
|
||||
last;
|
||||
}
|
||||
elsif ( $testcase eq $RHS_TEXTBOX ) {
|
||||
&rhs_textbox( "This script", "$Script", 0, 0 );
|
||||
}
|
||||
elsif ( $testcase eq $RHS_MSGBOX ) {
|
||||
my $msg =
|
||||
"This is a demonstration script.\\n"
|
||||
. "This should be the second line,\\n"
|
||||
. "and this should be the third line,";
|
||||
&rhs_msgbox( "A message", $msg,
|
||||
int( ( length($msg) + 3 ) / 3 ) + 3 );
|
||||
}
|
||||
elsif ( $testcase eq $RHS_INFOBOX ) {
|
||||
my $msg =
|
||||
"This is a fairly long line of text, used to"
|
||||
. " show how dialog can be used to wrap lines to fit in"
|
||||
. " screens with different width. The text will start wide,"
|
||||
. " then get narrower, showing a new infobox for each width"
|
||||
. " before going back up to the full width of the terminal.";
|
||||
my $wide = $maxcols;
|
||||
while ( $wide > $mincols ) {
|
||||
&rhs_infobox( "Info-box", $msg, $wide-- );
|
||||
&napms(50);
|
||||
}
|
||||
while ( $wide < $maxcols ) {
|
||||
&rhs_infobox( "Info-box", $msg, ++$wide );
|
||||
&napms(50);
|
||||
}
|
||||
&rhs_msgbox( "Info-end", $msg, $wide );
|
||||
}
|
||||
elsif ( $testcase eq $RHS_YESNO ) {
|
||||
if (
|
||||
&rhs_yesno(
|
||||
"Yes/no",
|
||||
"Should \"dialog --yesno\" return \"1\" on \"yes\""
|
||||
. " to simplify (some) shell scripts?",
|
||||
$cols / 2
|
||||
)
|
||||
)
|
||||
{
|
||||
&rhs_msgbox(
|
||||
"Explanation",
|
||||
"No, a successful program exits with "
|
||||
. "\"0\" (EXIT_SUCCESS)",
|
||||
$cols / 2
|
||||
);
|
||||
}
|
||||
else {
|
||||
&rhs_msgbox(
|
||||
"Explanation",
|
||||
"Shell scripts assume that \"exit\ 0\" is successful;"
|
||||
. " Perl is different.",
|
||||
$cols / 2
|
||||
);
|
||||
}
|
||||
}
|
||||
elsif ( $testcase eq $RHS_GAUGE ) {
|
||||
my $pct = 0;
|
||||
my $sec = 10;
|
||||
&rhs_gauge(
|
||||
"My gauge",
|
||||
"Show progress (or lack of it)",
|
||||
$midcols * 3, $pct
|
||||
);
|
||||
while ( $pct < 100 ) {
|
||||
$pct++;
|
||||
&napms($sec);
|
||||
$sec *= 1.04;
|
||||
&rhs_update_gauge($pct);
|
||||
}
|
||||
$pct = 99;
|
||||
&rhs_update_gauge_and_message( "This will go faster", $pct );
|
||||
while ( $pct > 0 ) {
|
||||
$pct--;
|
||||
&napms($sec);
|
||||
$sec /= 1.05;
|
||||
&rhs_update_gauge($pct);
|
||||
}
|
||||
&napms(1000);
|
||||
&rhs_stop_gauge;
|
||||
}
|
||||
elsif ( $testcase eq $RHS_INPUTBOX ) {
|
||||
if (
|
||||
&rhs_inputbox(
|
||||
"My inputbox", "This demonstrates the inputbox",
|
||||
$maxcols, ""
|
||||
)
|
||||
)
|
||||
{
|
||||
&show_results( "My inputbox", $midcols );
|
||||
}
|
||||
}
|
||||
elsif ( $testcase eq $RHS_MENU ) {
|
||||
if (
|
||||
&rhs_menu(
|
||||
(
|
||||
"A menu",
|
||||
"This menu uses \"tag\" values and descriptions:",
|
||||
$midcols, ( $#demo_2col + 1 ) / 2
|
||||
),
|
||||
@demo_2col
|
||||
)
|
||||
)
|
||||
{
|
||||
&show_results( "My menu", $midcols );
|
||||
}
|
||||
}
|
||||
elsif ( $testcase eq $RHS_MENUL ) {
|
||||
if (
|
||||
&rhs_menul(
|
||||
(
|
||||
"A menu", "This menu uses only the \"tag\" values:",
|
||||
$midcols, $#demo_tags + 1
|
||||
),
|
||||
@demo_tags
|
||||
)
|
||||
)
|
||||
{
|
||||
&show_results( "My long-menu", $midcols );
|
||||
}
|
||||
}
|
||||
elsif ( $testcase eq $RHS_MENUA ) {
|
||||
if (
|
||||
&rhs_menua(
|
||||
"A menu", "This menu uses the sorted keys from a hash:",
|
||||
$midcols, %demo_hash
|
||||
)
|
||||
)
|
||||
{
|
||||
&show_results( "My alpha-menu", $midcols );
|
||||
}
|
||||
}
|
||||
elsif ( $testcase eq $RHS_CHECKLIST ) {
|
||||
if (
|
||||
&rhs_checklist(
|
||||
(
|
||||
"A checklist",
|
||||
"This checklist uses \"tag\" values"
|
||||
. " and descriptions:",
|
||||
$midcols,
|
||||
( $#demo_3col + 1 ) / 3
|
||||
),
|
||||
@demo_3col
|
||||
)
|
||||
)
|
||||
{
|
||||
&show_results( "My checklist", $midcols );
|
||||
}
|
||||
}
|
||||
elsif ( $testcase eq $RHS_CHECKLISTL ) {
|
||||
if (
|
||||
&rhs_checklistl(
|
||||
(
|
||||
"A checklist",
|
||||
"This checklist uses only the \"tag\" values:",
|
||||
$midcols, $#demo_tags + 1
|
||||
),
|
||||
@demo_tags
|
||||
)
|
||||
)
|
||||
{
|
||||
&show_results( "My long-checklist", $midcols );
|
||||
}
|
||||
}
|
||||
elsif ( $testcase eq $RHS_CHECKLISTA ) {
|
||||
if (
|
||||
&rhs_checklista(
|
||||
"A checklist",
|
||||
"This checklist uses the sorted keys from a hash:",
|
||||
$midcols, %demo_hash
|
||||
)
|
||||
)
|
||||
{
|
||||
&show_results( "My alpha-checklist", $midcols );
|
||||
}
|
||||
}
|
||||
elsif ( $testcase eq $RHS_RADIOLIST ) {
|
||||
if (
|
||||
&rhs_radiolist(
|
||||
(
|
||||
"A radiolist",
|
||||
"This radiolist uses \"tag\" values"
|
||||
. " and descriptions:",
|
||||
$midcols,
|
||||
( $#demo_3col + 1 ) / 3
|
||||
),
|
||||
@demo_3col
|
||||
)
|
||||
)
|
||||
{
|
||||
&show_results( "My radiolist", $midcols );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&doit;
|
||||
|
||||
1;
|
||||
@@ -1,254 +0,0 @@
|
||||
#!@SHELL@
|
||||
# $Id: dialog-config.in,v 1.13 2019/09/26 00:50:46 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 2007-2012,2019 Thomas E. Dickey #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
# to deal in the Software without restriction, including without limitation #
|
||||
# the rights to use, copy, modify, merge, publish, distribute, distribute #
|
||||
# with modifications, sublicense, and/or sell copies of the Software, and to #
|
||||
# permit persons to whom the Software is furnished to do so, subject to the #
|
||||
# following conditions: #
|
||||
# #
|
||||
# The above copyright notice and this permission notice shall be included in #
|
||||
# all copies or substantial portions of the Software. #
|
||||
# #
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
|
||||
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
|
||||
# DEALINGS IN THE SOFTWARE. #
|
||||
# #
|
||||
# Except as contained in this notice, the name(s) of the above copyright #
|
||||
# holders shall not be used in advertising or otherwise to promote the sale, #
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
|
||||
prefix="@prefix@"
|
||||
exec_prefix="@exec_prefix@"
|
||||
datarootdir="@datarootdir@"
|
||||
|
||||
same_prefix=yes
|
||||
same_exec_prefix=yes
|
||||
|
||||
THIS="@PACKAGE@"
|
||||
|
||||
test $# = 0 && exec @SHELL@ "$0" --error
|
||||
|
||||
while test $# -gt 0; do
|
||||
|
||||
# (re)evaluate symbols that may depend upon $prefix
|
||||
if [ "x$same_prefix" != "xyes" ]
|
||||
then
|
||||
eval exec_prefix='@exec_prefix@'
|
||||
eval datarootdir='@datarootdir@'
|
||||
elif [ "x$same_exec_prefix" != "xyes" ]
|
||||
then
|
||||
eval datarootdir='@datarootdir@'
|
||||
fi
|
||||
|
||||
eval bindir='"@bindir@"'
|
||||
eval includedir='"@includedir@"'
|
||||
eval libdir='"@libdir@"'
|
||||
eval datadir='"@datadir@"'
|
||||
eval mandir='"@mandir@"'
|
||||
|
||||
[ -z "$includedir" ] && includedir="${prefix}/include"
|
||||
|
||||
eval LDFLAGS='"@LDFLAGS@"'
|
||||
eval LIBS='"@LIBS@"'
|
||||
LIBS="-l${THIS} $LIBS"
|
||||
|
||||
# If the directory given by --libdir is not in the LDFLAGS+LIBS set,
|
||||
# prepend it to LDFLAGS to help link this application's library.
|
||||
found=no
|
||||
for opt in $LDFLAGS $LIBS
|
||||
do
|
||||
if [ "x$-L${libdir}" = "x$opt" ]
|
||||
then
|
||||
found=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ $found = no ]
|
||||
then
|
||||
[ -n "$LFLAGS" ] && LDFLAGS=" $LFDLAGS"
|
||||
LDFLAGS="-L${libdir}$LDFLAGS"
|
||||
fi
|
||||
[ -z "$LDFLAGS" ] && LDFLAGS="-L${exec_prefix}/lib"
|
||||
|
||||
# Ignore -L options which do not correspond to an actual directory,
|
||||
# or which are standard library directories (i.e., the linker is
|
||||
# supposed to search those directories).
|
||||
#
|
||||
# There is no portable way to find the list of standard library
|
||||
# directories. Require a POSIX shell anyway, to keep this simple.
|
||||
lib_flags=
|
||||
for opt in $LDFLAGS $LIBS
|
||||
do
|
||||
case $opt in
|
||||
-L*)
|
||||
[ -d ${opt##-L} ] || continue
|
||||
case ${opt##-L} in
|
||||
@LD_SEARCHPATH@) # skip standard libdir
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
lib_flags="$lib_flags $opt"
|
||||
done
|
||||
|
||||
case "$1" in
|
||||
-*=*)
|
||||
ARG=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
|
||||
;;
|
||||
*)
|
||||
ARG=
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
# basic configuration
|
||||
--prefix=*)
|
||||
prefix="$ARG"
|
||||
test -z "$exec_prefix" && exec_prefix="$ARG"
|
||||
same_prefix=no
|
||||
;;
|
||||
--prefix)
|
||||
echo "$prefix"
|
||||
;;
|
||||
--exec-prefix=*)
|
||||
exec_prefix="$ARG"
|
||||
same_exec_prefix=no
|
||||
;;
|
||||
--exec-prefix)
|
||||
echo "$exec_prefix"
|
||||
;;
|
||||
# compile/link
|
||||
--cflags|--cflags-only-I)
|
||||
INCS=
|
||||
if test "$includedir" != /usr/include ; then
|
||||
INCS="-I$includedir"
|
||||
fi
|
||||
sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
|
||||
$INCS
|
||||
ENDECHO
|
||||
;;
|
||||
--cflags-only-other)
|
||||
# no -D/-U options should be needed
|
||||
echo
|
||||
;;
|
||||
--libs)
|
||||
OPTS=
|
||||
for opt in $lib_flags
|
||||
do
|
||||
[ -n "$OPTS" ] && OPTS="$OPTS "
|
||||
OPTS="${OPTS}${opt}"
|
||||
done
|
||||
printf "%s\n" "$OPTS"
|
||||
;;
|
||||
--libs-only-L)
|
||||
OPTS=
|
||||
for opt in $lib_flags
|
||||
do
|
||||
case "x$opt" in
|
||||
x-L*)
|
||||
[ -n "$OPTS" ] && OPTS="$OPTS "
|
||||
OPTS="${OPTS}${opt}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
printf "%s\n" "$OPTS"
|
||||
;;
|
||||
--libs-only-l)
|
||||
OPTS=
|
||||
for opt in $lib_flags
|
||||
do
|
||||
case "x$opt" in
|
||||
x-l*)
|
||||
[ -n "$OPTS" ] && OPTS="$OPTS "
|
||||
OPTS="${OPTS}${opt}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
printf "%s\n" "$OPTS"
|
||||
;;
|
||||
--libs-only-other)
|
||||
OPTS=
|
||||
for opt in $lib_flags
|
||||
do
|
||||
case "x$opt" in
|
||||
x-[lL]*)
|
||||
;;
|
||||
*)
|
||||
[ -n "$OPTS" ] && OPTS="$OPTS "
|
||||
OPTS="${OPTS}${opt}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
printf "%s\n" "$OPTS"
|
||||
;;
|
||||
# identification
|
||||
--version)
|
||||
echo "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@"
|
||||
;;
|
||||
--abi-version)
|
||||
echo "@VERSION@" | sed -e 's/:/./g'
|
||||
;;
|
||||
# locations
|
||||
--bindir)
|
||||
echo "${bindir}"
|
||||
;;
|
||||
--datadir)
|
||||
echo "${datadir}"
|
||||
;;
|
||||
--libdir)
|
||||
echo "${libdir}"
|
||||
;;
|
||||
--mandir)
|
||||
echo "${mandir}"
|
||||
;;
|
||||
# general info
|
||||
--help)
|
||||
cat <<ENDHELP
|
||||
Usage: ${THIS}-config [options]
|
||||
|
||||
Options:
|
||||
--prefix echos the package-prefix of ${THIS}
|
||||
--prefix=ARG sets the package-prefix of ${THIS}
|
||||
--exec-prefix echos the executable-prefix of ${THIS}
|
||||
--exec-prefix=ARG sets the executable-prefix of ${THIS}
|
||||
|
||||
--cflags echos the C compiler flags needed to compile with ${THIS}
|
||||
--libs echos the libraries needed to link with ${THIS}
|
||||
|
||||
--libs-only-L echos -L linker options (search path) for ${THIS}
|
||||
--libs-only-l echos -l linker options (libraries) for ${THIS}
|
||||
--libs-only-other echos linker options other than -L/-l
|
||||
|
||||
--version echos the release+patchdate version of ${THIS}
|
||||
--abi-version echos the ABI version of ${THIS}
|
||||
|
||||
--bindir echos the directory containing ${THIS} programs
|
||||
--datadir echos the directory containing ${THIS} data
|
||||
--libdir echos the directory containing ${THIS} libraries
|
||||
--mandir echos the directory containing ${THIS} manual pages
|
||||
|
||||
--help prints this message
|
||||
ENDHELP
|
||||
;;
|
||||
--error|*)
|
||||
@SHELL@ "$0" --help 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
# vile:shmode
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,23 +0,0 @@
|
||||
Begin3
|
||||
Title: dialog - Display dialog boxes in scripts
|
||||
Version: 1.0-20060221
|
||||
Entered-date: 21FEB06
|
||||
Description: Dialog is a program that will let you present a variety
|
||||
of questions or display messages in nice looking color
|
||||
non-graphical dialog boxes from a shell or perl script.
|
||||
Various dialog boxes can be presented such as yes/no, menu,
|
||||
input, message, checklist, radiolist, and more.
|
||||
|
||||
This program is based on the no longer maintained cdialog, but
|
||||
contains bug fixes and more features.
|
||||
Keywords: dialog, cdialog, shell, script, window
|
||||
Author: Originally Savio Lam for the ancient version
|
||||
Maintained-by: Thomas E. Dickey <[email protected]>
|
||||
Vila, Santiago <[email protected]>
|
||||
Primary-site: http://invisible-island.net/dialog/
|
||||
http://packages.debian.org/
|
||||
Alternate-site: ftp://ftp.us.debian.org/debian/pool/main/d/dialog/
|
||||
Original-site: ftp://sunsite.unc.edu/pub/Linux/utils/shell
|
||||
Platforms: Linux *nix, OS/2 EMX
|
||||
Copying-policy: LGPL
|
||||
End
|
||||
@@ -1,600 +0,0 @@
|
||||
# Functions that handle calling dialog(1) -*-perl-*-
|
||||
# $Id: dialog.pl,v 1.18 2018/06/12 21:01:58 tom Exp $
|
||||
################################################################################
|
||||
# Copyright 2018 Thomas E. Dickey
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this program; if not, write to
|
||||
# Free Software Foundation, Inc.
|
||||
# 51 Franklin St., Fifth Floor
|
||||
# Boston, MA 02110, USA.
|
||||
################################################################################
|
||||
# The "rhs_" functions, as well as return_output originally came from Redhat
|
||||
# 4.0, e.g.,
|
||||
# http://www.ibiblio.org/pub/historic-linux/distributions/redhat-4.0/i386/live/usr/bin/Xconfigurator.pl
|
||||
# The other functions were added to make this more useful for demonstrations.
|
||||
|
||||
# These comments are from the original file:
|
||||
#------------------------------------------------------------------------------
|
||||
# Return values are 1 for success and 0 for failure (or cancel)
|
||||
# Resultant text (if any) is in dialog_result
|
||||
|
||||
# Unfortunately, the gauge requires use of /bin/sh to get going.
|
||||
# I didn't bother to make the others shell-free, although it
|
||||
# would be simple to do.
|
||||
|
||||
# Note that dialog generally returns 0 for success, so I invert the
|
||||
# sense of the return code for more readable boolean expressions.
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
use diagnostics;
|
||||
|
||||
our $DIALOG = "dialog";
|
||||
our $GAUGE;
|
||||
our $gauge_width;
|
||||
our $scr_lines = 24;
|
||||
our $scr_cols = 80;
|
||||
our @dialog_result;
|
||||
our $trace = 0;
|
||||
|
||||
require "flush.pl";
|
||||
|
||||
sub trace {
|
||||
if ($trace) {
|
||||
if ( open TRACE, ">>dialog.log" ) {
|
||||
printf TRACE $_[0], @_[ 1 .. $#_ ];
|
||||
close TRACE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub quoted($) {
|
||||
my $text = shift;
|
||||
$text =~ s/[\r\n]+/\n/g;
|
||||
$text =~ s/[^\n\t -~]/?/g;
|
||||
$text =~ s/([\\"])/\\$1/g;
|
||||
return sprintf "\"%s\"", $text;
|
||||
}
|
||||
|
||||
sub screensize() {
|
||||
my $params = `$DIALOG --stdout --print-maxsize`;
|
||||
$params =~ s/\s+$//;
|
||||
$params =~ s/^[^:]*:\s+//;
|
||||
my @params = split /,\s+/, $params;
|
||||
if ( $#params == 1 ) {
|
||||
$scr_lines = $params[0];
|
||||
$scr_cols = $params[1];
|
||||
}
|
||||
else {
|
||||
$scr_lines = 24;
|
||||
$scr_cols = 80;
|
||||
}
|
||||
}
|
||||
|
||||
sub height_of($$) {
|
||||
my $width = shift;
|
||||
my $message = shift;
|
||||
my $command =
|
||||
"$DIALOG --stdout --print-text-size "
|
||||
. "ed($message)
|
||||
. " $scr_lines $width 2>&1";
|
||||
my $params = `$command`;
|
||||
my @params = split( /\s/, $params );
|
||||
return $params[0];
|
||||
}
|
||||
|
||||
sub rhs_clear {
|
||||
return system("$DIALOG --clear");
|
||||
}
|
||||
|
||||
sub rhs_textbox {
|
||||
my ( $title, $file, $width, $height ) = @_;
|
||||
|
||||
$width = int($width);
|
||||
$height = int($height);
|
||||
system( "$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --textbox $file $height $width" );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub rhs_msgbox {
|
||||
my ( $title, $message, $width ) = @_;
|
||||
my ( $tmp, $height );
|
||||
|
||||
$width = int($width);
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$height = 5 + &height_of( $width, $message );
|
||||
|
||||
$tmp =
|
||||
system( "$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --msgbox "
|
||||
. "ed($message)
|
||||
. " $height $width" );
|
||||
if ($tmp) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
sub rhs_infobox {
|
||||
my ( $title, $message, $width ) = @_;
|
||||
my ( $tmp, $height );
|
||||
|
||||
$width = int($width);
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$height = 2 + &height_of( $width, $message );
|
||||
|
||||
return
|
||||
system( "$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --infobox "
|
||||
. "ed($message)
|
||||
. " $height $width" );
|
||||
}
|
||||
|
||||
sub rhs_yesno {
|
||||
my ( $title, $message, $width ) = @_;
|
||||
my ( $tmp, $height );
|
||||
|
||||
$width = int($width);
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$height = 4 + &height_of( $width, $message );
|
||||
|
||||
$tmp =
|
||||
system( "$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --yesno "
|
||||
. "ed($message)
|
||||
. " $height $width" );
|
||||
|
||||
# Dumb: dialog returns 0 for "yes" and 1 for "no"
|
||||
if ( !$tmp ) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub rhs_gauge {
|
||||
my ( $title, $message, $width, $percent ) = @_;
|
||||
my ( $tmp, $height );
|
||||
|
||||
$width = int($width);
|
||||
$gauge_width = $width;
|
||||
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$height = 5 + &height_of( $width, $message );
|
||||
|
||||
open( $GAUGE,
|
||||
"|$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --gauge "
|
||||
. "ed($message)
|
||||
. " $height $width $percent" );
|
||||
}
|
||||
|
||||
sub rhs_update_gauge {
|
||||
my ($percent) = @_;
|
||||
|
||||
&printflush( $GAUGE, "$percent\n" );
|
||||
}
|
||||
|
||||
sub rhs_update_gauge_and_message {
|
||||
my ( $message, $percent ) = @_;
|
||||
|
||||
$message = &rhs_wordwrap( $message, $gauge_width );
|
||||
$message =~ s/\n/\\n/g;
|
||||
&printflush( $GAUGE, "XXX\n$percent\n$message\nXXX\n" );
|
||||
}
|
||||
|
||||
sub rhs_stop_gauge {
|
||||
close $GAUGE;
|
||||
}
|
||||
|
||||
sub rhs_inputbox {
|
||||
my ( $title, $message, $width, $instr ) = @_;
|
||||
my ( $tmp, $height );
|
||||
|
||||
$width = int($width);
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$height = 7 + &height_of( $width, $message );
|
||||
|
||||
return &return_output( 0,
|
||||
"$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --inputbox "
|
||||
. "ed($message)
|
||||
. " $height $width "
|
||||
. "ed($instr) );
|
||||
}
|
||||
|
||||
sub rhs_menu {
|
||||
my ( $title, $message, $width, $numitems ) = @_;
|
||||
my ( $i, $tmp, $ent, $height, $listheight, $menuheight, @list );
|
||||
|
||||
$width = int($width);
|
||||
$numitems = int($numitems);
|
||||
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
|
||||
@list = ();
|
||||
for ( $i = 0 ; $i < $numitems ; $i++ ) {
|
||||
$ent = shift;
|
||||
$list[@list] = "ed($ent);
|
||||
$ent = shift;
|
||||
$list[@list] = "ed($ent);
|
||||
}
|
||||
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$listheight = &height_of( $width, $message );
|
||||
$height = 6 + $listheight + $numitems;
|
||||
|
||||
if ( $height <= $scr_lines ) {
|
||||
$menuheight = $numitems;
|
||||
}
|
||||
else {
|
||||
$height = $scr_lines;
|
||||
$menuheight = $scr_lines - $listheight - 6;
|
||||
}
|
||||
|
||||
return &return_output( 0,
|
||||
"$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --menu "
|
||||
. "ed($message)
|
||||
. " $height $width $menuheight @list" );
|
||||
}
|
||||
|
||||
sub rhs_menul {
|
||||
my ( $title, $message, $width, $numitems ) = @_;
|
||||
my ( $i, $tmp, $ent, $height, $listheight, $menuheight, @list );
|
||||
|
||||
$width = int($width);
|
||||
$numitems = int($numitems);
|
||||
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
|
||||
@list = ();
|
||||
for ( $i = 0 ; $i < $numitems ; $i++ ) {
|
||||
$ent = shift;
|
||||
$list[@list] = "ed($ent);
|
||||
$list[@list] = "ed("");
|
||||
}
|
||||
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$listheight = &height_of( $width, $message );
|
||||
$height = 6 + $listheight + $numitems;
|
||||
|
||||
if ( $height <= $scr_lines ) {
|
||||
$menuheight = $numitems;
|
||||
}
|
||||
else {
|
||||
$height = $scr_lines;
|
||||
$menuheight = $scr_lines - $listheight - 6;
|
||||
}
|
||||
|
||||
return &return_output( 0,
|
||||
"$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --menu "
|
||||
. "ed($message)
|
||||
. " $height $width $menuheight @list" );
|
||||
}
|
||||
|
||||
sub rhs_menua {
|
||||
my ( $title, $message, $width, %items ) = @_;
|
||||
my ( $tmp, $ent, $height, $listheight, $menuheight, @list );
|
||||
|
||||
$width = int($width);
|
||||
@list = ();
|
||||
foreach $ent ( sort keys(%items) ) {
|
||||
$list[@list] = "ed($ent);
|
||||
$list[@list] = "ed( $items{$ent} );
|
||||
}
|
||||
|
||||
my $numitems = keys(%items);
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$listheight = &height_of( $width, $message );
|
||||
$height = 6 + $listheight + $numitems;
|
||||
|
||||
if ( $height <= $scr_lines ) {
|
||||
$menuheight = $numitems;
|
||||
}
|
||||
else {
|
||||
$height = $scr_lines;
|
||||
$menuheight = $scr_lines - $listheight - 6;
|
||||
}
|
||||
|
||||
return &return_output( 0,
|
||||
"$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --menu "
|
||||
. "ed($message)
|
||||
. " $height $width $menuheight @list" );
|
||||
}
|
||||
|
||||
sub rhs_checklist {
|
||||
my ( $title, $message, $width, $numitems ) = @_;
|
||||
my ( $i, $tmp, $ent, $height, $listheight, $menuheight, @list );
|
||||
|
||||
$width = int($width);
|
||||
$numitems = int($numitems);
|
||||
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
|
||||
@list = ();
|
||||
for ( $i = 0 ; $i < $numitems ; $i++ ) {
|
||||
$ent = shift;
|
||||
$list[@list] = "ed($ent);
|
||||
$ent = shift;
|
||||
$list[@list] = "ed($ent);
|
||||
$ent = shift;
|
||||
if ($ent) {
|
||||
$list[@list] = "ON";
|
||||
}
|
||||
else {
|
||||
$list[@list] = "OFF";
|
||||
}
|
||||
}
|
||||
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$listheight = &height_of( $width, $message );
|
||||
$height = 6 + $listheight + $numitems;
|
||||
|
||||
if ( $height <= $scr_lines ) {
|
||||
$menuheight = $numitems;
|
||||
}
|
||||
else {
|
||||
$height = $scr_lines;
|
||||
$menuheight = $scr_lines - $listheight - 6;
|
||||
}
|
||||
|
||||
return &return_output( "list",
|
||||
"$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --separate-output --checklist "
|
||||
. "ed($message)
|
||||
. " $height $width $menuheight @list" );
|
||||
}
|
||||
|
||||
sub rhs_checklistl {
|
||||
my ( $title, $message, $width, $numitems ) = @_;
|
||||
my ( $i, $tmp, $ent, $height, $listheight, $menuheight, @list );
|
||||
|
||||
$width = int($width);
|
||||
$numitems = int($numitems);
|
||||
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
|
||||
@list = ();
|
||||
for ( $i = 0 ; $i < $numitems ; $i++ ) {
|
||||
$ent = shift;
|
||||
$list[@list] = "ed($ent);
|
||||
$list[@list] = "ed("");
|
||||
$list[@list] = "OFF";
|
||||
}
|
||||
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$listheight = &height_of( $width, $message );
|
||||
$height = 6 + $listheight + $numitems;
|
||||
|
||||
if ( $height <= $scr_lines ) {
|
||||
$menuheight = $numitems;
|
||||
}
|
||||
else {
|
||||
$height = $scr_lines;
|
||||
$menuheight = $scr_lines - $listheight - 6;
|
||||
}
|
||||
return &return_output( "list",
|
||||
"$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --separate-output --checklist "
|
||||
. "ed($message)
|
||||
. " $height $width $menuheight @list" );
|
||||
}
|
||||
|
||||
sub rhs_checklista {
|
||||
my ( $title, $message, $width, %items ) = @_;
|
||||
my ( $tmp, $ent, $height, $listheight, $menuheight, @list );
|
||||
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
|
||||
@list = ();
|
||||
foreach $ent ( sort keys(%items) ) {
|
||||
$list[@list] = "ed($ent);
|
||||
$list[@list] = "ed( $items{$ent} );
|
||||
$list[@list] = "OFF";
|
||||
}
|
||||
|
||||
my $numitems = keys(%items);
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$listheight = &height_of( $width, $message );
|
||||
$height = 6 + $listheight + $numitems;
|
||||
|
||||
if ( $height <= $scr_lines ) {
|
||||
$menuheight = $numitems;
|
||||
}
|
||||
else {
|
||||
$height = $scr_lines;
|
||||
$menuheight = $scr_lines - $listheight - 6;
|
||||
}
|
||||
|
||||
return &return_output( "list",
|
||||
"$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --separate-output --checklist "
|
||||
. "ed($message)
|
||||
. " $height $width $menuheight @list" );
|
||||
}
|
||||
|
||||
sub rhs_radiolist {
|
||||
my ( $title, $message, $width, $numitems ) = @_;
|
||||
my ( $i, $tmp, $ent, $height, $listheight, $menuheight, @list );
|
||||
|
||||
$width = int($width);
|
||||
$numitems = int($numitems);
|
||||
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
shift;
|
||||
|
||||
@list = ();
|
||||
for ( $i = 0 ; $i < $numitems ; $i++ ) {
|
||||
$ent = shift;
|
||||
$list[@list] = "ed($ent);
|
||||
$ent = shift;
|
||||
$list[@list] = "ed($ent);
|
||||
$ent = shift;
|
||||
if ($ent) {
|
||||
$list[@list] = "ON";
|
||||
}
|
||||
else {
|
||||
$list[@list] = "OFF";
|
||||
}
|
||||
}
|
||||
|
||||
$message = &rhs_wordwrap( $message, $width );
|
||||
$listheight = &height_of( $width, $message );
|
||||
$height = 6 + $listheight + $numitems;
|
||||
|
||||
if ( $height <= $scr_lines ) {
|
||||
$menuheight = $numitems;
|
||||
}
|
||||
else {
|
||||
$height = $scr_lines;
|
||||
$menuheight = $scr_lines - $listheight - 6;
|
||||
}
|
||||
|
||||
return &return_output( 0,
|
||||
"$DIALOG --title "
|
||||
. "ed($title)
|
||||
. " --radiolist "
|
||||
. "ed($message)
|
||||
. " $height $width $menuheight @list" );
|
||||
}
|
||||
|
||||
sub return_output {
|
||||
my ( $listp, $command ) = @_;
|
||||
my ($res) = 1;
|
||||
|
||||
pipe( PARENT_READER, CHILD_WRITER );
|
||||
|
||||
# We have to fork (as opposed to using "system") so that the parent
|
||||
# process can read from the pipe to avoid deadlock.
|
||||
my ($pid) = fork;
|
||||
if ( $pid == 0 ) { # child
|
||||
close(PARENT_READER);
|
||||
open( STDERR, ">&CHILD_WRITER" );
|
||||
exec($command);
|
||||
die("no exec");
|
||||
}
|
||||
if ( $pid > 0 ) { # parent
|
||||
close(CHILD_WRITER);
|
||||
if ($listp) {
|
||||
@dialog_result = ();
|
||||
while (<PARENT_READER>) {
|
||||
chop;
|
||||
$dialog_result[@dialog_result] = $_;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@dialog_result = <PARENT_READER>;
|
||||
}
|
||||
close(PARENT_READER);
|
||||
waitpid( $pid, 0 );
|
||||
$res = $?;
|
||||
}
|
||||
|
||||
# Again, dialog returns results backwards
|
||||
if ( !$res ) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub rhs_wordwrap {
|
||||
my ( $intext, $width ) = @_;
|
||||
my ( $outtext, $i, $j, @lines, $wrap, @words, $pos, $pad );
|
||||
|
||||
&trace( "rhs_wordwrap\n\tintext:%s\n\twidth:%d\n", $intext, $width );
|
||||
&screensize;
|
||||
$width = int($width);
|
||||
$outtext = "";
|
||||
$pad = 3; # leave 3 spaces around each line
|
||||
$pos = $pad; # current insert position
|
||||
$wrap = 0; # 1 if we have been auto wrapping
|
||||
my $insert_nl = 0; # 1 if we just did an absolute
|
||||
# and we should preface any new text
|
||||
# with a new line
|
||||
@lines = split( /\n/, $intext );
|
||||
|
||||
for ( $i = 0 ; $i <= $#lines ; $i++ ) {
|
||||
|
||||
if ( $lines[$i] =~ /^>/ ) {
|
||||
$outtext .= "\n" if ($insert_nl);
|
||||
$outtext .= "\n" if ($wrap);
|
||||
$lines[$i] =~ /^>(.*)$/;
|
||||
$outtext .= $1;
|
||||
$insert_nl = 1;
|
||||
$wrap = 0;
|
||||
$pos = $pad;
|
||||
}
|
||||
else {
|
||||
$wrap = 1;
|
||||
@words = split( /\s+/, $lines[$i] );
|
||||
for ( $j = 0 ; $j <= $#words ; $j++ ) {
|
||||
if ($insert_nl) {
|
||||
$outtext .= "\n";
|
||||
$insert_nl = 0;
|
||||
}
|
||||
if ( ( length( $words[$j] ) + $pos ) > $width - $pad ) {
|
||||
$outtext .= "\n";
|
||||
$pos = $pad;
|
||||
}
|
||||
$outtext .= $words[$j] . " ";
|
||||
$pos += length( $words[$j] ) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&trace( "\touttext:%s\n", $outtext );
|
||||
return $outtext;
|
||||
}
|
||||
|
||||
############
|
||||
1;
|
||||
@@ -1,280 +0,0 @@
|
||||
/*
|
||||
* $Id: dlg_colors.h,v 1.18 2019/09/23 09:14:30 tom Exp $
|
||||
*
|
||||
* colors.h -- color attribute definitions
|
||||
*
|
||||
* Copyright 2000-2011,2019 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*
|
||||
* An earlier version of this program lists as authors
|
||||
* Savio Lam (lam836@cs.cuhk.hk)
|
||||
*/
|
||||
|
||||
#ifndef COLORS_H_included
|
||||
#define COLORS_H_included 1
|
||||
|
||||
#include <dialog.h>
|
||||
|
||||
/*
|
||||
* Default color definitions (DLGC means "Dialog Color")
|
||||
*
|
||||
* DLGC_FG_xxx = foreground for "xxx"
|
||||
* DLGC_BG_xxx = background for "xxx"
|
||||
* DLGC_HL_xxx = highlight for "xxx"
|
||||
* DLGC_UL_xxx = underline for "xxx"
|
||||
* DLGC_RV_xxx = reverse for "xxx"
|
||||
*/
|
||||
#define DLGC_FG_SCREEN COLOR_CYAN
|
||||
#define DLGC_BG_SCREEN COLOR_BLUE
|
||||
#define DLGC_HL_SCREEN TRUE
|
||||
#define DLGC_UL_SCREEN FALSE
|
||||
#define DLGC_RV_SCREEN FALSE
|
||||
|
||||
#define DLGC_FG_SHADOW COLOR_BLACK
|
||||
#define DLGC_BG_SHADOW COLOR_BLACK
|
||||
#define DLGC_HL_SHADOW TRUE
|
||||
#define DLGC_UL_SHADOW FALSE
|
||||
#define DLGC_RV_SHADOW FALSE
|
||||
|
||||
#define DLGC_FG_DIALOG COLOR_BLACK
|
||||
#define DLGC_BG_DIALOG COLOR_WHITE
|
||||
#define DLGC_HL_DIALOG FALSE
|
||||
#define DLGC_UL_DIALOG FALSE
|
||||
#define DLGC_RV_DIALOG FALSE
|
||||
|
||||
#define DLGC_FG_TITLE COLOR_BLUE
|
||||
#define DLGC_BG_TITLE COLOR_WHITE
|
||||
#define DLGC_HL_TITLE TRUE
|
||||
#define DLGC_UL_TITLE FALSE
|
||||
#define DLGC_RV_TITLE FALSE
|
||||
|
||||
#define DLGC_FG_BORDER COLOR_WHITE
|
||||
#define DLGC_BG_BORDER COLOR_WHITE
|
||||
#define DLGC_HL_BORDER TRUE
|
||||
#define DLGC_UL_BORDER FALSE
|
||||
#define DLGC_RV_BORDER FALSE
|
||||
|
||||
#define DLGC_FG_BORDER2 DLGC_FG_DIALOG
|
||||
#define DLGC_BG_BORDER2 DLGC_BG_DIALOG
|
||||
#define DLGC_HL_BORDER2 DLGC_HL_DIALOG
|
||||
#define DLGC_UL_BORDER2 FALSE
|
||||
#define DLGC_RV_BORDER2 FALSE
|
||||
|
||||
#define DLGC_FG_BUTTON_ACTIVE COLOR_WHITE
|
||||
#define DLGC_BG_BUTTON_ACTIVE COLOR_BLUE
|
||||
#define DLGC_HL_BUTTON_ACTIVE TRUE
|
||||
#define DLGC_UL_BUTTON_ACTIVE FALSE
|
||||
#define DLGC_RV_BUTTON_ACTIVE FALSE
|
||||
|
||||
#define DLGC_FG_BUTTON_INACTIVE COLOR_BLACK
|
||||
#define DLGC_BG_BUTTON_INACTIVE COLOR_WHITE
|
||||
#define DLGC_HL_BUTTON_INACTIVE FALSE
|
||||
#define DLGC_UL_BUTTON_INACTIVE FALSE
|
||||
#define DLGC_RV_BUTTON_INACTIVE FALSE
|
||||
|
||||
#define DLGC_FG_BUTTON_KEY_ACTIVE COLOR_WHITE
|
||||
#define DLGC_BG_BUTTON_KEY_ACTIVE COLOR_BLUE
|
||||
#define DLGC_HL_BUTTON_KEY_ACTIVE TRUE
|
||||
#define DLGC_UL_BUTTON_KEY_ACTIVE FALSE
|
||||
#define DLGC_RV_BUTTON_KEY_ACTIVE FALSE
|
||||
|
||||
#define DLGC_FG_BUTTON_KEY_INACTIVE COLOR_RED
|
||||
#define DLGC_BG_BUTTON_KEY_INACTIVE COLOR_WHITE
|
||||
#define DLGC_HL_BUTTON_KEY_INACTIVE FALSE
|
||||
#define DLGC_UL_BUTTON_KEY_INACTIVE FALSE
|
||||
#define DLGC_RV_BUTTON_KEY_INACTIVE FALSE
|
||||
|
||||
#define DLGC_FG_BUTTON_LABEL_ACTIVE COLOR_YELLOW
|
||||
#define DLGC_BG_BUTTON_LABEL_ACTIVE COLOR_BLUE
|
||||
#define DLGC_HL_BUTTON_LABEL_ACTIVE TRUE
|
||||
#define DLGC_UL_BUTTON_LABEL_ACTIVE FALSE
|
||||
#define DLGC_RV_BUTTON_LABEL_ACTIVE FALSE
|
||||
|
||||
#define DLGC_FG_BUTTON_LABEL_INACTIVE COLOR_BLACK
|
||||
#define DLGC_BG_BUTTON_LABEL_INACTIVE COLOR_WHITE
|
||||
#define DLGC_HL_BUTTON_LABEL_INACTIVE TRUE
|
||||
#define DLGC_UL_BUTTON_LABEL_INACTIVE FALSE
|
||||
#define DLGC_RV_BUTTON_LABEL_INACTIVE FALSE
|
||||
|
||||
#define DLGC_FG_FORM_ITEM_READONLY COLOR_CYAN
|
||||
#define DLGC_BG_FORM_ITEM_READONLY COLOR_WHITE
|
||||
#define DLGC_HL_FORM_ITEM_READONLY TRUE
|
||||
#define DLGC_UL_FORM_ITEM_READONLY FALSE
|
||||
#define DLGC_RV_FORM_ITEM_READONLY FALSE
|
||||
|
||||
#define DLGC_FG_INPUTBOX COLOR_BLACK
|
||||
#define DLGC_BG_INPUTBOX COLOR_WHITE
|
||||
#define DLGC_HL_INPUTBOX FALSE
|
||||
#define DLGC_UL_INPUTBOX FALSE
|
||||
#define DLGC_RV_INPUTBOX FALSE
|
||||
|
||||
#define DLGC_FG_INPUTBOX_BORDER COLOR_BLACK
|
||||
#define DLGC_BG_INPUTBOX_BORDER COLOR_WHITE
|
||||
#define DLGC_HL_INPUTBOX_BORDER FALSE
|
||||
#define DLGC_UL_INPUTBOX_BORDER FALSE
|
||||
#define DLGC_RV_INPUTBOX_BORDER FALSE
|
||||
|
||||
#define DLGC_FG_INPUTBOX_BORDER2 DLGC_FG_INPUTBOX
|
||||
#define DLGC_BG_INPUTBOX_BORDER2 DLGC_BG_INPUTBOX
|
||||
#define DLGC_HL_INPUTBOX_BORDER2 DLGC_HL_INPUTBOX
|
||||
#define DLGC_UL_INPUTBOX_BORDER2 FALSE
|
||||
#define DLGC_RV_INPUTBOX_BORDER2 FALSE
|
||||
|
||||
#define DLGC_FG_SEARCHBOX COLOR_BLACK
|
||||
#define DLGC_BG_SEARCHBOX COLOR_WHITE
|
||||
#define DLGC_HL_SEARCHBOX FALSE
|
||||
#define DLGC_UL_SEARCHBOX FALSE
|
||||
#define DLGC_RV_SEARCHBOX FALSE
|
||||
|
||||
#define DLGC_FG_SEARCHBOX_TITLE COLOR_BLUE
|
||||
#define DLGC_BG_SEARCHBOX_TITLE COLOR_WHITE
|
||||
#define DLGC_HL_SEARCHBOX_TITLE TRUE
|
||||
#define DLGC_UL_SEARCHBOX_TITLE FALSE
|
||||
#define DLGC_RV_SEARCHBOX_TITLE FALSE
|
||||
|
||||
#define DLGC_FG_SEARCHBOX_BORDER COLOR_WHITE
|
||||
#define DLGC_BG_SEARCHBOX_BORDER COLOR_WHITE
|
||||
#define DLGC_HL_SEARCHBOX_BORDER TRUE
|
||||
#define DLGC_UL_SEARCHBOX_BORDER FALSE
|
||||
#define DLGC_RV_SEARCHBOX_BORDER FALSE
|
||||
|
||||
#define DLGC_FG_SEARCHBOX_BORDER2 DLGC_FG_SEARCHBOX
|
||||
#define DLGC_BG_SEARCHBOX_BORDER2 DLGC_BG_SEARCHBOX
|
||||
#define DLGC_HL_SEARCHBOX_BORDER2 DLGC_HL_SEARCHBOX
|
||||
#define DLGC_UL_SEARCHBOX_BORDER2 FALSE
|
||||
#define DLGC_RV_SEARCHBOX_BORDER2 FALSE
|
||||
|
||||
#define DLGC_FG_POSITION_INDICATOR COLOR_BLUE
|
||||
#define DLGC_BG_POSITION_INDICATOR COLOR_WHITE
|
||||
#define DLGC_HL_POSITION_INDICATOR TRUE
|
||||
#define DLGC_UL_POSITION_INDICATOR FALSE
|
||||
#define DLGC_RV_POSITION_INDICATOR FALSE
|
||||
|
||||
#define DLGC_FG_MENUBOX COLOR_BLACK
|
||||
#define DLGC_BG_MENUBOX COLOR_WHITE
|
||||
#define DLGC_HL_MENUBOX FALSE
|
||||
#define DLGC_UL_MENUBOX FALSE
|
||||
#define DLGC_RV_MENUBOX FALSE
|
||||
|
||||
#define DLGC_FG_MENUBOX_BORDER COLOR_WHITE
|
||||
#define DLGC_BG_MENUBOX_BORDER COLOR_WHITE
|
||||
#define DLGC_HL_MENUBOX_BORDER TRUE
|
||||
#define DLGC_UL_MENUBOX_BORDER FALSE
|
||||
#define DLGC_RV_MENUBOX_BORDER FALSE
|
||||
|
||||
#define DLGC_FG_MENUBOX_BORDER2 DLGC_FG_MENUBOX
|
||||
#define DLGC_BG_MENUBOX_BORDER2 DLGC_BG_MENUBOX
|
||||
#define DLGC_HL_MENUBOX_BORDER2 DLGC_HL_MENUBOX
|
||||
#define DLGC_UL_MENUBOX_BORDER2 FALSE
|
||||
#define DLGC_RV_MENUBOX_BORDER2 FALSE
|
||||
|
||||
#define DLGC_FG_ITEM COLOR_BLACK
|
||||
#define DLGC_BG_ITEM COLOR_WHITE
|
||||
#define DLGC_HL_ITEM FALSE
|
||||
#define DLGC_UL_ITEM FALSE
|
||||
#define DLGC_RV_ITEM FALSE
|
||||
|
||||
#define DLGC_FG_ITEM_SELECTED COLOR_WHITE
|
||||
#define DLGC_BG_ITEM_SELECTED COLOR_BLUE
|
||||
#define DLGC_HL_ITEM_SELECTED TRUE
|
||||
#define DLGC_UL_ITEM_SELECTED FALSE
|
||||
#define DLGC_RV_ITEM_SELECTED FALSE
|
||||
|
||||
#define DLGC_FG_TAG COLOR_BLUE
|
||||
#define DLGC_BG_TAG COLOR_WHITE
|
||||
#define DLGC_HL_TAG TRUE
|
||||
#define DLGC_UL_TAG FALSE
|
||||
#define DLGC_RV_TAG FALSE
|
||||
|
||||
#define DLGC_FG_TAG_SELECTED COLOR_YELLOW
|
||||
#define DLGC_BG_TAG_SELECTED COLOR_BLUE
|
||||
#define DLGC_HL_TAG_SELECTED TRUE
|
||||
#define DLGC_UL_TAG_SELECTED FALSE
|
||||
#define DLGC_RV_TAG_SELECTED FALSE
|
||||
|
||||
#define DLGC_FG_TAG_KEY COLOR_RED
|
||||
#define DLGC_BG_TAG_KEY COLOR_WHITE
|
||||
#define DLGC_HL_TAG_KEY FALSE
|
||||
#define DLGC_UL_TAG_KEY FALSE
|
||||
#define DLGC_RV_TAG_KEY FALSE
|
||||
|
||||
#define DLGC_FG_TAG_KEY_SELECTED COLOR_RED
|
||||
#define DLGC_BG_TAG_KEY_SELECTED COLOR_BLUE
|
||||
#define DLGC_HL_TAG_KEY_SELECTED TRUE
|
||||
#define DLGC_UL_TAG_KEY_SELECTED FALSE
|
||||
#define DLGC_RV_TAG_KEY_SELECTED FALSE
|
||||
|
||||
#define DLGC_FG_CHECK COLOR_BLACK
|
||||
#define DLGC_BG_CHECK COLOR_WHITE
|
||||
#define DLGC_HL_CHECK FALSE
|
||||
#define DLGC_UL_CHECK FALSE
|
||||
#define DLGC_RV_CHECK FALSE
|
||||
|
||||
#define DLGC_FG_CHECK_SELECTED COLOR_WHITE
|
||||
#define DLGC_BG_CHECK_SELECTED COLOR_BLUE
|
||||
#define DLGC_HL_CHECK_SELECTED TRUE
|
||||
#define DLGC_UL_CHECK_SELECTED FALSE
|
||||
#define DLGC_RV_CHECK_SELECTED FALSE
|
||||
|
||||
#define DLGC_FG_UARROW COLOR_GREEN
|
||||
#define DLGC_BG_UARROW COLOR_WHITE
|
||||
#define DLGC_HL_UARROW TRUE
|
||||
#define DLGC_UL_UARROW FALSE
|
||||
#define DLGC_RV_UARROW FALSE
|
||||
|
||||
#define DLGC_FG_DARROW COLOR_GREEN
|
||||
#define DLGC_BG_DARROW COLOR_WHITE
|
||||
#define DLGC_HL_DARROW TRUE
|
||||
#define DLGC_UL_DARROW FALSE
|
||||
#define DLGC_RV_DARROW FALSE
|
||||
|
||||
#define DLGC_FG_ITEMHELP COLOR_WHITE
|
||||
#define DLGC_BG_ITEMHELP COLOR_BLACK
|
||||
#define DLGC_HL_ITEMHELP FALSE
|
||||
#define DLGC_UL_ITEMHELP FALSE
|
||||
#define DLGC_RV_ITEMHELP FALSE
|
||||
|
||||
#define DLGC_FG_FORM_ACTIVE_TEXT COLOR_WHITE
|
||||
#define DLGC_BG_FORM_ACTIVE_TEXT COLOR_BLUE
|
||||
#define DLGC_HL_FORM_ACTIVE_TEXT TRUE
|
||||
#define DLGC_UL_FORM_ACTIVE_TEXT FALSE
|
||||
#define DLGC_RV_FORM_ACTIVE_TEXT FALSE
|
||||
|
||||
#define DLGC_FG_FORM_TEXT COLOR_WHITE
|
||||
#define DLGC_BG_FORM_TEXT COLOR_CYAN
|
||||
#define DLGC_HL_FORM_TEXT TRUE
|
||||
#define DLGC_UL_FORM_TEXT FALSE
|
||||
#define DLGC_RV_FORM_TEXT FALSE
|
||||
|
||||
#define DLGC_FG_GAUGE COLOR_BLUE
|
||||
#define DLGC_BG_GAUGE COLOR_WHITE
|
||||
#define DLGC_HL_GAUGE TRUE
|
||||
#define DLGC_UL_GAUGE FALSE
|
||||
#define DLGC_RV_GAUGE FALSE
|
||||
|
||||
/* End of default color definitions */
|
||||
|
||||
/*
|
||||
* Global variables
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
int value;
|
||||
} color_names_st;
|
||||
|
||||
#endif /* COLORS_H_included */
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* $Id: dlg_internals.h,v 1.3 2019/08/08 21:29:41 tom Exp $
|
||||
*
|
||||
* dlg_internals.h -- runtime binding support for dialog
|
||||
*
|
||||
* Copyright 2019 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#ifndef DLG_INTERNALS_H_included
|
||||
#define DLG_INTERNALS_H_included 1
|
||||
|
||||
#include <dialog.h>
|
||||
|
||||
#define TableSize(name) (sizeof(name)/sizeof((name)[0]))
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#define resizeit(name, NAME) \
|
||||
name = ((NAME >= old_##NAME) \
|
||||
? (NAME - (old_##NAME - old_##name)) \
|
||||
: old_##name)
|
||||
|
||||
#define AddLastKey() \
|
||||
if (dialog_vars.last_key) { \
|
||||
if (dlg_need_separator()) \
|
||||
dlg_add_separator(); \
|
||||
dlg_add_last_key(-1); \
|
||||
}
|
||||
|
||||
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#endif /* DLG_INTERNALS_H_included */
|
||||
@@ -1,973 +0,0 @@
|
||||
/*
|
||||
* $Id: dlg_keys.c,v 1.58 2020/11/26 17:11:56 Glenn.Herteg Exp $
|
||||
*
|
||||
* dlg_keys.c -- runtime binding support for dialog
|
||||
*
|
||||
* Copyright 2006-2019,2020 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
#include <dlg_keys.h>
|
||||
#include <dlg_internals.h>
|
||||
|
||||
#define LIST_BINDINGS struct _list_bindings
|
||||
|
||||
#define CHR_BACKSLASH '\\'
|
||||
#define IsOctal(ch) ((ch) >= '0' && (ch) <= '7')
|
||||
|
||||
LIST_BINDINGS {
|
||||
LIST_BINDINGS *link;
|
||||
WINDOW *win; /* window on which widget gets input */
|
||||
const char *name; /* widget name */
|
||||
bool buttons; /* true only for dlg_register_buttons() */
|
||||
DLG_KEYS_BINDING *binding; /* list of bindings */
|
||||
};
|
||||
|
||||
#define WILDNAME "*"
|
||||
static LIST_BINDINGS *all_bindings;
|
||||
static const DLG_KEYS_BINDING end_keys_binding = END_KEYS_BINDING;
|
||||
|
||||
/*
|
||||
* For a given named widget's window, associate a binding table.
|
||||
*/
|
||||
void
|
||||
dlg_register_window(WINDOW *win, const char *name, DLG_KEYS_BINDING * binding)
|
||||
{
|
||||
LIST_BINDINGS *p, *q;
|
||||
|
||||
for (p = all_bindings, q = 0; p != 0; q = p, p = p->link) {
|
||||
if (p->win == win && !strcmp(p->name, name)) {
|
||||
p->binding = binding;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* add built-in bindings at the end of the list (see compare_bindings). */
|
||||
if ((p = dlg_calloc(LIST_BINDINGS, 1)) != 0) {
|
||||
p->win = win;
|
||||
p->name = name;
|
||||
p->binding = binding;
|
||||
if (q != 0) {
|
||||
q->link = p;
|
||||
} else {
|
||||
all_bindings = p;
|
||||
}
|
||||
}
|
||||
#if defined(HAVE_DLG_TRACE) && defined(HAVE_RC_FILE)
|
||||
/*
|
||||
* Trace the binding information assigned to this window. For most widgets
|
||||
* there is only one binding table. forms have two, so the trace will be
|
||||
* longer. Since compiled-in bindings are only visible when the widget is
|
||||
* registered, there is no other way to see what bindings are available,
|
||||
* than by running dialog and tracing it.
|
||||
*/
|
||||
DLG_TRACE(("# dlg_register_window %s\n", name));
|
||||
dlg_dump_keys(dialog_state.trace_output);
|
||||
dlg_dump_window_keys(dialog_state.trace_output, win);
|
||||
DLG_TRACE(("# ...done dlg_register_window %s\n", name));
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Unlike dlg_lookup_key(), this looks for either widget-builtin or rc-file
|
||||
* definitions, depending on whether 'win' is null.
|
||||
*/
|
||||
static int
|
||||
key_is_bound(WINDOW *win, const char *name, int curses_key, int function_key)
|
||||
{
|
||||
LIST_BINDINGS *p;
|
||||
|
||||
for (p = all_bindings; p != 0; p = p->link) {
|
||||
if (p->win == win && !dlg_strcmp(p->name, name)) {
|
||||
int n;
|
||||
for (n = 0; p->binding[n].is_function_key >= 0; ++n) {
|
||||
if (p->binding[n].curses_key == curses_key
|
||||
&& p->binding[n].is_function_key == function_key) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call this function after dlg_register_window(), for the list of button
|
||||
* labels associated with the widget.
|
||||
*
|
||||
* Ensure that dlg_lookup_key() will not accidentally translate a key that
|
||||
* we would like to use for a button abbreviation to some other key, e.g.,
|
||||
* h/j/k/l for navigation into a cursor key. Do this by binding the key
|
||||
* to itself.
|
||||
*
|
||||
* See dlg_char_to_button().
|
||||
*/
|
||||
void
|
||||
dlg_register_buttons(WINDOW *win, const char *name, const char **buttons)
|
||||
{
|
||||
int n;
|
||||
LIST_BINDINGS *p;
|
||||
DLG_KEYS_BINDING *q;
|
||||
|
||||
if (buttons == 0)
|
||||
return;
|
||||
|
||||
for (n = 0; buttons[n] != 0; ++n) {
|
||||
int curses_key = dlg_button_to_char(buttons[n]);
|
||||
|
||||
/* ignore binding if there is no key to bind */
|
||||
if (curses_key < 0)
|
||||
continue;
|
||||
|
||||
/* ignore multibyte characters */
|
||||
if (curses_key >= KEY_MIN)
|
||||
continue;
|
||||
|
||||
/* if it is not bound in the widget, skip it (no conflicts) */
|
||||
if (!key_is_bound(win, name, curses_key, FALSE))
|
||||
continue;
|
||||
|
||||
#ifdef HAVE_RC_FILE
|
||||
/* if it is bound in the rc-file, skip it */
|
||||
if (key_is_bound(0, name, curses_key, FALSE))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if ((p = dlg_calloc(LIST_BINDINGS, 1)) != 0) {
|
||||
if ((q = dlg_calloc(DLG_KEYS_BINDING, 2)) != 0) {
|
||||
q[0].is_function_key = 0;
|
||||
q[0].curses_key = curses_key;
|
||||
q[0].dialog_key = curses_key;
|
||||
q[1] = end_keys_binding;
|
||||
|
||||
p->win = win;
|
||||
p->name = name;
|
||||
p->buttons = TRUE;
|
||||
p->binding = q;
|
||||
|
||||
/* put these at the beginning, to override the widget's table */
|
||||
p->link = all_bindings;
|
||||
all_bindings = p;
|
||||
} else {
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the bindings for a given window.
|
||||
*/
|
||||
void
|
||||
dlg_unregister_window(WINDOW *win)
|
||||
{
|
||||
LIST_BINDINGS *p, *q;
|
||||
|
||||
for (p = all_bindings, q = 0; p != 0; p = p->link) {
|
||||
if (p->win == win) {
|
||||
if (q != 0) {
|
||||
q->link = p->link;
|
||||
} else {
|
||||
all_bindings = p->link;
|
||||
}
|
||||
/* the user-defined and buttons-bindings all are length=1 */
|
||||
if (p->binding[1].is_function_key < 0)
|
||||
free(p->binding);
|
||||
free(p);
|
||||
dlg_unregister_window(win);
|
||||
break;
|
||||
}
|
||||
q = p;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Call this after wgetch(), using the same window pointer and passing
|
||||
* the curses-key.
|
||||
*
|
||||
* If there is no binding associated with the widget, it simply returns
|
||||
* the given curses-key.
|
||||
*
|
||||
* Parameters:
|
||||
* win is the window on which the wgetch() was done.
|
||||
* curses_key is the value returned by wgetch().
|
||||
* fkey in/out (on input, it is nonzero if curses_key is a function key,
|
||||
* and on output, it is nonzero if the result is a function key).
|
||||
*/
|
||||
int
|
||||
dlg_lookup_key(WINDOW *win, int curses_key, int *fkey)
|
||||
{
|
||||
LIST_BINDINGS *p;
|
||||
DLG_KEYS_BINDING *q;
|
||||
|
||||
/*
|
||||
* Ignore mouse clicks, since they are already encoded properly.
|
||||
*/
|
||||
#ifdef KEY_MOUSE
|
||||
if (*fkey != 0 && curses_key == KEY_MOUSE) {
|
||||
;
|
||||
} else
|
||||
#endif
|
||||
/*
|
||||
* Ignore resize events, since they are already encoded properly.
|
||||
*/
|
||||
#ifdef KEY_RESIZE
|
||||
if (*fkey != 0 && curses_key == KEY_RESIZE) {
|
||||
;
|
||||
} else
|
||||
#endif
|
||||
if (*fkey == 0 || curses_key < KEY_MAX) {
|
||||
const char *name = WILDNAME;
|
||||
if (win != 0) {
|
||||
for (p = all_bindings; p != 0; p = p->link) {
|
||||
if (p->win == win) {
|
||||
name = p->name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (p = all_bindings; p != 0; p = p->link) {
|
||||
if (p->win == win ||
|
||||
(p->win == 0 &&
|
||||
(!strcmp(p->name, name) || !strcmp(p->name, WILDNAME)))) {
|
||||
int function_key = (*fkey != 0);
|
||||
for (q = p->binding; q->is_function_key >= 0; ++q) {
|
||||
if (p->buttons
|
||||
&& !function_key
|
||||
&& q->curses_key == (int) dlg_toupper(curses_key)) {
|
||||
*fkey = 0;
|
||||
return q->dialog_key;
|
||||
}
|
||||
if (q->curses_key == curses_key
|
||||
&& q->is_function_key == function_key) {
|
||||
*fkey = q->dialog_key;
|
||||
return *fkey;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return curses_key;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test a dialog internal keycode to see if it corresponds to one of the push
|
||||
* buttons on the widget such as "OK".
|
||||
*
|
||||
* This is only useful if there are user-defined key bindings, since there are
|
||||
* no built-in bindings that map directly to DLGK_OK, etc.
|
||||
*
|
||||
* See also dlg_ok_buttoncode().
|
||||
*/
|
||||
int
|
||||
dlg_result_key(int dialog_key, int fkey GCC_UNUSED, int *resultp)
|
||||
{
|
||||
int done = FALSE;
|
||||
|
||||
DLG_TRACE(("# dlg_result_key(dialog_key=%d, fkey=%d)\n", dialog_key, fkey));
|
||||
#ifdef KEY_RESIZE
|
||||
if (dialog_state.had_resize) {
|
||||
if (dialog_key == ERR) {
|
||||
dialog_key = 0;
|
||||
} else {
|
||||
dialog_state.had_resize = FALSE;
|
||||
}
|
||||
} else if (fkey && dialog_key == KEY_RESIZE) {
|
||||
dialog_state.had_resize = TRUE;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_RC_FILE
|
||||
if (fkey) {
|
||||
switch ((DLG_KEYS_ENUM) dialog_key) {
|
||||
case DLGK_OK:
|
||||
if (!dialog_vars.nook) {
|
||||
*resultp = DLG_EXIT_OK;
|
||||
done = TRUE;
|
||||
}
|
||||
break;
|
||||
case DLGK_CANCEL:
|
||||
if (!dialog_vars.nocancel) {
|
||||
*resultp = DLG_EXIT_CANCEL;
|
||||
done = TRUE;
|
||||
}
|
||||
break;
|
||||
case DLGK_EXTRA:
|
||||
if (dialog_vars.extra_button) {
|
||||
*resultp = DLG_EXIT_EXTRA;
|
||||
done = TRUE;
|
||||
}
|
||||
break;
|
||||
case DLGK_HELP:
|
||||
if (dialog_vars.help_button) {
|
||||
*resultp = DLG_EXIT_HELP;
|
||||
done = TRUE;
|
||||
}
|
||||
break;
|
||||
case DLGK_ESC:
|
||||
*resultp = DLG_EXIT_ESC;
|
||||
done = TRUE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (dialog_key == ESC) {
|
||||
*resultp = DLG_EXIT_ESC;
|
||||
done = TRUE;
|
||||
} else if (dialog_key == ERR) {
|
||||
*resultp = DLG_EXIT_ERROR;
|
||||
done = TRUE;
|
||||
}
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
/*
|
||||
* If a key was bound to one of the button-codes in dlg_result_key(), fake
|
||||
* a button-value and an "Enter" key to cause the calling widget to return
|
||||
* the corresponding status.
|
||||
*
|
||||
* See dlg_ok_buttoncode(), which maps settings for ok/extra/help and button
|
||||
* number into exit-code.
|
||||
*/
|
||||
int
|
||||
dlg_button_key(int exit_code, int *button, int *dialog_key, int *fkey)
|
||||
{
|
||||
int changed = FALSE;
|
||||
switch (exit_code) {
|
||||
case DLG_EXIT_OK:
|
||||
if (!dialog_vars.nook) {
|
||||
*button = 0;
|
||||
changed = TRUE;
|
||||
}
|
||||
break;
|
||||
case DLG_EXIT_EXTRA:
|
||||
if (dialog_vars.extra_button) {
|
||||
*button = dialog_vars.nook ? 0 : 1;
|
||||
changed = TRUE;
|
||||
}
|
||||
break;
|
||||
case DLG_EXIT_CANCEL:
|
||||
if (!dialog_vars.nocancel) {
|
||||
*button = dialog_vars.nook ? 1 : 2;
|
||||
changed = TRUE;
|
||||
}
|
||||
break;
|
||||
case DLG_EXIT_HELP:
|
||||
if (dialog_vars.help_button) {
|
||||
int cancel = dialog_vars.nocancel ? 0 : 1;
|
||||
int extra = dialog_vars.extra_button ? 1 : 0;
|
||||
int okay = dialog_vars.nook ? 0 : 1;
|
||||
*button = okay + extra + cancel;
|
||||
changed = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (changed) {
|
||||
DLG_TRACE(("# dlg_button_key(%d:%s) button %d\n",
|
||||
exit_code, dlg_exitcode2s(exit_code), *button));
|
||||
*dialog_key = *fkey = DLGK_ENTER;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
int
|
||||
dlg_ok_button_key(int exit_code, int *button, int *dialog_key, int *fkey)
|
||||
{
|
||||
int result;
|
||||
DIALOG_VARS save;
|
||||
|
||||
dlg_save_vars(&save);
|
||||
dialog_vars.nocancel = TRUE;
|
||||
|
||||
result = dlg_button_key(exit_code, button, dialog_key, fkey);
|
||||
|
||||
dlg_restore_vars(&save);
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef HAVE_RC_FILE
|
||||
typedef struct {
|
||||
const char *name;
|
||||
int code;
|
||||
} CODENAME;
|
||||
|
||||
#define ASCII_NAME(name,code) { #name, code }
|
||||
#define CURSES_NAME(upper) { #upper, KEY_ ## upper }
|
||||
#define COUNT_CURSES TableSize(curses_names)
|
||||
static const CODENAME curses_names[] =
|
||||
{
|
||||
ASCII_NAME(ESC, '\033'),
|
||||
ASCII_NAME(CR, '\r'),
|
||||
ASCII_NAME(LF, '\n'),
|
||||
ASCII_NAME(FF, '\f'),
|
||||
ASCII_NAME(TAB, '\t'),
|
||||
ASCII_NAME(DEL, '\177'),
|
||||
|
||||
CURSES_NAME(DOWN),
|
||||
CURSES_NAME(UP),
|
||||
CURSES_NAME(LEFT),
|
||||
CURSES_NAME(RIGHT),
|
||||
CURSES_NAME(HOME),
|
||||
CURSES_NAME(BACKSPACE),
|
||||
CURSES_NAME(F0),
|
||||
CURSES_NAME(DL),
|
||||
CURSES_NAME(IL),
|
||||
CURSES_NAME(DC),
|
||||
CURSES_NAME(IC),
|
||||
CURSES_NAME(EIC),
|
||||
CURSES_NAME(CLEAR),
|
||||
CURSES_NAME(EOS),
|
||||
CURSES_NAME(EOL),
|
||||
CURSES_NAME(SF),
|
||||
CURSES_NAME(SR),
|
||||
CURSES_NAME(NPAGE),
|
||||
CURSES_NAME(PPAGE),
|
||||
CURSES_NAME(STAB),
|
||||
CURSES_NAME(CTAB),
|
||||
CURSES_NAME(CATAB),
|
||||
CURSES_NAME(ENTER),
|
||||
CURSES_NAME(PRINT),
|
||||
CURSES_NAME(LL),
|
||||
CURSES_NAME(A1),
|
||||
CURSES_NAME(A3),
|
||||
CURSES_NAME(B2),
|
||||
CURSES_NAME(C1),
|
||||
CURSES_NAME(C3),
|
||||
CURSES_NAME(BTAB),
|
||||
CURSES_NAME(BEG),
|
||||
CURSES_NAME(CANCEL),
|
||||
CURSES_NAME(CLOSE),
|
||||
CURSES_NAME(COMMAND),
|
||||
CURSES_NAME(COPY),
|
||||
CURSES_NAME(CREATE),
|
||||
CURSES_NAME(END),
|
||||
CURSES_NAME(EXIT),
|
||||
CURSES_NAME(FIND),
|
||||
CURSES_NAME(HELP),
|
||||
CURSES_NAME(MARK),
|
||||
CURSES_NAME(MESSAGE),
|
||||
CURSES_NAME(MOVE),
|
||||
CURSES_NAME(NEXT),
|
||||
CURSES_NAME(OPEN),
|
||||
CURSES_NAME(OPTIONS),
|
||||
CURSES_NAME(PREVIOUS),
|
||||
CURSES_NAME(REDO),
|
||||
CURSES_NAME(REFERENCE),
|
||||
CURSES_NAME(REFRESH),
|
||||
CURSES_NAME(REPLACE),
|
||||
CURSES_NAME(RESTART),
|
||||
CURSES_NAME(RESUME),
|
||||
CURSES_NAME(SAVE),
|
||||
CURSES_NAME(SBEG),
|
||||
CURSES_NAME(SCANCEL),
|
||||
CURSES_NAME(SCOMMAND),
|
||||
CURSES_NAME(SCOPY),
|
||||
CURSES_NAME(SCREATE),
|
||||
CURSES_NAME(SDC),
|
||||
CURSES_NAME(SDL),
|
||||
CURSES_NAME(SELECT),
|
||||
CURSES_NAME(SEND),
|
||||
CURSES_NAME(SEOL),
|
||||
CURSES_NAME(SEXIT),
|
||||
CURSES_NAME(SFIND),
|
||||
CURSES_NAME(SHELP),
|
||||
CURSES_NAME(SHOME),
|
||||
CURSES_NAME(SIC),
|
||||
CURSES_NAME(SLEFT),
|
||||
CURSES_NAME(SMESSAGE),
|
||||
CURSES_NAME(SMOVE),
|
||||
CURSES_NAME(SNEXT),
|
||||
CURSES_NAME(SOPTIONS),
|
||||
CURSES_NAME(SPREVIOUS),
|
||||
CURSES_NAME(SPRINT),
|
||||
CURSES_NAME(SREDO),
|
||||
CURSES_NAME(SREPLACE),
|
||||
CURSES_NAME(SRIGHT),
|
||||
CURSES_NAME(SRSUME),
|
||||
CURSES_NAME(SSAVE),
|
||||
CURSES_NAME(SSUSPEND),
|
||||
CURSES_NAME(SUNDO),
|
||||
CURSES_NAME(SUSPEND),
|
||||
CURSES_NAME(UNDO),
|
||||
};
|
||||
|
||||
#define DIALOG_NAME(upper) { #upper, DLGK_ ## upper }
|
||||
#define COUNT_DIALOG TableSize(dialog_names)
|
||||
static const CODENAME dialog_names[] =
|
||||
{
|
||||
DIALOG_NAME(OK),
|
||||
DIALOG_NAME(CANCEL),
|
||||
DIALOG_NAME(EXTRA),
|
||||
DIALOG_NAME(HELP),
|
||||
DIALOG_NAME(ESC),
|
||||
DIALOG_NAME(PAGE_FIRST),
|
||||
DIALOG_NAME(PAGE_LAST),
|
||||
DIALOG_NAME(PAGE_NEXT),
|
||||
DIALOG_NAME(PAGE_PREV),
|
||||
DIALOG_NAME(ITEM_FIRST),
|
||||
DIALOG_NAME(ITEM_LAST),
|
||||
DIALOG_NAME(ITEM_NEXT),
|
||||
DIALOG_NAME(ITEM_PREV),
|
||||
DIALOG_NAME(FIELD_FIRST),
|
||||
DIALOG_NAME(FIELD_LAST),
|
||||
DIALOG_NAME(FIELD_NEXT),
|
||||
DIALOG_NAME(FIELD_PREV),
|
||||
DIALOG_NAME(FORM_FIRST),
|
||||
DIALOG_NAME(FORM_LAST),
|
||||
DIALOG_NAME(FORM_NEXT),
|
||||
DIALOG_NAME(FORM_PREV),
|
||||
DIALOG_NAME(GRID_UP),
|
||||
DIALOG_NAME(GRID_DOWN),
|
||||
DIALOG_NAME(GRID_LEFT),
|
||||
DIALOG_NAME(GRID_RIGHT),
|
||||
DIALOG_NAME(DELETE_LEFT),
|
||||
DIALOG_NAME(DELETE_RIGHT),
|
||||
DIALOG_NAME(DELETE_ALL),
|
||||
DIALOG_NAME(ENTER),
|
||||
DIALOG_NAME(BEGIN),
|
||||
DIALOG_NAME(FINAL),
|
||||
DIALOG_NAME(SELECT),
|
||||
DIALOG_NAME(HELPFILE),
|
||||
DIALOG_NAME(TRACE),
|
||||
DIALOG_NAME(TOGGLE),
|
||||
DIALOG_NAME(LEAVE)
|
||||
};
|
||||
|
||||
#define MAP2(letter,actual) { letter, actual }
|
||||
|
||||
static const struct {
|
||||
int letter;
|
||||
int actual;
|
||||
} escaped_letters[] = {
|
||||
|
||||
MAP2('a', DLG_CTRL('G')),
|
||||
MAP2('b', DLG_CTRL('H')),
|
||||
MAP2('f', DLG_CTRL('L')),
|
||||
MAP2('n', DLG_CTRL('J')),
|
||||
MAP2('r', DLG_CTRL('M')),
|
||||
MAP2('s', CHR_SPACE),
|
||||
MAP2('t', DLG_CTRL('I')),
|
||||
MAP2('\\', '\\'),
|
||||
};
|
||||
|
||||
#undef MAP2
|
||||
|
||||
static char *
|
||||
skip_white(char *s)
|
||||
{
|
||||
while (*s != '\0' && isspace(UCH(*s)))
|
||||
++s;
|
||||
return s;
|
||||
}
|
||||
|
||||
static char *
|
||||
skip_black(char *s)
|
||||
{
|
||||
while (*s != '\0' && !isspace(UCH(*s)))
|
||||
++s;
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find a user-defined binding, given the curses key code.
|
||||
*/
|
||||
static DLG_KEYS_BINDING *
|
||||
find_binding(char *widget, int curses_key)
|
||||
{
|
||||
LIST_BINDINGS *p;
|
||||
DLG_KEYS_BINDING *result = 0;
|
||||
|
||||
for (p = all_bindings; p != 0; p = p->link) {
|
||||
if (p->win == 0
|
||||
&& !dlg_strcmp(p->name, widget)
|
||||
&& p->binding->curses_key == curses_key) {
|
||||
result = p->binding;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Built-in bindings have a nonzero "win" member, and the associated binding
|
||||
* table can have more than one entry. We keep those last, since lookups will
|
||||
* find the user-defined bindings first and use those.
|
||||
*
|
||||
* Sort "*" (all-widgets) entries past named widgets, since those are less
|
||||
* specific.
|
||||
*/
|
||||
static int
|
||||
compare_bindings(LIST_BINDINGS * a, LIST_BINDINGS * b)
|
||||
{
|
||||
int result = 0;
|
||||
if (a->win == b->win) {
|
||||
if (!strcmp(a->name, b->name)) {
|
||||
result = a->binding[0].curses_key - b->binding[0].curses_key;
|
||||
} else if (!strcmp(b->name, WILDNAME)) {
|
||||
result = -1;
|
||||
} else if (!strcmp(a->name, WILDNAME)) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = dlg_strcmp(a->name, b->name);
|
||||
}
|
||||
} else if (b->win) {
|
||||
result = -1;
|
||||
} else {
|
||||
result = 1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find a user-defined binding, given the curses key code. If it does not
|
||||
* exist, create a new one, inserting it into the linked list, keeping it
|
||||
* sorted to simplify lookups for user-defined bindings that can override
|
||||
* the built-in bindings.
|
||||
*/
|
||||
static DLG_KEYS_BINDING *
|
||||
make_binding(char *widget, int curses_key, int is_function, int dialog_key)
|
||||
{
|
||||
LIST_BINDINGS *entry = 0;
|
||||
DLG_KEYS_BINDING *data = 0;
|
||||
char *name;
|
||||
DLG_KEYS_BINDING *result = find_binding(widget, curses_key);
|
||||
|
||||
if (result == 0
|
||||
&& (entry = dlg_calloc(LIST_BINDINGS, 1)) != 0
|
||||
&& (data = dlg_calloc(DLG_KEYS_BINDING, 2)) != 0
|
||||
&& (name = dlg_strclone(widget)) != 0) {
|
||||
LIST_BINDINGS *p, *q;
|
||||
|
||||
entry->name = name;
|
||||
entry->binding = data;
|
||||
|
||||
data[0].is_function_key = is_function;
|
||||
data[0].curses_key = curses_key;
|
||||
data[0].dialog_key = dialog_key;
|
||||
|
||||
data[1] = end_keys_binding;
|
||||
|
||||
for (p = all_bindings, q = 0; p != 0; q = p, p = p->link) {
|
||||
if (compare_bindings(entry, p) < 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (q != 0) {
|
||||
q->link = entry;
|
||||
} else {
|
||||
all_bindings = entry;
|
||||
}
|
||||
if (p != 0) {
|
||||
entry->link = p;
|
||||
}
|
||||
result = data;
|
||||
} else if (entry != 0) {
|
||||
free(entry);
|
||||
if (data)
|
||||
free(data);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static int
|
||||
decode_escaped(char **string)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (IsOctal(**string)) {
|
||||
int limit = 3;
|
||||
while (limit-- > 0 && IsOctal(**string)) {
|
||||
int ch = (**string);
|
||||
*string += 1;
|
||||
result = (result << 3) | (ch - '0');
|
||||
}
|
||||
} else {
|
||||
unsigned n;
|
||||
|
||||
for (n = 0; n < TableSize(escaped_letters); ++n) {
|
||||
if (**string == escaped_letters[n].letter) {
|
||||
*string += 1;
|
||||
result = escaped_letters[n].actual;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static char *
|
||||
encode_escaped(int value)
|
||||
{
|
||||
static char result[80];
|
||||
unsigned n;
|
||||
bool found = FALSE;
|
||||
for (n = 0; n < TableSize(escaped_letters); ++n) {
|
||||
if (value == escaped_letters[n].actual) {
|
||||
found = TRUE;
|
||||
sprintf(result, "%c", escaped_letters[n].letter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
sprintf(result, "%03o", value & 0xff);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse the parameters of the "bindkey" configuration-file entry. This
|
||||
* expects widget name which may be "*", followed by curses key definition and
|
||||
* then dialog key definition.
|
||||
*
|
||||
* The curses key "should" be one of the names (ignoring case) from
|
||||
* curses_names[], but may also be a single control character (prefix "^" or
|
||||
* "~" depending on whether it is C0 or C1), or an escaped single character.
|
||||
* Binding a printable character with dialog is possible but not useful.
|
||||
*
|
||||
* The dialog key must be one of the names from dialog_names[].
|
||||
*/
|
||||
int
|
||||
dlg_parse_bindkey(char *params)
|
||||
{
|
||||
char *p = skip_white(params);
|
||||
int result = FALSE;
|
||||
char *widget;
|
||||
int curses_key;
|
||||
int dialog_key;
|
||||
|
||||
curses_key = -1;
|
||||
dialog_key = -1;
|
||||
widget = p;
|
||||
|
||||
p = skip_black(p);
|
||||
if (p != widget && *p != '\0') {
|
||||
char *q;
|
||||
unsigned xx;
|
||||
bool escaped = FALSE;
|
||||
int modified = 0;
|
||||
int is_function = FALSE;
|
||||
|
||||
*p++ = '\0';
|
||||
p = skip_white(p);
|
||||
q = p;
|
||||
while (*p != '\0' && curses_key < 0) {
|
||||
if (escaped) {
|
||||
escaped = FALSE;
|
||||
curses_key = decode_escaped(&p);
|
||||
} else if (*p == CHR_BACKSLASH) {
|
||||
escaped = TRUE;
|
||||
} else if (modified) {
|
||||
if (*p == '?') {
|
||||
curses_key = ((modified == '^')
|
||||
? 127
|
||||
: 255);
|
||||
} else {
|
||||
curses_key = ((modified == '^')
|
||||
? (*p & 0x1f)
|
||||
: ((*p & 0x1f) | 0x80));
|
||||
}
|
||||
} else if (*p == '^') {
|
||||
modified = *p;
|
||||
} else if (*p == '~') {
|
||||
modified = *p;
|
||||
} else if (isspace(UCH(*p))) {
|
||||
break;
|
||||
}
|
||||
++p;
|
||||
}
|
||||
if (!isspace(UCH(*p))) {
|
||||
;
|
||||
} else {
|
||||
*p++ = '\0';
|
||||
if (curses_key < 0) {
|
||||
char fprefix[2];
|
||||
char check[2];
|
||||
int keynumber;
|
||||
if (sscanf(q, "%1[Ff]%d%c", fprefix, &keynumber, check) == 2) {
|
||||
curses_key = KEY_F(keynumber);
|
||||
is_function = TRUE;
|
||||
} else {
|
||||
for (xx = 0; xx < COUNT_CURSES; ++xx) {
|
||||
if (!dlg_strcmp(curses_names[xx].name, q)) {
|
||||
curses_key = curses_names[xx].code;
|
||||
is_function = (curses_key >= KEY_MIN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
q = skip_white(p);
|
||||
p = skip_black(q);
|
||||
if (p != q) {
|
||||
for (xx = 0; xx < COUNT_DIALOG; ++xx) {
|
||||
if (!dlg_strcmp(dialog_names[xx].name, q)) {
|
||||
dialog_key = dialog_names[xx].code;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (*widget != '\0'
|
||||
&& curses_key >= 0
|
||||
&& dialog_key >= 0
|
||||
&& make_binding(widget, curses_key, is_function, dialog_key) != 0) {
|
||||
result = TRUE;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
dump_curses_key(FILE *fp, int curses_key)
|
||||
{
|
||||
if (curses_key > KEY_MIN) {
|
||||
unsigned n;
|
||||
bool found = FALSE;
|
||||
for (n = 0; n < COUNT_CURSES; ++n) {
|
||||
if (curses_names[n].code == curses_key) {
|
||||
fprintf(fp, "%s", curses_names[n].name);
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
#ifdef KEY_MOUSE
|
||||
if (is_DLGK_MOUSE(curses_key)) {
|
||||
fprintf(fp, "MOUSE-");
|
||||
dump_curses_key(fp, curses_key - M_EVENT);
|
||||
} else
|
||||
#endif
|
||||
if (curses_key >= KEY_F(0)) {
|
||||
fprintf(fp, "F%d", curses_key - KEY_F(0));
|
||||
} else {
|
||||
fprintf(fp, "curses%d", curses_key);
|
||||
}
|
||||
}
|
||||
} else if (curses_key >= 0 && curses_key < 32) {
|
||||
fprintf(fp, "^%c", curses_key + 64);
|
||||
} else if (curses_key == 127) {
|
||||
fprintf(fp, "^?");
|
||||
} else if (curses_key >= 128 && curses_key < 160) {
|
||||
fprintf(fp, "~%c", curses_key - 64);
|
||||
} else if (curses_key == 255) {
|
||||
fprintf(fp, "~?");
|
||||
} else if (curses_key > 32 &&
|
||||
curses_key < 127 &&
|
||||
curses_key != CHR_BACKSLASH) {
|
||||
fprintf(fp, "%c", curses_key);
|
||||
} else {
|
||||
fprintf(fp, "%c%s", CHR_BACKSLASH, encode_escaped(curses_key));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dump_dialog_key(FILE *fp, int dialog_key)
|
||||
{
|
||||
unsigned n;
|
||||
bool found = FALSE;
|
||||
for (n = 0; n < COUNT_DIALOG; ++n) {
|
||||
if (dialog_names[n].code == dialog_key) {
|
||||
fputs(dialog_names[n].name, fp);
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
fprintf(fp, "dialog%d", dialog_key);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dump_one_binding(FILE *fp,
|
||||
WINDOW *win,
|
||||
const char *widget,
|
||||
DLG_KEYS_BINDING * binding)
|
||||
{
|
||||
int actual;
|
||||
int fkey = (binding->curses_key > 255);
|
||||
|
||||
fprintf(fp, "bindkey %s ", widget);
|
||||
dump_curses_key(fp, binding->curses_key);
|
||||
fputc(' ', fp);
|
||||
dump_dialog_key(fp, binding->dialog_key);
|
||||
actual = dlg_lookup_key(win, binding->curses_key, &fkey);
|
||||
#ifdef KEY_MOUSE
|
||||
if (is_DLGK_MOUSE(binding->curses_key) && is_DLGK_MOUSE(actual)) {
|
||||
; /* EMPTY */
|
||||
} else
|
||||
#endif
|
||||
if (actual != binding->dialog_key) {
|
||||
fprintf(fp, "\t# overridden by ");
|
||||
dump_dialog_key(fp, actual);
|
||||
}
|
||||
fputc('\n', fp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Dump bindings for the given window. If it is a null, then this dumps the
|
||||
* initial bindings which were loaded from the rc-file that are used as
|
||||
* overall defaults.
|
||||
*/
|
||||
void
|
||||
dlg_dump_window_keys(FILE *fp, WINDOW *win)
|
||||
{
|
||||
if (fp != 0) {
|
||||
LIST_BINDINGS *p;
|
||||
DLG_KEYS_BINDING *q;
|
||||
const char *last = "";
|
||||
|
||||
for (p = all_bindings; p != 0; p = p->link) {
|
||||
if (p->win == win) {
|
||||
if (dlg_strcmp(last, p->name)) {
|
||||
fprintf(fp, "# key bindings for %s widgets%s\n",
|
||||
!strcmp(p->name, WILDNAME) ? "all" : p->name,
|
||||
win == 0 ? " (user-defined)" : "");
|
||||
last = p->name;
|
||||
}
|
||||
for (q = p->binding; q->is_function_key >= 0; ++q) {
|
||||
dump_one_binding(fp, win, p->name, q);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Dump all of the bindings which are not specific to a given widget, i.e.,
|
||||
* the "win" member is null.
|
||||
*/
|
||||
void
|
||||
dlg_dump_keys(FILE *fp)
|
||||
{
|
||||
if (fp != 0) {
|
||||
LIST_BINDINGS *p;
|
||||
unsigned count = 0;
|
||||
|
||||
for (p = all_bindings; p != 0; p = p->link) {
|
||||
if (p->win == 0) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
if (count != 0) {
|
||||
dlg_dump_window_keys(fp, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_RC_FILE */
|
||||
@@ -1,182 +0,0 @@
|
||||
/*
|
||||
* $Id: dlg_keys.h,v 1.39 2020/11/22 23:19:24 tom Exp $
|
||||
*
|
||||
* dlg_keys.h -- runtime binding support for dialog
|
||||
*
|
||||
* Copyright 2005-2019,2020 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#ifndef DLG_KEYS_H_included
|
||||
#define DLG_KEYS_H_included 1
|
||||
/* *INDENT-OFF* */
|
||||
|
||||
#include <dialog.h>
|
||||
|
||||
#ifdef USE_WIDE_CURSES
|
||||
#include <wctype.h>
|
||||
#define dlg_toupper(ch) towupper((wint_t)ch)
|
||||
#define dlg_isupper(ch) iswupper((wint_t)ch)
|
||||
#else
|
||||
#define dlg_toupper(ch) (((ch) > 0 && (ch) <= 255) ? toupper(ch) : (ch))
|
||||
#define dlg_isupper(ch) (isalpha(ch) && isupper(ch))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int is_function_key;
|
||||
int curses_key;
|
||||
int dialog_key;
|
||||
} DLG_KEYS_BINDING;
|
||||
|
||||
#define DLG_KEYS_DATA(dialog, curses) { (curses) >= KEY_MIN, curses, dialog }
|
||||
|
||||
#define END_KEYS_BINDING { -1, 0, 0 }
|
||||
|
||||
/*
|
||||
* Define dialog's internal function-keys past the range used by curses.
|
||||
*/
|
||||
typedef enum {
|
||||
DLGK_MIN = KEY_MAX + 1,
|
||||
/* predefined buttons */
|
||||
DLGK_OK,
|
||||
DLGK_CANCEL,
|
||||
DLGK_EXTRA,
|
||||
DLGK_HELP,
|
||||
DLGK_ESC,
|
||||
/* moving from screen to screen (pages) */
|
||||
DLGK_PAGE_FIRST,
|
||||
DLGK_PAGE_LAST,
|
||||
DLGK_PAGE_NEXT,
|
||||
DLGK_PAGE_PREV,
|
||||
/* moving within a list */
|
||||
DLGK_ITEM_FIRST,
|
||||
DLGK_ITEM_LAST,
|
||||
DLGK_ITEM_NEXT,
|
||||
DLGK_ITEM_PREV,
|
||||
/* moving from field to field (or buttons) */
|
||||
DLGK_FIELD_FIRST,
|
||||
DLGK_FIELD_LAST,
|
||||
DLGK_FIELD_NEXT,
|
||||
DLGK_FIELD_PREV,
|
||||
/* moving from form-field to form-field (or buttons) */
|
||||
DLGK_FORM_FIRST,
|
||||
DLGK_FORM_LAST,
|
||||
DLGK_FORM_NEXT,
|
||||
DLGK_FORM_PREV,
|
||||
/* moving within a grid */
|
||||
DLGK_GRID_UP,
|
||||
DLGK_GRID_DOWN,
|
||||
DLGK_GRID_LEFT,
|
||||
DLGK_GRID_RIGHT,
|
||||
/* delete */
|
||||
DLGK_DELETE_LEFT,
|
||||
DLGK_DELETE_RIGHT,
|
||||
DLGK_DELETE_ALL,
|
||||
/* special */
|
||||
DLGK_ENTER,
|
||||
DLGK_BEGIN,
|
||||
DLGK_FINAL,
|
||||
DLGK_SELECT,
|
||||
DLGK_HELPFILE,
|
||||
DLGK_TRACE,
|
||||
DLGK_TOGGLE,
|
||||
DLGK_LEAVE
|
||||
} DLG_KEYS_ENUM;
|
||||
|
||||
#define is_DLGK_MOUSE(code) ((code) >= M_EVENT)
|
||||
#define DLGK_MOUSE(code) ((code) + M_EVENT)
|
||||
|
||||
#define HELPKEY_BINDINGS \
|
||||
DLG_KEYS_DATA( DLGK_HELPFILE, CHR_HELP ), \
|
||||
DLG_KEYS_DATA( DLGK_HELPFILE, KEY_F(1) ), \
|
||||
DLG_KEYS_DATA( DLGK_HELPFILE, KEY_HELP )
|
||||
|
||||
#define ENTERKEY_BINDINGS \
|
||||
DLG_KEYS_DATA( DLGK_ENTER, '\n' ), \
|
||||
DLG_KEYS_DATA( DLGK_ENTER, '\r' ), \
|
||||
DLG_KEYS_DATA( DLGK_ENTER, KEY_ENTER ), \
|
||||
DLG_KEYS_DATA( DLGK_LEAVE, CHR_LEAVE )
|
||||
|
||||
/* ^U == 21 */
|
||||
#define INPUTSTR_BINDINGS \
|
||||
DLG_KEYS_DATA( DLGK_BEGIN, KEY_HOME ), \
|
||||
DLG_KEYS_DATA( DLGK_DELETE_ALL, CHR_KILL ), \
|
||||
DLG_KEYS_DATA( DLGK_DELETE_LEFT, CHR_BACKSPACE ), \
|
||||
DLG_KEYS_DATA( DLGK_DELETE_LEFT, KEY_BACKSPACE ), \
|
||||
DLG_KEYS_DATA( DLGK_DELETE_RIGHT, CHR_DELETE ), \
|
||||
DLG_KEYS_DATA( DLGK_DELETE_RIGHT, KEY_DC ), \
|
||||
DLG_KEYS_DATA( DLGK_FINAL, KEY_END ), \
|
||||
DLG_KEYS_DATA( DLGK_GRID_LEFT, KEY_LEFT ), \
|
||||
DLG_KEYS_DATA( DLGK_GRID_RIGHT, KEY_RIGHT )
|
||||
|
||||
#define SCROLL_FKEY_BINDINGS \
|
||||
DLG_KEYS_DATA( DLGK_GRID_DOWN, KEY_DOWN ), \
|
||||
DLG_KEYS_DATA( DLGK_GRID_UP, KEY_UP ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_FIRST, KEY_HOME ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_END ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE )
|
||||
|
||||
#define SCROLLKEY_BINDINGS \
|
||||
SCROLL_FKEY_BINDINGS, \
|
||||
DLG_KEYS_DATA( DLGK_GRID_DOWN, 'J' ), \
|
||||
DLG_KEYS_DATA( DLGK_GRID_DOWN, 'j' ), \
|
||||
DLG_KEYS_DATA( DLGK_GRID_UP, 'K' ), \
|
||||
DLG_KEYS_DATA( DLGK_GRID_UP, 'k' ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_FIRST, 'g' ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_LAST, 'G' ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_NEXT, 'F' ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_NEXT, 'f' ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_PREV, 'B' ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_PREV, 'b' )
|
||||
|
||||
#define TRAVERSE_BINDINGS \
|
||||
DLG_KEYS_DATA( DLGK_ENTER, CHR_SPACE ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_DOWN ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_UP ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT )
|
||||
|
||||
#define TOGGLEKEY_BINDINGS \
|
||||
DLG_KEYS_DATA( DLGK_TOGGLE, CHR_SPACE )
|
||||
|
||||
extern int dlg_button_key(int /*exit_code*/, int * /*button*/, int * /*dialog_key*/, int * /*fkey*/);
|
||||
extern int dlg_lookup_key(WINDOW * /*win*/, int /*curses_key*/, int * /*dialog_key*/);
|
||||
extern int dlg_ok_button_key(int /*exit_code*/, int * /*button*/, int * /*dialog_key*/, int * /*fkey*/);
|
||||
extern int dlg_result_key(int /*dialog_key*/, int /*fkey*/, int * /*resultp*/);
|
||||
extern void dlg_register_buttons(WINDOW * /*win*/, const char * /*name*/, const char ** /*buttons*/);
|
||||
extern void dlg_register_window(WINDOW * /*win*/, const char * /*name*/, DLG_KEYS_BINDING * /*binding*/);
|
||||
extern void dlg_unregister_window(WINDOW * /*win*/);
|
||||
|
||||
#ifdef HAVE_RC_FILE
|
||||
extern int dlg_parse_bindkey(char * /*params*/);
|
||||
extern void dlg_dump_keys(FILE * /*fp*/);
|
||||
extern void dlg_dump_window_keys(FILE * /*fp*/, WINDOW * /*win*/);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#endif /* DLG_KEYS_H_included */
|
||||
@@ -1,771 +0,0 @@
|
||||
/*
|
||||
* $Id: editbox.c,v 1.80 2020/11/23 00:27:21 tom Exp $
|
||||
*
|
||||
* editbox.c -- implements the edit box
|
||||
*
|
||||
* Copyright 2007-2019,2020 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
#include <dlg_keys.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define sTEXT -1
|
||||
|
||||
static void
|
||||
fail_list(void)
|
||||
{
|
||||
dlg_exiterr("File too large");
|
||||
}
|
||||
|
||||
static void
|
||||
grow_list(char ***list, int *have, int want)
|
||||
{
|
||||
if (want > *have) {
|
||||
size_t last = (size_t) *have;
|
||||
size_t need = (size_t) (want | 31) + 3;
|
||||
*have = (int) need;
|
||||
(*list) = dlg_realloc(char *, need, *list);
|
||||
if ((*list) == 0) {
|
||||
fail_list();
|
||||
} else {
|
||||
while (++last < need) {
|
||||
(*list)[last] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
load_list(const char *file, char ***list, int *rows)
|
||||
{
|
||||
char *blob = 0;
|
||||
struct stat sb;
|
||||
size_t size;
|
||||
|
||||
*list = 0;
|
||||
*rows = 0;
|
||||
|
||||
if (stat(file, &sb) < 0 ||
|
||||
(sb.st_mode & S_IFMT) != S_IFREG)
|
||||
dlg_exiterr("Not a file: %s", file);
|
||||
|
||||
size = (size_t) sb.st_size;
|
||||
if ((blob = dlg_malloc(char, size + 2)) == 0) {
|
||||
fail_list();
|
||||
} else {
|
||||
FILE *fp;
|
||||
unsigned n, pass;
|
||||
|
||||
blob[size] = '\0';
|
||||
|
||||
if ((fp = fopen(file, "r")) == 0)
|
||||
dlg_exiterr("Cannot open: %s", file);
|
||||
size = fread(blob, sizeof(char), size, fp);
|
||||
fclose(fp);
|
||||
|
||||
/*
|
||||
* If the file is not empty, ensure that it ends with a newline.
|
||||
*/
|
||||
if (size != 0 && blob[size - 1] != '\n') {
|
||||
blob[++size - 1] = '\n';
|
||||
blob[size] = '\0';
|
||||
}
|
||||
|
||||
for (pass = 0; pass < 2; ++pass) {
|
||||
int first = TRUE;
|
||||
unsigned need = 0;
|
||||
|
||||
for (n = 0; n < size; ++n) {
|
||||
if (first && pass) {
|
||||
(*list)[need] = blob + n;
|
||||
first = FALSE;
|
||||
}
|
||||
if (blob[n] == '\n') {
|
||||
first = TRUE;
|
||||
++need;
|
||||
if (pass)
|
||||
blob[n] = '\0';
|
||||
}
|
||||
}
|
||||
if (pass) {
|
||||
if (need == 0) {
|
||||
(*list)[0] = dlg_strclone("");
|
||||
(*list)[1] = 0;
|
||||
} else {
|
||||
for (n = 0; n < need; ++n) {
|
||||
(*list)[n] = dlg_strclone((*list)[n]);
|
||||
}
|
||||
(*list)[need] = 0;
|
||||
}
|
||||
} else {
|
||||
grow_list(list, rows, (int) need + 1);
|
||||
}
|
||||
}
|
||||
free(blob);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
free_list(char ***list, int *rows)
|
||||
{
|
||||
if (*list != 0) {
|
||||
int n;
|
||||
for (n = 0; n < (*rows); ++n) {
|
||||
if ((*list)[n] != 0)
|
||||
free((*list)[n]);
|
||||
}
|
||||
free(*list);
|
||||
*list = 0;
|
||||
}
|
||||
*rows = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display a single row in the editing window:
|
||||
* thisrow is the actual row number that's being displayed.
|
||||
* show_row is the row number that's highlighted for edit.
|
||||
* base_row is the first row number in the window
|
||||
*/
|
||||
static bool
|
||||
display_one(WINDOW *win,
|
||||
char *text,
|
||||
int thisrow,
|
||||
int show_row,
|
||||
int base_row,
|
||||
int chr_offset)
|
||||
{
|
||||
bool result;
|
||||
|
||||
if (text != 0) {
|
||||
dlg_show_string(win,
|
||||
text,
|
||||
chr_offset,
|
||||
((thisrow == show_row)
|
||||
? form_active_text_attr
|
||||
: form_text_attr),
|
||||
thisrow - base_row,
|
||||
0,
|
||||
getmaxx(win),
|
||||
FALSE,
|
||||
FALSE);
|
||||
result = TRUE;
|
||||
} else {
|
||||
result = FALSE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
display_all(WINDOW *win,
|
||||
char **list,
|
||||
int show_row,
|
||||
int firstrow,
|
||||
int lastrow,
|
||||
int chr_offset)
|
||||
{
|
||||
int limit = getmaxy(win);
|
||||
int row;
|
||||
|
||||
dlg_attr_clear(win, getmaxy(win), getmaxx(win), dialog_attr);
|
||||
if (lastrow - firstrow >= limit)
|
||||
lastrow = firstrow + limit;
|
||||
for (row = firstrow; row < lastrow; ++row) {
|
||||
if (!display_one(win, list[row],
|
||||
row, show_row, firstrow,
|
||||
(row == show_row) ? chr_offset : 0))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
size_list(char **list)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
if (list != 0) {
|
||||
while (*list++ != 0) {
|
||||
++result;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool
|
||||
scroll_to(int pagesize, int rows, int *base_row, int *this_row, int target)
|
||||
{
|
||||
bool result = FALSE;
|
||||
|
||||
if (target < *base_row) {
|
||||
if (target < 0) {
|
||||
if (*base_row == 0 && *this_row == 0) {
|
||||
beep();
|
||||
} else {
|
||||
*this_row = 0;
|
||||
*base_row = 0;
|
||||
result = TRUE;
|
||||
}
|
||||
} else {
|
||||
*this_row = target;
|
||||
*base_row = target;
|
||||
result = TRUE;
|
||||
}
|
||||
} else if (target >= rows) {
|
||||
if (*this_row < rows - 1) {
|
||||
*this_row = rows - 1;
|
||||
*base_row = rows - 1;
|
||||
result = TRUE;
|
||||
} else {
|
||||
beep();
|
||||
}
|
||||
} else if (target >= *base_row + pagesize) {
|
||||
*this_row = target;
|
||||
*base_row = target;
|
||||
result = TRUE;
|
||||
} else {
|
||||
*this_row = target;
|
||||
result = FALSE;
|
||||
}
|
||||
if (pagesize < rows) {
|
||||
if (*base_row + pagesize >= rows) {
|
||||
*base_row = rows - pagesize;
|
||||
}
|
||||
} else {
|
||||
*base_row = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static int
|
||||
col_to_chr_offset(const char *text, int col)
|
||||
{
|
||||
const int *cols = dlg_index_columns(text);
|
||||
const int *indx = dlg_index_wchars(text);
|
||||
bool found = FALSE;
|
||||
int result = 0;
|
||||
unsigned n;
|
||||
unsigned len = (unsigned) dlg_count_wchars(text);
|
||||
|
||||
for (n = 0; n < len; ++n) {
|
||||
if (cols[n] <= col && cols[n + 1] > col) {
|
||||
result = indx[n];
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found && len && cols[len] == col) {
|
||||
result = indx[len];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#define Scroll_To(target) scroll_to(pagesize, listsize, &base_row, &thisrow, target)
|
||||
#define SCROLL_TO(target) show_all = Scroll_To(target)
|
||||
|
||||
#define PREV_ROW (*list)[thisrow - 1]
|
||||
#define THIS_ROW (*list)[thisrow]
|
||||
#define NEXT_ROW (*list)[thisrow + 1]
|
||||
|
||||
#define UPDATE_COL(input) col_offset = dlg_edit_offset(input, chr_offset, box_width)
|
||||
|
||||
static int
|
||||
widest_line(char **list)
|
||||
{
|
||||
int result = MAX_LEN;
|
||||
|
||||
if (list != 0) {
|
||||
char *value;
|
||||
|
||||
while ((value = *list++) != 0) {
|
||||
int check = (int) strlen(value);
|
||||
if (check > result)
|
||||
result = check;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#define NAVIGATE_BINDINGS \
|
||||
DLG_KEYS_DATA( DLGK_GRID_DOWN, KEY_DOWN ), \
|
||||
DLG_KEYS_DATA( DLGK_GRID_RIGHT, KEY_RIGHT ), \
|
||||
DLG_KEYS_DATA( DLGK_GRID_LEFT, KEY_LEFT ), \
|
||||
DLG_KEYS_DATA( DLGK_GRID_UP, KEY_UP ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_FIRST, KEY_HOME ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_END ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_LL ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_NEXT, DLGK_MOUSE(KEY_NPAGE) ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_PREV, DLGK_MOUSE(KEY_PPAGE) )
|
||||
/*
|
||||
* Display a dialog box for editing a copy of a file
|
||||
*/
|
||||
int
|
||||
dlg_editbox(const char *title,
|
||||
char ***list,
|
||||
int *rows,
|
||||
int height,
|
||||
int width)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
static DLG_KEYS_BINDING binding[] = {
|
||||
HELPKEY_BINDINGS,
|
||||
ENTERKEY_BINDINGS,
|
||||
NAVIGATE_BINDINGS,
|
||||
TOGGLEKEY_BINDINGS,
|
||||
END_KEYS_BINDING
|
||||
};
|
||||
static DLG_KEYS_BINDING binding2[] = {
|
||||
INPUTSTR_BINDINGS,
|
||||
HELPKEY_BINDINGS,
|
||||
ENTERKEY_BINDINGS,
|
||||
NAVIGATE_BINDINGS,
|
||||
/* no TOGGLEKEY_BINDINGS, since that includes space... */
|
||||
END_KEYS_BINDING
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
int old_height = height;
|
||||
int old_width = width;
|
||||
#endif
|
||||
int x, y, box_y, box_x, box_height, box_width;
|
||||
int show_buttons;
|
||||
int thisrow, base_row, lastrow;
|
||||
int goal_col = -1;
|
||||
int col_offset = 0;
|
||||
int chr_offset = 0;
|
||||
int key, fkey, code;
|
||||
int pagesize;
|
||||
int listsize = size_list(*list);
|
||||
int result = DLG_EXIT_UNKNOWN;
|
||||
int state;
|
||||
size_t max_len = (size_t) dlg_max_input(widest_line(*list));
|
||||
char *buffer;
|
||||
bool show_all, show_one;
|
||||
bool first_trace = TRUE;
|
||||
WINDOW *dialog;
|
||||
WINDOW *editing;
|
||||
DIALOG_VARS save_vars;
|
||||
const char **buttons = dlg_ok_labels();
|
||||
int mincols = (3 * COLS / 4);
|
||||
|
||||
DLG_TRACE(("# editbox args:\n"));
|
||||
DLG_TRACE2S("title", title);
|
||||
/* FIXME dump the rows & list */
|
||||
DLG_TRACE2N("height", height);
|
||||
DLG_TRACE2N("width", width);
|
||||
|
||||
dlg_save_vars(&save_vars);
|
||||
dialog_vars.separate_output = TRUE;
|
||||
|
||||
dlg_does_output();
|
||||
|
||||
buffer = dlg_malloc(char, max_len + 1);
|
||||
assert_ptr(buffer, "dlg_editbox");
|
||||
|
||||
thisrow = base_row = lastrow = 0;
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
retry:
|
||||
#endif
|
||||
show_buttons = TRUE;
|
||||
state = dialog_vars.default_button >= 0 ? dlg_default_button() : sTEXT;
|
||||
fkey = 0;
|
||||
|
||||
dlg_button_layout(buttons, &mincols);
|
||||
dlg_auto_size(title, "", &height, &width, 3 * LINES / 4, mincols);
|
||||
dlg_print_size(height, width);
|
||||
dlg_ctl_size(height, width);
|
||||
|
||||
x = dlg_box_x_ordinate(width);
|
||||
y = dlg_box_y_ordinate(height);
|
||||
|
||||
dialog = dlg_new_window(height, width, y, x);
|
||||
dlg_register_window(dialog, "editbox", binding);
|
||||
dlg_register_buttons(dialog, "editbox", buttons);
|
||||
|
||||
dlg_mouse_setbase(x, y);
|
||||
|
||||
dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr);
|
||||
dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr);
|
||||
dlg_draw_title(dialog, title);
|
||||
|
||||
dlg_attrset(dialog, dialog_attr);
|
||||
|
||||
/* Draw the editing field in a box */
|
||||
box_y = MARGIN + 0;
|
||||
box_x = MARGIN + 1;
|
||||
box_width = width - 2 - (2 * MARGIN);
|
||||
box_height = height - (4 * MARGIN);
|
||||
|
||||
dlg_draw_box(dialog,
|
||||
box_y,
|
||||
box_x,
|
||||
box_height,
|
||||
box_width,
|
||||
border_attr, border2_attr);
|
||||
dlg_mouse_mkbigregion(box_y + MARGIN,
|
||||
box_x + MARGIN,
|
||||
box_height - (2 * MARGIN),
|
||||
box_width - (2 * MARGIN),
|
||||
KEY_MAX, 1, 1, 3);
|
||||
editing = dlg_sub_window(dialog,
|
||||
box_height - (2 * MARGIN),
|
||||
box_width - (2 * MARGIN),
|
||||
getbegy(dialog) + box_y + 1,
|
||||
getbegx(dialog) + box_x + 1);
|
||||
dlg_register_window(editing, "editbox2", binding2);
|
||||
|
||||
show_all = TRUE;
|
||||
show_one = FALSE;
|
||||
pagesize = getmaxy(editing);
|
||||
|
||||
while (result == DLG_EXIT_UNKNOWN) {
|
||||
bool was_mouse;
|
||||
char *input;
|
||||
|
||||
if (show_all) {
|
||||
display_all(editing, *list, thisrow, base_row, listsize, chr_offset);
|
||||
display_one(editing, THIS_ROW,
|
||||
thisrow, thisrow, base_row, chr_offset);
|
||||
show_all = FALSE;
|
||||
show_one = TRUE;
|
||||
} else {
|
||||
if (thisrow != lastrow) {
|
||||
display_one(editing, (*list)[lastrow],
|
||||
lastrow, thisrow, base_row, 0);
|
||||
show_one = TRUE;
|
||||
}
|
||||
}
|
||||
if (show_one) {
|
||||
display_one(editing, THIS_ROW,
|
||||
thisrow, thisrow, base_row, chr_offset);
|
||||
getyx(editing, y, x);
|
||||
dlg_draw_scrollbar(dialog,
|
||||
base_row,
|
||||
base_row,
|
||||
base_row + pagesize,
|
||||
listsize,
|
||||
box_x,
|
||||
box_x + getmaxx(editing),
|
||||
box_y + 0,
|
||||
box_y + getmaxy(editing) + 1,
|
||||
border2_attr,
|
||||
border_attr);
|
||||
wmove(editing, y, x);
|
||||
show_one = FALSE;
|
||||
}
|
||||
lastrow = thisrow;
|
||||
input = THIS_ROW;
|
||||
|
||||
/*
|
||||
* The last field drawn determines where the cursor is shown:
|
||||
*/
|
||||
if (show_buttons) {
|
||||
show_buttons = FALSE;
|
||||
UPDATE_COL(input);
|
||||
if (state != sTEXT) {
|
||||
display_one(editing, input, thisrow,
|
||||
-1, base_row, 0);
|
||||
wrefresh(editing);
|
||||
}
|
||||
dlg_draw_buttons(dialog,
|
||||
height - 2,
|
||||
0,
|
||||
buttons,
|
||||
(state != sTEXT) ? state : 99,
|
||||
FALSE,
|
||||
width);
|
||||
if (state == sTEXT) {
|
||||
display_one(editing, input, thisrow,
|
||||
thisrow, base_row, chr_offset);
|
||||
}
|
||||
}
|
||||
|
||||
if (first_trace) {
|
||||
first_trace = FALSE;
|
||||
dlg_trace_win(dialog);
|
||||
}
|
||||
|
||||
key = dlg_mouse_wgetch((state == sTEXT) ? editing : dialog, &fkey);
|
||||
if (key == ERR) {
|
||||
result = DLG_EXIT_ERROR;
|
||||
break;
|
||||
} else if (key == ESC) {
|
||||
result = DLG_EXIT_ESC;
|
||||
break;
|
||||
}
|
||||
if (state != sTEXT) {
|
||||
if (dlg_result_key(key, fkey, &result)) {
|
||||
if (!dlg_button_key(result, &code, &key, &fkey))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
was_mouse = (fkey && is_DLGK_MOUSE(key));
|
||||
if (was_mouse)
|
||||
key -= M_EVENT;
|
||||
|
||||
/*
|
||||
* Handle mouse clicks first, since we want to know if this is a
|
||||
* button, or something that dlg_edit_string() should handle.
|
||||
*/
|
||||
if (fkey
|
||||
&& was_mouse
|
||||
&& (code = dlg_ok_buttoncode(key)) >= 0) {
|
||||
result = code;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (was_mouse
|
||||
&& (key >= KEY_MAX)) {
|
||||
int wide = getmaxx(editing);
|
||||
int cell = key - KEY_MAX;
|
||||
int check = (cell / wide) + base_row;
|
||||
if (check < listsize) {
|
||||
thisrow = check;
|
||||
col_offset = (cell % wide);
|
||||
chr_offset = col_to_chr_offset(THIS_ROW, col_offset);
|
||||
show_one = TRUE;
|
||||
if (state != sTEXT) {
|
||||
state = sTEXT;
|
||||
show_buttons = TRUE;
|
||||
}
|
||||
} else {
|
||||
beep();
|
||||
}
|
||||
continue;
|
||||
} else if (was_mouse && key >= KEY_MIN) {
|
||||
key = dlg_lookup_key(dialog, key, &fkey);
|
||||
}
|
||||
|
||||
if (state == sTEXT) { /* editing box selected */
|
||||
int edit = 0;
|
||||
|
||||
/*
|
||||
* Intercept scrolling keys that dlg_edit_string() does not
|
||||
* understand.
|
||||
*/
|
||||
if (fkey) {
|
||||
bool moved = TRUE;
|
||||
|
||||
switch (key) {
|
||||
case DLGK_GRID_UP:
|
||||
SCROLL_TO(thisrow - 1);
|
||||
break;
|
||||
case DLGK_GRID_DOWN:
|
||||
SCROLL_TO(thisrow + 1);
|
||||
break;
|
||||
case DLGK_PAGE_FIRST:
|
||||
SCROLL_TO(0);
|
||||
break;
|
||||
case DLGK_PAGE_LAST:
|
||||
SCROLL_TO(listsize);
|
||||
break;
|
||||
case DLGK_PAGE_NEXT:
|
||||
SCROLL_TO(base_row + pagesize);
|
||||
break;
|
||||
case DLGK_PAGE_PREV:
|
||||
if (thisrow > base_row) {
|
||||
SCROLL_TO(base_row);
|
||||
} else {
|
||||
SCROLL_TO(base_row - pagesize);
|
||||
}
|
||||
break;
|
||||
case DLGK_DELETE_LEFT:
|
||||
if (chr_offset == 0) {
|
||||
if (thisrow == 0) {
|
||||
beep();
|
||||
} else {
|
||||
size_t len = (strlen(THIS_ROW) +
|
||||
strlen(PREV_ROW) + 1);
|
||||
char *tmp = dlg_malloc(char, len);
|
||||
|
||||
assert_ptr(tmp, "dlg_editbox");
|
||||
|
||||
chr_offset = dlg_count_wchars(PREV_ROW);
|
||||
UPDATE_COL(PREV_ROW);
|
||||
goal_col = col_offset;
|
||||
|
||||
sprintf(tmp, "%s%s", PREV_ROW, THIS_ROW);
|
||||
if (len > max_len)
|
||||
tmp[max_len] = '\0';
|
||||
|
||||
free(PREV_ROW);
|
||||
PREV_ROW = tmp;
|
||||
for (y = thisrow; y < listsize; ++y) {
|
||||
(*list)[y] = (*list)[y + 1];
|
||||
}
|
||||
--listsize;
|
||||
--thisrow;
|
||||
(void) Scroll_To(thisrow);
|
||||
|
||||
show_all = TRUE;
|
||||
}
|
||||
} else {
|
||||
/* dlg_edit_string() can handle this case */
|
||||
moved = FALSE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
moved = FALSE;
|
||||
break;
|
||||
}
|
||||
if (moved) {
|
||||
if (thisrow != lastrow) {
|
||||
if (goal_col < 0)
|
||||
goal_col = col_offset;
|
||||
chr_offset = col_to_chr_offset(THIS_ROW, goal_col);
|
||||
} else {
|
||||
UPDATE_COL(THIS_ROW);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
strncpy(buffer, input, max_len - 1)[max_len - 1] = '\0';
|
||||
edit = dlg_edit_string(buffer, &chr_offset, key, fkey, FALSE);
|
||||
|
||||
if (edit) {
|
||||
goal_col = UPDATE_COL(input);
|
||||
if (strcmp(input, buffer)) {
|
||||
free(input);
|
||||
THIS_ROW = dlg_strclone(buffer);
|
||||
input = THIS_ROW;
|
||||
}
|
||||
display_one(editing, input, thisrow,
|
||||
thisrow, base_row, chr_offset);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* handle non-functionkeys */
|
||||
if (!fkey && (code = dlg_char_to_button(key, buttons)) >= 0) {
|
||||
dlg_del_window(dialog);
|
||||
result = dlg_ok_buttoncode(code);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* handle functionkeys */
|
||||
if (fkey) {
|
||||
switch (key) {
|
||||
case DLGK_GRID_UP:
|
||||
case DLGK_GRID_LEFT:
|
||||
case DLGK_FIELD_PREV:
|
||||
show_buttons = TRUE;
|
||||
state = dlg_prev_ok_buttonindex(state, sTEXT);
|
||||
break;
|
||||
case DLGK_GRID_RIGHT:
|
||||
case DLGK_GRID_DOWN:
|
||||
case DLGK_FIELD_NEXT:
|
||||
show_buttons = TRUE;
|
||||
state = dlg_next_ok_buttonindex(state, sTEXT);
|
||||
break;
|
||||
case DLGK_ENTER:
|
||||
if (state == sTEXT) {
|
||||
const int *indx = dlg_index_wchars(THIS_ROW);
|
||||
int split = indx[chr_offset];
|
||||
char *tmp = dlg_strclone(THIS_ROW + split);
|
||||
|
||||
assert_ptr(tmp, "dlg_editbox");
|
||||
grow_list(list, rows, listsize + 1);
|
||||
++listsize;
|
||||
for (y = listsize; y > thisrow; --y) {
|
||||
(*list)[y] = (*list)[y - 1];
|
||||
}
|
||||
THIS_ROW[split] = '\0';
|
||||
++thisrow;
|
||||
chr_offset = 0;
|
||||
col_offset = 0;
|
||||
THIS_ROW = tmp;
|
||||
(void) Scroll_To(thisrow);
|
||||
show_all = TRUE;
|
||||
} else {
|
||||
result = dlg_enter_buttoncode(state);
|
||||
}
|
||||
break;
|
||||
case DLGK_LEAVE:
|
||||
if (state >= 0)
|
||||
result = dlg_ok_buttoncode(state);
|
||||
break;
|
||||
#ifdef KEY_RESIZE
|
||||
case KEY_RESIZE:
|
||||
dlg_will_resize(dialog);
|
||||
/* reset data */
|
||||
height = old_height;
|
||||
width = old_width;
|
||||
/* repaint */
|
||||
dlg_del_window(editing);
|
||||
dlg_unregister_window(editing);
|
||||
_dlg_resize_cleanup(dialog);
|
||||
goto retry;
|
||||
#endif
|
||||
case DLGK_TOGGLE:
|
||||
if (state != sTEXT) {
|
||||
result = dlg_ok_buttoncode(state);
|
||||
} else {
|
||||
beep();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
beep();
|
||||
break;
|
||||
}
|
||||
} else if (key > 0) {
|
||||
beep();
|
||||
}
|
||||
}
|
||||
|
||||
dlg_unregister_window(editing);
|
||||
dlg_del_window(editing);
|
||||
dlg_del_window(dialog);
|
||||
dlg_mouse_free_regions();
|
||||
|
||||
/*
|
||||
* The caller's copy of the (*list)[] array has been updated, but for
|
||||
* consistency with the other widgets, we put the "real" result in
|
||||
* the output buffer.
|
||||
*/
|
||||
if (result == DLG_EXIT_OK) {
|
||||
int n;
|
||||
for (n = 0; n < listsize; ++n) {
|
||||
dlg_add_result((*list)[n]);
|
||||
dlg_add_separator();
|
||||
}
|
||||
dlg_add_last_key(-1);
|
||||
}
|
||||
free(buffer);
|
||||
dlg_restore_vars(&save_vars);
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
dialog_editbox(const char *title, const char *file, int height, int width)
|
||||
{
|
||||
int result;
|
||||
char **list;
|
||||
int rows;
|
||||
|
||||
load_list(file, &list, &rows);
|
||||
result = dlg_editbox(title, &list, &rows, height, width);
|
||||
free_list(&list, &rows);
|
||||
return result;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,962 +0,0 @@
|
||||
/*
|
||||
* $Id: fselect.c,v 1.115 2021/01/16 17:19:15 tom Exp $
|
||||
*
|
||||
* fselect.c -- implements the file-selector box
|
||||
*
|
||||
* Copyright 2000-2020,2021 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#include <dlg_internals.h>
|
||||
#include <dlg_keys.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if HAVE_DIRENT_H
|
||||
# include <dirent.h>
|
||||
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
#else
|
||||
# define dirent direct
|
||||
# define NAMLEN(dirent) (dirent)->d_namlen
|
||||
# if HAVE_SYS_NDIR_H
|
||||
# include <sys/ndir.h>
|
||||
# endif
|
||||
# if HAVE_SYS_DIR_H
|
||||
# include <sys/dir.h>
|
||||
# endif
|
||||
# if HAVE_NDIR_H
|
||||
# include <ndir.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# if defined(_FILE_OFFSET_BITS) && defined(HAVE_STRUCT_DIRENT64)
|
||||
# if !defined(_LP64) && (_FILE_OFFSET_BITS == 64)
|
||||
# define DIRENT struct dirent64
|
||||
# else
|
||||
# define DIRENT struct dirent
|
||||
# endif
|
||||
# else
|
||||
# define DIRENT struct dirent
|
||||
# endif
|
||||
|
||||
#define EXT_WIDE 1
|
||||
#define HDR_HIGH 1
|
||||
#define BTN_HIGH (1 + 2 * MARGIN) /* Ok/Cancel, also input-box */
|
||||
#define MIN_HIGH (HDR_HIGH - MARGIN + (BTN_HIGH * 2) + 4 * MARGIN)
|
||||
#define MIN_WIDE (2 * MAX(dlg_count_columns(d_label), dlg_count_columns(f_label)) + 6 * MARGIN + 2 * EXT_WIDE)
|
||||
|
||||
#define MOUSE_D (KEY_MAX + 0)
|
||||
#define MOUSE_F (KEY_MAX + 10000)
|
||||
#define MOUSE_T (KEY_MAX + 20000)
|
||||
|
||||
typedef enum {
|
||||
sDIRS = -3
|
||||
,sFILES = -2
|
||||
,sTEXT = -1
|
||||
} STATES;
|
||||
|
||||
typedef struct {
|
||||
WINDOW *par; /* parent window */
|
||||
WINDOW *win; /* this window */
|
||||
int length; /* length of the data[] array */
|
||||
int offset; /* index of first item on screen */
|
||||
int choice; /* index of the selection */
|
||||
int mousex; /* base of mouse-code return-values */
|
||||
unsigned allocd;
|
||||
char **data;
|
||||
} LIST;
|
||||
|
||||
typedef struct {
|
||||
int length;
|
||||
char **data;
|
||||
} MATCH;
|
||||
|
||||
static void
|
||||
init_list(LIST * list, WINDOW *par, WINDOW *win, int mousex)
|
||||
{
|
||||
list->par = par;
|
||||
list->win = win;
|
||||
list->length = 0;
|
||||
list->offset = 0;
|
||||
list->choice = 0;
|
||||
list->mousex = mousex;
|
||||
list->allocd = 0;
|
||||
list->data = 0;
|
||||
dlg_mouse_mkbigregion(getbegy(win), getbegx(win),
|
||||
getmaxy(win), getmaxx(win),
|
||||
mousex, 1, 1, 1 /* by lines */ );
|
||||
}
|
||||
|
||||
static char *
|
||||
leaf_of(char *path)
|
||||
{
|
||||
char *leaf = strrchr(path, '/');
|
||||
if (leaf != 0)
|
||||
leaf++;
|
||||
else
|
||||
leaf = path;
|
||||
return leaf;
|
||||
}
|
||||
|
||||
static char *
|
||||
data_of(LIST * list)
|
||||
{
|
||||
if (list != 0
|
||||
&& list->data != 0)
|
||||
return list->data[list->choice];
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
free_list(LIST * list, int reinit)
|
||||
{
|
||||
if (list->data != 0) {
|
||||
int n;
|
||||
|
||||
for (n = 0; list->data[n] != 0; n++)
|
||||
free(list->data[n]);
|
||||
free(list->data);
|
||||
list->data = 0;
|
||||
}
|
||||
if (reinit)
|
||||
init_list(list, list->par, list->win, list->mousex);
|
||||
}
|
||||
|
||||
static void
|
||||
add_to_list(LIST * list, char *text)
|
||||
{
|
||||
unsigned need;
|
||||
|
||||
need = (unsigned) (list->length + 1);
|
||||
if (need + 1 > list->allocd) {
|
||||
list->allocd = 2 * (need + 1);
|
||||
if (list->data == 0) {
|
||||
list->data = dlg_malloc(char *, list->allocd);
|
||||
} else {
|
||||
list->data = dlg_realloc(char *, list->allocd, list->data);
|
||||
}
|
||||
assert_ptr(list->data, "add_to_list");
|
||||
}
|
||||
list->data[list->length++] = dlg_strclone(text);
|
||||
list->data[list->length] = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
keep_visible(LIST * list)
|
||||
{
|
||||
int high = getmaxy(list->win);
|
||||
|
||||
if (list->choice < list->offset) {
|
||||
list->offset = list->choice;
|
||||
}
|
||||
if (list->choice - list->offset >= high)
|
||||
list->offset = list->choice - high + 1;
|
||||
}
|
||||
|
||||
#define Value(c) (int)((c) & 0xff)
|
||||
|
||||
static int
|
||||
find_choice(char *target, LIST * list)
|
||||
{
|
||||
int choice = list->choice;
|
||||
|
||||
if (*target == 0) {
|
||||
list->choice = 0;
|
||||
} else {
|
||||
int n;
|
||||
int len_1, cmp_1;
|
||||
|
||||
/* find the match with the longest length. If more than one has the
|
||||
* same length, choose the one with the closest match of the final
|
||||
* character.
|
||||
*/
|
||||
len_1 = 0;
|
||||
cmp_1 = 256;
|
||||
for (n = 0; n < list->length; n++) {
|
||||
char *a = target;
|
||||
char *b = list->data[n];
|
||||
int len_2, cmp_2;
|
||||
|
||||
len_2 = 0;
|
||||
while ((*a != 0) && (*b != 0) && (*a == *b)) {
|
||||
a++;
|
||||
b++;
|
||||
len_2++;
|
||||
}
|
||||
cmp_2 = Value(*a) - Value(*b);
|
||||
if (cmp_2 < 0)
|
||||
cmp_2 = -cmp_2;
|
||||
if ((len_2 > len_1)
|
||||
|| (len_1 == len_2 && cmp_2 < cmp_1)) {
|
||||
len_1 = len_2;
|
||||
cmp_1 = cmp_2;
|
||||
list->choice = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (choice != list->choice) {
|
||||
keep_visible(list);
|
||||
}
|
||||
return (choice != list->choice);
|
||||
}
|
||||
|
||||
static void
|
||||
display_list(LIST * list)
|
||||
{
|
||||
if (list->win != 0) {
|
||||
int n;
|
||||
int x;
|
||||
int y;
|
||||
int top;
|
||||
int bottom;
|
||||
|
||||
dlg_attr_clear(list->win, getmaxy(list->win), getmaxx(list->win), item_attr);
|
||||
for (n = list->offset; n < list->length && list->data[n]; n++) {
|
||||
y = n - list->offset;
|
||||
if (y >= getmaxy(list->win))
|
||||
break;
|
||||
(void) wmove(list->win, y, 0);
|
||||
if (n == list->choice)
|
||||
dlg_attrset(list->win, item_selected_attr);
|
||||
(void) waddstr(list->win, list->data[n]);
|
||||
dlg_attrset(list->win, item_attr);
|
||||
}
|
||||
dlg_attrset(list->win, item_attr);
|
||||
|
||||
getparyx(list->win, y, x);
|
||||
|
||||
top = y - 1;
|
||||
bottom = y + getmaxy(list->win);
|
||||
dlg_draw_scrollbar(list->par,
|
||||
(long) list->offset,
|
||||
(long) list->offset,
|
||||
(long) (list->offset + getmaxy(list->win)),
|
||||
(long) (list->length),
|
||||
x + 1,
|
||||
x + getmaxx(list->win),
|
||||
top,
|
||||
bottom,
|
||||
menubox_border2_attr,
|
||||
menubox_border_attr);
|
||||
|
||||
(void) wmove(list->win, list->choice - list->offset, 0);
|
||||
(void) wnoutrefresh(list->win);
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: see arrows.c
|
||||
* This workaround is used to allow two lists to have scroll-tabs at the same
|
||||
* time, by reassigning their return-values to be different. Just for
|
||||
* readability, we use the names of keys with similar connotations, though all
|
||||
* that is really required is that they're distinct, so we can put them in a
|
||||
* switch statement.
|
||||
*/
|
||||
#if USE_MOUSE
|
||||
static void
|
||||
fix_arrows(LIST * list)
|
||||
{
|
||||
if (list->win != 0) {
|
||||
int x;
|
||||
int y;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
|
||||
getparyx(list->win, y, x);
|
||||
top = y - 1;
|
||||
right = getmaxx(list->win);
|
||||
bottom = y + getmaxy(list->win);
|
||||
|
||||
mouse_mkbutton(top, x, right,
|
||||
((list->mousex == MOUSE_D)
|
||||
? KEY_PREVIOUS
|
||||
: KEY_PPAGE));
|
||||
mouse_mkbutton(bottom, x, right,
|
||||
((list->mousex == MOUSE_D)
|
||||
? KEY_NEXT
|
||||
: KEY_NPAGE));
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
#define fix_arrows(list) /* nothing */
|
||||
#endif
|
||||
|
||||
static bool
|
||||
show_list(char *target, LIST * list, bool keep)
|
||||
{
|
||||
bool changed = keep || find_choice(target, list);
|
||||
display_list(list);
|
||||
return changed;
|
||||
}
|
||||
|
||||
/*
|
||||
* Highlight the closest match to 'target' in the given list, setting offset
|
||||
* to match.
|
||||
*/
|
||||
static bool
|
||||
show_both_lists(char *input, LIST * d_list, LIST * f_list, bool keep)
|
||||
{
|
||||
char *leaf = leaf_of(input);
|
||||
|
||||
return show_list(leaf, d_list, keep) || show_list(leaf, f_list, keep);
|
||||
}
|
||||
|
||||
/*
|
||||
* Move up/down in the given list
|
||||
*/
|
||||
static bool
|
||||
change_list(int choice, LIST * list)
|
||||
{
|
||||
if (data_of(list) != 0) {
|
||||
int last = list->length - 1;
|
||||
|
||||
choice += list->choice;
|
||||
if (choice < 0)
|
||||
choice = 0;
|
||||
if (choice > last)
|
||||
choice = last;
|
||||
list->choice = choice;
|
||||
keep_visible(list);
|
||||
display_list(list);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
scroll_list(int direction, LIST * list)
|
||||
{
|
||||
if (data_of(list) != 0) {
|
||||
int length = getmaxy(list->win);
|
||||
if (change_list(direction * length, list))
|
||||
return;
|
||||
}
|
||||
beep();
|
||||
}
|
||||
|
||||
static int
|
||||
compar(const void *a, const void *b)
|
||||
{
|
||||
return strcmp(*(const char *const *) a, *(const char *const *) b);
|
||||
}
|
||||
|
||||
static void
|
||||
match(char *name, LIST * d_list, LIST * f_list, MATCH * match_list)
|
||||
{
|
||||
char *test = leaf_of(name);
|
||||
size_t test_len = strlen(test);
|
||||
char **matches = dlg_malloc(char *, (size_t) (d_list->length + f_list->length));
|
||||
size_t data_len = 0;
|
||||
|
||||
if (matches != 0) {
|
||||
int i;
|
||||
char **new_ptr;
|
||||
|
||||
for (i = 2; i < d_list->length; i++) {
|
||||
if (strncmp(test, d_list->data[i], test_len) == 0) {
|
||||
matches[data_len++] = d_list->data[i];
|
||||
}
|
||||
}
|
||||
for (i = 0; i < f_list->length; i++) {
|
||||
if (strncmp(test, f_list->data[i], test_len) == 0) {
|
||||
matches[data_len++] = f_list->data[i];
|
||||
}
|
||||
}
|
||||
if ((new_ptr = dlg_realloc(char *, data_len + 1, matches)) != 0) {
|
||||
matches = new_ptr;
|
||||
} else {
|
||||
free(matches);
|
||||
matches = 0;
|
||||
data_len = 0;
|
||||
}
|
||||
}
|
||||
match_list->data = matches;
|
||||
match_list->length = (int) data_len;
|
||||
}
|
||||
|
||||
static void
|
||||
free_match(MATCH * match_list)
|
||||
{
|
||||
free(match_list->data);
|
||||
match_list->length = 0;
|
||||
}
|
||||
|
||||
static int
|
||||
complete(char *name, LIST * d_list, LIST * f_list, char **buff_ptr)
|
||||
{
|
||||
MATCH match_list;
|
||||
char *test;
|
||||
size_t test_len;
|
||||
size_t i;
|
||||
char *buff;
|
||||
|
||||
match(name, d_list, f_list, &match_list);
|
||||
if (match_list.length == 0) {
|
||||
free(match_list.data);
|
||||
*buff_ptr = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
test = match_list.data[0];
|
||||
test_len = strlen(test);
|
||||
buff = dlg_malloc(char, test_len + 2);
|
||||
if (match_list.length == 1) {
|
||||
strcpy(buff, test);
|
||||
i = test_len;
|
||||
if (test == data_of(d_list)) {
|
||||
buff[test_len] = '/';
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
int j;
|
||||
|
||||
for (i = 0; i < test_len; i++) {
|
||||
char test_char = test[i];
|
||||
if (test_char == '\0')
|
||||
break;
|
||||
for (j = 0; j < match_list.length; j++) {
|
||||
if (match_list.data[j][i] != test_char) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j == match_list.length) {
|
||||
(buff)[i] = test_char;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
buff = dlg_realloc(char, i + 1, buff);
|
||||
}
|
||||
free_match(&match_list);
|
||||
buff[i] = '\0';
|
||||
*buff_ptr = buff;
|
||||
return (i != 0);
|
||||
}
|
||||
|
||||
static bool
|
||||
fill_lists(char *current, char *input, LIST * d_list, LIST * f_list, bool keep)
|
||||
{
|
||||
bool result = TRUE;
|
||||
bool rescan = FALSE;
|
||||
struct stat sb;
|
||||
int n;
|
||||
char path[MAX_LEN + 1];
|
||||
|
||||
/* check if we've updated the lists */
|
||||
for (n = 0; current[n] && input[n]; n++) {
|
||||
if (current[n] != input[n])
|
||||
break;
|
||||
}
|
||||
|
||||
if (current[n] == input[n]) {
|
||||
result = FALSE;
|
||||
rescan = (n == 0 && d_list->length == 0);
|
||||
} else if (strchr(current + n, '/') == 0
|
||||
&& strchr(input + n, '/') == 0) {
|
||||
result = show_both_lists(input, d_list, f_list, keep);
|
||||
} else {
|
||||
rescan = TRUE;
|
||||
}
|
||||
|
||||
if (rescan) {
|
||||
DIR *dp;
|
||||
size_t have = strlen(input);
|
||||
char *leaf;
|
||||
|
||||
if (have > MAX_LEN)
|
||||
have = MAX_LEN;
|
||||
memcpy(current, input, have);
|
||||
current[have] = '\0';
|
||||
|
||||
/* refill the lists */
|
||||
free_list(d_list, TRUE);
|
||||
free_list(f_list, TRUE);
|
||||
memcpy(path, current, have);
|
||||
path[have] = '\0';
|
||||
if ((leaf = strrchr(path, '/')) != 0) {
|
||||
*++leaf = 0;
|
||||
} else {
|
||||
strcpy(path, "./");
|
||||
leaf = path + strlen(path);
|
||||
}
|
||||
DLG_TRACE(("opendir '%s'\n", path));
|
||||
if ((dp = opendir(path)) != 0) {
|
||||
DIRENT *de;
|
||||
|
||||
while ((de = readdir(dp)) != 0) {
|
||||
size_t len = NAMLEN(de);
|
||||
if (len == 0 || (len + have + 2) >= MAX_LEN)
|
||||
continue;
|
||||
memcpy(leaf, de->d_name, len);
|
||||
leaf[len] = '\0';
|
||||
if (stat(path, &sb) == 0) {
|
||||
if ((sb.st_mode & S_IFMT) == S_IFDIR)
|
||||
add_to_list(d_list, leaf);
|
||||
else if (f_list->win)
|
||||
add_to_list(f_list, leaf);
|
||||
}
|
||||
}
|
||||
(void) closedir(dp);
|
||||
/* sort the lists */
|
||||
if (d_list->data != 0 && d_list->length > 1) {
|
||||
qsort(d_list->data,
|
||||
(size_t) d_list->length,
|
||||
sizeof(d_list->data[0]),
|
||||
compar);
|
||||
}
|
||||
if (f_list->data != 0 && f_list->length > 1) {
|
||||
qsort(f_list->data,
|
||||
(size_t) f_list->length,
|
||||
sizeof(f_list->data[0]),
|
||||
compar);
|
||||
}
|
||||
}
|
||||
|
||||
(void) show_both_lists(input, d_list, f_list, FALSE);
|
||||
d_list->offset = d_list->choice;
|
||||
f_list->offset = f_list->choice;
|
||||
result = TRUE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool
|
||||
usable_state(int state, LIST * dirs, LIST * files)
|
||||
{
|
||||
bool result;
|
||||
|
||||
switch (state) {
|
||||
case sDIRS:
|
||||
result = (dirs->win != 0) && (data_of(dirs) != 0);
|
||||
break;
|
||||
case sFILES:
|
||||
result = (files->win != 0) && (data_of(files) != 0);
|
||||
break;
|
||||
default:
|
||||
result = TRUE;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#define which_list() ((state == sFILES) \
|
||||
? &f_list \
|
||||
: ((state == sDIRS) \
|
||||
? &d_list \
|
||||
: 0))
|
||||
#define NAVIGATE_BINDINGS \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ), \
|
||||
DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_DOWN ), \
|
||||
DLG_KEYS_DATA( DLGK_ITEM_NEXT, CHR_NEXT ), \
|
||||
DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_NEXT ), \
|
||||
DLG_KEYS_DATA( DLGK_ITEM_PREV, CHR_PREVIOUS ), \
|
||||
DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_UP ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ), \
|
||||
DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE )
|
||||
|
||||
/*
|
||||
* Display a dialog box for entering a filename
|
||||
*/
|
||||
static int
|
||||
dlg_fselect(const char *title, const char *path, int height, int width, int dselect)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
static DLG_KEYS_BINDING binding[] = {
|
||||
HELPKEY_BINDINGS,
|
||||
ENTERKEY_BINDINGS,
|
||||
NAVIGATE_BINDINGS,
|
||||
TOGGLEKEY_BINDINGS,
|
||||
END_KEYS_BINDING
|
||||
};
|
||||
static DLG_KEYS_BINDING binding2[] = {
|
||||
INPUTSTR_BINDINGS,
|
||||
HELPKEY_BINDINGS,
|
||||
ENTERKEY_BINDINGS,
|
||||
NAVIGATE_BINDINGS,
|
||||
TOGGLEKEY_BINDINGS,
|
||||
END_KEYS_BINDING
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
int old_height = height;
|
||||
int old_width = width;
|
||||
bool resized = FALSE;
|
||||
#endif
|
||||
int tbox_y, tbox_x, tbox_width, tbox_height;
|
||||
int dbox_y, dbox_x, dbox_width, dbox_height;
|
||||
int fbox_y, fbox_x, fbox_width, fbox_height;
|
||||
int show_buttons = TRUE;
|
||||
int offset = 0;
|
||||
int key = 0;
|
||||
int fkey = FALSE;
|
||||
int code;
|
||||
int result = DLG_EXIT_UNKNOWN;
|
||||
int state = dialog_vars.default_button >= 0 ? dlg_default_button() : sTEXT;
|
||||
int button;
|
||||
bool first = (state == sTEXT);
|
||||
bool first_trace = TRUE;
|
||||
char *input;
|
||||
char *completed;
|
||||
char current[MAX_LEN + 1];
|
||||
WINDOW *dialog = 0;
|
||||
WINDOW *w_text = 0;
|
||||
WINDOW *w_work = 0;
|
||||
const char **buttons = dlg_ok_labels();
|
||||
const char *d_label = _("Directories");
|
||||
const char *f_label = _("Files");
|
||||
char *partial = 0;
|
||||
int min_wide = MIN_WIDE;
|
||||
int min_items = height ? 0 : 4;
|
||||
LIST d_list, f_list;
|
||||
|
||||
DLG_TRACE(("# %s args:\n", dselect ? "dselect" : "fselect"));
|
||||
DLG_TRACE2S("title", title);
|
||||
DLG_TRACE2S("path", path);
|
||||
DLG_TRACE2N("height", height);
|
||||
DLG_TRACE2N("width", width);
|
||||
|
||||
dlg_does_output();
|
||||
|
||||
/* Set up the initial value */
|
||||
input = dlg_set_result(path);
|
||||
offset = (int) strlen(input);
|
||||
*current = 0;
|
||||
|
||||
dlg_button_layout(buttons, &min_wide);
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
retry:
|
||||
#endif
|
||||
dlg_auto_size(title, "", &height, &width, MIN_HIGH + min_items, min_wide);
|
||||
|
||||
dlg_print_size(height, width);
|
||||
dlg_ctl_size(height, width);
|
||||
|
||||
dialog = dlg_new_window(height, width,
|
||||
dlg_box_y_ordinate(height),
|
||||
dlg_box_x_ordinate(width));
|
||||
dlg_register_window(dialog, "fselect", binding);
|
||||
dlg_register_buttons(dialog, "fselect", buttons);
|
||||
|
||||
dlg_mouse_setbase(0, 0);
|
||||
|
||||
dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr);
|
||||
dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr);
|
||||
dlg_draw_title(dialog, title);
|
||||
|
||||
dlg_attrset(dialog, dialog_attr);
|
||||
|
||||
/* Draw the input field box */
|
||||
tbox_height = 1;
|
||||
tbox_width = width - (4 * MARGIN + 2);
|
||||
tbox_y = height - (BTN_HIGH * 2) + MARGIN;
|
||||
tbox_x = (width - tbox_width) / 2;
|
||||
|
||||
w_text = dlg_der_window(dialog, tbox_height, tbox_width, tbox_y, tbox_x);
|
||||
if (w_text == 0) {
|
||||
result = DLG_EXIT_ERROR;
|
||||
goto finish;
|
||||
}
|
||||
|
||||
dlg_draw_box(dialog, tbox_y - MARGIN, tbox_x - MARGIN,
|
||||
(2 * MARGIN + 1), tbox_width + (MARGIN + EXT_WIDE),
|
||||
menubox_border_attr, menubox_border2_attr);
|
||||
dlg_mouse_mkbigregion(getbegy(dialog) + tbox_y - MARGIN,
|
||||
getbegx(dialog) + tbox_x - MARGIN,
|
||||
1 + (2 * MARGIN),
|
||||
tbox_width + (MARGIN + EXT_WIDE),
|
||||
MOUSE_T, 1, 1, 3 /* doesn't matter */ );
|
||||
|
||||
dlg_register_window(w_text, "fselect2", binding2);
|
||||
|
||||
/* Draw the directory listing box */
|
||||
if (dselect)
|
||||
dbox_width = (width - (6 * MARGIN));
|
||||
else
|
||||
dbox_width = (width - (6 * MARGIN + 2 * EXT_WIDE)) / 2;
|
||||
dbox_height = height - MIN_HIGH;
|
||||
dbox_y = (2 * MARGIN + 1);
|
||||
dbox_x = tbox_x;
|
||||
|
||||
w_work = dlg_der_window(dialog, dbox_height, dbox_width, dbox_y, dbox_x);
|
||||
if (w_work == 0) {
|
||||
result = DLG_EXIT_ERROR;
|
||||
goto finish;
|
||||
}
|
||||
|
||||
(void) mvwaddstr(dialog, dbox_y - (MARGIN + 1), dbox_x - MARGIN, d_label);
|
||||
dlg_draw_box(dialog,
|
||||
dbox_y - MARGIN, dbox_x - MARGIN,
|
||||
dbox_height + (MARGIN + 1), dbox_width + (MARGIN + 1),
|
||||
menubox_border_attr, menubox_border2_attr);
|
||||
init_list(&d_list, dialog, w_work, MOUSE_D);
|
||||
|
||||
if (!dselect) {
|
||||
/* Draw the filename listing box */
|
||||
fbox_height = dbox_height;
|
||||
fbox_width = dbox_width;
|
||||
fbox_y = dbox_y;
|
||||
fbox_x = tbox_x + dbox_width + (2 * MARGIN);
|
||||
|
||||
w_work = dlg_der_window(dialog, fbox_height, fbox_width, fbox_y, fbox_x);
|
||||
if (w_work == 0) {
|
||||
result = DLG_EXIT_ERROR;
|
||||
goto finish;
|
||||
}
|
||||
|
||||
(void) mvwaddstr(dialog, fbox_y - (MARGIN + 1), fbox_x - MARGIN, f_label);
|
||||
dlg_draw_box(dialog,
|
||||
fbox_y - MARGIN, fbox_x - MARGIN,
|
||||
fbox_height + (MARGIN + 1), fbox_width + (MARGIN + 1),
|
||||
menubox_border_attr, menubox_border2_attr);
|
||||
init_list(&f_list, dialog, w_work, MOUSE_F);
|
||||
} else {
|
||||
memset(&f_list, 0, sizeof(f_list));
|
||||
}
|
||||
|
||||
while (result == DLG_EXIT_UNKNOWN) {
|
||||
|
||||
if (fill_lists(current, input, &d_list, &f_list, state < sTEXT))
|
||||
show_buttons = TRUE;
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
if (resized) {
|
||||
resized = FALSE;
|
||||
dlg_show_string(w_text, input, offset, inputbox_attr,
|
||||
0, 0, tbox_width, FALSE, first);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The last field drawn determines where the cursor is shown:
|
||||
*/
|
||||
if (show_buttons) {
|
||||
show_buttons = FALSE;
|
||||
button = (state < 0) ? 0 : state;
|
||||
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
|
||||
}
|
||||
|
||||
if (first_trace) {
|
||||
first_trace = FALSE;
|
||||
dlg_trace_win(dialog);
|
||||
}
|
||||
|
||||
if (state < 0) {
|
||||
switch (state) {
|
||||
case sTEXT:
|
||||
dlg_set_focus(dialog, w_text);
|
||||
break;
|
||||
case sFILES:
|
||||
dlg_set_focus(dialog, f_list.win);
|
||||
break;
|
||||
case sDIRS:
|
||||
dlg_set_focus(dialog, d_list.win);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (first) {
|
||||
(void) wrefresh(dialog);
|
||||
} else {
|
||||
fix_arrows(&d_list);
|
||||
fix_arrows(&f_list);
|
||||
key = dlg_mouse_wgetch((state == sTEXT) ? w_text : dialog, &fkey);
|
||||
if (dlg_result_key(key, fkey, &result)) {
|
||||
if (!dlg_button_key(result, &button, &key, &fkey))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (key == DLGK_TOGGLE) {
|
||||
key = DLGK_SELECT;
|
||||
fkey = TRUE;
|
||||
}
|
||||
|
||||
if (fkey) {
|
||||
switch (key) {
|
||||
case DLGK_MOUSE(KEY_PREVIOUS):
|
||||
state = sDIRS;
|
||||
scroll_list(-1, which_list());
|
||||
continue;
|
||||
case DLGK_MOUSE(KEY_NEXT):
|
||||
state = sDIRS;
|
||||
scroll_list(1, which_list());
|
||||
continue;
|
||||
case DLGK_MOUSE(KEY_PPAGE):
|
||||
state = sFILES;
|
||||
scroll_list(-1, which_list());
|
||||
continue;
|
||||
case DLGK_MOUSE(KEY_NPAGE):
|
||||
state = sFILES;
|
||||
scroll_list(1, which_list());
|
||||
continue;
|
||||
case DLGK_PAGE_PREV:
|
||||
scroll_list(-1, which_list());
|
||||
continue;
|
||||
case DLGK_PAGE_NEXT:
|
||||
scroll_list(1, which_list());
|
||||
continue;
|
||||
case DLGK_ITEM_PREV:
|
||||
if (change_list(-1, which_list()))
|
||||
continue;
|
||||
/* FALLTHRU */
|
||||
case DLGK_FIELD_PREV:
|
||||
show_buttons = TRUE;
|
||||
do {
|
||||
state = dlg_prev_ok_buttonindex(state, sDIRS);
|
||||
} while (!usable_state(state, &d_list, &f_list));
|
||||
continue;
|
||||
case DLGK_ITEM_NEXT:
|
||||
if (change_list(1, which_list()))
|
||||
continue;
|
||||
/* FALLTHRU */
|
||||
case DLGK_FIELD_NEXT:
|
||||
show_buttons = TRUE;
|
||||
do {
|
||||
state = dlg_next_ok_buttonindex(state, sDIRS);
|
||||
} while (!usable_state(state, &d_list, &f_list));
|
||||
continue;
|
||||
case DLGK_SELECT:
|
||||
completed = 0;
|
||||
if (partial != 0) {
|
||||
free(partial);
|
||||
partial = 0;
|
||||
}
|
||||
if (state == sFILES && !dselect) {
|
||||
completed = data_of(&f_list);
|
||||
} else if (state == sDIRS) {
|
||||
completed = data_of(&d_list);
|
||||
} else {
|
||||
if (complete(input, &d_list, &f_list, &partial)) {
|
||||
completed = partial;
|
||||
}
|
||||
}
|
||||
if (completed != 0) {
|
||||
state = sTEXT;
|
||||
show_buttons = TRUE;
|
||||
strcpy(leaf_of(input), completed);
|
||||
offset = (int) strlen(input);
|
||||
dlg_show_string(w_text, input, offset, inputbox_attr,
|
||||
0, 0, tbox_width, 0, first);
|
||||
if (partial != NULL) {
|
||||
free(partial);
|
||||
partial = 0;
|
||||
}
|
||||
continue;
|
||||
} else { /* if (state < sTEXT) */
|
||||
(void) beep();
|
||||
continue;
|
||||
}
|
||||
/* FALLTHRU */
|
||||
case DLGK_ENTER:
|
||||
result = (state > 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK;
|
||||
continue;
|
||||
case DLGK_LEAVE:
|
||||
if (state >= 0)
|
||||
result = dlg_ok_buttoncode(state);
|
||||
break;
|
||||
#ifdef KEY_RESIZE
|
||||
case KEY_RESIZE:
|
||||
dlg_will_resize(dialog);
|
||||
/* reset data */
|
||||
height = old_height;
|
||||
width = old_width;
|
||||
show_buttons = TRUE;
|
||||
*current = 0;
|
||||
resized = TRUE;
|
||||
/* repaint */
|
||||
free_list(&d_list, FALSE);
|
||||
free_list(&f_list, FALSE);
|
||||
_dlg_resize_cleanup(dialog);
|
||||
goto retry;
|
||||
#endif
|
||||
default:
|
||||
if (key >= DLGK_MOUSE(MOUSE_T)) {
|
||||
state = sTEXT;
|
||||
continue;
|
||||
} else if (key >= DLGK_MOUSE(MOUSE_F)) {
|
||||
if (f_list.win != 0) {
|
||||
state = sFILES;
|
||||
f_list.choice = (key - DLGK_MOUSE(MOUSE_F)) + f_list.offset;
|
||||
display_list(&f_list);
|
||||
}
|
||||
continue;
|
||||
} else if (key >= DLGK_MOUSE(MOUSE_D)) {
|
||||
if (d_list.win != 0) {
|
||||
state = sDIRS;
|
||||
d_list.choice = (key - DLGK_MOUSE(MOUSE_D)) + d_list.offset;
|
||||
display_list(&d_list);
|
||||
}
|
||||
continue;
|
||||
} else if (is_DLGK_MOUSE(key)
|
||||
&& (code = dlg_ok_buttoncode(key - M_EVENT)) >= 0) {
|
||||
result = code;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (state < 0) { /* Input box selected if we're editing */
|
||||
int edit = dlg_edit_string(input, &offset, key, fkey, first);
|
||||
|
||||
if (edit) {
|
||||
dlg_show_string(w_text, input, offset, inputbox_attr,
|
||||
0, 0, tbox_width, 0, first);
|
||||
first = FALSE;
|
||||
state = sTEXT;
|
||||
}
|
||||
} else if ((code = dlg_char_to_button(key, buttons)) >= 0) {
|
||||
result = dlg_ok_buttoncode(code);
|
||||
break;
|
||||
}
|
||||
}
|
||||
AddLastKey();
|
||||
|
||||
dlg_unregister_window(w_text);
|
||||
dlg_del_window(dialog);
|
||||
dlg_mouse_free_regions();
|
||||
free_list(&d_list, FALSE);
|
||||
free_list(&f_list, FALSE);
|
||||
|
||||
finish:
|
||||
if (partial != 0)
|
||||
free(partial);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display a dialog box for entering a filename
|
||||
*/
|
||||
int
|
||||
dialog_fselect(const char *title, const char *path, int height, int width)
|
||||
{
|
||||
return dlg_fselect(title, path, height, width, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Display a dialog box for entering a directory
|
||||
*/
|
||||
int
|
||||
dialog_dselect(const char *title, const char *path, int height, int width)
|
||||
{
|
||||
return dlg_fselect(title, path, height, width, TRUE);
|
||||
}
|
||||
@@ -1,456 +0,0 @@
|
||||
/*
|
||||
* $Id: guage.c,v 1.83 2020/03/27 20:54:43 tom Exp $
|
||||
*
|
||||
* guage.c -- implements the gauge dialog
|
||||
*
|
||||
* Copyright 2000-2019,2020 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*
|
||||
* An earlier version of this program lists as authors
|
||||
* Marc Ewing, Red Hat Software
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#define MY_LEN (MAX_LEN)/2
|
||||
|
||||
#define MIN_HIGH (4)
|
||||
#define MIN_WIDE (10 + 2 * (2 + MARGIN))
|
||||
|
||||
#define isMarker(buf) !strncmp(buf, "XXX", (size_t) 3)
|
||||
|
||||
typedef struct _my_obj {
|
||||
DIALOG_CALLBACK obj; /* has to be first in struct */
|
||||
struct _my_obj *next;
|
||||
WINDOW *text;
|
||||
char *title;
|
||||
char *prompt;
|
||||
char prompt_buf[MY_LEN];
|
||||
int percent;
|
||||
int height;
|
||||
int width;
|
||||
char line[MAX_LEN + 1];
|
||||
} MY_OBJ;
|
||||
|
||||
static MY_OBJ *all_objects;
|
||||
|
||||
static int
|
||||
valid(MY_OBJ * obj)
|
||||
{
|
||||
MY_OBJ *list = all_objects;
|
||||
int result = 0;
|
||||
|
||||
while (list != 0) {
|
||||
if (list == obj) {
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
list = list->next;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
delink(MY_OBJ * obj)
|
||||
{
|
||||
MY_OBJ *p = all_objects;
|
||||
MY_OBJ *q = 0;
|
||||
while (p != 0) {
|
||||
if (p == obj) {
|
||||
if (q != 0) {
|
||||
q->next = p->next;
|
||||
} else {
|
||||
all_objects = p->next;
|
||||
}
|
||||
break;
|
||||
}
|
||||
q = p;
|
||||
p = p->next;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
read_data(char *buffer, FILE *fp)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (feof(fp)) {
|
||||
result = 0;
|
||||
} else if (fgets(buffer, MY_LEN, fp) != 0) {
|
||||
DLG_TRACE(("read_data:%s", buffer));
|
||||
buffer[MY_LEN] = '\0';
|
||||
dlg_trim_string(buffer);
|
||||
result = 1;
|
||||
} else {
|
||||
result = -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static int
|
||||
decode_percent(char *buffer)
|
||||
{
|
||||
char *tmp = 0;
|
||||
long value = strtol(buffer, &tmp, 10);
|
||||
|
||||
if (tmp != 0 && (*tmp == 0 || isspace(UCH(*tmp))) && value >= 0) {
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
repaint_text(MY_OBJ * obj)
|
||||
{
|
||||
WINDOW *dialog = obj->obj.win;
|
||||
|
||||
if (dialog != 0) {
|
||||
int i, x;
|
||||
|
||||
(void) werase(dialog);
|
||||
dlg_draw_box2(dialog, 0, 0, obj->height, obj->width, dialog_attr,
|
||||
border_attr, border2_attr);
|
||||
|
||||
dlg_draw_title(dialog, obj->title);
|
||||
|
||||
dlg_attrset(dialog, dialog_attr);
|
||||
dlg_draw_helpline(dialog, FALSE);
|
||||
dlg_print_autowrap(dialog, obj->prompt, obj->height, obj->width);
|
||||
|
||||
dlg_draw_box2(dialog,
|
||||
obj->height - 4, 2 + MARGIN,
|
||||
2 + MARGIN, obj->width - 2 * (2 + MARGIN),
|
||||
dialog_attr,
|
||||
border_attr,
|
||||
border2_attr);
|
||||
|
||||
/*
|
||||
* Clear the area for the progress bar by filling it with spaces
|
||||
* in the gauge-attribute, and write the percentage with that
|
||||
* attribute.
|
||||
*/
|
||||
(void) wmove(dialog, obj->height - 3, 4);
|
||||
dlg_attrset(dialog, gauge_attr);
|
||||
|
||||
for (i = 0; i < (obj->width - 2 * (3 + MARGIN)); i++)
|
||||
(void) waddch(dialog, ' ');
|
||||
|
||||
(void) wmove(dialog, obj->height - 3, (obj->width / 2) - 2);
|
||||
(void) wprintw(dialog, "%3d%%", obj->percent);
|
||||
|
||||
/*
|
||||
* Now draw a bar in reverse, relative to the background.
|
||||
* The window attribute was useful for painting the background,
|
||||
* but requires some tweaks to reverse it.
|
||||
*/
|
||||
x = (obj->percent * (obj->width - 2 * (3 + MARGIN))) / 100;
|
||||
if ((gauge_attr & A_REVERSE) != 0) {
|
||||
dlg_attroff(dialog, A_REVERSE);
|
||||
} else {
|
||||
dlg_attrset(dialog, A_REVERSE);
|
||||
}
|
||||
(void) wmove(dialog, obj->height - 3, 4);
|
||||
for (i = 0; i < x; i++) {
|
||||
chtype ch2 = winch(dialog);
|
||||
if (gauge_attr & A_REVERSE) {
|
||||
ch2 &= ~A_REVERSE;
|
||||
}
|
||||
(void) waddch(dialog, ch2);
|
||||
}
|
||||
|
||||
(void) wrefresh(dialog);
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
handle_input(DIALOG_CALLBACK * cb)
|
||||
{
|
||||
MY_OBJ *obj = (MY_OBJ *) cb;
|
||||
bool result;
|
||||
bool cleanup = FALSE;
|
||||
int status;
|
||||
char buf[MY_LEN + 1];
|
||||
|
||||
if (dialog_state.pipe_input == 0) {
|
||||
status = -1;
|
||||
cleanup = TRUE;
|
||||
} else if ((status = read_data(buf, dialog_state.pipe_input)) > 0) {
|
||||
|
||||
if (isMarker(buf)) {
|
||||
/*
|
||||
* Historically, next line should be percentage, but one of the
|
||||
* worse-written clones of 'dialog' assumes the number is missing.
|
||||
* (Gresham's Law applied to software).
|
||||
*/
|
||||
if ((status = read_data(buf, dialog_state.pipe_input)) > 0) {
|
||||
|
||||
obj->prompt_buf[0] = '\0';
|
||||
if (decode_percent(buf))
|
||||
obj->percent = atoi(buf);
|
||||
else
|
||||
strcpy(obj->prompt_buf, buf);
|
||||
|
||||
/* Rest is message text */
|
||||
while ((status = read_data(buf, dialog_state.pipe_input)) > 0
|
||||
&& !isMarker(buf)) {
|
||||
if (strlen(obj->prompt_buf) + strlen(buf) <
|
||||
sizeof(obj->prompt_buf) - 1) {
|
||||
strcat(obj->prompt_buf, buf);
|
||||
}
|
||||
}
|
||||
|
||||
if (obj->prompt != obj->prompt_buf)
|
||||
free(obj->prompt);
|
||||
obj->prompt = obj->prompt_buf;
|
||||
}
|
||||
} else if (decode_percent(buf)) {
|
||||
obj->percent = atoi(buf);
|
||||
}
|
||||
} else {
|
||||
if (feof(dialog_state.pipe_input) ||
|
||||
(ferror(dialog_state.pipe_input) && errno != EINTR)) {
|
||||
cleanup = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
repaint_text(obj);
|
||||
if (status > 0) {
|
||||
result = TRUE;
|
||||
} else {
|
||||
result = FALSE;
|
||||
if (cleanup) {
|
||||
dlg_remove_callback(cb);
|
||||
delink(obj);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool
|
||||
handle_my_getc(DIALOG_CALLBACK * cb, int ch, int fkey, int *result)
|
||||
{
|
||||
bool status = TRUE;
|
||||
|
||||
*result = DLG_EXIT_OK;
|
||||
if (cb != 0) {
|
||||
if (!fkey && (ch == ERR)) {
|
||||
(void) handle_input(cb);
|
||||
/* cb might be freed in handle_input */
|
||||
status = (valid((MY_OBJ *) cb) && (cb->input != 0));
|
||||
}
|
||||
} else {
|
||||
status = FALSE;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
my_cleanup(DIALOG_CALLBACK * cb)
|
||||
{
|
||||
MY_OBJ *obj = (MY_OBJ *) cb;
|
||||
|
||||
if (valid(obj)) {
|
||||
if (obj->prompt != obj->prompt_buf) {
|
||||
free(obj->prompt);
|
||||
obj->prompt = obj->prompt_buf;
|
||||
}
|
||||
free(obj->title);
|
||||
dlg_del_window(obj->obj.win);
|
||||
delink(obj);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
dlg_update_gauge(void *objptr, int percent)
|
||||
{
|
||||
MY_OBJ *obj = (MY_OBJ *) objptr;
|
||||
bool save_finish_string = dialog_state.finish_string;
|
||||
|
||||
dialog_state.finish_string = TRUE;
|
||||
curs_set(0);
|
||||
obj->percent = percent;
|
||||
repaint_text(obj);
|
||||
dialog_state.finish_string = save_finish_string;
|
||||
}
|
||||
|
||||
/*
|
||||
* (Re)Allocates an object and fills it as per the arguments
|
||||
*/
|
||||
void *
|
||||
dlg_reallocate_gauge(void *objptr,
|
||||
const char *title,
|
||||
const char *cprompt,
|
||||
int height,
|
||||
int width,
|
||||
int percent)
|
||||
{
|
||||
char *prompt = dlg_strclone(cprompt);
|
||||
MY_OBJ *obj;
|
||||
bool save_finish_string = dialog_state.finish_string;
|
||||
|
||||
dialog_state.finish_string = TRUE;
|
||||
dlg_tab_correct_str(prompt);
|
||||
|
||||
if (objptr == 0) {
|
||||
/* create a new object */
|
||||
obj = dlg_calloc(MY_OBJ, 1);
|
||||
assert_ptr(obj, "dialog_gauge");
|
||||
|
||||
dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MIN_WIDE);
|
||||
dlg_print_size(height, width);
|
||||
dlg_ctl_size(height, width);
|
||||
|
||||
} else {
|
||||
/* reuse an existing object */
|
||||
obj = objptr;
|
||||
height = obj->height;
|
||||
width = obj->width;
|
||||
}
|
||||
|
||||
if (obj->obj.win == 0) {
|
||||
/* center dialog box on screen */
|
||||
int x = dlg_box_x_ordinate(width);
|
||||
int y = dlg_box_y_ordinate(height);
|
||||
WINDOW *dialog = dlg_new_window(height, width, y, x);
|
||||
obj->obj.win = dialog;
|
||||
}
|
||||
|
||||
obj->obj.input = dialog_state.pipe_input;
|
||||
obj->obj.keep_win = TRUE;
|
||||
obj->obj.bg_task = TRUE;
|
||||
obj->obj.handle_getc = handle_my_getc;
|
||||
obj->obj.handle_input = handle_input;
|
||||
|
||||
if (obj->title == 0 || strcmp(obj->title, title)) {
|
||||
dlg_finish_string(obj->title);
|
||||
free(obj->title);
|
||||
obj->title = dlg_strclone(title);
|
||||
}
|
||||
|
||||
dlg_finish_string(obj->prompt);
|
||||
free(obj->prompt);
|
||||
|
||||
obj->prompt = prompt;
|
||||
obj->percent = percent;
|
||||
obj->height = height;
|
||||
obj->width = width;
|
||||
|
||||
/* if this was a new object, link it into the list */
|
||||
if (objptr == 0) {
|
||||
obj->next = all_objects;
|
||||
all_objects = obj;
|
||||
}
|
||||
|
||||
dialog_state.finish_string = save_finish_string;
|
||||
return (void *) obj;
|
||||
}
|
||||
|
||||
void *
|
||||
dlg_allocate_gauge(const char *title,
|
||||
const char *cprompt,
|
||||
int height,
|
||||
int width,
|
||||
int percent)
|
||||
{
|
||||
return dlg_reallocate_gauge(NULL, title, cprompt, height, width, percent);
|
||||
}
|
||||
|
||||
void
|
||||
dlg_free_gauge(void *objptr)
|
||||
{
|
||||
MY_OBJ *obj = (MY_OBJ *) objptr;
|
||||
|
||||
if (valid(obj)) {
|
||||
if (obj->title)
|
||||
free(obj->title);
|
||||
if (obj->prompt)
|
||||
free(obj->prompt);
|
||||
obj->obj.keep_win = FALSE;
|
||||
dlg_remove_callback(&(obj->obj));
|
||||
delink(obj);
|
||||
}
|
||||
curs_set(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Display a gauge, or progress meter. Starts at percent% and reads stdin. If
|
||||
* stdin is not XXX, then it is interpreted as a percentage, and the display is
|
||||
* updated accordingly. Otherwise the next line is the percentage, and
|
||||
* subsequent lines up to another XXX are used for the new prompt. Note that
|
||||
* the size of the window never changes, so the prompt can not get any larger
|
||||
* than the height and width specified.
|
||||
*/
|
||||
int
|
||||
dialog_gauge(const char *title,
|
||||
const char *cprompt,
|
||||
int height,
|
||||
int width,
|
||||
int percent)
|
||||
{
|
||||
int fkey;
|
||||
int ch, result;
|
||||
void *objptr = dlg_allocate_gauge(title, cprompt, height, width, percent);
|
||||
MY_OBJ *obj = (MY_OBJ *) objptr;
|
||||
|
||||
DLG_TRACE(("# gauge args:\n"));
|
||||
DLG_TRACE2S("title", title);
|
||||
DLG_TRACE2S("message", cprompt);
|
||||
DLG_TRACE2N("height", height);
|
||||
DLG_TRACE2N("width", width);
|
||||
DLG_TRACE2N("percent", percent);
|
||||
|
||||
dlg_add_callback_ref((DIALOG_CALLBACK **) & obj, my_cleanup);
|
||||
dlg_update_gauge(obj, percent);
|
||||
|
||||
dlg_trace_win(obj->obj.win);
|
||||
do {
|
||||
ch = dlg_getc(obj->obj.win, &fkey);
|
||||
#ifdef KEY_RESIZE
|
||||
if (fkey && ch == KEY_RESIZE) {
|
||||
MY_OBJ *oldobj = obj;
|
||||
|
||||
dlg_will_resize(obj->obj.win);
|
||||
|
||||
obj = dlg_allocate_gauge(title,
|
||||
cprompt,
|
||||
height,
|
||||
width,
|
||||
oldobj->percent);
|
||||
|
||||
/* avoid breaking new window in dlg_remove_callback */
|
||||
oldobj->obj.caller = 0;
|
||||
oldobj->obj.input = 0;
|
||||
oldobj->obj.keep_win = FALSE;
|
||||
|
||||
/* remove the old version of the gauge */
|
||||
_dlg_resize_cleanup(oldobj->obj.win);
|
||||
dlg_remove_callback(&(oldobj->obj));
|
||||
|
||||
dlg_add_callback_ref((DIALOG_CALLBACK **) & obj, my_cleanup);
|
||||
dlg_update_gauge(obj, obj->percent);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
while (valid(obj) && handle_my_getc(&(obj->obj), ch, fkey, &result));
|
||||
|
||||
dlg_free_gauge(obj);
|
||||
|
||||
return (DLG_EXIT_OK);
|
||||
}
|
||||
@@ -1,199 +0,0 @@
|
||||
#! /bin/sh
|
||||
# $Id: headers-sh.in,v 1.11 2011/10/18 23:49:13 tom Exp $
|
||||
##############################################################################
|
||||
# Copyright (c) 2004-2007,2011 Thomas E. Dickey #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
# to deal in the Software without restriction, including without limitation #
|
||||
# the rights to use, copy, modify, merge, publish, distribute, distribute #
|
||||
# with modifications, sublicense, and/or sell copies of the Software, and to #
|
||||
# permit persons to whom the Software is furnished to do so, subject to the #
|
||||
# following conditions: #
|
||||
# #
|
||||
# The above copyright notice and this permission notice shall be included in #
|
||||
# all copies or substantial portions of the Software. #
|
||||
# #
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
|
||||
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
|
||||
# DEALINGS IN THE SOFTWARE. #
|
||||
# #
|
||||
# Except as contained in this notice, the name(s) of the above copyright #
|
||||
# holders shall not be used in advertising or otherwise to promote the sale, #
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
#
|
||||
# Adjust includes for header files that reside in a subdirectory of
|
||||
# /usr/include, etc.
|
||||
#
|
||||
# Parameters (the first case creates the sed script):
|
||||
# $1 is the target directory
|
||||
# $2 is the source directory
|
||||
# or (the second case does the install, using the sed script):
|
||||
# $1 is the script to use for installing
|
||||
# $2 is the target directory
|
||||
# $3 is the source directory
|
||||
# $4 is the file to install, editing source/target/etc.
|
||||
|
||||
PACKAGE=@PACKAGE@
|
||||
PKGNAME=@PACKAGE_PREFIX@
|
||||
CONFIGH=@PACKAGE_CONFIG@
|
||||
SUB_INC=@SUB_INC@
|
||||
|
||||
: ${TMPDIR:=/tmp}
|
||||
|
||||
TMPSED=headers.sed
|
||||
|
||||
DIGIT=0123456789
|
||||
alpha=abcdefghijklmnopqrstuvwxyz
|
||||
ALPHA=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
|
||||
alnum=_${DIGIT}${alpha}
|
||||
ALNUM=_${DIGIT}${ALPHA}
|
||||
MIXED=_${DIGIT}${ALPHA}${alpha}
|
||||
|
||||
pkgname=`echo "$PKGNAME" | tr "$ALPHA" "$alpha"`
|
||||
|
||||
if test $# = 2 ; then
|
||||
rm -f $TMPSED
|
||||
DST=$1
|
||||
REF=$2
|
||||
LEAF=`basename $DST`
|
||||
|
||||
# map the include-directory, if needed, to the subdirectory
|
||||
case $DST in
|
||||
/*/include/$LEAF)
|
||||
END=`basename $DST`
|
||||
for i in $REF/*.h
|
||||
do
|
||||
NAME=`basename $i`
|
||||
echo "s/<$NAME>/<$END\/$NAME>/g" >> $TMPSED
|
||||
done
|
||||
;;
|
||||
*)
|
||||
touch $TMPSED
|
||||
;;
|
||||
esac
|
||||
|
||||
# cannot do _this_ in -e options:
|
||||
cat >headers.tmp <<EOF
|
||||
s/^#[^ ][^ ]*//
|
||||
s/[^'$MIXED']/ /g
|
||||
s/[ ][ ]*/ /g
|
||||
s/^ //
|
||||
s/ $//
|
||||
:split
|
||||
h
|
||||
s/ .*//
|
||||
p
|
||||
t next
|
||||
b done
|
||||
:next
|
||||
x
|
||||
s/^[^ ][^ ]* //
|
||||
t split
|
||||
:done
|
||||
EOF
|
||||
# pick up autoconf-style symbols used in the application's headers
|
||||
for name in $REF/*.h
|
||||
do
|
||||
sed -e 's/^[ ][ ]*#[ ][ ]*/#/' $name \
|
||||
| egrep '^#(if|ifdef|ifndef|elif)' \
|
||||
| sed -f headers.tmp \
|
||||
| sort -u \
|
||||
| egrep '^(HAVE_|NEED_|NO_|ENABLE_|DISABLE_)' \
|
||||
| sed -e 's%^\(.*\)%s/\\<\1\\>/'${PKGNAME}'_\1/g%' >>$TMPSED
|
||||
done
|
||||
rm -f headers.tmp
|
||||
|
||||
# pick up autoconf-defined symbols in the config.h file
|
||||
for name in `
|
||||
egrep '^#define[ ][ ]*['$ALNUM']' $REF/$CONFIGH \
|
||||
| sed \
|
||||
-e 's/^#define[ ][ ]*//' \
|
||||
-e 's/[ ].*//' \
|
||||
| egrep -v "^${PACKAGE}_" \
|
||||
| sort -u`
|
||||
do
|
||||
echo "s/\\<$name\\>/${PKGNAME}_$name/g" >>$TMPSED
|
||||
done
|
||||
|
||||
if test "$SUB_INC" = yes
|
||||
then
|
||||
echo "s,#include <${pkgname}_,#include <${PACKAGE}/${pkgname}_," >>$TMPSED
|
||||
fi
|
||||
|
||||
echo '/_FILE_OFFSET_BITS/d' >>$TMPSED
|
||||
|
||||
# reduce the count if possible, since some old sed's limit is 100 lines
|
||||
sort -u $TMPSED >headers.tmp
|
||||
mv headers.tmp $TMPSED
|
||||
else
|
||||
PRG=""
|
||||
while test $# != 3
|
||||
do
|
||||
PRG="$PRG $1"; shift
|
||||
done
|
||||
|
||||
DST=$1
|
||||
REF=$2
|
||||
SRC=$3
|
||||
|
||||
SHOW=`basename $SRC`
|
||||
TMPSRC=$TMPDIR/${SHOW}-text$$
|
||||
TMPEDT=$TMPDIR/${SHOW}-edit$$
|
||||
TMPTMP=$TMPDIR/${SHOW}-temp$$
|
||||
|
||||
echo " ... $SHOW"
|
||||
test -f $REF/$SRC && SRC="$REF/$SRC"
|
||||
|
||||
rm -f $TMPSRC
|
||||
cat $SRC >$TMPSRC
|
||||
|
||||
tmp1=1
|
||||
while true
|
||||
do
|
||||
tmp2=`expr $tmp1 + 49`
|
||||
if test $tmp1 = 1
|
||||
then
|
||||
sed "${tmp2}q" $TMPSED >$TMPEDT
|
||||
else
|
||||
sed "1,${tmp1}d; ${tmp2}q" $TMPSED >$TMPEDT
|
||||
fi
|
||||
test -s $TMPEDT || break
|
||||
sed -f $TMPEDT $TMPSRC > $TMPTMP
|
||||
mv $TMPTMP $TMPSRC
|
||||
tmp1=$tmp2
|
||||
done
|
||||
|
||||
NAME=`basename $SRC`
|
||||
|
||||
# Just in case someone gzip'd manpages, remove the conflicting copy.
|
||||
test -f $DST/$NAME.gz && rm -f $DST/$NAME.gz
|
||||
|
||||
if test "$SUB_INC" = yes
|
||||
then
|
||||
case $NAME in #(vi
|
||||
${pkgname}_*) #(vi
|
||||
case "$PRG" in #(vi
|
||||
*install*)
|
||||
test -d $DST/$PACKAGE || mkdir -p $DST/$PACKAGE
|
||||
;;
|
||||
esac
|
||||
NAME=$PACKAGE/$NAME
|
||||
;;
|
||||
*)
|
||||
NAME=$PACKAGE.h
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
eval $PRG $TMPSRC $DST/$NAME
|
||||
rm -f $TMPEDT $TMPTMP $TMPSRC
|
||||
fi
|
||||
# vile:ts=4 sw=4
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* $Id: help.c,v 1.3 2012/12/04 02:01:10 tom Exp $
|
||||
*
|
||||
* help.c -- implements the help dialog
|
||||
*
|
||||
* Copyright 2011,2012 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
|
||||
/*
|
||||
* Display a help-file as a textbox widget.
|
||||
*/
|
||||
int
|
||||
dialog_helpfile(const char *title,
|
||||
const char *file,
|
||||
int height,
|
||||
int width)
|
||||
{
|
||||
int result = DLG_EXIT_ERROR;
|
||||
DIALOG_VARS save;
|
||||
|
||||
if (!dialog_vars.in_helpfile && file != 0 && *file != '\0') {
|
||||
dlg_save_vars(&save);
|
||||
|
||||
dialog_vars.no_label = NULL;
|
||||
dialog_vars.ok_label = NULL;
|
||||
dialog_vars.help_button = FALSE;
|
||||
dialog_vars.extra_button = FALSE;
|
||||
dialog_vars.nook = FALSE;
|
||||
|
||||
dialog_vars.in_helpfile = TRUE;
|
||||
|
||||
result = dialog_textbox(title, file, height, width);
|
||||
|
||||
dlg_restore_vars(&save);
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
@@ -1,274 +0,0 @@
|
||||
/*
|
||||
* $Id: inputbox.c,v 1.93 2021/01/17 16:36:37 tom Exp $
|
||||
*
|
||||
* inputbox.c -- implements the input box
|
||||
*
|
||||
* Copyright 2000-2020,2021 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*
|
||||
* An earlier version of this program lists as authors:
|
||||
* Savio Lam (lam836@cs.cuhk.hk)
|
||||
*/
|
||||
|
||||
#include <dlg_internals.h>
|
||||
#include <dlg_keys.h>
|
||||
|
||||
#define sTEXT -1
|
||||
|
||||
#define NAVIGATE_BINDINGS \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_DOWN ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ), \
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_UP )
|
||||
|
||||
#define BTN_HIGH 1
|
||||
#define HDR_HIGH 1
|
||||
#define MIN_HIGH (HDR_HIGH + (MARGIN * 2 + 1) + (BTN_HIGH + MARGIN * 2))
|
||||
#define MIN_WIDE 26
|
||||
|
||||
/*
|
||||
* Display a dialog box for entering a string
|
||||
*/
|
||||
int
|
||||
dialog_inputbox(const char *title, const char *cprompt, int height, int width,
|
||||
const char *init, const int password)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
static DLG_KEYS_BINDING binding[] = {
|
||||
HELPKEY_BINDINGS,
|
||||
ENTERKEY_BINDINGS,
|
||||
NAVIGATE_BINDINGS,
|
||||
TOGGLEKEY_BINDINGS,
|
||||
END_KEYS_BINDING
|
||||
};
|
||||
static DLG_KEYS_BINDING binding2[] = {
|
||||
INPUTSTR_BINDINGS,
|
||||
HELPKEY_BINDINGS,
|
||||
ENTERKEY_BINDINGS,
|
||||
NAVIGATE_BINDINGS,
|
||||
/* no TOGGLEKEY_BINDINGS, since that includes space... */
|
||||
END_KEYS_BINDING
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
int old_height = height;
|
||||
int old_width = width;
|
||||
#endif
|
||||
int xorg, yorg;
|
||||
int x, y, box_y, box_x, box_width;
|
||||
int show_buttons;
|
||||
int col_offset = 0;
|
||||
int chr_offset = 0;
|
||||
int key, fkey, code;
|
||||
int result = DLG_EXIT_UNKNOWN;
|
||||
int state;
|
||||
bool first;
|
||||
bool edited;
|
||||
char *input;
|
||||
WINDOW *dialog;
|
||||
WINDOW *editor;
|
||||
char *prompt = dlg_strclone(cprompt);
|
||||
const char **buttons = dlg_ok_labels();
|
||||
|
||||
dlg_does_output();
|
||||
|
||||
DLG_TRACE(("# inputbox args:\n"));
|
||||
DLG_TRACE2S("title", title);
|
||||
DLG_TRACE2S("message", cprompt);
|
||||
DLG_TRACE2N("height", height);
|
||||
DLG_TRACE2N("width", width);
|
||||
DLG_TRACE2S("init", init);
|
||||
DLG_TRACE2N("password", password);
|
||||
|
||||
dlg_tab_correct_str(prompt);
|
||||
|
||||
/* Set up the initial value */
|
||||
input = dlg_set_result(init);
|
||||
edited = FALSE;
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
retry:
|
||||
#endif
|
||||
show_buttons = TRUE;
|
||||
state = dialog_vars.default_button >= 0 ? dlg_default_button() : sTEXT;
|
||||
first = (state == sTEXT);
|
||||
key = fkey = 0;
|
||||
|
||||
if (init != NULL) {
|
||||
dlg_auto_size(title, prompt, &height, &width, MIN_HIGH,
|
||||
MIN(MAX(dlg_count_columns(init) + 7, MIN_WIDE),
|
||||
SCOLS - (dialog_vars.begin_set ?
|
||||
dialog_vars.begin_x : 0)));
|
||||
chr_offset = (int) strlen(init);
|
||||
} else {
|
||||
dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MIN_WIDE);
|
||||
}
|
||||
dlg_button_layout(buttons, &width);
|
||||
dlg_print_size(height, width);
|
||||
dlg_ctl_size(height, width);
|
||||
|
||||
xorg = dlg_box_x_ordinate(width);
|
||||
yorg = dlg_box_y_ordinate(height);
|
||||
|
||||
dialog = dlg_new_window(height, width, yorg, xorg);
|
||||
dlg_register_window(dialog, "inputbox", binding);
|
||||
dlg_register_buttons(dialog, "inputbox", buttons);
|
||||
|
||||
dlg_mouse_setbase(xorg, yorg);
|
||||
|
||||
dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr);
|
||||
dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr);
|
||||
dlg_draw_title(dialog, title);
|
||||
|
||||
dlg_attrset(dialog, dialog_attr);
|
||||
dlg_draw_helpline(dialog, FALSE);
|
||||
dlg_print_autowrap(dialog, prompt, height, width);
|
||||
|
||||
/* Draw the input field box */
|
||||
box_width = width - 6;
|
||||
getyx(dialog, y, x);
|
||||
(void) x;
|
||||
box_y = y + 2;
|
||||
box_x = (width - box_width) / 2;
|
||||
dlg_mouse_mkregion(y + 1, box_x - 1, 3, box_width + 2, 'i');
|
||||
dlg_draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2,
|
||||
border_attr, border2_attr);
|
||||
|
||||
/* Make a window for the input-field, to associate bindings */
|
||||
editor = dlg_sub_window(dialog, 1, box_width, yorg + box_y, xorg + box_x);
|
||||
dlg_register_window(editor, "inputbox2", binding2);
|
||||
|
||||
if (*input != '\0') {
|
||||
dlg_show_string(editor, input, chr_offset, inputbox_attr,
|
||||
0, 0, box_width, (bool) (password != 0), first);
|
||||
wsyncup(editor);
|
||||
wcursyncup(editor);
|
||||
}
|
||||
|
||||
while (result == DLG_EXIT_UNKNOWN) {
|
||||
/*
|
||||
* The last field drawn determines where the cursor is shown:
|
||||
*/
|
||||
if (show_buttons) {
|
||||
show_buttons = FALSE;
|
||||
col_offset = dlg_edit_offset(input, chr_offset, box_width);
|
||||
(void) wmove(dialog, box_y, box_x + col_offset);
|
||||
dlg_draw_buttons(dialog, height - 2, 0, buttons, state, FALSE, width);
|
||||
}
|
||||
|
||||
if (!first) {
|
||||
if (*input != '\0' && !edited) {
|
||||
dlg_show_string(editor, input, chr_offset, inputbox_attr,
|
||||
0, 0, box_width, (bool) (password != 0), first);
|
||||
wmove(editor, 0, chr_offset);
|
||||
wsyncup(editor);
|
||||
wcursyncup(editor);
|
||||
}
|
||||
key = dlg_mouse_wgetch((state == sTEXT) ? editor : dialog, &fkey);
|
||||
if (dlg_result_key(key, fkey, &result)) {
|
||||
if (!dlg_button_key(result, &code, &key, &fkey))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle mouse clicks first, since we want to know if this is a button,
|
||||
* or something that dlg_edit_string() should handle.
|
||||
*/
|
||||
if (fkey
|
||||
&& is_DLGK_MOUSE(key)
|
||||
&& (code = dlg_ok_buttoncode(key - M_EVENT)) >= 0) {
|
||||
result = code;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (state == sTEXT) { /* Input box selected */
|
||||
int edit = dlg_edit_string(input, &chr_offset, key, fkey, first);
|
||||
|
||||
if (edit) {
|
||||
dlg_show_string(editor, input, chr_offset, inputbox_attr,
|
||||
0, 0, box_width, (bool) (password != 0), first);
|
||||
wsyncup(editor);
|
||||
wcursyncup(editor);
|
||||
first = FALSE;
|
||||
edited = TRUE;
|
||||
continue;
|
||||
} else if (first) {
|
||||
first = FALSE;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* handle non-functionkeys */
|
||||
if (!fkey && (code = dlg_char_to_button(key, buttons)) >= 0) {
|
||||
dlg_del_window(dialog);
|
||||
result = dlg_ok_buttoncode(code);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* handle functionkeys */
|
||||
if (fkey) {
|
||||
switch (key) {
|
||||
case DLGK_MOUSE('i'): /* mouse enter events */
|
||||
state = 0;
|
||||
/* FALLTHRU */
|
||||
case DLGK_FIELD_PREV:
|
||||
show_buttons = TRUE;
|
||||
state = dlg_prev_ok_buttonindex(state, sTEXT);
|
||||
break;
|
||||
case DLGK_FIELD_NEXT:
|
||||
show_buttons = TRUE;
|
||||
state = dlg_next_ok_buttonindex(state, sTEXT);
|
||||
break;
|
||||
case DLGK_TOGGLE:
|
||||
case DLGK_ENTER:
|
||||
dlg_del_window(dialog);
|
||||
result = (state >= 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK;
|
||||
break;
|
||||
case DLGK_LEAVE:
|
||||
if (state >= 0)
|
||||
result = dlg_ok_buttoncode(state);
|
||||
break;
|
||||
#ifdef KEY_RESIZE
|
||||
case KEY_RESIZE:
|
||||
dlg_will_resize(dialog);
|
||||
/* reset data */
|
||||
height = old_height;
|
||||
width = old_width;
|
||||
/* repaint */
|
||||
_dlg_resize_cleanup(dialog);
|
||||
goto retry;
|
||||
#endif
|
||||
default:
|
||||
beep();
|
||||
break;
|
||||
}
|
||||
} else if (key > 0) {
|
||||
beep();
|
||||
}
|
||||
}
|
||||
AddLastKey();
|
||||
|
||||
dlg_unregister_window(editor);
|
||||
dlg_del_window(dialog);
|
||||
dlg_mouse_free_regions();
|
||||
free(prompt);
|
||||
return result;
|
||||
}
|
||||
@@ -1,808 +0,0 @@
|
||||
/*
|
||||
* $Id: inputstr.c,v 1.91 2021/01/17 22:19:05 tom Exp $
|
||||
*
|
||||
* inputstr.c -- functions for input/display of a string
|
||||
*
|
||||
* Copyright 2000-2019,2021 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
#include <dlg_keys.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SEARCH_H) && defined(HAVE_TSEARCH)
|
||||
#include <search.h>
|
||||
#else
|
||||
#undef HAVE_TSEARCH
|
||||
#endif
|
||||
|
||||
#ifdef NEED_WCHAR_H
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
#if defined(USE_WIDE_CURSES)
|
||||
#define USE_CACHING 1
|
||||
#elif defined(HAVE_XDIALOG)
|
||||
#define USE_CACHING 1 /* editbox really needs caching! */
|
||||
#else
|
||||
#define USE_CACHING 0
|
||||
#endif
|
||||
|
||||
typedef struct _cache {
|
||||
struct _cache *next;
|
||||
#if USE_CACHING
|
||||
int cache_num; /* tells what type of data is in list[] */
|
||||
const char *string_at; /* unique: associate caches by char* */
|
||||
#endif
|
||||
size_t s_len; /* strlen(string) - we add 1 for EOS */
|
||||
size_t i_len; /* length(list) - we add 1 for EOS */
|
||||
char *string; /* a copy of the last-processed string */
|
||||
int *list; /* indices into the string */
|
||||
} CACHE;
|
||||
|
||||
#if USE_CACHING
|
||||
#define SAME_CACHE(c,s,l) (c->string != 0 && memcmp(c->string,s,l) == 0)
|
||||
|
||||
static CACHE *cache_list;
|
||||
|
||||
typedef enum {
|
||||
cInxCols
|
||||
,cCntWideBytes
|
||||
,cCntWideChars
|
||||
,cInxWideChars
|
||||
,cMAX
|
||||
} CACHE_USED;
|
||||
|
||||
#ifdef HAVE_TSEARCH
|
||||
static void *sorted_cache;
|
||||
#endif
|
||||
|
||||
#ifdef USE_WIDE_CURSES
|
||||
static int
|
||||
have_locale(void)
|
||||
{
|
||||
static int result = -1;
|
||||
if (result < 0) {
|
||||
char *test = setlocale(LC_ALL, 0);
|
||||
if (test == 0 || *test == 0) {
|
||||
result = FALSE;
|
||||
} else if (strcmp(test, "C") && strcmp(test, "POSIX")) {
|
||||
result = TRUE;
|
||||
} else {
|
||||
result = FALSE;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TSEARCH
|
||||
|
||||
#if 0
|
||||
static void
|
||||
show_tsearch(const void *nodep, const VISIT which, const int depth)
|
||||
{
|
||||
const CACHE *p = *(CACHE * const *) nodep;
|
||||
(void) depth;
|
||||
if (which == postorder || which == leaf) {
|
||||
DLG_TRACE(("# cache %p %p:%s\n", p, p->string, p->string));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
trace_cache(const char *fn, int ln)
|
||||
{
|
||||
DLG_TRACE(("# trace_cache %s@%d\n", fn, ln));
|
||||
twalk(sorted_cache, show_tsearch);
|
||||
}
|
||||
|
||||
#else
|
||||
#define trace_cache(fn, ln) /* nothing */
|
||||
#endif
|
||||
|
||||
#define CMP(a,b) (((a) > (b)) ? 1 : (((a) < (b)) ? -1 : 0))
|
||||
|
||||
static int
|
||||
compare_cache(const void *a, const void *b)
|
||||
{
|
||||
const CACHE *p = (const CACHE *) a;
|
||||
const CACHE *q = (const CACHE *) b;
|
||||
int result = CMP(p->cache_num, q->cache_num);
|
||||
if (result == 0)
|
||||
result = CMP(p->string_at, q->string_at);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
static CACHE *
|
||||
find_cache(int cache_num, const char *string)
|
||||
{
|
||||
CACHE *p;
|
||||
|
||||
#ifdef HAVE_TSEARCH
|
||||
void *pp;
|
||||
CACHE find;
|
||||
|
||||
memset(&find, 0, sizeof(find));
|
||||
find.cache_num = cache_num;
|
||||
find.string_at = string;
|
||||
|
||||
if ((pp = tfind(&find, &sorted_cache, compare_cache)) != 0) {
|
||||
p = *(CACHE **) pp;
|
||||
} else {
|
||||
p = 0;
|
||||
}
|
||||
#else
|
||||
for (p = cache_list; p != 0; p = p->next) {
|
||||
if (p->string_at == string) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
|
||||
static CACHE *
|
||||
make_cache(int cache_num, const char *string)
|
||||
{
|
||||
CACHE *p;
|
||||
|
||||
p = dlg_calloc(CACHE, 1);
|
||||
assert_ptr(p, "load_cache");
|
||||
p->next = cache_list;
|
||||
cache_list = p;
|
||||
|
||||
p->cache_num = cache_num;
|
||||
p->string_at = string;
|
||||
|
||||
#ifdef HAVE_TSEARCH
|
||||
(void) tsearch(p, &sorted_cache, compare_cache);
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
|
||||
static CACHE *
|
||||
load_cache(int cache_num, const char *string)
|
||||
{
|
||||
CACHE *p;
|
||||
|
||||
if ((p = find_cache(cache_num, string)) == 0) {
|
||||
p = make_cache(cache_num, string);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
#else
|
||||
static CACHE my_cache;
|
||||
#define SAME_CACHE(c,s,l) (c->string != 0)
|
||||
#define load_cache(cache, string) &my_cache
|
||||
#endif /* USE_CACHING */
|
||||
|
||||
/*
|
||||
* If the given string has not changed, we do not need to update the index.
|
||||
* If we need to update the index, allocate enough memory for it.
|
||||
*/
|
||||
static bool
|
||||
same_cache2(CACHE * cache, const char *string, unsigned i_len)
|
||||
{
|
||||
size_t s_len = strlen(string);
|
||||
bool result = TRUE;
|
||||
|
||||
if (cache->s_len == 0
|
||||
|| cache->s_len < s_len
|
||||
|| cache->list == 0
|
||||
|| !SAME_CACHE(cache, string, (size_t) s_len)) {
|
||||
unsigned need = (i_len + 1);
|
||||
|
||||
if (cache->list == 0) {
|
||||
cache->list = dlg_malloc(int, need);
|
||||
} else if (cache->i_len < i_len) {
|
||||
cache->list = dlg_realloc(int, need, cache->list);
|
||||
}
|
||||
assert_ptr(cache->list, "load_cache");
|
||||
cache->i_len = i_len;
|
||||
|
||||
if (cache->s_len >= s_len && cache->string != 0) {
|
||||
strcpy(cache->string, string);
|
||||
} else {
|
||||
if (cache->string != 0)
|
||||
free(cache->string);
|
||||
cache->string = dlg_strclone(string);
|
||||
}
|
||||
cache->s_len = s_len;
|
||||
|
||||
result = FALSE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef USE_WIDE_CURSES
|
||||
/*
|
||||
* Like same_cache2(), but we are only concerned about caching a copy of the
|
||||
* string and its associated length.
|
||||
*/
|
||||
static bool
|
||||
same_cache1(CACHE * cache, const char *string, size_t i_len)
|
||||
{
|
||||
size_t s_len = strlen(string);
|
||||
bool result = TRUE;
|
||||
|
||||
if (cache->s_len != s_len
|
||||
|| !SAME_CACHE(cache, string, (size_t) s_len)) {
|
||||
|
||||
if (cache->s_len >= s_len && cache->string != 0) {
|
||||
strcpy(cache->string, string);
|
||||
} else {
|
||||
if (cache->string != 0)
|
||||
free(cache->string);
|
||||
cache->string = dlg_strclone(string);
|
||||
}
|
||||
cache->s_len = s_len;
|
||||
cache->i_len = i_len;
|
||||
|
||||
result = FALSE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endif /* USE_CACHING */
|
||||
|
||||
/*
|
||||
* Counts the number of bytes that make up complete wide-characters, up to byte
|
||||
* 'len'. If there is no locale set, simply return the original length.
|
||||
*/
|
||||
#ifdef USE_WIDE_CURSES
|
||||
static int
|
||||
dlg_count_wcbytes(const char *string, size_t len)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (have_locale()) {
|
||||
CACHE *cache = load_cache(cCntWideBytes, string);
|
||||
if (!same_cache1(cache, string, len)) {
|
||||
while (len != 0) {
|
||||
size_t code = 0;
|
||||
const char *src = cache->string;
|
||||
mbstate_t state;
|
||||
char save = cache->string[len];
|
||||
|
||||
cache->string[len] = '\0';
|
||||
memset(&state, 0, sizeof(state));
|
||||
code = mbsrtowcs((wchar_t *) 0, &src, len, &state);
|
||||
cache->string[len] = save;
|
||||
if ((int) code >= 0) {
|
||||
break;
|
||||
}
|
||||
--len;
|
||||
}
|
||||
cache->i_len = len;
|
||||
}
|
||||
result = (int) cache->i_len;
|
||||
} else {
|
||||
result = (int) len;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endif /* USE_WIDE_CURSES */
|
||||
|
||||
/*
|
||||
* Counts the number of wide-characters in the string.
|
||||
*/
|
||||
int
|
||||
dlg_count_wchars(const char *string)
|
||||
{
|
||||
int result;
|
||||
#ifdef USE_WIDE_CURSES
|
||||
|
||||
if (have_locale()) {
|
||||
size_t len = strlen(string);
|
||||
CACHE *cache = load_cache(cCntWideChars, string);
|
||||
|
||||
if (!same_cache1(cache, string, len)) {
|
||||
const char *src = cache->string;
|
||||
mbstate_t state;
|
||||
int part = dlg_count_wcbytes(cache->string, len);
|
||||
char save = cache->string[part];
|
||||
wchar_t *temp = dlg_calloc(wchar_t, len + 1);
|
||||
|
||||
if (temp != 0) {
|
||||
size_t code;
|
||||
|
||||
cache->string[part] = '\0';
|
||||
memset(&state, 0, sizeof(state));
|
||||
code = mbsrtowcs(temp, &src, (size_t) part, &state);
|
||||
cache->i_len = ((int) code >= 0) ? wcslen(temp) : 0;
|
||||
cache->string[part] = save;
|
||||
free(temp);
|
||||
} else {
|
||||
cache->i_len = 0;
|
||||
}
|
||||
}
|
||||
result = (int) cache->i_len;
|
||||
} else
|
||||
#endif /* USE_WIDE_CURSES */
|
||||
{
|
||||
result = (int) strlen(string);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Build an index of the wide-characters in the string, so we can easily tell
|
||||
* which byte-offset begins a given wide-character.
|
||||
*/
|
||||
const int *
|
||||
dlg_index_wchars(const char *string)
|
||||
{
|
||||
unsigned len = (unsigned) dlg_count_wchars(string);
|
||||
CACHE *cache = load_cache(cInxWideChars, string);
|
||||
|
||||
if (!same_cache2(cache, string, len)) {
|
||||
const char *current = string;
|
||||
unsigned inx;
|
||||
|
||||
cache->list[0] = 0;
|
||||
for (inx = 1; inx <= len; ++inx) {
|
||||
#ifdef USE_WIDE_CURSES
|
||||
if (have_locale()) {
|
||||
mbstate_t state;
|
||||
int width;
|
||||
memset(&state, 0, sizeof(state));
|
||||
width = (int) mbrlen(current, strlen(current), &state);
|
||||
if (width <= 0)
|
||||
width = 1; /* FIXME: what if we have a control-char? */
|
||||
current += width;
|
||||
cache->list[inx] = cache->list[inx - 1] + width;
|
||||
} else
|
||||
#endif /* USE_WIDE_CURSES */
|
||||
{
|
||||
(void) current;
|
||||
cache->list[inx] = (int) inx;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cache->list;
|
||||
}
|
||||
|
||||
/*
|
||||
* Given the character-offset to find in the list, return the corresponding
|
||||
* array index.
|
||||
*/
|
||||
int
|
||||
dlg_find_index(const int *list, int limit, int to_find)
|
||||
{
|
||||
int result;
|
||||
for (result = 0; result <= limit; ++result) {
|
||||
if (to_find == list[result]
|
||||
|| result == limit
|
||||
|| ((result < limit) && (to_find < list[result + 1]))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Build a list of the display-columns for the given string's characters.
|
||||
*/
|
||||
const int *
|
||||
dlg_index_columns(const char *string)
|
||||
{
|
||||
unsigned len = (unsigned) dlg_count_wchars(string);
|
||||
CACHE *cache = load_cache(cInxCols, string);
|
||||
|
||||
if (!same_cache2(cache, string, len)) {
|
||||
|
||||
cache->list[0] = 0;
|
||||
#ifdef USE_WIDE_CURSES
|
||||
if (have_locale()) {
|
||||
unsigned inx;
|
||||
size_t num_bytes = strlen(string);
|
||||
const int *inx_wchars = dlg_index_wchars(string);
|
||||
mbstate_t state;
|
||||
|
||||
for (inx = 0; inx < len; ++inx) {
|
||||
int result;
|
||||
|
||||
if (string[inx_wchars[inx]] == TAB) {
|
||||
result = ((cache->list[inx] | 7) + 1) - cache->list[inx];
|
||||
} else {
|
||||
wchar_t temp[2];
|
||||
size_t check;
|
||||
|
||||
memset(&state, 0, sizeof(state));
|
||||
memset(temp, 0, sizeof(temp));
|
||||
check = mbrtowc(temp,
|
||||
string + inx_wchars[inx],
|
||||
num_bytes - (size_t) inx_wchars[inx],
|
||||
&state);
|
||||
if ((int) check <= 0) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = wcwidth(temp[0]);
|
||||
}
|
||||
if (result < 0) {
|
||||
const wchar_t *printable;
|
||||
cchar_t temp2, *temp2p = &temp2;
|
||||
setcchar(temp2p, temp, 0, 0, 0);
|
||||
printable = wunctrl(temp2p);
|
||||
result = printable ? (int) wcslen(printable) : 1;
|
||||
}
|
||||
}
|
||||
cache->list[inx + 1] = result;
|
||||
if (inx != 0)
|
||||
cache->list[inx + 1] += cache->list[inx];
|
||||
}
|
||||
} else
|
||||
#endif /* USE_WIDE_CURSES */
|
||||
{
|
||||
unsigned inx;
|
||||
|
||||
for (inx = 0; inx < len; ++inx) {
|
||||
chtype ch = UCH(string[inx]);
|
||||
|
||||
if (ch == TAB)
|
||||
cache->list[inx + 1] =
|
||||
((cache->list[inx] | 7) + 1) - cache->list[inx];
|
||||
else if (isprint(UCH(ch)))
|
||||
cache->list[inx + 1] = 1;
|
||||
else {
|
||||
const char *printable;
|
||||
printable = unctrl(ch);
|
||||
cache->list[inx + 1] = (printable
|
||||
? (int) strlen(printable)
|
||||
: 1);
|
||||
}
|
||||
if (inx != 0)
|
||||
cache->list[inx + 1] += cache->list[inx];
|
||||
}
|
||||
}
|
||||
}
|
||||
return cache->list;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the number of columns used for a string. That happens to be the
|
||||
* end-value of the cols[] array.
|
||||
*/
|
||||
int
|
||||
dlg_count_columns(const char *string)
|
||||
{
|
||||
int result = 0;
|
||||
int limit = dlg_count_wchars(string);
|
||||
if (limit > 0) {
|
||||
const int *cols = dlg_index_columns(string);
|
||||
result = cols[limit];
|
||||
} else {
|
||||
result = (int) strlen(string);
|
||||
}
|
||||
dlg_finish_string(string);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Given a column limit, count the number of wide characters that can fit
|
||||
* into that limit. The offset is used to skip over a leading character
|
||||
* that was already written.
|
||||
*/
|
||||
int
|
||||
dlg_limit_columns(const char *string, int limit, int offset)
|
||||
{
|
||||
const int *cols = dlg_index_columns(string);
|
||||
int result = dlg_count_wchars(string);
|
||||
|
||||
while (result > 0 && (cols[result] - cols[offset]) > limit)
|
||||
--result;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Updates the string and character-offset, given various editing characters
|
||||
* or literal characters which are inserted at the character-offset.
|
||||
*/
|
||||
bool
|
||||
dlg_edit_string(char *string, int *chr_offset, int key, int fkey, bool force)
|
||||
{
|
||||
int i;
|
||||
int len = (int) strlen(string);
|
||||
int limit = dlg_count_wchars(string);
|
||||
const int *indx = dlg_index_wchars(string);
|
||||
int offset = dlg_find_index(indx, limit, *chr_offset);
|
||||
int max_len = dlg_max_input(MAX_LEN);
|
||||
bool edit = TRUE;
|
||||
|
||||
/* transform editing characters into equivalent function-keys */
|
||||
if (!fkey) {
|
||||
fkey = TRUE; /* assume we transform */
|
||||
switch (key) {
|
||||
case 0:
|
||||
break;
|
||||
case ESC:
|
||||
case TAB:
|
||||
fkey = FALSE; /* this is used for navigation */
|
||||
break;
|
||||
default:
|
||||
fkey = FALSE; /* ...no, we did not transform */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fkey) {
|
||||
switch (key) {
|
||||
case 0: /* special case for loop entry */
|
||||
edit = force;
|
||||
break;
|
||||
case DLGK_GRID_LEFT:
|
||||
if (*chr_offset && offset > 0)
|
||||
*chr_offset = indx[offset - 1];
|
||||
break;
|
||||
case DLGK_GRID_RIGHT:
|
||||
if (offset < limit)
|
||||
*chr_offset = indx[offset + 1];
|
||||
break;
|
||||
case DLGK_BEGIN:
|
||||
if (*chr_offset)
|
||||
*chr_offset = 0;
|
||||
break;
|
||||
case DLGK_FINAL:
|
||||
if (offset < limit)
|
||||
*chr_offset = indx[limit];
|
||||
break;
|
||||
case DLGK_DELETE_LEFT:
|
||||
if (offset) {
|
||||
int gap = indx[offset] - indx[offset - 1];
|
||||
*chr_offset = indx[offset - 1];
|
||||
if (gap > 0) {
|
||||
for (i = *chr_offset;
|
||||
(string[i] = string[i + gap]) != '\0';
|
||||
i++) {
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DLGK_DELETE_RIGHT:
|
||||
if (limit) {
|
||||
if (--limit == 0) {
|
||||
string[*chr_offset = 0] = '\0';
|
||||
} else {
|
||||
int gap = ((offset <= limit)
|
||||
? (indx[offset + 1] - indx[offset])
|
||||
: 0);
|
||||
if (gap > 0) {
|
||||
for (i = indx[offset];
|
||||
(string[i] = string[i + gap]) != '\0';
|
||||
i++) {
|
||||
;
|
||||
}
|
||||
} else if (offset > 0) {
|
||||
string[indx[offset - 1]] = '\0';
|
||||
}
|
||||
if (*chr_offset > indx[limit])
|
||||
*chr_offset = indx[limit];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DLGK_DELETE_ALL:
|
||||
string[*chr_offset = 0] = '\0';
|
||||
break;
|
||||
case DLGK_ENTER:
|
||||
edit = 0;
|
||||
break;
|
||||
#ifdef KEY_RESIZE
|
||||
case KEY_RESIZE:
|
||||
edit = 0;
|
||||
break;
|
||||
#endif
|
||||
case DLGK_GRID_UP:
|
||||
case DLGK_GRID_DOWN:
|
||||
case DLGK_FIELD_NEXT:
|
||||
case DLGK_FIELD_PREV:
|
||||
edit = 0;
|
||||
break;
|
||||
case ERR:
|
||||
edit = 0;
|
||||
break;
|
||||
default:
|
||||
beep();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (key == ESC || key == ERR) {
|
||||
edit = 0;
|
||||
} else {
|
||||
if (len < max_len) {
|
||||
for (i = ++len; i > *chr_offset; i--)
|
||||
string[i] = string[i - 1];
|
||||
string[*chr_offset] = (char) key;
|
||||
*chr_offset += 1;
|
||||
} else {
|
||||
(void) beep();
|
||||
}
|
||||
}
|
||||
}
|
||||
return edit;
|
||||
}
|
||||
|
||||
static void
|
||||
compute_edit_offset(const char *string,
|
||||
int chr_offset,
|
||||
int x_last,
|
||||
int *p_dpy_column,
|
||||
int *p_scroll_amt)
|
||||
{
|
||||
const int *cols = dlg_index_columns(string);
|
||||
const int *indx = dlg_index_wchars(string);
|
||||
int limit = dlg_count_wchars(string);
|
||||
int offset = dlg_find_index(indx, limit, chr_offset);
|
||||
int offset2;
|
||||
int dpy_column;
|
||||
int n;
|
||||
|
||||
for (n = offset2 = 0; n <= offset; ++n) {
|
||||
if ((cols[offset] - cols[n]) < x_last
|
||||
&& (offset == limit || (cols[offset + 1] - cols[n]) < x_last)) {
|
||||
offset2 = n;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
dpy_column = cols[offset] - cols[offset2];
|
||||
|
||||
if (p_dpy_column != 0)
|
||||
*p_dpy_column = dpy_column;
|
||||
if (p_scroll_amt != 0)
|
||||
*p_scroll_amt = offset2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Given the character-offset in the string, returns the display-offset where
|
||||
* we will position the cursor.
|
||||
*/
|
||||
int
|
||||
dlg_edit_offset(char *string, int chr_offset, int x_last)
|
||||
{
|
||||
int result;
|
||||
|
||||
compute_edit_offset(string, chr_offset, x_last, &result, 0);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Displays the string, shifted as necessary, to fit within the box and show
|
||||
* the current character-offset.
|
||||
*/
|
||||
void
|
||||
dlg_show_string(WINDOW *win,
|
||||
const char *string, /* string to display (may be multibyte) */
|
||||
int chr_offset, /* character (not bytes) offset */
|
||||
chtype attr, /* window-attributes */
|
||||
int y_base, /* beginning row on screen */
|
||||
int x_base, /* beginning column on screen */
|
||||
int x_last, /* number of columns on screen */
|
||||
bool hidden, /* if true, do not echo */
|
||||
bool force) /* if true, force repaint */
|
||||
{
|
||||
x_last = MIN(x_last + x_base, getmaxx(win)) - x_base;
|
||||
|
||||
if (hidden && !dialog_vars.insecure) {
|
||||
if (force) {
|
||||
(void) wmove(win, y_base, x_base);
|
||||
wrefresh(win);
|
||||
}
|
||||
} else {
|
||||
const int *cols = dlg_index_columns(string);
|
||||
const int *indx = dlg_index_wchars(string);
|
||||
int limit = dlg_count_wchars(string);
|
||||
|
||||
int i, j, k;
|
||||
int input_x;
|
||||
int scrollamt;
|
||||
|
||||
compute_edit_offset(string, chr_offset, x_last, &input_x, &scrollamt);
|
||||
|
||||
dlg_attrset(win, attr);
|
||||
(void) wmove(win, y_base, x_base);
|
||||
for (i = scrollamt, k = 0; i < limit && k < x_last; ++i) {
|
||||
int check = cols[i + 1] - cols[scrollamt];
|
||||
if (check <= x_last) {
|
||||
for (j = indx[i]; j < indx[i + 1]; ++j) {
|
||||
chtype ch = UCH(string[j]);
|
||||
if (hidden && dialog_vars.insecure) {
|
||||
waddch(win, '*');
|
||||
} else if (ch == TAB) {
|
||||
int count = cols[i + 1] - cols[i];
|
||||
while (--count >= 0)
|
||||
waddch(win, ' ');
|
||||
} else {
|
||||
waddch(win, ch);
|
||||
}
|
||||
}
|
||||
k = check;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (k++ < x_last)
|
||||
waddch(win, ' ');
|
||||
(void) wmove(win, y_base, x_base + input_x);
|
||||
wrefresh(win);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Discard cached data for the given string.
|
||||
*/
|
||||
void
|
||||
dlg_finish_string(const char *string)
|
||||
{
|
||||
#if USE_CACHING
|
||||
if ((string != 0) && dialog_state.finish_string) {
|
||||
CACHE *p = cache_list;
|
||||
CACHE *q = 0;
|
||||
CACHE *r;
|
||||
|
||||
while (p != 0) {
|
||||
if (p->string_at == string) {
|
||||
#ifdef HAVE_TSEARCH
|
||||
if (tdelete(p, &sorted_cache, compare_cache) == 0) {
|
||||
continue;
|
||||
}
|
||||
trace_cache(__FILE__, __LINE__);
|
||||
#endif
|
||||
if (p->string != 0)
|
||||
free(p->string);
|
||||
if (p->list != 0)
|
||||
free(p->list);
|
||||
if (p == cache_list) {
|
||||
cache_list = p->next;
|
||||
r = cache_list;
|
||||
} else {
|
||||
q->next = p->next;
|
||||
r = q;
|
||||
}
|
||||
free(p);
|
||||
p = r;
|
||||
} else {
|
||||
q = p;
|
||||
p = p->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
(void) string;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NO_LEAKS
|
||||
void
|
||||
_dlg_inputstr_leaks(void)
|
||||
{
|
||||
#if USE_CACHING
|
||||
dialog_state.finish_string = TRUE;
|
||||
trace_cache(__FILE__, __LINE__);
|
||||
while (cache_list != 0) {
|
||||
dlg_finish_string(cache_list->string_at);
|
||||
}
|
||||
#endif /* USE_CACHING */
|
||||
}
|
||||
#endif /* NO_LEAKS */
|
||||
@@ -1,294 +0,0 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
#
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd=$cpprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "$0: no input file specified" >&2
|
||||
exit 1
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d "$dst" ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f "$src" ] || [ -d "$src" ]
|
||||
then
|
||||
:
|
||||
else
|
||||
echo "$0: $src does not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "$0: no destination specified" >&2
|
||||
exit 1
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d "$dst" ]
|
||||
then
|
||||
dst=$dst/`basename "$src"`
|
||||
else
|
||||
:
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-$defaultIFS}"
|
||||
|
||||
oIFS=$IFS
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS=$oIFS
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp=$pathcomp$1
|
||||
shift
|
||||
|
||||
if [ ! -d "$pathcomp" ] ;
|
||||
then
|
||||
$mkdirprog "$pathcomp"
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd "$dst" &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename "$dst"`
|
||||
else
|
||||
dstfile=`basename "$dst" $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename "$dst"`
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
rmtmp=$dstdir/#rm.$$#
|
||||
|
||||
# Trap to clean up temp files at exit.
|
||||
|
||||
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd "$src" "$dsttmp" &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
|
||||
|
||||
# Now remove or move aside any old file at destination location. We try this
|
||||
# two ways since rm can't unlink itself on some systems and the destination
|
||||
# file might be busy for other reasons. In this case, the final cleanup
|
||||
# might fail but the new file should still install successfully.
|
||||
|
||||
{
|
||||
if [ -f "$dstdir/$dstfile" ]
|
||||
then
|
||||
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
|
||||
$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
|
||||
{
|
||||
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
|
||||
(exit 1); exit
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
||||
|
||||
fi &&
|
||||
|
||||
# The final little trick to "correctly" pass the exit status to the exit trap.
|
||||
|
||||
{
|
||||
(exit 0); exit
|
||||
}
|
||||
@@ -1,363 +0,0 @@
|
||||
# $Id: makefile.in,v 1.103 2021/01/11 09:03:36 tom Exp $
|
||||
# template makefile for DIALOG
|
||||
##############################################################################
|
||||
# Copyright (c) 1999-2020,2021 Thomas E. Dickey #
|
||||
# #
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a #
|
||||
# copy of this software and associated documentation files (the "Software"), #
|
||||
# to deal in the Software without restriction, including without limitation #
|
||||
# the rights to use, copy, modify, merge, publish, distribute, distribute #
|
||||
# with modifications, sublicense, and/or sell copies of the Software, and to #
|
||||
# permit persons to whom the Software is furnished to do so, subject to the #
|
||||
# following conditions: #
|
||||
# #
|
||||
# The above copyright notice and this permission notice shall be included in #
|
||||
# all copies or substantial portions of the Software. #
|
||||
# #
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
|
||||
# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
|
||||
# DEALINGS IN THE SOFTWARE. #
|
||||
# #
|
||||
# Except as contained in this notice, the name(s) of the above copyright #
|
||||
# holders shall not be used in advertising or otherwise to promote the sale, #
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
#
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
datarootdir = @datarootdir@
|
||||
|
||||
top_builddir = .
|
||||
|
||||
x = @EXEEXT@
|
||||
o = .@OBJEXT@
|
||||
|
||||
DESTDIR = @DESTDIR@
|
||||
|
||||
THIS = dialog
|
||||
|
||||
CFG_ROOTNAME = @CFG_ROOTNAME@
|
||||
HDR_ROOTNAME = @HDR_ROOTNAME@
|
||||
LIB_ROOTNAME = @LIB_ROOTNAME@
|
||||
LIB_PREFIX = @LIB_PREFIX@
|
||||
LIB_SUFFIX = @LIB_SUFFIX@
|
||||
|
||||
VERSION_MAJOR = @VERSION_MAJOR@
|
||||
VERSION_MINOR = @VERSION_MINOR@
|
||||
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
|
||||
REL_VERSION = @REL_VERSION@
|
||||
ABI_VERSION = @ABI_VERSION@
|
||||
LIB_ROOTNAME = @LIB_ROOTNAME@
|
||||
|
||||
RESULTING_SYMS = @RESULTING_SYMS@
|
||||
VERSIONED_SYMS = @VERSIONED_SYMS@
|
||||
|
||||
@SET_SHLIB_VARS@
|
||||
|
||||
bindir = @bindir@
|
||||
includedir = @includedir@
|
||||
libdir = @libdir@
|
||||
mandir = @mandir@
|
||||
manext = 1
|
||||
libext = 3
|
||||
|
||||
BINDIR = $(DESTDIR)$(bindir)
|
||||
INCLUDEDIR = $(DESTDIR)$(includedir)
|
||||
LIBDIR = $(DESTDIR)$(libdir)
|
||||
MANDIR = $(DESTDIR)$(mandir)
|
||||
|
||||
MAN1DIR = $(MANDIR)/man1
|
||||
MAN3DIR = $(MANDIR)/man3
|
||||
|
||||
# see po/makefile
|
||||
localedir = $(prefix)/@DATADIRNAME@/locale
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@ @DEFS@ -DLOCALEDIR=\"$(localedir)\"
|
||||
EXTRA_CFLAGS = @EXTRA_CFLAGS@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
AR = @AR@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
LDFLAGS = @EXTRA_LDFLAGS@ @LDFLAGS@
|
||||
LIBS = @LIBS@ @INTLLIBS@
|
||||
RANLIB = @LIB_PREP@
|
||||
|
||||
RM = rm -f
|
||||
LN_S = @LN_S@
|
||||
LINT = @LINT@
|
||||
LINT_OPTS = @LINT_OPTS@
|
||||
|
||||
CTAGS = @CTAGS@
|
||||
ETAGS = @ETAGS@
|
||||
|
||||
RPATH_LIST = @RPATH_LIST@
|
||||
LIBTOOL = @LIBTOOL@ @ECHO_LT@
|
||||
LIBTOOL_OPTS = @LIBTOOL_OPTS@
|
||||
LIBTOOL_CLEAN = @LIB_CLEAN@
|
||||
LIBTOOL_COMPILE = @LIB_COMPILE@
|
||||
LIBTOOL_CREATE = @LIB_CREATE@
|
||||
LIBTOOL_LINK = @LIB_LINK@
|
||||
LIBTOOL_INSTALL = @LIB_INSTALL@
|
||||
LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
|
||||
LIBTOOL_VERSION = @LIBTOOL_VERSION@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = $(LIBTOOL_INSTALL) @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
LINK = $(LIBTOOL_LINK)
|
||||
|
||||
# The library is always named for the package, but the program can be further
|
||||
# renamed at install time, starting with the package name.
|
||||
PACKAGE = @PACKAGE@
|
||||
ACTUAL_PROG = `echo $(PACKAGE) |sed @program_transform_name@`
|
||||
LIB_CONFIG = $(CFG_ROOTNAME)-config
|
||||
|
||||
# The library name $(LIB) is set at configure/make time, since it is used as a
|
||||
# makefile target. Ditto for $(PROG).
|
||||
LIB = @LIB_TARGET@
|
||||
PROG = @PACKAGE@$x
|
||||
#
|
||||
# Standard .c to .o compile line.
|
||||
#
|
||||
.SUFFIXES: .c .i $o .1 .man .txt @MAN2HTML_NOTE@ .html @GROFF_NOTE@ .ps .pdf
|
||||
.c.i :
|
||||
@RULE_CC@
|
||||
@ECHO_CC@$(CPP) $(CPPFLAGS) -c $< >$@
|
||||
.c$o :
|
||||
@RULE_CC@
|
||||
@ECHO_CC@$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c $<
|
||||
|
||||
@[email protected] :
|
||||
@NROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | nroff -rHY=0 -Tascii -man | col -bx" >$@
|
||||
|
||||
@[email protected] :
|
||||
@MAN2HTML_NOTE@ ./@MAN2HTML_TEMP@ $* 1 man >$@
|
||||
@MAN2HTML_NOTE@
|
||||
@[email protected] :
|
||||
@GROFF_NOTE@ $(SHELL) -c "tbl $< | groff -man" >$@
|
||||
@GROFF_NOTE@
|
||||
@[email protected] :
|
||||
@GROFF_NOTE@ ps2pdf $*.ps
|
||||
|
||||
EXTRAOBJS = @EXTRAOBJS@
|
||||
OBJECTS = $(EXTRAOBJS) \
|
||||
argv$o \
|
||||
arrows$o \
|
||||
buttons$o \
|
||||
checklist$o \
|
||||
columns$o \
|
||||
dlg_keys$o \
|
||||
editbox$o \
|
||||
help$o \
|
||||
inputbox$o \
|
||||
inputstr$o \
|
||||
menubox$o \
|
||||
mouse$o \
|
||||
mousewget$o \
|
||||
msgbox$o \
|
||||
textbox$o \
|
||||
ttysize$o \
|
||||
ui_getc$o \
|
||||
util$o \
|
||||
version$o \
|
||||
yesno$o
|
||||
|
||||
LIB_OBJECT = @LIB_OBJECT@
|
||||
|
||||
SRCS = $(OBJECTS:$o=.c)
|
||||
HDRS = \
|
||||
dialog.h \
|
||||
dlg_colors.h \
|
||||
dlg_config.h \
|
||||
dlg_keys.h
|
||||
|
||||
ALL = $(LIB) $(PROG)
|
||||
|
||||
BIN_DIRS = $(BINDIR) $(MAN1DIR)
|
||||
LIB_DIRS = $(LIBDIR) $(INCLUDEDIR)
|
||||
|
||||
PO_DIR = $(srcdir)/po
|
||||
|
||||
all :: $(ALL)
|
||||
|
||||
@LIBTOOL_MAKE@install :: install-lib
|
||||
@LIBTOOL_MAKE@uninstall :: uninstall-lib
|
||||
|
||||
@INTLDIR_MAKE@@INTLLIBS@ :
|
||||
@INTLDIR_MAKE@ @echo "Building GNU gettext library..."
|
||||
@INTLDIR_MAKE@ @cd intl && $(MAKE) @cf_cv_makeflags@
|
||||
|
||||
dialog$o \
|
||||
$(OBJECTS) : $(srcdir)/dialog.h $(srcdir)/dlg_keys.h dlg_config.h VERSION
|
||||
|
||||
$(PROG) : $(LIB) dialog$o @INTLDIR_MAKE@ @INTLLIBS@
|
||||
$(LINK) -o $@ dialog$o -L. -l@PACKAGE@ $(CFLAGS) $(LDFLAGS) $(LIBS)
|
||||
|
||||
clean \
|
||||
distclean \
|
||||
install \
|
||||
install-full \
|
||||
install-strip \
|
||||
uninstall ::
|
||||
@echo making $@
|
||||
@INTLDIR_MAKE@ @-test -f intl/makefile && cd intl && $(MAKE) @cf_cv_makeflags@ $@
|
||||
@MSG_DIR_MAKE@ @-test -f po/makefile && cd po && $(MAKE) @cf_cv_makeflags@ $@
|
||||
|
||||
clean ::
|
||||
@- $(RM) -r autom4te.cache
|
||||
- $(RM) *.*cov *.da *.bb *.bbg
|
||||
- $(LIBTOOL_CLEAN) $(RM) *.i *$o $(ALL)
|
||||
- $(RM) headers.sed
|
||||
- $(RM) *.html *.pdf *.png *.ps *.txt dialog_lib.1
|
||||
- $(RM) core *~ tags TAGS
|
||||
|
||||
distclean :: clean
|
||||
$(RM) intl/libintl.h intl/po2tbl.sed
|
||||
$(RM) makefile dlg_config.h config.cache config.log config.status
|
||||
$(RM) samples/install/makefile
|
||||
$(RM) headers-sh
|
||||
$(RM) man2html.*
|
||||
$(RM) dialog-config
|
||||
|
||||
check :
|
||||
@echo "Verify that create-rc works"
|
||||
$(SHELL) -c "DIALOG=./$(PROG) ./run_test.sh $(srcdir)/samples"
|
||||
|
||||
install :: install-bin install-man
|
||||
@echo "made $@"
|
||||
|
||||
install-full :: install-lib install-bin install-man
|
||||
@echo "made $@"
|
||||
|
||||
install-strip :: $(PROG) $(BINDIR)
|
||||
$(INSTALL_PROGRAM) -s $(PROG) $(BINDIR)
|
||||
|
||||
uninstall :: uninstall-bin uninstall-man
|
||||
@echo "made $@"
|
||||
|
||||
uninstall-full :: uninstall-bin uninstall-man uninstall-lib
|
||||
@echo "made $@"
|
||||
|
||||
install-bin : $(PROG) $(BINDIR)
|
||||
$(INSTALL_PROGRAM) $(PROG) $(BINDIR)/$(ACTUAL_PROG)$x
|
||||
|
||||
uninstall-bin :
|
||||
$(RM) $(BINDIR)/$(ACTUAL_PROG)$x
|
||||
|
||||
install-man :: $(MAN1DIR)
|
||||
@ echo "** installing $(ACTUAL_PROG).$(manext)"
|
||||
@ $(SHELL) $(srcdir)/rename.sh \
|
||||
$(srcdir)/dialog.1 \
|
||||
$(MAN1DIR)/$(ACTUAL_PROG).$(manext) \
|
||||
$(ACTUAL_PROG) \
|
||||
@PACKAGE@ \
|
||||
$(INSTALL_DATA)
|
||||
|
||||
uninstall-man ::
|
||||
$(RM) $(MAN1DIR)/$(ACTUAL_PROG).$(manext)
|
||||
|
||||
# most users do not want/need the library, so the install rules are distinct.
|
||||
install-lib :: $(BINDIR) dialog-config
|
||||
@ echo "** installing config script in $(BINDIR)"
|
||||
@ $(INSTALL_SCRIPT) dialog-config $(BINDIR)/$(LIB_CONFIG)
|
||||
|
||||
install-lib :: $(LIB_DIRS) $(LIB) headers.sed
|
||||
@ echo "** installing library in $(LIBDIR)"
|
||||
@ $(LIBTOOL_INSTALL) $(INSTALL_DATA) $(LIB) $(LIBDIR)
|
||||
@ echo "** installing headers in $(INCLUDEDIR)"
|
||||
@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dialog.h
|
||||
@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dlg_colors.h
|
||||
@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dlg_keys.h
|
||||
@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) . dlg_config.h
|
||||
|
||||
uninstall-lib :: $(BINDIR)
|
||||
$(RM) $(BINDIR)/$(LIB_CONFIG)
|
||||
|
||||
uninstall-lib :: $(LIB_DIRS)
|
||||
- $(LIBTOOL_UNINSTALL) $(RM) $(LIBDIR)/$(LIB)
|
||||
@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dialog.h
|
||||
@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dlg_colors.h
|
||||
@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dlg_keys.h
|
||||
@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) . dlg_config.h
|
||||
|
||||
install-lib :: $(MAN3DIR)
|
||||
@ echo "** installing @PACKAGE@.$(libext)"
|
||||
@ $(SHELL) $(srcdir)/rename.sh \
|
||||
$(srcdir)/dialog.3 \
|
||||
$(MAN3DIR)/@PACKAGE@.$(libext) \
|
||||
$(ACTUAL_PROG) \
|
||||
@PACKAGE@ \
|
||||
$(INSTALL_DATA)
|
||||
|
||||
uninstall-lib ::
|
||||
$(RM) $(MAN3DIR)/@PACKAGE@.$(libext)
|
||||
|
||||
headers.sed : headers-sh
|
||||
$(SHELL) headers-sh $(INCLUDEDIR) $(srcdir)
|
||||
|
||||
################################################################################
|
||||
TOP_DOCS = \
|
||||
@NROFF_NOTE@ dialog.txt \
|
||||
@MAN2HTML_NOTE@ dialog.html \
|
||||
@GROFF_NOTE@ dialog.pdf \
|
||||
@GROFF_NOTE@ dialog.ps
|
||||
|
||||
dialog.html : dialog.1
|
||||
dialog.pdf : dialog.ps
|
||||
dialog.ps : dialog.1
|
||||
dialog.txt : dialog.1
|
||||
################################################################################
|
||||
# rename, to use suffix-rules
|
||||
dialog_lib.1 : dialog.3
|
||||
-$(RM) $@
|
||||
cp dialog.3 $@
|
||||
|
||||
LIB_DOCS = \
|
||||
dialog_lib.1 \
|
||||
@NROFF_NOTE@ dialog_lib.txt \
|
||||
@MAN2HTML_NOTE@ dialog_lib.html \
|
||||
@GROFF_NOTE@ dialog_lib.pdf \
|
||||
@GROFF_NOTE@ dialog_lib.ps
|
||||
|
||||
dialog_lib.html : dialog_lib.1
|
||||
dialog_lib.pdf : dialog_lib.ps
|
||||
dialog_lib.ps : dialog_lib.1
|
||||
dialog_lib.txt : dialog_lib.1
|
||||
################################################################################
|
||||
docs: $(TOP_DOCS) $(LIB_DOCS)
|
||||
clean-docs:
|
||||
-$(RM) $(TOP_DOCS) $(LIB_DOCS)
|
||||
################################################################################
|
||||
|
||||
$(MAN1DIR) \
|
||||
$(MAN3DIR) \
|
||||
$(BINDIR) \
|
||||
$(INCLUDEDIR) \
|
||||
$(LIBDIR) : ; mkdir -p $@
|
||||
|
||||
@MAKE_LOWER_TAGS@tags :
|
||||
@MAKE_LOWER_TAGS@ $(CTAGS) $(SRCS) $(HDRS)
|
||||
|
||||
@MAKE_LOWER_TAGS@TAGS :
|
||||
@MAKE_LOWER_TAGS@ $(ETAGS) $(SRCS) $(HDRS)
|
||||
|
||||
update-po:
|
||||
rsync -Lrtvz translationproject.org::tp/latest/dialog/ $(PO_DIR)
|
||||
test -f $(PO_DIR)/makefile && cd $(PO_DIR) && $(MAKE) $@
|
||||
|
||||
lint:
|
||||
$(LINT) $(LINT_OPTS) $(CPPFLAGS) *.c
|
||||
@@ -1,814 +0,0 @@
|
||||
/*
|
||||
* $Id: menubox.c,v 1.171 2020/11/23 21:03:11 tom Exp $
|
||||
*
|
||||
* menubox.c -- implements the menu box
|
||||
*
|
||||
* Copyright 2000-2019,2020 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public Licens, version 2.1e
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*
|
||||
* An earlier version of this program lists as authors
|
||||
* Savio Lam (lam836@cs.cuhk.hk)
|
||||
*/
|
||||
|
||||
#include <dlg_internals.h>
|
||||
#include <dlg_keys.h>
|
||||
|
||||
typedef enum {
|
||||
Unselected = 0,
|
||||
Selected,
|
||||
Editing
|
||||
} Mode;
|
||||
|
||||
typedef struct {
|
||||
/* the outer-window */
|
||||
WINDOW *dialog;
|
||||
int box_y;
|
||||
int box_x;
|
||||
int tag_x;
|
||||
int item_x;
|
||||
int menu_height;
|
||||
int menu_width;
|
||||
/* the inner-window */
|
||||
WINDOW *menu;
|
||||
DIALOG_LISTITEM *items;
|
||||
int item_no;
|
||||
} ALL_DATA;
|
||||
|
||||
#define MIN_HIGH (1 + (5 * MARGIN))
|
||||
|
||||
#define INPUT_ROWS 3 /* rows per inputmenu entry */
|
||||
|
||||
#define RowHeight(i) (is_inputmenu ? ((i) * INPUT_ROWS) : ((i) * 1))
|
||||
#define ItemToRow(i) (is_inputmenu ? ((i) * INPUT_ROWS + 1) : (i))
|
||||
#define RowToItem(i) (is_inputmenu ? ((i) / INPUT_ROWS + 0) : (i))
|
||||
|
||||
/*
|
||||
* Print menu item
|
||||
*/
|
||||
static void
|
||||
print_item(ALL_DATA * data,
|
||||
WINDOW *win,
|
||||
DIALOG_LISTITEM * item,
|
||||
int choice,
|
||||
Mode selected,
|
||||
bool is_inputmenu)
|
||||
{
|
||||
chtype save = dlg_get_attrs(win);
|
||||
int climit = (data->item_x - data->tag_x - GUTTER);
|
||||
int my_width = data->menu_width;
|
||||
int my_x = data->item_x;
|
||||
int my_y = ItemToRow(choice);
|
||||
bool both = (!dialog_vars.no_tags && !dialog_vars.no_items);
|
||||
bool first = TRUE;
|
||||
chtype bordchar;
|
||||
const char *show = (dialog_vars.no_items
|
||||
? item->name
|
||||
: item->text);
|
||||
|
||||
switch (selected) {
|
||||
default:
|
||||
case Unselected:
|
||||
bordchar = item_attr;
|
||||
break;
|
||||
case Selected:
|
||||
bordchar = item_selected_attr;
|
||||
break;
|
||||
case Editing:
|
||||
bordchar = dialog_attr;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Clear 'residue' of last item and mark current current item */
|
||||
if (is_inputmenu) {
|
||||
int n;
|
||||
|
||||
dlg_attrset(win, (selected != Unselected) ? item_selected_attr : item_attr);
|
||||
for (n = my_y - 1; n < my_y + INPUT_ROWS - 1; n++) {
|
||||
wmove(win, n, 0);
|
||||
wprintw(win, "%*s", my_width, " ");
|
||||
}
|
||||
} else {
|
||||
dlg_attrset(win, menubox_attr);
|
||||
wmove(win, my_y, 0);
|
||||
wprintw(win, "%*s", my_width, " ");
|
||||
}
|
||||
|
||||
/* highlight first char of the tag to be special */
|
||||
if (both) {
|
||||
(void) wmove(win, my_y, data->tag_x);
|
||||
dlg_print_listitem(win, item->name, climit, first, selected);
|
||||
first = FALSE;
|
||||
}
|
||||
|
||||
/* Draw the input field box (only for inputmenu) */
|
||||
(void) wmove(win, my_y, my_x);
|
||||
if (is_inputmenu) {
|
||||
my_width -= 1;
|
||||
dlg_draw_box(win, my_y - 1, my_x, INPUT_ROWS, my_width - my_x - data->tag_x,
|
||||
bordchar,
|
||||
bordchar);
|
||||
my_width -= 1;
|
||||
++my_x;
|
||||
}
|
||||
|
||||
/* print actual item */
|
||||
wmove(win, my_y, my_x);
|
||||
dlg_print_listitem(win, show, my_width - my_x, first, selected);
|
||||
|
||||
if (selected) {
|
||||
dlg_item_help(item->help);
|
||||
}
|
||||
dlg_attrset(win, save);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allow the user to edit the text of a menu entry.
|
||||
*/
|
||||
static int
|
||||
input_menu_edit(ALL_DATA * data,
|
||||
DIALOG_LISTITEM * items,
|
||||
int choice,
|
||||
char **resultp)
|
||||
{
|
||||
chtype save = dlg_get_attrs(data->menu);
|
||||
char *result;
|
||||
int offset = 0;
|
||||
int key = 0, fkey = 0;
|
||||
bool first = TRUE;
|
||||
/* see above */
|
||||
bool is_inputmenu = TRUE;
|
||||
int y = ItemToRow(choice);
|
||||
int code = TRUE;
|
||||
int max_len = dlg_max_input(MAX((int) strlen(items->text) + 1, MAX_LEN));
|
||||
|
||||
result = dlg_malloc(char, (size_t) max_len);
|
||||
assert_ptr(result, "input_menu_edit");
|
||||
|
||||
/* original item is used to initialize the input string. */
|
||||
result[0] = '\0';
|
||||
strcpy(result, items->text);
|
||||
|
||||
print_item(data, data->menu, items, choice, Editing, TRUE);
|
||||
|
||||
/* taken out of inputbox.c - but somewhat modified */
|
||||
for (;;) {
|
||||
if (!first) {
|
||||
int check = DLG_EXIT_UNKNOWN;
|
||||
key = dlg_mouse_wgetch(data->menu, &fkey);
|
||||
if (dlg_result_key(key, fkey, &check)) {
|
||||
if (check == DLG_EXIT_CANCEL) {
|
||||
code = FALSE;
|
||||
break;
|
||||
} else {
|
||||
flash();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dlg_edit_string(result, &offset, key, fkey, first)) {
|
||||
dlg_show_string(data->menu, result, offset, inputbox_attr,
|
||||
y,
|
||||
data->item_x + 1,
|
||||
data->menu_width - data->item_x - 3,
|
||||
FALSE, first);
|
||||
first = FALSE;
|
||||
} else if (key == ESC || key == TAB) {
|
||||
code = FALSE;
|
||||
break;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
print_item(data, data->menu, items, choice, Selected, TRUE);
|
||||
dlg_attrset(data->menu, save);
|
||||
|
||||
*resultp = result;
|
||||
return code;
|
||||
}
|
||||
|
||||
static int
|
||||
handle_button(int code, DIALOG_LISTITEM * items, int choice)
|
||||
{
|
||||
char *help_result;
|
||||
|
||||
switch (code) {
|
||||
case DLG_EXIT_OK: /* FALLTHRU */
|
||||
case DLG_EXIT_EXTRA:
|
||||
dlg_add_string(items[choice].name);
|
||||
break;
|
||||
case DLG_EXIT_HELP:
|
||||
dlg_add_help_listitem(&code, &help_result, &items[choice]);
|
||||
dlg_add_string(help_result);
|
||||
break;
|
||||
}
|
||||
AddLastKey();
|
||||
return code;
|
||||
}
|
||||
|
||||
int
|
||||
dlg_renamed_menutext(DIALOG_LISTITEM * items, int current, char *newtext)
|
||||
{
|
||||
if (dialog_vars.input_result)
|
||||
dialog_vars.input_result[0] = '\0';
|
||||
dlg_add_result("RENAMED ");
|
||||
dlg_add_string(items[current].name);
|
||||
dlg_add_result(" ");
|
||||
dlg_add_string(newtext);
|
||||
AddLastKey();
|
||||
return DLG_EXIT_EXTRA;
|
||||
}
|
||||
|
||||
int
|
||||
dlg_dummy_menutext(DIALOG_LISTITEM * items, int current, char *newtext)
|
||||
{
|
||||
(void) items;
|
||||
(void) current;
|
||||
(void) newtext;
|
||||
return DLG_EXIT_ERROR;
|
||||
}
|
||||
|
||||
static void
|
||||
print_menu(ALL_DATA * data, int choice, int scrollamt, int max_choice, bool is_inputmenu)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < max_choice; i++) {
|
||||
print_item(data,
|
||||
data->menu,
|
||||
&data->items[i + scrollamt],
|
||||
i,
|
||||
(i == choice) ? Selected : Unselected,
|
||||
is_inputmenu);
|
||||
}
|
||||
|
||||
/* Clean bottom lines */
|
||||
if (is_inputmenu) {
|
||||
int spare_lines, x_count;
|
||||
spare_lines = data->menu_height % INPUT_ROWS;
|
||||
dlg_attrset(data->menu, menubox_attr);
|
||||
for (; spare_lines; spare_lines--) {
|
||||
wmove(data->menu, data->menu_height - spare_lines, 0);
|
||||
for (x_count = 0; x_count < data->menu_width;
|
||||
x_count++) {
|
||||
waddch(data->menu, ' ');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(void) wnoutrefresh(data->menu);
|
||||
|
||||
dlg_draw_scrollbar(data->dialog,
|
||||
scrollamt,
|
||||
scrollamt,
|
||||
scrollamt + max_choice,
|
||||
data->item_no,
|
||||
data->box_x,
|
||||
data->box_x + data->menu_width,
|
||||
data->box_y,
|
||||
data->box_y + data->menu_height + 1,
|
||||
menubox_border2_attr,
|
||||
menubox_border_attr);
|
||||
}
|
||||
|
||||
static bool
|
||||
check_hotkey(DIALOG_LISTITEM * items, int choice)
|
||||
{
|
||||
bool result = FALSE;
|
||||
|
||||
if (dlg_match_char(dlg_last_getc(),
|
||||
(dialog_vars.no_tags
|
||||
? items[choice].text
|
||||
: items[choice].name))) {
|
||||
result = TRUE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is an alternate interface to 'menu' which allows the application
|
||||
* to read the list item states back directly without putting them in the
|
||||
* output buffer.
|
||||
*/
|
||||
int
|
||||
dlg_menu(const char *title,
|
||||
const char *cprompt,
|
||||
int height,
|
||||
int width,
|
||||
int menu_height,
|
||||
int item_no,
|
||||
DIALOG_LISTITEM * items,
|
||||
int *current_item,
|
||||
DIALOG_INPUTMENU rename_menutext)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
static DLG_KEYS_BINDING binding[] = {
|
||||
HELPKEY_BINDINGS,
|
||||
ENTERKEY_BINDINGS,
|
||||
TOGGLEKEY_BINDINGS,
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
|
||||
DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
|
||||
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_NEXT, '+' ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_DOWN ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_NEXT, CHR_NEXT ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_PREV, '-' ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_UP ),
|
||||
DLG_KEYS_DATA( DLGK_ITEM_PREV, CHR_PREVIOUS ),
|
||||
DLG_KEYS_DATA( DLGK_PAGE_FIRST, KEY_HOME ),
|
||||
DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_END ),
|
||||
DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_LL ),
|
||||
DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ),
|
||||
DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ),
|
||||
END_KEYS_BINDING
|
||||
};
|
||||
static DLG_KEYS_BINDING binding2[] = {
|
||||
INPUTSTR_BINDINGS,
|
||||
HELPKEY_BINDINGS,
|
||||
ENTERKEY_BINDINGS,
|
||||
END_KEYS_BINDING
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
int old_LINES = LINES;
|
||||
int old_COLS = COLS;
|
||||
int old_height = height;
|
||||
int old_width = width;
|
||||
#endif
|
||||
ALL_DATA all;
|
||||
int i, j, x, y, cur_x, cur_y;
|
||||
int fkey;
|
||||
int button = dialog_state.visit_items ? -1 : dlg_default_button();
|
||||
int choice = dlg_default_listitem(items);
|
||||
int result = DLG_EXIT_UNKNOWN;
|
||||
int scrollamt = 0;
|
||||
int max_choice;
|
||||
int use_width, name_width, text_width, list_width;
|
||||
WINDOW *dialog, *menu;
|
||||
char *prompt = 0;
|
||||
const char **buttons = dlg_ok_labels();
|
||||
bool is_inputmenu = ((rename_menutext != 0)
|
||||
&& (rename_menutext != dlg_dummy_menutext));
|
||||
|
||||
DLG_TRACE(("# menubox args:\n"));
|
||||
DLG_TRACE2S("title", title);
|
||||
DLG_TRACE2S("message", cprompt);
|
||||
DLG_TRACE2N("height", height);
|
||||
DLG_TRACE2N("width", width);
|
||||
DLG_TRACE2N("lheight", menu_height);
|
||||
DLG_TRACE2N("llength", item_no);
|
||||
/* FIXME dump the items[][] too */
|
||||
DLG_TRACE2N("rename", rename_menutext != 0);
|
||||
|
||||
dialog_state.plain_buttons = TRUE;
|
||||
|
||||
all.items = items;
|
||||
all.item_no = item_no;
|
||||
|
||||
dlg_does_output();
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
retry:
|
||||
#endif
|
||||
|
||||
prompt = dlg_strclone(cprompt);
|
||||
dlg_tab_correct_str(prompt);
|
||||
|
||||
all.menu_height = menu_height;
|
||||
use_width = dlg_calc_list_width(item_no, items) + 10;
|
||||
use_width = MAX(26, use_width);
|
||||
if (all.menu_height == 0) {
|
||||
/* calculate height without items (4) */
|
||||
dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, use_width);
|
||||
dlg_calc_listh(&height, &all.menu_height, item_no);
|
||||
} else {
|
||||
dlg_auto_size(title, prompt,
|
||||
&height, &width,
|
||||
MIN_HIGH + all.menu_height, use_width);
|
||||
}
|
||||
dlg_button_layout(buttons, &width);
|
||||
dlg_print_size(height, width);
|
||||
dlg_ctl_size(height, width);
|
||||
|
||||
x = dlg_box_x_ordinate(width);
|
||||
y = dlg_box_y_ordinate(height);
|
||||
|
||||
dialog = dlg_new_window(height, width, y, x);
|
||||
all.dialog = dialog;
|
||||
|
||||
dlg_register_window(dialog, "menubox", binding);
|
||||
dlg_register_buttons(dialog, "menubox", buttons);
|
||||
|
||||
dlg_mouse_setbase(x, y);
|
||||
|
||||
dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr);
|
||||
dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr);
|
||||
dlg_draw_title(dialog, title);
|
||||
|
||||
dlg_attrset(dialog, dialog_attr);
|
||||
dlg_print_autowrap(dialog, prompt, height, width);
|
||||
|
||||
all.menu_width = width - 6;
|
||||
getyx(dialog, cur_y, cur_x);
|
||||
all.box_y = cur_y + 1;
|
||||
all.box_x = (width - all.menu_width) / 2 - 1;
|
||||
|
||||
/*
|
||||
* After displaying the prompt, we know how much space we really have.
|
||||
* Limit the list to avoid overwriting the ok-button.
|
||||
*/
|
||||
all.menu_height = height - MIN_HIGH - cur_y;
|
||||
if (all.menu_height <= 0)
|
||||
all.menu_height = 1;
|
||||
|
||||
/* Find out maximal number of displayable items at once. */
|
||||
max_choice = MIN(all.menu_height,
|
||||
RowHeight(item_no));
|
||||
if (is_inputmenu)
|
||||
max_choice /= INPUT_ROWS;
|
||||
|
||||
/* create new window for the menu */
|
||||
menu = dlg_sub_window(dialog, all.menu_height, all.menu_width,
|
||||
y + all.box_y + 1,
|
||||
x + all.box_x + 1);
|
||||
all.menu = menu;
|
||||
|
||||
dlg_register_window(menu, "menu", binding2);
|
||||
dlg_register_buttons(menu, "menu", buttons);
|
||||
|
||||
/* draw a box around the menu items */
|
||||
dlg_draw_box(dialog,
|
||||
all.box_y, all.box_x,
|
||||
all.menu_height + 2, all.menu_width + 2,
|
||||
menubox_border_attr, menubox_border2_attr);
|
||||
|
||||
name_width = 0;
|
||||
text_width = 0;
|
||||
|
||||
/* Find length of longest item to center menu *
|
||||
* only if --menu was given, using --inputmenu *
|
||||
* won't be centered. */
|
||||
for (i = 0; i < item_no; i++) {
|
||||
name_width = MAX(name_width, dlg_count_columns(items[i].name));
|
||||
text_width = MAX(text_width, dlg_count_columns(items[i].text));
|
||||
}
|
||||
|
||||
/* If the name+text is wider than the list is allowed, then truncate
|
||||
* one or both of them. If the name is no wider than 30% of the list,
|
||||
* leave it intact.
|
||||
*
|
||||
* FIXME: the gutter width and name/list ratio should be configurable.
|
||||
*/
|
||||
use_width = (all.menu_width - GUTTER);
|
||||
if (dialog_vars.no_tags) {
|
||||
list_width = MIN(use_width, text_width);
|
||||
} else if (dialog_vars.no_items) {
|
||||
list_width = MIN(use_width, name_width);
|
||||
} else {
|
||||
if (text_width >= 0
|
||||
&& name_width >= 0
|
||||
&& use_width > 0
|
||||
&& text_width + name_width > use_width) {
|
||||
int need = (int) (0.30 * use_width);
|
||||
if (name_width > need) {
|
||||
int want = (int) (use_width
|
||||
* ((double) name_width)
|
||||
/ (text_width + name_width));
|
||||
name_width = (want > need) ? want : need;
|
||||
}
|
||||
text_width = use_width - name_width;
|
||||
}
|
||||
list_width = (text_width + name_width);
|
||||
}
|
||||
|
||||
all.tag_x = (is_inputmenu
|
||||
? 0
|
||||
: (use_width - list_width) / 2);
|
||||
all.item_x = ((dialog_vars.no_tags
|
||||
? 0
|
||||
: (dialog_vars.no_items
|
||||
? 0
|
||||
: (GUTTER + name_width)))
|
||||
+ all.tag_x);
|
||||
|
||||
if (choice - scrollamt >= max_choice) {
|
||||
scrollamt = choice - (max_choice - 1);
|
||||
choice = max_choice - 1;
|
||||
}
|
||||
|
||||
print_menu(&all, choice, scrollamt, max_choice, is_inputmenu);
|
||||
|
||||
/* register the new window, along with its borders */
|
||||
dlg_mouse_mkbigregion(all.box_y + 1, all.box_x,
|
||||
all.menu_height + 2, all.menu_width + 2,
|
||||
KEY_MAX, 1, 1, 1 /* by lines */ );
|
||||
|
||||
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
|
||||
|
||||
dlg_trace_win(dialog);
|
||||
|
||||
while (result == DLG_EXIT_UNKNOWN) {
|
||||
int key, found;
|
||||
|
||||
if (button < 0) /* --visit-items */
|
||||
wmove(dialog,
|
||||
all.box_y + ItemToRow(choice) + 1,
|
||||
all.box_x + all.tag_x + 1);
|
||||
|
||||
key = dlg_mouse_wgetch(dialog, &fkey);
|
||||
if (dlg_result_key(key, fkey, &result)) {
|
||||
if (!dlg_button_key(result, &button, &key, &fkey))
|
||||
break;
|
||||
}
|
||||
|
||||
found = FALSE;
|
||||
if (fkey) {
|
||||
/*
|
||||
* Allow a mouse-click on a box to switch selection to that box.
|
||||
* Handling a button click is a little more complicated, since we
|
||||
* push a KEY_ENTER back onto the input stream so we'll put the
|
||||
* cursor at the right place before handling the "keypress".
|
||||
*/
|
||||
if (key >= DLGK_MOUSE(KEY_MAX)) {
|
||||
key -= DLGK_MOUSE(KEY_MAX);
|
||||
i = RowToItem(key);
|
||||
if (i < max_choice) {
|
||||
found = TRUE;
|
||||
} else {
|
||||
beep();
|
||||
continue;
|
||||
}
|
||||
} else if (is_DLGK_MOUSE(key)
|
||||
&& dlg_ok_buttoncode(key - M_EVENT) >= 0) {
|
||||
button = (key - M_EVENT);
|
||||
ungetch('\n');
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Check if key pressed matches first character of any item tag in
|
||||
* list. If there is more than one match, we will cycle through
|
||||
* each one as the same key is pressed repeatedly.
|
||||
*/
|
||||
if (button < 0 || !dialog_state.visit_items) {
|
||||
for (j = scrollamt + choice + 1; j < item_no; j++) {
|
||||
if (check_hotkey(items, j)) {
|
||||
found = TRUE;
|
||||
i = j - scrollamt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
for (j = 0; j <= scrollamt + choice; j++) {
|
||||
if (check_hotkey(items, j)) {
|
||||
found = TRUE;
|
||||
i = j - scrollamt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
dlg_flush_getc();
|
||||
} else if ((j = dlg_char_to_button(key, buttons)) >= 0) {
|
||||
button = j;
|
||||
ungetch('\n');
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* A single digit (1-9) positions the selection to that line in the
|
||||
* current screen.
|
||||
*/
|
||||
if (!found
|
||||
&& (key <= '9')
|
||||
&& (key > '0')
|
||||
&& (key - '1' < max_choice)) {
|
||||
found = TRUE;
|
||||
i = key - '1';
|
||||
}
|
||||
}
|
||||
|
||||
if (!found && fkey) {
|
||||
found = TRUE;
|
||||
switch (key) {
|
||||
case DLGK_PAGE_FIRST:
|
||||
i = -scrollamt;
|
||||
break;
|
||||
case DLGK_PAGE_LAST:
|
||||
i = item_no - 1 - scrollamt;
|
||||
break;
|
||||
case DLGK_MOUSE(KEY_PPAGE):
|
||||
case DLGK_PAGE_PREV:
|
||||
if (choice)
|
||||
i = 0;
|
||||
else if (scrollamt != 0)
|
||||
i = -MIN(scrollamt, max_choice);
|
||||
else
|
||||
continue;
|
||||
break;
|
||||
case DLGK_MOUSE(KEY_NPAGE):
|
||||
case DLGK_PAGE_NEXT:
|
||||
i = MIN(choice + max_choice, item_no - scrollamt - 1);
|
||||
break;
|
||||
case DLGK_ITEM_PREV:
|
||||
i = choice - 1;
|
||||
if (choice == 0 && scrollamt == 0)
|
||||
continue;
|
||||
break;
|
||||
case DLGK_ITEM_NEXT:
|
||||
i = choice + 1;
|
||||
if (scrollamt + choice >= item_no - 1)
|
||||
continue;
|
||||
break;
|
||||
default:
|
||||
found = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
if (i != choice) {
|
||||
getyx(dialog, cur_y, cur_x);
|
||||
if (i < 0 || i >= max_choice) {
|
||||
if (i < 0) {
|
||||
scrollamt += i;
|
||||
choice = 0;
|
||||
} else {
|
||||
choice = max_choice - 1;
|
||||
scrollamt += (i - max_choice + 1);
|
||||
}
|
||||
print_menu(&all, choice, scrollamt, max_choice, is_inputmenu);
|
||||
} else {
|
||||
choice = i;
|
||||
print_menu(&all, choice, scrollamt, max_choice, is_inputmenu);
|
||||
(void) wmove(dialog, cur_y, cur_x);
|
||||
wrefresh(dialog);
|
||||
}
|
||||
}
|
||||
continue; /* wait for another key press */
|
||||
}
|
||||
|
||||
if (fkey) {
|
||||
switch (key) {
|
||||
case DLGK_FIELD_PREV:
|
||||
button = dlg_prev_button(buttons, button);
|
||||
dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
|
||||
FALSE, width);
|
||||
break;
|
||||
|
||||
case DLGK_FIELD_NEXT:
|
||||
button = dlg_next_button(buttons, button);
|
||||
dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
|
||||
FALSE, width);
|
||||
break;
|
||||
|
||||
case DLGK_TOGGLE:
|
||||
case DLGK_ENTER:
|
||||
case DLGK_LEAVE:
|
||||
result = ((key == DLGK_LEAVE)
|
||||
? dlg_ok_buttoncode(button)
|
||||
: dlg_enter_buttoncode(button));
|
||||
|
||||
/*
|
||||
* If dlg_menu() is called from dialog_menu(), we want to
|
||||
* capture the results into dialog_vars.input_result.
|
||||
*/
|
||||
if (result == DLG_EXIT_ERROR) {
|
||||
result = DLG_EXIT_UNKNOWN;
|
||||
} else if (is_inputmenu
|
||||
|| rename_menutext == dlg_dummy_menutext) {
|
||||
result = handle_button(result,
|
||||
items,
|
||||
scrollamt + choice);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have a rename_menutext function, interpret the Extra
|
||||
* button as a request to rename the menu's text. If that
|
||||
* function doesn't return "Unknown", we will exit from this
|
||||
* function. Usually that is done for dialog_menu(), so the
|
||||
* shell script can use the updated value. If it does return
|
||||
* "Unknown", update the list item only. A direct caller of
|
||||
* dlg_menu() can free the renamed value - we cannot.
|
||||
*/
|
||||
if (is_inputmenu && result == DLG_EXIT_EXTRA) {
|
||||
char *tmp;
|
||||
|
||||
if (input_menu_edit(&all,
|
||||
&items[scrollamt + choice],
|
||||
choice,
|
||||
&tmp)) {
|
||||
result = rename_menutext(items, scrollamt + choice, tmp);
|
||||
if (result == DLG_EXIT_UNKNOWN) {
|
||||
items[scrollamt + choice].text = tmp;
|
||||
} else {
|
||||
free(tmp);
|
||||
}
|
||||
} else {
|
||||
result = DLG_EXIT_UNKNOWN;
|
||||
print_item(&all,
|
||||
menu,
|
||||
&items[scrollamt + choice],
|
||||
choice,
|
||||
Selected,
|
||||
is_inputmenu);
|
||||
(void) wnoutrefresh(menu);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
if (result == DLG_EXIT_UNKNOWN) {
|
||||
dlg_draw_buttons(dialog, height - 2, 0,
|
||||
buttons, button, FALSE, width);
|
||||
}
|
||||
}
|
||||
break;
|
||||
#ifdef KEY_RESIZE
|
||||
case KEY_RESIZE:
|
||||
dlg_will_resize(dialog);
|
||||
/* reset data */
|
||||
resizeit(height, LINES);
|
||||
resizeit(width, COLS);
|
||||
free(prompt);
|
||||
_dlg_resize_cleanup(dialog);
|
||||
/* repaint */
|
||||
goto retry;
|
||||
#endif
|
||||
default:
|
||||
flash();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dlg_mouse_free_regions();
|
||||
dlg_unregister_window(menu);
|
||||
dlg_del_window(dialog);
|
||||
free(prompt);
|
||||
|
||||
*current_item = scrollamt + choice;
|
||||
|
||||
DLG_TRACE2N("current", *current_item);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Display a menu for choosing among a number of options
|
||||
*/
|
||||
int
|
||||
dialog_menu(const char *title,
|
||||
const char *cprompt,
|
||||
int height,
|
||||
int width,
|
||||
int menu_height,
|
||||
int item_no,
|
||||
char **items)
|
||||
{
|
||||
int result;
|
||||
int choice;
|
||||
int i, j;
|
||||
DIALOG_LISTITEM *listitems;
|
||||
|
||||
listitems = dlg_calloc(DIALOG_LISTITEM, (size_t) item_no + 1);
|
||||
assert_ptr(listitems, "dialog_menu");
|
||||
|
||||
for (i = j = 0; i < item_no; ++i) {
|
||||
listitems[i].name = items[j++];
|
||||
listitems[i].text = (dialog_vars.no_items
|
||||
? dlg_strempty()
|
||||
: items[j++]);
|
||||
listitems[i].help = ((dialog_vars.item_help)
|
||||
? items[j++]
|
||||
: dlg_strempty());
|
||||
}
|
||||
dlg_align_columns(&listitems[0].text, sizeof(DIALOG_LISTITEM), item_no);
|
||||
|
||||
result = dlg_menu(title,
|
||||
cprompt,
|
||||
height,
|
||||
width,
|
||||
menu_height,
|
||||
item_no,
|
||||
listitems,
|
||||
&choice,
|
||||
(dialog_vars.input_menu
|
||||
? dlg_renamed_menutext
|
||||
: dlg_dummy_menutext));
|
||||
|
||||
dlg_free_columns(&listitems[0].text, sizeof(DIALOG_LISTITEM), item_no);
|
||||
free(listitems);
|
||||
return result;
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
/*
|
||||
* $Id: mixedform.c,v 1.13 2018/06/15 01:23:33 tom Exp $
|
||||
*
|
||||
* mixedform.c -- implements the mixed form (i.e, typed pairs label/editbox)
|
||||
*
|
||||
* Copyright 2007-2013,2018 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*
|
||||
* This is inspired by a patch from Kiran Cherupally
|
||||
* (but different interface design).
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
|
||||
#define LLEN(n) ((n) * MIXEDFORM_TAGS)
|
||||
|
||||
#define ItemName(i) items[LLEN(i) + 0]
|
||||
#define ItemNameY(i) items[LLEN(i) + 1]
|
||||
#define ItemNameX(i) items[LLEN(i) + 2]
|
||||
#define ItemText(i) items[LLEN(i) + 3]
|
||||
#define ItemTextY(i) items[LLEN(i) + 4]
|
||||
#define ItemTextX(i) items[LLEN(i) + 5]
|
||||
#define ItemTextFLen(i) items[LLEN(i) + 6]
|
||||
#define ItemTextILen(i) items[LLEN(i) + 7]
|
||||
#define ItemTypep(i) items[LLEN(i) + 8]
|
||||
#define ItemHelp(i) (dialog_vars.item_help ? items[LLEN(i) + 9] : dlg_strempty())
|
||||
|
||||
int
|
||||
dialog_mixedform(const char *title,
|
||||
const char *cprompt,
|
||||
int height,
|
||||
int width,
|
||||
int form_height,
|
||||
int item_no,
|
||||
char **items)
|
||||
{
|
||||
int result;
|
||||
int choice = 0;
|
||||
int i;
|
||||
DIALOG_FORMITEM *listitems;
|
||||
DIALOG_VARS save_vars;
|
||||
bool show_status = FALSE;
|
||||
char *help_result;
|
||||
|
||||
dlg_save_vars(&save_vars);
|
||||
dialog_vars.separate_output = TRUE;
|
||||
|
||||
listitems = dlg_calloc(DIALOG_FORMITEM, (size_t) item_no + 1);
|
||||
assert_ptr(listitems, "dialog_mixedform");
|
||||
|
||||
for (i = 0; i < item_no; ++i) {
|
||||
listitems[i].type = dialog_vars.formitem_type;
|
||||
listitems[i].name = ItemName(i);
|
||||
listitems[i].name_len = (int) strlen(ItemName(i));
|
||||
listitems[i].name_y = dlg_ordinate(ItemNameY(i));
|
||||
listitems[i].name_x = dlg_ordinate(ItemNameX(i));
|
||||
listitems[i].text = ItemText(i);
|
||||
listitems[i].text_len = (int) strlen(ItemText(i));
|
||||
listitems[i].text_y = dlg_ordinate(ItemTextY(i));
|
||||
listitems[i].text_x = dlg_ordinate(ItemTextX(i));
|
||||
listitems[i].text_flen = atoi(ItemTextFLen(i));
|
||||
listitems[i].text_ilen = atoi(ItemTextILen(i));
|
||||
listitems[i].help = (dialog_vars.item_help ? ItemHelp(i) :
|
||||
dlg_strempty());
|
||||
listitems[i].type = (unsigned) atoi(ItemTypep(i));
|
||||
}
|
||||
|
||||
result = dlg_form(title,
|
||||
cprompt,
|
||||
height,
|
||||
width,
|
||||
form_height,
|
||||
item_no,
|
||||
listitems,
|
||||
&choice);
|
||||
|
||||
switch (result) {
|
||||
case DLG_EXIT_OK: /* FALLTHRU */
|
||||
case DLG_EXIT_EXTRA:
|
||||
show_status = TRUE;
|
||||
break;
|
||||
case DLG_EXIT_HELP:
|
||||
dlg_add_help_formitem(&result, &help_result, &listitems[choice]);
|
||||
show_status = dialog_vars.help_status;
|
||||
dlg_add_string(help_result);
|
||||
if (show_status)
|
||||
dlg_add_separator();
|
||||
break;
|
||||
}
|
||||
if (show_status) {
|
||||
for (i = 0; i < item_no; i++) {
|
||||
if (listitems[i].text_flen > 0) {
|
||||
dlg_add_string(listitems[i].text);
|
||||
dlg_add_separator();
|
||||
}
|
||||
}
|
||||
dlg_add_last_key(-1);
|
||||
}
|
||||
|
||||
dlg_free_formitems(listitems);
|
||||
dlg_restore_vars(&save_vars);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1,408 +0,0 @@
|
||||
/*
|
||||
* $Id: mixedgauge.c,v 1.37 2021/01/16 17:19:15 tom Exp $
|
||||
*
|
||||
* mixedgauge.c -- implements the mixedgauge dialog
|
||||
*
|
||||
* Copyright 2007-2020,2021 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*
|
||||
* This is inspired by a patch from Kiran Cherupally
|
||||
* (but different interface design).
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
|
||||
#define LLEN(n) ((n) * MIXEDGAUGE_TAGS)
|
||||
#define ItemData(i) &items[LLEN(i)]
|
||||
#define ItemName(i) items[LLEN(i)]
|
||||
#define ItemText(i) items[LLEN(i) + 1]
|
||||
|
||||
#define MIN_HIGH (4)
|
||||
#define MIN_WIDE (10 + 2 * (2 + MARGIN))
|
||||
|
||||
typedef struct {
|
||||
WINDOW *dialog;
|
||||
WINDOW *caption;
|
||||
const char *title;
|
||||
char *prompt;
|
||||
int height, old_height, min_height;
|
||||
int width, old_width, min_width;
|
||||
int len_name, len_text;
|
||||
int item_no;
|
||||
DIALOG_LISTITEM *list;
|
||||
} DIALOG_MIXEDGAUGE;
|
||||
|
||||
static const char *
|
||||
status_string(char *given, char **freeMe)
|
||||
{
|
||||
const char *result;
|
||||
|
||||
*freeMe = 0;
|
||||
if (isdigit(UCH(*given))) {
|
||||
switch (*given) {
|
||||
case '0':
|
||||
result = _("Succeeded");
|
||||
break;
|
||||
case '1':
|
||||
result = _("Failed");
|
||||
break;
|
||||
case '2':
|
||||
result = _("Passed");
|
||||
break;
|
||||
case '3':
|
||||
result = _("Completed");
|
||||
break;
|
||||
case '4':
|
||||
result = _("Checked");
|
||||
break;
|
||||
case '5':
|
||||
result = _("Done");
|
||||
break;
|
||||
case '6':
|
||||
result = _("Skipped");
|
||||
break;
|
||||
case '7':
|
||||
result = _("In Progress");
|
||||
break;
|
||||
case '8':
|
||||
result = "";
|
||||
break;
|
||||
case '9':
|
||||
result = _("N/A");
|
||||
break;
|
||||
default:
|
||||
result = "?";
|
||||
break;
|
||||
}
|
||||
} else if (*given == '-') {
|
||||
size_t need = strlen(++given) + 4;
|
||||
char *temp = dlg_malloc(char, need);
|
||||
*freeMe = temp;
|
||||
sprintf(temp, "%3s%%", given);
|
||||
result = temp;
|
||||
} else if (!isspace(UCH(*given))) {
|
||||
result = given;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* This function displays status messages */
|
||||
static void
|
||||
myprint_status(DIALOG_MIXEDGAUGE * dlg)
|
||||
{
|
||||
WINDOW *win = dlg->dialog;
|
||||
int limit_y = dlg->height;
|
||||
int limit_x = dlg->width;
|
||||
|
||||
int item;
|
||||
int cells = dlg->len_text - 2;
|
||||
int lm = limit_x - dlg->len_text - 1;
|
||||
int bm = limit_y; /* bottom margin */
|
||||
int last_y = 0, last_x = 0;
|
||||
int j, xxx;
|
||||
float percent;
|
||||
char *freeMe = 0;
|
||||
|
||||
bm -= (2 * MARGIN);
|
||||
getyx(win, last_y, last_x);
|
||||
for (item = 0; item < dlg->item_no; ++item) {
|
||||
const char *status = "";
|
||||
chtype attr = A_NORMAL;
|
||||
int y = item + MARGIN + 1;
|
||||
|
||||
if (y > bm)
|
||||
break;
|
||||
|
||||
status = status_string(dlg->list[item].text, &freeMe);
|
||||
if (status == 0 || *status == 0) {
|
||||
free(freeMe);
|
||||
continue;
|
||||
}
|
||||
|
||||
(void) wmove(win, y, 2 * MARGIN);
|
||||
dlg_attrset(win, dialog_attr);
|
||||
dlg_print_text(win, dlg->list[item].name, lm, &attr);
|
||||
|
||||
(void) wmove(win, y, lm);
|
||||
(void) waddch(win, '[');
|
||||
(void) wmove(win, y, lm + (cells - (int) strlen(status)) / 2);
|
||||
if (freeMe) {
|
||||
(void) wmove(win, y, lm + 1);
|
||||
dlg_attrset(win, title_attr);
|
||||
for (j = 0; j < cells; j++)
|
||||
(void) waddch(win, ' ');
|
||||
|
||||
(void) wmove(win, y, lm + (cells - (int) strlen(status)) / 2);
|
||||
(void) waddstr(win, status);
|
||||
|
||||
if ((title_attr & A_REVERSE) != 0) {
|
||||
dlg_attroff(win, A_REVERSE);
|
||||
} else {
|
||||
dlg_attrset(win, A_REVERSE);
|
||||
}
|
||||
(void) wmove(win, y, lm + 1);
|
||||
|
||||
if (sscanf(status, "%f%%", &percent) != 1)
|
||||
percent = 0.0;
|
||||
xxx = (int) ((cells * (percent + 0.5)) / 100.0);
|
||||
for (j = 0; j < xxx; j++) {
|
||||
chtype ch1 = winch(win);
|
||||
if (title_attr & A_REVERSE) {
|
||||
ch1 &= ~A_REVERSE;
|
||||
}
|
||||
(void) waddch(win, ch1);
|
||||
}
|
||||
free(freeMe);
|
||||
|
||||
} else {
|
||||
(void) wmove(win, y, lm + (cells - (int) strlen(status)) / 2);
|
||||
(void) waddstr(win, status);
|
||||
}
|
||||
(void) wmove(win, y, limit_x - 3);
|
||||
dlg_attrset(win, dialog_attr);
|
||||
(void) waddch(win, ']');
|
||||
(void) wnoutrefresh(win);
|
||||
}
|
||||
if (win != 0)
|
||||
wmove(win, last_y, last_x);
|
||||
}
|
||||
|
||||
static void
|
||||
mydraw_mixed_box(WINDOW *win, int y, int x, int height, int width,
|
||||
chtype boxchar, chtype borderchar)
|
||||
{
|
||||
dlg_draw_box(win, y, x, height, width, boxchar, borderchar);
|
||||
{
|
||||
chtype attr = A_NORMAL;
|
||||
const char *message = _("Overall Progress");
|
||||
chtype save2 = dlg_get_attrs(win);
|
||||
dlg_attrset(win, title_attr);
|
||||
(void) wmove(win, y, x + 2);
|
||||
dlg_print_text(win, message, width, &attr);
|
||||
dlg_attrset(win, save2);
|
||||
}
|
||||
}
|
||||
|
||||
static char *
|
||||
clean_copy(const char *string)
|
||||
{
|
||||
char *result = dlg_strclone(string);
|
||||
|
||||
dlg_trim_string(result);
|
||||
dlg_tab_correct_str(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update mixed-gauge dialog (may be from pipe, may be via direct calls).
|
||||
*/
|
||||
static void
|
||||
dlg_update_mixedgauge(DIALOG_MIXEDGAUGE * dlg, int percent)
|
||||
{
|
||||
int i, x;
|
||||
|
||||
/*
|
||||
* Clear the area for the progress bar by filling it with spaces
|
||||
* in the title-attribute, and write the percentage with that
|
||||
* attribute.
|
||||
*/
|
||||
(void) wmove(dlg->dialog, dlg->height - 3, 4);
|
||||
dlg_attrset(dlg->dialog, gauge_attr);
|
||||
|
||||
for (i = 0; i < (dlg->width - 2 * (3 + MARGIN)); i++)
|
||||
(void) waddch(dlg->dialog, ' ');
|
||||
|
||||
(void) wmove(dlg->dialog, dlg->height - 3, (dlg->width / 2) - 2);
|
||||
(void) wprintw(dlg->dialog, "%3d%%", percent);
|
||||
|
||||
/*
|
||||
* Now draw a bar in reverse, relative to the background.
|
||||
* The window attribute was useful for painting the background,
|
||||
* but requires some tweaks to reverse it.
|
||||
*/
|
||||
x = (percent * (dlg->width - 2 * (3 + MARGIN))) / 100;
|
||||
if ((title_attr & A_REVERSE) != 0) {
|
||||
dlg_attroff(dlg->dialog, A_REVERSE);
|
||||
} else {
|
||||
dlg_attrset(dlg->dialog, A_REVERSE);
|
||||
}
|
||||
(void) wmove(dlg->dialog, dlg->height - 3, 4);
|
||||
for (i = 0; i < x; i++) {
|
||||
chtype ch = winch(dlg->dialog);
|
||||
if (title_attr & A_REVERSE) {
|
||||
ch &= ~A_REVERSE;
|
||||
}
|
||||
(void) waddch(dlg->dialog, ch);
|
||||
}
|
||||
myprint_status(dlg);
|
||||
dlg_trace_win(dlg->dialog);
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup dialog.
|
||||
*/
|
||||
static void
|
||||
dlg_begin_mixedgauge(DIALOG_MIXEDGAUGE * dlg,
|
||||
int *began,
|
||||
const char *aTitle,
|
||||
const char *aPrompt,
|
||||
int aHeight,
|
||||
int aWidth,
|
||||
int aItemNo,
|
||||
char **items)
|
||||
{
|
||||
int y, x;
|
||||
|
||||
if (!*began) {
|
||||
int n;
|
||||
|
||||
curs_set(0);
|
||||
|
||||
memset(dlg, 0, sizeof(*dlg));
|
||||
dlg->title = aTitle;
|
||||
dlg->prompt = clean_copy(aPrompt);
|
||||
dlg->height = dlg->old_height = aHeight;
|
||||
dlg->width = dlg->old_width = aWidth;
|
||||
dlg->item_no = aItemNo;
|
||||
|
||||
dlg->list = dlg_calloc(DIALOG_LISTITEM, (size_t) aItemNo);
|
||||
assert_ptr(dlg->list, "dialog_mixedgauge");
|
||||
|
||||
dlg->len_name = 0;
|
||||
dlg->len_text = 15;
|
||||
|
||||
for (n = 0; n < aItemNo; ++n) {
|
||||
int thisWidth = (int) strlen(ItemName(n));
|
||||
if (dlg->len_name < thisWidth)
|
||||
dlg->len_name = thisWidth;
|
||||
dlg->list[n].name = ItemName(n);
|
||||
dlg->list[n].text = ItemText(n);
|
||||
}
|
||||
|
||||
dlg->min_height = MIN_HIGH + aItemNo;
|
||||
dlg->min_width = MIN_WIDE + dlg->len_name + GUTTER + dlg->len_text;
|
||||
|
||||
if (dlg->prompt != 0 && *(dlg->prompt) != 0)
|
||||
dlg->min_height += (2 * MARGIN);
|
||||
#ifdef KEY_RESIZE
|
||||
nodelay(stdscr, TRUE);
|
||||
#endif
|
||||
}
|
||||
#ifdef KEY_RESIZE
|
||||
else {
|
||||
dlg_del_window(dlg->dialog);
|
||||
dlg->height = dlg->old_height;
|
||||
dlg->width = dlg->old_width;
|
||||
}
|
||||
#endif
|
||||
|
||||
dlg_auto_size(dlg->title, dlg->prompt,
|
||||
&(dlg->height),
|
||||
&(dlg->width),
|
||||
dlg->min_height,
|
||||
dlg->min_width);
|
||||
dlg_print_size(dlg->height, dlg->width);
|
||||
dlg_ctl_size(dlg->height, dlg->width);
|
||||
|
||||
/* center dialog box on screen */
|
||||
x = dlg_box_x_ordinate(dlg->width);
|
||||
y = dlg_box_y_ordinate(dlg->height);
|
||||
|
||||
dlg->dialog = dlg_new_window(dlg->height, dlg->width, y, x);
|
||||
|
||||
(void) werase(dlg->dialog);
|
||||
dlg_draw_box2(dlg->dialog,
|
||||
0, 0,
|
||||
dlg->height,
|
||||
dlg->width,
|
||||
dialog_attr, border_attr, border2_attr);
|
||||
|
||||
dlg_draw_title(dlg->dialog, dlg->title);
|
||||
dlg_draw_helpline(dlg->dialog, FALSE);
|
||||
|
||||
if ((dlg->prompt != 0 && *(dlg->prompt) != 0)
|
||||
&& wmove(dlg->dialog, dlg->item_no, 0) != ERR) {
|
||||
dlg->caption = dlg_sub_window(dlg->dialog,
|
||||
dlg->height - dlg->item_no - (2 * MARGIN),
|
||||
dlg->width,
|
||||
y + dlg->item_no + (2 * MARGIN),
|
||||
x);
|
||||
dlg_attrset(dlg->caption, dialog_attr);
|
||||
dlg_print_autowrap(dlg->caption, dlg->prompt, dlg->height, dlg->width);
|
||||
}
|
||||
|
||||
mydraw_mixed_box(dlg->dialog,
|
||||
dlg->height - 4,
|
||||
2 + MARGIN,
|
||||
2 + MARGIN,
|
||||
dlg->width - 2 * (2 + MARGIN),
|
||||
dialog_attr,
|
||||
border_attr);
|
||||
|
||||
*began += 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Discard the mixed-gauge dialog.
|
||||
*/
|
||||
static int
|
||||
dlg_finish_mixedgauge(DIALOG_MIXEDGAUGE * dlg, int status)
|
||||
{
|
||||
(void) wrefresh(dlg->dialog);
|
||||
#ifdef KEY_RESIZE
|
||||
nodelay(stdscr, FALSE);
|
||||
#endif
|
||||
curs_set(1);
|
||||
dlg_del_window(dlg->dialog);
|
||||
free(dlg->prompt);
|
||||
free(dlg->list);
|
||||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup dialog, read mixed-gauge data from pipe.
|
||||
*/
|
||||
int
|
||||
dialog_mixedgauge(const char *title,
|
||||
const char *cprompt,
|
||||
int height,
|
||||
int width,
|
||||
int percent,
|
||||
int item_no,
|
||||
char **items)
|
||||
{
|
||||
DIALOG_MIXEDGAUGE dlg;
|
||||
int began = 0;
|
||||
|
||||
DLG_TRACE(("# mixedgauge args:\n"));
|
||||
DLG_TRACE2S("title", title);
|
||||
DLG_TRACE2S("message", cprompt);
|
||||
DLG_TRACE2N("height", height);
|
||||
DLG_TRACE2N("width", width);
|
||||
DLG_TRACE2N("percent", percent);
|
||||
DLG_TRACE2N("llength", item_no);
|
||||
/* FIXME dump the items[][] too */
|
||||
|
||||
dlg_begin_mixedgauge(&dlg, &began, title, cprompt, height,
|
||||
width, item_no, items);
|
||||
|
||||
dlg_update_mixedgauge(&dlg, percent);
|
||||
|
||||
return dlg_finish_mixedgauge(&dlg, DLG_EXIT_OK);
|
||||
}
|
||||
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
* $Id: mouse.c,v 1.24 2017/01/31 00:27:21 tom Exp $
|
||||
*
|
||||
* mouse.c -- mouse support for dialog
|
||||
*
|
||||
* Copyright 2002-2016,2017 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
#include <dlg_keys.h>
|
||||
|
||||
#if USE_MOUSE
|
||||
|
||||
static int basex, basey, basecode;
|
||||
|
||||
static mseRegion *regionList = NULL;
|
||||
|
||||
/*=========== region related functions =============*/
|
||||
|
||||
static mseRegion *
|
||||
find_region_by_code(int code)
|
||||
{
|
||||
mseRegion *butPtr;
|
||||
|
||||
for (butPtr = regionList; butPtr; butPtr = butPtr->next) {
|
||||
if (code == butPtr->code)
|
||||
break;
|
||||
}
|
||||
return butPtr;
|
||||
}
|
||||
|
||||
void
|
||||
dlg_mouse_setbase(int x, int y)
|
||||
{
|
||||
basex = x;
|
||||
basey = y;
|
||||
}
|
||||
|
||||
void
|
||||
dlg_mouse_setcode(int code)
|
||||
{
|
||||
basecode = code;
|
||||
DLG_TRACE(("# mouse_setcode %d\n", code));
|
||||
}
|
||||
|
||||
void
|
||||
dlg_mouse_mkbigregion(int y, int x,
|
||||
int height, int width,
|
||||
int code,
|
||||
int step_y, int step_x,
|
||||
int mode)
|
||||
{
|
||||
mseRegion *butPtr = dlg_mouse_mkregion(y, x, height, width, -DLGK_MOUSE(code));
|
||||
butPtr->mode = mode;
|
||||
butPtr->step_x = MAX(1, step_x);
|
||||
butPtr->step_y = MAX(1, step_y);
|
||||
}
|
||||
|
||||
void
|
||||
dlg_mouse_free_regions(void)
|
||||
{
|
||||
while (regionList != 0) {
|
||||
mseRegion *butPtr = regionList->next;
|
||||
free(regionList);
|
||||
regionList = butPtr;
|
||||
}
|
||||
}
|
||||
|
||||
mseRegion *
|
||||
dlg_mouse_mkregion(int y, int x, int height, int width, int code)
|
||||
{
|
||||
mseRegion *butPtr;
|
||||
|
||||
if ((butPtr = find_region_by_code(basecode + code)) == 0) {
|
||||
butPtr = dlg_calloc(mseRegion, 1);
|
||||
assert_ptr(butPtr, "dlg_mouse_mkregion");
|
||||
butPtr->next = regionList;
|
||||
regionList = butPtr;
|
||||
}
|
||||
|
||||
if ((butPtr->mode != -1) ||
|
||||
(butPtr->step_x != 0) ||
|
||||
(butPtr->step_y != 0) ||
|
||||
(butPtr->y != (basey + y)) ||
|
||||
(butPtr->Y != (basey + y + height)) ||
|
||||
(butPtr->x != (basex + x)) ||
|
||||
(butPtr->X != (basex + x + width)) ||
|
||||
(butPtr->code != basecode + code)) {
|
||||
DLG_TRACE(("# mouse_mkregion %d,%d %dx%d %d (%d)\n",
|
||||
y, x, height, width,
|
||||
butPtr->code, code));
|
||||
}
|
||||
|
||||
butPtr->mode = -1;
|
||||
butPtr->step_x = 0;
|
||||
butPtr->step_y = 0;
|
||||
butPtr->y = basey + y;
|
||||
butPtr->Y = basey + y + height;
|
||||
butPtr->x = basex + x;
|
||||
butPtr->X = basex + x + width;
|
||||
butPtr->code = basecode + code;
|
||||
|
||||
return butPtr;
|
||||
}
|
||||
|
||||
/* retrieve the frame under the pointer */
|
||||
static mseRegion *
|
||||
any_mouse_region(int y, int x, int small)
|
||||
{
|
||||
mseRegion *butPtr;
|
||||
|
||||
for (butPtr = regionList; butPtr; butPtr = butPtr->next) {
|
||||
if (small ^ (butPtr->code >= 0)) {
|
||||
continue;
|
||||
}
|
||||
if (y < butPtr->y || y >= butPtr->Y) {
|
||||
continue;
|
||||
}
|
||||
if (x < butPtr->x || x >= butPtr->X) {
|
||||
continue;
|
||||
}
|
||||
break; /* found */
|
||||
}
|
||||
return butPtr;
|
||||
}
|
||||
|
||||
/* retrieve the frame under the pointer */
|
||||
mseRegion *
|
||||
dlg_mouse_region(int y, int x)
|
||||
{
|
||||
return any_mouse_region(y, x, TRUE);
|
||||
}
|
||||
|
||||
/* retrieve the bigframe under the pointer */
|
||||
mseRegion *
|
||||
dlg_mouse_bigregion(int y, int x)
|
||||
{
|
||||
return any_mouse_region(y, x, FALSE);
|
||||
}
|
||||
|
||||
#else
|
||||
void mouse_dummy(void);
|
||||
void
|
||||
mouse_dummy(void)
|
||||
{
|
||||
}
|
||||
#endif /* USE_MOUSE */
|
||||
@@ -1,96 +0,0 @@
|
||||
/*
|
||||
* $Id: mousewget.c,v 1.25 2019/07/25 00:06:38 tom Exp $
|
||||
*
|
||||
* mousewget.c -- mouse/wgetch support for dialog
|
||||
*
|
||||
* Copyright 2000-2017,2019 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
#include <dlg_keys.h>
|
||||
|
||||
static int
|
||||
mouse_wgetch(WINDOW *win, int *fkey, bool ignore_errs)
|
||||
{
|
||||
int mouse_err = FALSE;
|
||||
int key;
|
||||
|
||||
do {
|
||||
|
||||
key = dlg_getc(win, fkey);
|
||||
|
||||
#if USE_MOUSE
|
||||
|
||||
mouse_err = FALSE;
|
||||
if (key == KEY_MOUSE) {
|
||||
MEVENT event;
|
||||
|
||||
if (getmouse(&event) != ERR) {
|
||||
mseRegion *p;
|
||||
|
||||
DLG_TRACE(("# mouse-click abs %d,%d (rel %d,%d)\n",
|
||||
event.y, event.x,
|
||||
event.y - getbegy(win),
|
||||
event.x - getbegx(win)));
|
||||
if ((p = dlg_mouse_region(event.y, event.x)) != 0) {
|
||||
key = DLGK_MOUSE(p->code);
|
||||
} else if ((p = dlg_mouse_bigregion(event.y, event.x)) != 0) {
|
||||
int x = event.x - p->x;
|
||||
int y = event.y - p->y;
|
||||
int row = (p->X - p->x) / p->step_x;
|
||||
|
||||
key = -(p->code);
|
||||
switch (p->mode) {
|
||||
case 1: /* index by lines */
|
||||
key += y;
|
||||
break;
|
||||
case 2: /* index by columns */
|
||||
key += (x / p->step_x);
|
||||
break;
|
||||
default:
|
||||
case 3: /* index by cells */
|
||||
key += (x / p->step_x) + (y * row);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
(void) beep();
|
||||
mouse_err = TRUE;
|
||||
}
|
||||
} else {
|
||||
(void) beep();
|
||||
mouse_err = TRUE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
} while (ignore_errs && mouse_err);
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
int
|
||||
dlg_mouse_wgetch(WINDOW *win, int *fkey)
|
||||
{
|
||||
return mouse_wgetch(win, fkey, TRUE);
|
||||
}
|
||||
|
||||
int
|
||||
dlg_mouse_wgetch_nowait(WINDOW *win, int *fkey)
|
||||
{
|
||||
return mouse_wgetch(win, fkey, FALSE);
|
||||
}
|
||||
@@ -1,204 +0,0 @@
|
||||
/*
|
||||
* $Id: msgbox.c,v 1.89 2020/11/23 00:32:02 tom Exp $
|
||||
*
|
||||
* msgbox.c -- implements the message box and info box
|
||||
*
|
||||
* Copyright 2000-2019,2020 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*
|
||||
* An earlier version of this program lists as authors:
|
||||
* Savio Lam (lam836@cs.cuhk.hk)
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
#include <dlg_keys.h>
|
||||
|
||||
/*
|
||||
* Display a message box. Program will pause and display an "OK" button
|
||||
* if the parameter 'pauseopt' is non-zero.
|
||||
*/
|
||||
int
|
||||
dialog_msgbox(const char *title, const char *cprompt, int height, int width,
|
||||
int pauseopt)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
static DLG_KEYS_BINDING binding[] = {
|
||||
HELPKEY_BINDINGS,
|
||||
ENTERKEY_BINDINGS,
|
||||
SCROLLKEY_BINDINGS,
|
||||
TRAVERSE_BINDINGS,
|
||||
END_KEYS_BINDING
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
int x, y, page;
|
||||
int button;
|
||||
int key, fkey;
|
||||
int result = DLG_EXIT_UNKNOWN;
|
||||
WINDOW *dialog = 0;
|
||||
char *prompt;
|
||||
const char **buttons = dlg_ok_label();
|
||||
int offset = 0;
|
||||
bool show = TRUE;
|
||||
int min_width = (pauseopt == 1 ? 12 : 0);
|
||||
bool save_nocancel = dialog_vars.nocancel;
|
||||
#ifdef KEY_RESIZE
|
||||
int req_high;
|
||||
int req_wide;
|
||||
#endif
|
||||
|
||||
DLG_TRACE(("# msgbox args:\n"));
|
||||
DLG_TRACE2S("title", title);
|
||||
DLG_TRACE2S("message", cprompt);
|
||||
DLG_TRACE2N("height", height);
|
||||
DLG_TRACE2N("width", width);
|
||||
DLG_TRACE2N("pauseopt", pauseopt);
|
||||
|
||||
dialog_vars.nocancel = TRUE;
|
||||
button = dlg_default_button();
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
req_high = height;
|
||||
req_wide = width;
|
||||
restart:
|
||||
#endif
|
||||
|
||||
dlg_button_layout(buttons, &min_width);
|
||||
|
||||
prompt = dlg_strclone(cprompt);
|
||||
dlg_tab_correct_str(prompt);
|
||||
dlg_auto_size(title, prompt, &height, &width,
|
||||
(pauseopt == 1 ? 2 : 0),
|
||||
min_width);
|
||||
dlg_print_size(height, width);
|
||||
dlg_ctl_size(height, width);
|
||||
|
||||
x = dlg_box_x_ordinate(width);
|
||||
y = dlg_box_y_ordinate(height);
|
||||
|
||||
dialog = dlg_new_window(height, width, y, x);
|
||||
dlg_register_window(dialog, "msgbox", binding);
|
||||
dlg_register_buttons(dialog, "msgbox", buttons);
|
||||
|
||||
page = height - (1 + 3 * MARGIN);
|
||||
|
||||
dlg_mouse_setbase(x, y);
|
||||
|
||||
dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr);
|
||||
dlg_draw_title(dialog, title);
|
||||
|
||||
dlg_attrset(dialog, dialog_attr);
|
||||
|
||||
if (pauseopt) {
|
||||
int last = 0;
|
||||
|
||||
dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr);
|
||||
mouse_mkbutton(height - 2, width / 2 - 4, 6, '\n');
|
||||
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
|
||||
dlg_draw_helpline(dialog, FALSE);
|
||||
|
||||
while (result == DLG_EXIT_UNKNOWN) {
|
||||
int check;
|
||||
|
||||
if (show) {
|
||||
last = dlg_print_scrolled(dialog, prompt, offset,
|
||||
page, width, pauseopt);
|
||||
dlg_trace_win(dialog);
|
||||
show = FALSE;
|
||||
}
|
||||
key = dlg_mouse_wgetch(dialog, &fkey);
|
||||
if (dlg_result_key(key, fkey, &result)) {
|
||||
if (!dlg_button_key(result, &button, &key, &fkey))
|
||||
break;
|
||||
}
|
||||
if (!fkey && (check = dlg_char_to_button(key, buttons)) >= 0) {
|
||||
result = dlg_ok_buttoncode(check);
|
||||
break;
|
||||
}
|
||||
|
||||
if (fkey) {
|
||||
switch (key) {
|
||||
#ifdef KEY_RESIZE
|
||||
case KEY_RESIZE:
|
||||
dlg_will_resize(dialog);
|
||||
free(prompt);
|
||||
height = req_high;
|
||||
width = req_wide;
|
||||
show = TRUE;
|
||||
_dlg_resize_cleanup(dialog);
|
||||
goto restart;
|
||||
#endif
|
||||
case DLGK_FIELD_NEXT:
|
||||
button = dlg_next_button(buttons, button);
|
||||
if (button < 0)
|
||||
button = 0;
|
||||
dlg_draw_buttons(dialog,
|
||||
height - 2, 0,
|
||||
buttons, button,
|
||||
FALSE, width);
|
||||
break;
|
||||
case DLGK_FIELD_PREV:
|
||||
button = dlg_prev_button(buttons, button);
|
||||
if (button < 0)
|
||||
button = 0;
|
||||
dlg_draw_buttons(dialog,
|
||||
height - 2, 0,
|
||||
buttons, button,
|
||||
FALSE, width);
|
||||
break;
|
||||
case DLGK_ENTER:
|
||||
result = dlg_enter_buttoncode(button);
|
||||
break;
|
||||
case DLGK_LEAVE:
|
||||
result = dlg_ok_buttoncode(button);
|
||||
break;
|
||||
default:
|
||||
if (is_DLGK_MOUSE(key)) {
|
||||
result = dlg_ok_buttoncode(key - M_EVENT);
|
||||
if (result < 0)
|
||||
result = DLG_EXIT_OK;
|
||||
} else if (dlg_check_scrolled(key,
|
||||
last,
|
||||
page,
|
||||
&show,
|
||||
&offset) == 0) {
|
||||
} else {
|
||||
beep();
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if (key > 0) {
|
||||
beep();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dlg_print_scrolled(dialog, prompt, offset, page, width, pauseopt);
|
||||
dlg_draw_helpline(dialog, FALSE);
|
||||
wrefresh(dialog);
|
||||
dlg_trace_win(dialog);
|
||||
result = DLG_EXIT_OK;
|
||||
}
|
||||
dlg_add_last_key(-1);
|
||||
|
||||
dlg_del_window(dialog);
|
||||
dlg_mouse_free_regions();
|
||||
free(prompt);
|
||||
|
||||
dialog_vars.nocancel = save_nocancel;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1,337 +0,0 @@
|
||||
cdialog (20210117) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Wed, 13 Jan 2021 19:58:21 -0500
|
||||
|
||||
cdialog (20210112) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 11 Jan 2021 03:53:05 -0500
|
||||
|
||||
cdialog (20201126) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sun, 26 Jul 2020 11:17:16 -0400
|
||||
|
||||
cdialog (20200327) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Thu, 19 Mar 2020 05:02:12 -0400
|
||||
|
||||
cdialog (20200228) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Fri, 28 Feb 2020 20:31:15 -0500
|
||||
|
||||
cdialog (20191231) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Tue, 31 Dec 2019 15:37:41 -0500
|
||||
|
||||
cdialog (20191210) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Tue, 10 Dec 2019 17:19:19 -0500
|
||||
|
||||
cdialog (20191209) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 09 Dec 2019 04:14:47 -0500
|
||||
|
||||
cdialog (20191110) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sun, 10 Nov 2019 17:48:23 -0500
|
||||
|
||||
cdialog (20190926) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Wed, 25 Sep 2019 04:37:53 -0400
|
||||
|
||||
cdialog (20190924) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 23 Sep 2019 05:13:54 -0400
|
||||
|
||||
cdialog (20190808) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Thu, 08 Aug 2019 16:54:08 -0400
|
||||
|
||||
cdialog (20190806) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Thu, 01 Aug 2019 20:16:04 -0400
|
||||
|
||||
cdialog (20190728) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sun, 28 Jul 2019 18:04:47 -0400
|
||||
|
||||
cdialog (20190724) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 22 Jul 2019 19:20:18 -0400
|
||||
|
||||
cdialog (20190211) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 11 Feb 2019 15:47:42 -0500
|
||||
|
||||
cdialog (20181107) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Wed, 07 Nov 2018 20:38:14 -0500
|
||||
|
||||
cdialog (20181022) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sun, 28 Oct 2018 10:53:29 -0400
|
||||
|
||||
cdialog (20180621) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Thu, 15 Feb 2018 05:02:43 -0500
|
||||
|
||||
cdialog (20171209) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sat, 09 Dec 2017 10:52:09 -0500
|
||||
|
||||
cdialog (20170509) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Tue, 09 May 2017 19:08:48 -0400
|
||||
|
||||
cdialog (20170131) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 23 Jan 2017 17:41:21 -0500
|
||||
|
||||
cdialog (20161120) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sun, 20 Nov 2016 06:47:59 -0500
|
||||
|
||||
cdialog (20160828) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Fri, 26 Aug 2016 17:41:17 -0400
|
||||
|
||||
cdialog (20160424) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Tue, 19 Apr 2016 06:33:50 -0400
|
||||
|
||||
cdialog (20160209) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 01 Feb 2016 05:18:04 -0500
|
||||
|
||||
cdialog (20160126) unstable; urgency=low
|
||||
|
||||
* maintenance updates, add --week-start option
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 25 Jan 2016 13:13:51 -0500
|
||||
|
||||
cdialog (20150920) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sun, 20 Sep 2015 18:08:36 -0400
|
||||
|
||||
cdialog (20150528) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Thu, 28 May 2015 19:42:32 -0400
|
||||
|
||||
cdialog (20150513) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Wed, 13 May 2015 10:46:07 -0400
|
||||
|
||||
cdialog (20150512) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sun, 10 May 2015 19:31:46 -0400
|
||||
|
||||
cdialog (20150225) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Wed, 25 Feb 2015 05:10:57 -0500
|
||||
|
||||
cdialog (20150224) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Tue, 24 Feb 2015 07:10:45 -0500
|
||||
|
||||
cdialog (20150125) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sun, 25 Jan 2015 16:30:54 -0500
|
||||
|
||||
cdialog (20140911) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Thu, 11 Sep 2014 03:56:17 -0400
|
||||
|
||||
cdialog (20140910) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Wed, 10 Sep 2014 04:23:13 -0400
|
||||
|
||||
cdialog (20140908) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 08 Sep 2014 05:10:11 -0400
|
||||
|
||||
cdialog (20140901) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 01 Sep 2014 12:15:40 -0400
|
||||
|
||||
cdialog (20140219) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Wed, 19 Feb 2014 04:13:36 -0500
|
||||
|
||||
cdialog (20140112) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sun, 12 Jan 2014 13:22:17 -0500
|
||||
|
||||
cdialog (20130928) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sat, 28 Sep 2013 21:27:37 -0400
|
||||
|
||||
cdialog (20130923) unstable; urgency=low
|
||||
|
||||
* improved memory-caching for gauge widget
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sat, 21 Sep 2013 09:18:26 -0400
|
||||
|
||||
cdialog (20130902) unstable; urgency=low
|
||||
|
||||
* maintenance updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sun, 01 Sep 2013 19:08:31 -0400
|
||||
|
||||
cdialog (20130523) unstable; urgency=low
|
||||
|
||||
* minor fixes
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Thu, 23 May 2013 19:25:01 -0400
|
||||
|
||||
cdialog (20130315) unstable; urgency=low
|
||||
|
||||
* minor fixes
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Fri, 15 Mar 2013 04:41:20 -0400
|
||||
|
||||
cdialog (20121230) unstable; urgency=low
|
||||
|
||||
* new widgets
|
||||
* coverity fixes
|
||||
* configure-script updates
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sat, 06 Oct 2012 09:19:29 -0400
|
||||
|
||||
cdialog (20120706) unstable; urgency=high
|
||||
|
||||
* fix regression in msgbox (ArchLinux #30574)
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Fri, 06 Jul 2012 12:52:46 -0400
|
||||
|
||||
cdialog (20120703) unstable; urgency=low
|
||||
|
||||
* minor fixes
|
||||
* add --default-button
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Sat, 30 Jun 2012 10:41:05 -0400
|
||||
|
||||
cdialog (20120215) unstable; urgency=low
|
||||
|
||||
* minor fixes
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Wed, 15 Feb 2012 19:40:32 -0500
|
||||
|
||||
cdialog (20111020) unstable; urgency=high
|
||||
|
||||
* fix regression in menubox.c logic for inputmenu vs menu.
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Wed, 19 Oct 2011 19:17:40 -0400
|
||||
|
||||
cdialog (20111018) unstable; urgency=high
|
||||
|
||||
* improve color configurability
|
||||
* misc bug-fixes.
|
||||
* various improvements to tracing.
|
||||
* remove an incorrect free() call in dlg_free_gauge()
|
||||
* fix missing trailing null from dlg_align_columns
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Wed, 07 Sep 2011 20:04:04 -0400
|
||||
|
||||
cdialog (20110707) unstable; urgency=high
|
||||
|
||||
* fix a regression in dlg_getc() from 20110630 changes.
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Thu, 07 Jul 2011 18:10:47 -0400
|
||||
|
||||
cdialog (20110630) unstable; urgency=high
|
||||
|
||||
* various bug-fixes reported in FreeBSD.
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 13 Jun 2011 05:44:17 -0400
|
||||
|
||||
cdialog (20110302) unstable; urgency=high
|
||||
|
||||
* Add --prgbox and --progressbox
|
||||
* Bug-fix for --timeout.
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Mon, 28 Feb 2011 18:42:17 -0500
|
||||
|
||||
cdialog (20110118) unstable; urgency=high
|
||||
|
||||
* Initial package release
|
||||
|
||||
-- Thomas E. Dickey <[email protected]> Thu, 30 Dec 2010 09:23:24 -0500
|
||||
@@ -1 +0,0 @@
|
||||
10
|
||||
@@ -1,33 +0,0 @@
|
||||
Source: cdialog
|
||||
Maintainer: Thomas E. Dickey <[email protected]>
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Standards-Version: 3.8.4
|
||||
Build-Depends: debhelper (>= 5), libc6 (>= 2.11), libncursesw5-dev (>= 5.3), groff-base
|
||||
Homepage: http://invisible-island.net/dialog/
|
||||
|
||||
Package: cdialog
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.11), libncursesw5 (>= 5.3)
|
||||
Description: dialog - display dialog boxes from shell scripts
|
||||
Dialog is a program that will let you present a variety of questions or
|
||||
display messages using dialog boxes from a shell script. These types
|
||||
of dialog boxes are implemented (though not all are necessarily
|
||||
compiled into dialog):
|
||||
.
|
||||
buildlist, calendar, checklist, dselect, editbox, form, fselect,
|
||||
gauge, infobox, inputbox, inputmenu, menu, mixedform,
|
||||
mixedgauge, msgbox (message), passwordbox, passwordform, pause,
|
||||
prgbox, programbox, progressbox, radiolist, rangebox, tailbox,
|
||||
tailboxbg, textbox, timebox, treeview, and yesno (yes/no).
|
||||
.
|
||||
This package installs as "cdialog" to avoid conflict with other packages.
|
||||
|
||||
Package: cdialog-dev
|
||||
Architecture: any
|
||||
Depends: libc6 (>= 2.11), libncursesw5 (>= 5.3)
|
||||
Description: dialog - display dialog boxes from shell scripts
|
||||
Dialog is a program that will let you present a variety of questions or
|
||||
display messages using dialog boxes from a shell script. These types
|
||||
This package provides headers and documentation for the library used
|
||||
by "cdialog".
|
||||
@@ -1,111 +0,0 @@
|
||||
Upstream source http://invisible-island.net/dialog/dialog.html
|
||||
|
||||
Current dialog upstream maintainer: Thomas Dickey <[email protected]>
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Files: *.c *.h
|
||||
Copyright 2000-2020,2021 Thomas E. Dickey
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this program; if not, write to
|
||||
Free Software Foundation, Inc.
|
||||
51 Franklin St., Fifth Floor
|
||||
Boston, MA 02110, USA.
|
||||
|
||||
An earlier version of this program lists as authors
|
||||
Savio Lam ([email protected])
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Files: aclocal.m4
|
||||
Licence: other-BSD
|
||||
Copyright: 1999-2020,2021 by Thomas E. Dickey
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, distribute with modifications, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
||||
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name(s) of the above copyright
|
||||
holders shall not be used in advertising or otherwise to promote the
|
||||
sale, use or other dealings in this Software without prior written
|
||||
authorization.
|
||||
|
||||
Files: install-sh
|
||||
Copyright: 1994 X Consortium
|
||||
Licence: other-BSD
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not
|
||||
be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
ings in this Software without prior written authorization from the X Consor-
|
||||
tium.
|
||||
|
||||
FSF changes to this file are in the public domain.
|
||||
|
||||
Calling this script install-sh is preferred over install.sh, to prevent
|
||||
`make' implicit rules from creating a file called install from it
|
||||
when there is no Makefile.
|
||||
|
||||
This script is compatible with the BSD install script, but was written
|
||||
from scratch. It can only install one file at a time, a restriction
|
||||
shared with many OS's install programs.
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2010-2020,2021 Thomas E. Dickey
|
||||
Licence: other-BSD
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the name of the above listed
|
||||
copyright holder(s) not be used in advertising or publicity pertaining
|
||||
to distribution of the software without specific, written prior
|
||||
permission.
|
||||
|
||||
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
|
||||
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
|
||||
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License can be found in '/usr/share/common-licenses/GPL-2'
|
||||
@@ -1 +0,0 @@
|
||||
README
|
||||
@@ -1,7 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" = "configure" ]; then
|
||||
ldconfig
|
||||
fi
|
||||
@@ -1,140 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
# $Id: rules,v 1.11 2019/07/24 00:53:35 tom Exp $
|
||||
# Made with the aid of dh_make, by Craig Small
|
||||
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
|
||||
# Some lines taken from debmake, by Cristoph Lameter.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
# These are used for cross-compiling and for saving the configure script
|
||||
# from having to guess our platform (since we know it already)
|
||||
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
||||
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
||||
|
||||
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
|
||||
CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
|
||||
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
|
||||
|
||||
TMP = $(CURDIR)/debian/tmp
|
||||
|
||||
ACTUAL_PROG = cdialog
|
||||
DEV_PACKAGE = $(ACTUAL_PROG)-dev
|
||||
|
||||
BINDIR = /usr/bin
|
||||
LIBDIR = /usr/lib
|
||||
LOCALE = /usr/share/locale
|
||||
MANDIR = /usr/share/man
|
||||
HEADER = /usr/include
|
||||
|
||||
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS += -O0
|
||||
else
|
||||
CFLAGS += -O2
|
||||
endif
|
||||
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
||||
INSTALL_PROGRAM += -s
|
||||
endif
|
||||
|
||||
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
|
||||
cp -v package/dialog.map package/${ACTUAL_PROG}.map
|
||||
|
||||
CPPFLAGS="$(CPPFLAGS)" \
|
||||
CFLAGS="$(CFLAGS)" \
|
||||
LDFLAGS="$(LDFLAGS)" \
|
||||
./configure \
|
||||
--host=$(DEB_HOST_GNU_TYPE) \
|
||||
--build=$(DEB_BUILD_GNU_TYPE) \
|
||||
--prefix=/usr \
|
||||
--mandir=\$${prefix}/share/man \
|
||||
--enable-nls \
|
||||
--enable-header-subdir \
|
||||
--enable-widec \
|
||||
--with-shared \
|
||||
--with-screen=ncursesw6 \
|
||||
--with-package=${ACTUAL_PROG} \
|
||||
--with-versioned-syms \
|
||||
--disable-rpath-hack
|
||||
|
||||
touch configure-stamp
|
||||
|
||||
build: build-stamp
|
||||
build-stamp: configure-stamp
|
||||
dh_testdir
|
||||
|
||||
$(MAKE)
|
||||
|
||||
touch build-stamp
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
|
||||
[ ! -f makefile ] || $(MAKE) distclean
|
||||
|
||||
rm -f configure-stamp build-stamp install-stamp
|
||||
|
||||
dh_clean
|
||||
|
||||
install: install-stamp
|
||||
install-stamp: build-stamp
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
|
||||
$(MAKE) install-full DESTDIR=$(TMP)
|
||||
|
||||
dh_install -p${ACTUAL_PROG} $(BINDIR)/$(ACTUAL_PROG)
|
||||
dh_install -p${ACTUAL_PROG} $(LIBDIR)
|
||||
dh_install -p${ACTUAL_PROG} $(LOCALE)
|
||||
dh_install -p${ACTUAL_PROG} $(MANDIR)/man1
|
||||
dh_install -p${DEV_PACKAGE} $(BINDIR)/$(ACTUAL_PROG)-config
|
||||
dh_install -p${DEV_PACKAGE} $(MANDIR)/man3
|
||||
dh_install -p${DEV_PACKAGE} $(HEADER)
|
||||
|
||||
echo FIXME
|
||||
for P in lib${ACTUAL_PROG}.so*; \
|
||||
do \
|
||||
[ -L "$$P" ] || continue; \
|
||||
case "$$P" in \
|
||||
*.so) \
|
||||
echo "DEV: $$P"; \
|
||||
dh_link -p${DEV_PACKAGE} $(LIBDIR)/`readlink $$P` $(LIBDIR)/$$P ; \
|
||||
;; \
|
||||
*) \
|
||||
echo "BIN: $$P"; \
|
||||
dh_link -p${ACTUAL_PROG} $(LIBDIR)/`readlink $$P` $(LIBDIR)/$$P ; \
|
||||
;; \
|
||||
esac; \
|
||||
done
|
||||
|
||||
touch install-stamp
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
# No binary-indep target.
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
dh_installchangelogs CHANGES
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
dh_installdeb
|
||||
dh_makeshlibs
|
||||
dh_shlibdeps
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install install-stamp
|
||||
@@ -1 +0,0 @@
|
||||
3.0 (native)
|
||||
@@ -1,4 +0,0 @@
|
||||
version=3
|
||||
|
||||
opts=passive ftp://ftp.invisible-island.net/dialog/dialog-([\d.]+)\.tgz \
|
||||
debian uupdate
|
||||
@@ -1,263 +0,0 @@
|
||||
# $Id: dialog.map,v 1.13 2020/11/26 18:09:52 tom Exp $
|
||||
# script for shared library symbol-versioning using ld
|
||||
#
|
||||
# This file was generated by ncu-mapsyms
|
||||
# Configure options (1.0.20040721)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.1.20070227)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.2.20121230)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20160126)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20180620)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20190806)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20191209)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20200326)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20201126)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
|
||||
DIALOG_1.0.20040721 {
|
||||
global:
|
||||
dialog_calendar;
|
||||
dialog_checklist;
|
||||
dialog_form;
|
||||
dialog_fselect;
|
||||
dialog_gauge;
|
||||
dialog_inputbox;
|
||||
dialog_menu;
|
||||
dialog_msgbox;
|
||||
dialog_state;
|
||||
dialog_tailbox;
|
||||
dialog_textbox;
|
||||
dialog_timebox;
|
||||
dialog_vars;
|
||||
dialog_version;
|
||||
dialog_yesno;
|
||||
dlg_add_callback;
|
||||
dlg_add_quoted;
|
||||
dlg_add_result;
|
||||
dlg_attr_clear;
|
||||
dlg_auto_size;
|
||||
dlg_auto_sizefile;
|
||||
dlg_beeping;
|
||||
dlg_box_x_ordinate;
|
||||
dlg_box_y_ordinate;
|
||||
dlg_button_count;
|
||||
dlg_button_layout;
|
||||
dlg_button_sizes;
|
||||
dlg_button_x_step;
|
||||
dlg_calc_listh;
|
||||
dlg_calc_listw;
|
||||
dlg_char_to_button;
|
||||
dlg_clear;
|
||||
dlg_color_count;
|
||||
dlg_color_setup;
|
||||
dlg_color_table;
|
||||
dlg_count_columns;
|
||||
dlg_count_wchars;
|
||||
dlg_create_rc;
|
||||
dlg_ctl_size;
|
||||
dlg_default_item;
|
||||
dlg_defaultno_button;
|
||||
dlg_del_window;
|
||||
dlg_does_output;
|
||||
dlg_draw_arrows;
|
||||
dlg_draw_bottom_box;
|
||||
dlg_draw_box;
|
||||
dlg_draw_buttons;
|
||||
dlg_draw_shadow;
|
||||
dlg_draw_title;
|
||||
dlg_edit_offset;
|
||||
dlg_edit_string;
|
||||
dlg_exit;
|
||||
dlg_exit_label;
|
||||
dlg_exiterr;
|
||||
dlg_flush_getc;
|
||||
dlg_getc;
|
||||
dlg_getc_callbacks;
|
||||
dlg_index_columns;
|
||||
dlg_index_wchars;
|
||||
dlg_item_help;
|
||||
dlg_killall_bg;
|
||||
dlg_last_getc;
|
||||
dlg_limit_columns;
|
||||
dlg_match_char;
|
||||
dlg_mouse_bigregion;
|
||||
dlg_mouse_free_regions;
|
||||
dlg_mouse_mkbigregion;
|
||||
dlg_mouse_mkregion;
|
||||
dlg_mouse_region;
|
||||
dlg_mouse_setbase;
|
||||
dlg_mouse_wgetch;
|
||||
dlg_new_window;
|
||||
dlg_next_button;
|
||||
dlg_next_ok_buttonindex;
|
||||
dlg_ok_buttoncode;
|
||||
dlg_ok_label;
|
||||
dlg_ok_labels;
|
||||
dlg_parse_rc;
|
||||
dlg_prev_button;
|
||||
dlg_prev_ok_buttonindex;
|
||||
dlg_print_autowrap;
|
||||
dlg_print_size;
|
||||
dlg_print_text;
|
||||
dlg_put_backtitle;
|
||||
dlg_remove_callback;
|
||||
dlg_set_focus;
|
||||
dlg_show_string;
|
||||
dlg_strclone;
|
||||
dlg_sub_window;
|
||||
dlg_tab_correct_str;
|
||||
dlg_trim_string;
|
||||
dlg_yes_labels;
|
||||
end_dialog;
|
||||
init_dialog;
|
||||
};
|
||||
|
||||
DIALOG_1.1.20070227 {
|
||||
global:
|
||||
dialog_dselect;
|
||||
dialog_editbox;
|
||||
dialog_mixedform;
|
||||
dialog_mixedgauge;
|
||||
dialog_pause;
|
||||
dialog_progressbox;
|
||||
dlg_asciibox;
|
||||
dlg_boxchar;
|
||||
dlg_button_to_char;
|
||||
dlg_calc_list_width;
|
||||
dlg_checklist;
|
||||
dlg_clr_result;
|
||||
dlg_color_pair;
|
||||
dlg_default_formitem;
|
||||
dlg_default_listitem;
|
||||
dlg_draw_arrows2;
|
||||
dlg_dump_keys;
|
||||
dlg_editbox;
|
||||
dlg_exit_buttoncode;
|
||||
dlg_find_index;
|
||||
dlg_form;
|
||||
dlg_free_formitems;
|
||||
dlg_lookup_key;
|
||||
dlg_max_input;
|
||||
dlg_menu;
|
||||
dlg_mouse_wgetch_nowait;
|
||||
dlg_move_window;
|
||||
dlg_ordinate;
|
||||
dlg_parse_bindkey;
|
||||
dlg_print_line;
|
||||
dlg_register_buttons;
|
||||
dlg_register_window;
|
||||
dlg_result_key;
|
||||
dlg_set_result;
|
||||
dlg_strempty;
|
||||
dlg_trace;
|
||||
dlg_trace_chr;
|
||||
dlg_trace_win;
|
||||
dlg_unregister_window;
|
||||
dlg_yes_buttoncode;
|
||||
} DIALOG_1.0.20040721;
|
||||
|
||||
DIALOG_1.2.20121230 {
|
||||
global:
|
||||
dialog_buildlist;
|
||||
dialog_helpfile;
|
||||
dialog_prgbox;
|
||||
dialog_rangebox;
|
||||
dialog_treeview;
|
||||
dlg_add_callback_ref;
|
||||
dlg_add_separator;
|
||||
dlg_add_string;
|
||||
dlg_align_columns;
|
||||
dlg_allocate_gauge;
|
||||
dlg_buildlist;
|
||||
dlg_check_scrolled;
|
||||
dlg_count_argv;
|
||||
dlg_count_real_columns;
|
||||
dlg_default_button;
|
||||
dlg_draw_bottom_box2;
|
||||
dlg_draw_box2;
|
||||
dlg_draw_helpline;
|
||||
dlg_draw_scrollbar;
|
||||
dlg_dummy_menutext;
|
||||
dlg_dump_window_keys;
|
||||
dlg_eat_argv;
|
||||
dlg_free_columns;
|
||||
dlg_free_gauge;
|
||||
dlg_get_attrs;
|
||||
dlg_mouse_setcode;
|
||||
dlg_need_separator;
|
||||
dlg_new_modal_window;
|
||||
dlg_print_listitem;
|
||||
dlg_print_scrolled;
|
||||
dlg_progressbox;
|
||||
dlg_renamed_menutext;
|
||||
dlg_restore_vars;
|
||||
dlg_save_vars;
|
||||
dlg_string_to_argv;
|
||||
dlg_trace_msg;
|
||||
dlg_treeview;
|
||||
dlg_update_gauge;
|
||||
dlg_wgetparent;
|
||||
} DIALOG_1.1.20070227;
|
||||
|
||||
DIALOG_1.3.20160126 {
|
||||
global:
|
||||
dlg_add_help_formitem;
|
||||
dlg_add_help_listitem;
|
||||
dlg_add_last_key;
|
||||
dlg_finish_string;
|
||||
dlg_popen;
|
||||
dlg_reallocate_gauge;
|
||||
} DIALOG_1.2.20121230;
|
||||
|
||||
DIALOG_1.3.20180620 {
|
||||
global:
|
||||
dlg_trace_2n;
|
||||
dlg_trace_2s;
|
||||
dlg_ttysize;
|
||||
dlg_will_resize;
|
||||
} DIALOG_1.3.20160126;
|
||||
|
||||
DIALOG_1.3.20190806 {
|
||||
global:
|
||||
dlg_button_key;
|
||||
dlg_exitcode2s;
|
||||
dlg_exitname2n;
|
||||
dlg_ok_button_key;
|
||||
} DIALOG_1.3.20180620;
|
||||
|
||||
DIALOG_1.3.20191209 {
|
||||
global:
|
||||
dlg_trace_va_msg;
|
||||
} DIALOG_1.3.20190806;
|
||||
|
||||
DIALOG_1.3.20200326 {
|
||||
global:
|
||||
dlg_reset_timeout;
|
||||
dlg_set_timeout;
|
||||
} DIALOG_1.3.20191209;
|
||||
|
||||
DIALOG_1.3.20201126 {
|
||||
global:
|
||||
dlg_der_window;
|
||||
dlg_getenv_num;
|
||||
dlg_getenv_str;
|
||||
dlg_keep_tite;
|
||||
local:
|
||||
_*;
|
||||
} DIALOG_1.3.20200326;
|
||||
@@ -1,110 +0,0 @@
|
||||
Summary: dialog - display dialog boxes from shell scripts
|
||||
%define AppProgram dialog
|
||||
%define AppVersion 1.3
|
||||
%define AppRelease 20210117
|
||||
%define ActualProg c%{AppProgram}
|
||||
# $XTermId: dialog.spec,v 1.146 2021/01/16 16:21:23 tom Exp $
|
||||
Name: %{ActualProg}
|
||||
Version: %{AppVersion}
|
||||
Release: %{AppRelease}
|
||||
License: LGPL
|
||||
Group: Applications/System
|
||||
URL: ftp://ftp.invisible-island.net/%{AppProgram}
|
||||
Source0: %{AppProgram}-%{AppVersion}-%{AppRelease}.tgz
|
||||
Packager: Thomas Dickey <[email protected]>
|
||||
|
||||
%package devel
|
||||
Summary: Development headers/library for the dialog package.
|
||||
Requires: %{ActualProg}, ncurses-devel
|
||||
|
||||
%description
|
||||
Dialog is a program that will let you present a variety of questions or
|
||||
display messages using dialog boxes from a shell script. These types
|
||||
of dialog boxes are implemented (though not all are necessarily compiled
|
||||
into dialog):
|
||||
|
||||
buildlist, calendar, checklist, dselect, editbox, form, fselect,
|
||||
gauge, infobox, inputbox, inputmenu, menu, mixedform,
|
||||
mixedgauge, msgbox (message), passwordbox, passwordform, pause,
|
||||
prgbox, programbox, progressbox, radiolist, rangebox, tailbox,
|
||||
tailboxbg, textbox, timebox, treeview, and yesno (yes/no).
|
||||
|
||||
This package installs as "cdialog" to avoid conflict with other packages.
|
||||
|
||||
%description devel
|
||||
This is the development package "cdialog", which includes the header files,
|
||||
the linkage information and library documentation.
|
||||
%prep
|
||||
|
||||
%define debug_package %{nil}
|
||||
|
||||
%setup -q -n %{AppProgram}-%{AppVersion}-%{AppRelease}
|
||||
|
||||
%build
|
||||
|
||||
cp -v package/dialog.map package/%{ActualProg}.map
|
||||
|
||||
INSTALL_PROGRAM='${INSTALL}' \
|
||||
%configure \
|
||||
--target %{_target_platform} \
|
||||
--prefix=%{_prefix} \
|
||||
--bindir=%{_bindir} \
|
||||
--libdir=%{_libdir} \
|
||||
--mandir=%{_mandir} \
|
||||
--with-package=%{ActualProg} \
|
||||
--enable-header-subdir \
|
||||
--enable-nls \
|
||||
--enable-widec \
|
||||
--with-shared \
|
||||
--with-ncursesw \
|
||||
--with-versioned-syms \
|
||||
--disable-rpath-hack
|
||||
|
||||
make
|
||||
|
||||
%install
|
||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
make install-full DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
strip $RPM_BUILD_ROOT%{_bindir}/%{ActualProg}
|
||||
chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib%{ActualProg}.so.*
|
||||
|
||||
%clean
|
||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/%{ActualProg}
|
||||
%{_mandir}/man1/%{ActualProg}.*
|
||||
%{_libdir}/lib%{ActualProg}.so.*
|
||||
%{_datadir}/locale/*/LC_MESSAGES/%{ActualProg}.mo
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/%{ActualProg}-config
|
||||
%{_includedir}/%{ActualProg}.h
|
||||
%{_includedir}/%{ActualProg}/dlg_colors.h
|
||||
%{_includedir}/%{ActualProg}/dlg_config.h
|
||||
%{_includedir}/%{ActualProg}/dlg_keys.h
|
||||
%{_libdir}/lib%{ActualProg}.so
|
||||
%{_mandir}/man3/%{ActualProg}.*
|
||||
|
||||
%changelog
|
||||
# each patch should add its ChangeLog entries here
|
||||
|
||||
* Wed Jul 24 2019 Thomas Dickey
|
||||
- split-out "-devel" package
|
||||
|
||||
* Sat Dec 09 2017 Thomas Dickey
|
||||
- update ftp url
|
||||
|
||||
* Thu Apr 21 2016 Thomas Dickey
|
||||
- remove stray call to libtool
|
||||
|
||||
* Tue Oct 18 2011 Thomas Dickey
|
||||
- add executable permissions for shared libraries, discard ".la" file.
|
||||
|
||||
* Thu Dec 30 2010 Thomas Dickey
|
||||
- initial version
|
||||
@@ -1,225 +0,0 @@
|
||||
# $Id: dialog.sym,v 1.12 2020/11/26 18:08:18 tom Exp $
|
||||
# script for shared library symbol-visibility using libtool
|
||||
#
|
||||
# This file was generated by ncu-mapsyms
|
||||
# Configure options (1.0.20040721)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.1.20070227)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.2.20121230)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20160126)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20180620)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20190806)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20191209)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20200326)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
# Configure options (1.3.20201126)
|
||||
# --disable-leaks --enable-trace
|
||||
# --disable-leaks --enable-trace --enable-widec
|
||||
dialog_buildlist
|
||||
dialog_calendar
|
||||
dialog_checklist
|
||||
dialog_dselect
|
||||
dialog_editbox
|
||||
dialog_form
|
||||
dialog_fselect
|
||||
dialog_gauge
|
||||
dialog_helpfile
|
||||
dialog_inputbox
|
||||
dialog_menu
|
||||
dialog_mixedform
|
||||
dialog_mixedgauge
|
||||
dialog_msgbox
|
||||
dialog_pause
|
||||
dialog_prgbox
|
||||
dialog_progressbox
|
||||
dialog_rangebox
|
||||
dialog_state
|
||||
dialog_tailbox
|
||||
dialog_textbox
|
||||
dialog_timebox
|
||||
dialog_treeview
|
||||
dialog_vars
|
||||
dialog_version
|
||||
dialog_yesno
|
||||
dlg_add_callback
|
||||
dlg_add_callback_ref
|
||||
dlg_add_help_formitem
|
||||
dlg_add_help_listitem
|
||||
dlg_add_last_key
|
||||
dlg_add_quoted
|
||||
dlg_add_result
|
||||
dlg_add_separator
|
||||
dlg_add_string
|
||||
dlg_align_columns
|
||||
dlg_allocate_gauge
|
||||
dlg_asciibox
|
||||
dlg_attr_clear
|
||||
dlg_auto_size
|
||||
dlg_auto_sizefile
|
||||
dlg_beeping
|
||||
dlg_box_x_ordinate
|
||||
dlg_box_y_ordinate
|
||||
dlg_boxchar
|
||||
dlg_buildlist
|
||||
dlg_button_count
|
||||
dlg_button_key
|
||||
dlg_button_layout
|
||||
dlg_button_sizes
|
||||
dlg_button_to_char
|
||||
dlg_button_x_step
|
||||
dlg_calc_list_width
|
||||
dlg_calc_listh
|
||||
dlg_calc_listw
|
||||
dlg_char_to_button
|
||||
dlg_check_scrolled
|
||||
dlg_checklist
|
||||
dlg_clear
|
||||
dlg_clr_result
|
||||
dlg_color_count
|
||||
dlg_color_pair
|
||||
dlg_color_setup
|
||||
dlg_color_table
|
||||
dlg_count_argv
|
||||
dlg_count_columns
|
||||
dlg_count_real_columns
|
||||
dlg_count_wchars
|
||||
dlg_create_rc
|
||||
dlg_ctl_size
|
||||
dlg_default_button
|
||||
dlg_default_formitem
|
||||
dlg_default_item
|
||||
dlg_default_listitem
|
||||
dlg_defaultno_button
|
||||
dlg_del_window
|
||||
dlg_der_window
|
||||
dlg_does_output
|
||||
dlg_draw_arrows
|
||||
dlg_draw_arrows2
|
||||
dlg_draw_bottom_box
|
||||
dlg_draw_bottom_box2
|
||||
dlg_draw_box
|
||||
dlg_draw_box2
|
||||
dlg_draw_buttons
|
||||
dlg_draw_helpline
|
||||
dlg_draw_scrollbar
|
||||
dlg_draw_shadow
|
||||
dlg_draw_title
|
||||
dlg_dummy_menutext
|
||||
dlg_dump_keys
|
||||
dlg_dump_window_keys
|
||||
dlg_eat_argv
|
||||
dlg_edit_offset
|
||||
dlg_edit_string
|
||||
dlg_editbox
|
||||
dlg_exit
|
||||
dlg_exit_buttoncode
|
||||
dlg_exit_label
|
||||
dlg_exitcode2s
|
||||
dlg_exiterr
|
||||
dlg_exitname2n
|
||||
dlg_find_index
|
||||
dlg_finish_string
|
||||
dlg_flush_getc
|
||||
dlg_form
|
||||
dlg_free_columns
|
||||
dlg_free_formitems
|
||||
dlg_free_gauge
|
||||
dlg_get_attrs
|
||||
dlg_getc
|
||||
dlg_getc_callbacks
|
||||
dlg_getenv_num
|
||||
dlg_getenv_str
|
||||
dlg_index_columns
|
||||
dlg_index_wchars
|
||||
dlg_item_help
|
||||
dlg_keep_tite
|
||||
dlg_killall_bg
|
||||
dlg_last_getc
|
||||
dlg_limit_columns
|
||||
dlg_lookup_key
|
||||
dlg_match_char
|
||||
dlg_max_input
|
||||
dlg_menu
|
||||
dlg_mouse_bigregion
|
||||
dlg_mouse_free_regions
|
||||
dlg_mouse_mkbigregion
|
||||
dlg_mouse_mkregion
|
||||
dlg_mouse_region
|
||||
dlg_mouse_setbase
|
||||
dlg_mouse_setcode
|
||||
dlg_mouse_wgetch
|
||||
dlg_mouse_wgetch_nowait
|
||||
dlg_move_window
|
||||
dlg_need_separator
|
||||
dlg_new_modal_window
|
||||
dlg_new_window
|
||||
dlg_next_button
|
||||
dlg_next_ok_buttonindex
|
||||
dlg_ok_button_key
|
||||
dlg_ok_buttoncode
|
||||
dlg_ok_label
|
||||
dlg_ok_labels
|
||||
dlg_ordinate
|
||||
dlg_parse_bindkey
|
||||
dlg_parse_rc
|
||||
dlg_popen
|
||||
dlg_prev_button
|
||||
dlg_prev_ok_buttonindex
|
||||
dlg_print_autowrap
|
||||
dlg_print_line
|
||||
dlg_print_listitem
|
||||
dlg_print_scrolled
|
||||
dlg_print_size
|
||||
dlg_print_text
|
||||
dlg_progressbox
|
||||
dlg_put_backtitle
|
||||
dlg_reallocate_gauge
|
||||
dlg_register_buttons
|
||||
dlg_register_window
|
||||
dlg_remove_callback
|
||||
dlg_renamed_menutext
|
||||
dlg_reset_timeout
|
||||
dlg_restore_vars
|
||||
dlg_result_key
|
||||
dlg_save_vars
|
||||
dlg_set_focus
|
||||
dlg_set_result
|
||||
dlg_set_timeout
|
||||
dlg_show_string
|
||||
dlg_strclone
|
||||
dlg_strempty
|
||||
dlg_string_to_argv
|
||||
dlg_sub_window
|
||||
dlg_tab_correct_str
|
||||
dlg_trace
|
||||
dlg_trace_2n
|
||||
dlg_trace_2s
|
||||
dlg_trace_chr
|
||||
dlg_trace_msg
|
||||
dlg_trace_va_msg
|
||||
dlg_trace_win
|
||||
dlg_treeview
|
||||
dlg_trim_string
|
||||
dlg_ttysize
|
||||
dlg_unregister_window
|
||||
dlg_update_gauge
|
||||
dlg_wgetparent
|
||||
dlg_will_resize
|
||||
dlg_yes_buttoncode
|
||||
dlg_yes_labels
|
||||
end_dialog
|
||||
init_dialog
|
||||
@@ -1,48 +0,0 @@
|
||||
# New ports collection makefile for: ncdialog
|
||||
# Date created: 2003-01-11
|
||||
# Whom: AlanE <[email protected]>
|
||||
#
|
||||
# $Carpetsmoker: ports/cdialog/Makefile,v 1.4 2007/04/22 11:30:53 carpetsmoker Exp $
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= cdialog
|
||||
PORTVERSION= 1.3.20210117
|
||||
PORTEPOCH= 1
|
||||
CATEGORIES= devel
|
||||
MASTER_SITES= ftp://ftp.invisible-island.net/${PORTNAME:S|^c||}/
|
||||
DISTNAME= ${PORTNAME:S|^c||}-${PORTVERSION:R}-${PORTVERSION:E}
|
||||
EXTRACT_SUFX= .tgz
|
||||
|
||||
MAINTAINER= [email protected]
|
||||
COMMENT= An enhanced version of 'dialog' to work with ncurses
|
||||
|
||||
LICENSE= LGPL21
|
||||
|
||||
USE_AUTOTOOLS= libtool
|
||||
GNU_CONFIGURE= yes
|
||||
USE_LDCONFIG= yes
|
||||
CONFIGURE_ARGS= --enable-widec \
|
||||
--includedir=${PREFIX}/include/${PORTNAME} \
|
||||
--with-libtool \
|
||||
--with-ncursesw \
|
||||
--with-package=${PORTNAME}
|
||||
MAKEFILE= makefile
|
||||
|
||||
MAN1= cdialog.1
|
||||
MAN3= cdialog.3
|
||||
MANCOMPRESSED= no
|
||||
|
||||
INSTALL_TARGET= install-strip install-man install-lib
|
||||
|
||||
.if !defined(NOPORTEXAMPLES)
|
||||
post-patch:
|
||||
@${FIND} ${WRKSRC}/samples/ -type f -exec ${REINPLACE_CMD} -i "" "s|dialog|cdialog|g" {} \;
|
||||
|
||||
post-install:
|
||||
@${MKDIR} ${EXAMPLESDIR}
|
||||
cd ${WRKSRC}/samples && ${FIND} . | \
|
||||
${CPIO} -pdm -L -R ${SHAREOWN}:${SHAREGRP} ${EXAMPLESDIR}
|
||||
.endif
|
||||
|
||||
.include <bsd.port.mk>
|
||||
@@ -1,2 +0,0 @@
|
||||
SHA256 (dialog-1.1-20120215.tgz) = 883c58498663d939b18f3aea56976b64268b736d1579ac850512e5d5a4a2eafc
|
||||
SIZE (dialog-1.1-20120215.tgz) = 441234
|
||||
@@ -1,9 +0,0 @@
|
||||
This is an enhanced version of the 'dialog' command. Quoting Thomas Dickey,
|
||||
the ncurses developer, "DIALOG was written by Savio Lam <[email protected]>
|
||||
and modified by several people.
|
||||
|
||||
"Initially, I made fixes and reviewed the code to ensure that problems
|
||||
reported were not related to ncurses. After that, I resumed development,
|
||||
adding new widget types. See the changelog for details."
|
||||
|
||||
WWW: http://invisible-island.net/dialog/
|
||||
@@ -1,203 +0,0 @@
|
||||
bin/cdialog
|
||||
bin/cdialog-config
|
||||
include/cdialog/dialog.h
|
||||
include/cdialog/dlg_colors.h
|
||||
include/cdialog/dlg_config.h
|
||||
include/cdialog/dlg_keys.h
|
||||
lib/libcdialog.a
|
||||
lib/libcdialog.la
|
||||
lib/libcdialog.so
|
||||
lib/libcdialog.so.10
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/README
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/calendar
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/calendar-stdout
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/calendar2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/calendar2-stdout
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/calendar3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/calendar3-stdout
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist-8bit
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist-utf8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist10
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist11
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist4
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist5
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist6
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist7
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist9
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/checklist9.txt
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/admin.funcs
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/common.funcs
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.funcs
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.ifman1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.ifman2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.ifmcfg2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.ifmcfg4
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.ifmcfg5
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.ifpoll1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.ifpoll2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.ifreq1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.ifreq2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.rcnews
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.sendifm1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.sendifm2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.trnrc
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/copi.wheel
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copifuncs/ifpatch
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/copismall
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/debian.rc
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/dialog.py
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/editbox
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/editbox-utf8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/editbox2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/editbox3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/editbox4
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/form1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/form1-both
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/form1-extra
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/form1-help
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/form1-utf8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/form2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/form3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/form4
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/form5
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/form6
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fselect
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fselect-stdout
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fselect0
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fselect1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fselect1-stdout
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fselect2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fselect2-stdout
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gauge
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gauge0
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gauge0-input-fd
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gauge2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/infobox
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/infobox1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/infobox2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/infobox3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/infobox4
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/infobox5
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/infobox6
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox-both
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox-extra
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox-help
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox4
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox5
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox6-8bit
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox6-utf8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputbox7
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputmenu
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputmenu-stdout
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputmenu1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputmenu2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputmenu3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/inputmenu4
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/install/FDISK.TEST
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/install/makefile
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/install/makefile.in
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/install/setup.c
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/install/setup.help
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/killall
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/listing
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox-8bit
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox-utf8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox10
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox4
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox5
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox6
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox7
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/menubox9
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/mixedform
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/mixedform2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/mixedgauge
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox-help
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox-utf8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox4-8bit
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox4-eucjp
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox4-utf8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox5
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox6
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/msgbox6a
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/password
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/password1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/password2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/passwordform1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/passwordform1-utf8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pause
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pause-both
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pause-extra
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pause-help
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/prgbox
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/prgbox2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/programbox
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/programbox2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/progress
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/progress2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/radiolist
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/radiolist1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/radiolist10
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/radiolist2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/radiolist3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/radiolist4
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/report-button
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/report-edit
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/report-string
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/report-tempfile
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/report-yesno
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/rotated-data
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/setup-edit
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/setup-tempfile
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/setup-utf8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/setup-vars
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/shortlist
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/slackware.rc
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sourcemage.rc
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/suse.rc
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tailbox
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tailboxbg
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tailboxbg1
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tailboxbg2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/testdata-8bit
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/textbox
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/textbox-both
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/textbox-help
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/textbox.txt
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/textbox2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/textbox3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/timebox
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/timebox-stdout
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/timebox2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/timebox2-stdout
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/wheel
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/whiptail.rc
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yesno
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yesno-both
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yesno-extra
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yesno-help
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yesno-utf8
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yesno2
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yesno3
|
||||
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/yesno4
|
||||
%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%/install
|
||||
%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%/copifuncs
|
||||
%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
|
||||
@dirrm include/cdialog
|
||||
@@ -1,259 +0,0 @@
|
||||
/*
|
||||
* $Id: pause.c,v 1.48 2020/11/23 00:38:19 tom Exp $
|
||||
*
|
||||
* pause.c -- implements the pause dialog
|
||||
*
|
||||
* Copyright 2004-2019,2020 Thomas E. Dickey
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License, version 2.1
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write to
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin St., Fifth Floor
|
||||
* Boston, MA 02110, USA.
|
||||
*
|
||||
* This is adapted from source contributed by
|
||||
* Yura Kalinichenko
|
||||
*/
|
||||
|
||||
#include <dialog.h>
|
||||
#include <dlg_keys.h>
|
||||
|
||||
#define MY_TIMEOUT 50
|
||||
|
||||
#define MIN_HIGH (4)
|
||||
#define MIN_WIDE (10 + 2 * (2 + MARGIN))
|
||||
#define BTN_HIGH (1 + 2 * MARGIN)
|
||||
|
||||
/*
|
||||
* This is like gauge, but can be interrupted.
|
||||
*
|
||||
* A pause box displays a meter along the bottom of the box. The meter
|
||||
* indicates how many seconds remain until the end of the pause. The pause
|
||||
* exits when timeout is reached (status OK) or the user presses:
|
||||
* OK button (status OK)
|
||||
* CANCEL button (status CANCEL)
|
||||
* Esc key (status ESC)
|
||||
*
|
||||
*/
|
||||
int
|
||||
dialog_pause(const char *title,
|
||||
const char *cprompt,
|
||||
int height,
|
||||
int width,
|
||||
int seconds)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
static DLG_KEYS_BINDING binding[] = {
|
||||
HELPKEY_BINDINGS,
|
||||
ENTERKEY_BINDINGS,
|
||||
TRAVERSE_BINDINGS,
|
||||
END_KEYS_BINDING
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
int old_height = height;
|
||||
int old_width = width;
|
||||
#endif
|
||||
|
||||
int i, x, y, step;
|
||||
int button = dlg_default_button();
|
||||
int seconds_orig;
|
||||
WINDOW *dialog;
|
||||
const char **buttons = dlg_ok_labels();
|
||||
bool have_buttons = (dlg_button_count(buttons) != 0);
|
||||
bool first;
|
||||
int key, fkey;
|
||||
int result = DLG_EXIT_UNKNOWN;
|
||||
int button_high = (have_buttons ? BTN_HIGH : MARGIN);
|
||||
int gauge_y;
|
||||
char *prompt;
|
||||
int save_timeout = dialog_vars.timeout_secs;
|
||||
|
||||
DLG_TRACE(("# pause args:\n"));
|
||||
DLG_TRACE2S("title", title);
|
||||
DLG_TRACE2S("message", cprompt);
|
||||
DLG_TRACE2N("height", height);
|
||||
DLG_TRACE2N("width", width);
|
||||
DLG_TRACE2N("seconds", seconds);
|
||||
|
||||
curs_set(0);
|
||||
|
||||
seconds_orig = (seconds > 0) ? seconds : 1;
|
||||
dialog_vars.pause_secs = seconds_orig;
|
||||
dialog_vars.timeout_secs = 0;
|
||||
|
||||
#ifdef KEY_RESIZE
|
||||
retry:
|
||||
#endif
|
||||
|
||||
prompt = dlg_strclone(cprompt);
|
||||
dlg_tab_correct_str(prompt);
|
||||
|
||||
if (have_buttons) {
|
||||
dlg_auto_size(title, prompt, &height, &width,
|
||||
MIN_HIGH,
|
||||
MIN_WIDE);
|
||||
dlg_button_layout(buttons, &width);
|
||||
} else {
|
||||
dlg_auto_size(title, prompt, &height, &width,
|
||||
MIN_HIGH + MARGIN - BTN_HIGH,
|
||||
MIN_WIDE);
|
||||
}
|
||||
gauge_y = height - button_high - (1 + 2 * MARGIN);
|
||||
dlg_print_size(height, width);
|
||||
dlg_ctl_size(height, width);
|
||||
|
||||
/* center dialog box on screen */
|
||||
x = dlg_box_x_ordinate(width);
|
||||
y = dlg_box_y_ordinate(height);
|
||||
|
||||
dialog = dlg_new_window(height, width, y, x);
|
||||
dlg_register_window(dialog, "pause", binding);
|
||||
dlg_register_buttons(dialog, "pause", buttons);
|
||||
|
||||
dlg_mouse_setbase(x, y);
|
||||
nodelay(dialog, TRUE);
|
||||
|
||||
first = TRUE;
|
||||
do {
|
||||
(void) werase(dialog);
|
||||
dlg_draw_box2(dialog, 0, 0, height, width, dialog_attr, border_attr, border2_attr);
|
||||
|
||||
dlg_draw_title(dialog, title);
|
||||
dlg_draw_helpline(dialog, FALSE);
|
||||
|
||||
dlg_attrset(dialog, dialog_attr);
|
||||
dlg_print_autowrap(dialog, prompt, height, width);
|
||||
|
||||
dlg_draw_box2(dialog,
|
||||
gauge_y, 2 + MARGIN,
|
||||
2 + MARGIN, width - 2 * (2 + MARGIN),
|
||||
dialog_attr,
|
||||
border_attr,
|
||||
border2_attr);
|
||||
|
||||
/*
|
||||
* Clear the area for the progress bar by filling it with spaces
|
||||
* in the title-attribute, and write the percentage with that
|
||||
* attribute.
|
||||
*/
|
||||
(void) wmove(dialog, gauge_y + MARGIN, 4);
|
||||
dlg_attrset(dialog, title_attr);
|
||||
|
||||
for (i = 0; i < (width - 2 * (3 + MARGIN)); i++)
|
||||
(void) waddch(dialog, ' ');
|
||||
|
||||
(void) wmove(dialog, gauge_y + MARGIN, (width / 2) - 2);
|
||||
(void) wprintw(dialog, "%3d", seconds);
|
||||
|
||||
/*
|
||||
* Now draw a bar in reverse, relative to the background.
|
||||
* The window attribute was useful for painting the background,
|
||||
* but requires some tweaks to reverse it.
|
||||
*/
|
||||
x = (seconds * (width - 2 * (3 + MARGIN))) / seconds_orig;
|
||||
if ((title_attr & A_REVERSE) != 0) {
|
||||
dlg_attroff(dialog, A_REVERSE);
|
||||
} else {
|
||||
dlg_attrset(dialog, A_REVERSE);
|
||||
}
|
||||
(void) wmove(dialog, gauge_y + MARGIN, 4);
|
||||
for (i = 0; i < x; i++) {
|
||||
chtype ch = winch(dialog);
|
||||
if (title_attr & A_REVERSE) {
|
||||
ch &= ~A_REVERSE;
|
||||
}
|
||||
(void) waddch(dialog, ch);
|
||||
}
|
||||
|
||||
mouse_mkbutton(height - 2, width / 2 - 4, 6, '\n');
|
||||
if (have_buttons) {
|
||||
dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr);
|
||||
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
|
||||
}
|
||||
if (first) {
|
||||
(void) wrefresh(dialog);
|
||||
dlg_trace_win(dialog);
|
||||
first = FALSE;
|
||||
}
|
||||
|
||||
for (step = 0;
|
||||
(result == DLG_EXIT_UNKNOWN) && (step < 1000);
|
||||
step += MY_TIMEOUT) {
|
||||
|
||||
napms(MY_TIMEOUT);
|
||||
key = dlg_mouse_wgetch_nowait(dialog, &fkey);
|
||||
if (key == ERR) {
|
||||
; /* ignore errors in nodelay mode */
|
||||
} else if (dlg_result_key(key, fkey, &result)) {
|
||||
if (!dlg_button_key(result, &button, &key, &fkey))
|
||||
break;
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
#ifdef KEY_RESIZE
|
||||
case KEY_RESIZE:
|
||||
dlg_will_resize(dialog);
|
||||
height = old_height;
|
||||
width = old_width;
|
||||
free(prompt);
|
||||
_dlg_resize_cleanup(dialog);
|
||||
goto retry;
|
||||
#endif
|
||||
case DLGK_FIELD_NEXT:
|
||||
button = dlg_next_button(buttons, button);
|
||||
if (button < 0)
|
||||
button = 0;
|
||||
dlg_draw_buttons(dialog,
|
||||
height - 2, 0,
|
||||
buttons, button,
|
||||
FALSE, width);
|
||||
break;
|
||||
case DLGK_FIELD_PREV:
|
||||
button = dlg_prev_button(buttons, button);
|
||||
if (button < 0)
|
||||
button = 0;
|
||||
dlg_draw_buttons(dialog,
|
||||
height - 2, 0,
|
||||
buttons, button,
|
||||
FALSE, width);
|
||||
break;
|
||||
case DLGK_ENTER:
|
||||
result = dlg_enter_buttoncode(button);
|
||||
break;
|
||||
case DLGK_LEAVE:
|
||||
result = dlg_ok_buttoncode(button);
|
||||
break;
|
||||
case ERR:
|
||||
break;
|
||||
default:
|
||||
if (is_DLGK_MOUSE(key)) {
|
||||
result = dlg_ok_buttoncode(key - M_EVENT);
|
||||
if (result < 0)
|
||||
result = DLG_EXIT_OK;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while ((result == DLG_EXIT_UNKNOWN) && (seconds-- > 0));
|
||||
dlg_add_last_key(-1);
|
||||
|
||||
curs_set(1);
|
||||
dlg_mouse_free_regions();
|
||||
dlg_del_window(dialog);
|
||||
free(prompt);
|
||||
|
||||
dialog_vars.timeout_secs = save_timeout;
|
||||
|
||||
return ((result == DLG_EXIT_UNKNOWN) ? DLG_EXIT_OK : result);
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
arrows.c
|
||||
buttons.c
|
||||
calendar.c
|
||||
checklist.c
|
||||
dialog.c
|
||||
dialog.h
|
||||
dlg_colors.h
|
||||
dlg_keys.c
|
||||
dlg_keys.h
|
||||
editbox.c
|
||||
formbox.c
|
||||
fselect.c
|
||||
guage.c
|
||||
inputbox.c
|
||||
inputstr.c
|
||||
menubox.c
|
||||
mixedform.c
|
||||
mixedgauge.c
|
||||
mouse.c
|
||||
mousewget.c
|
||||
msgbox.c
|
||||
pause.c
|
||||
progressbox.c
|
||||
rc.c
|
||||
tailbox.c
|
||||
textbox.c
|
||||
timebox.c
|
||||
trace.c
|
||||
ui_getc.c
|
||||
util.c
|
||||
version.c
|
||||
yesno.c
|
||||
@@ -1,111 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2003-2007,2008 # Thomas Dickey
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Daniel Martinez <[email protected]>, 2013.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2013-02-19 17:50+0100\n"
|
||||
"Last-Translator: Daniel Martinez <[email protected]>\n"
|
||||
"Language-Team: Aragonese <[email protected]>\n"
|
||||
"Language: an\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Sí"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "No"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "Acceptar"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Cancelar"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "Salir"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Extra"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Aduya"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Mes"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Anyo"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Renombrar"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Directorios"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Fichers"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Finalizau con exito"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Falló"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Pasau"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Completau"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Comprebau"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Feito"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Blincau"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "En progreso"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Progreso total"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Buscar"
|
||||
@@ -1,112 +0,0 @@
|
||||
# Arabic translation of Dialog.
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Copyright (C) 2005 Thomas Dickey.
|
||||
# Abdulaziz Al-Arfaj <[email protected]>, 2004.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Dialog 1.0-20050116\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2004-07-21 00:22+0300\n"
|
||||
"Last-Translator: Abdulaziz Al-Arfaj <[email protected]>\n"
|
||||
"Language-Team: Arabic <[email protected]>\n"
|
||||
"Language: ar\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: KBabel 1.3\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "نعم"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "لا"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "موافق"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "إلغاء"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr ""
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr ""
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr ""
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr ""
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr ""
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr ""
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr ""
|
||||
@@ -1,115 +0,0 @@
|
||||
# Asturian translation for dialog
|
||||
# Dialog
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Copyright 2003-2007,2008 # Thomas Dickey
|
||||
#
|
||||
# enolp <[email protected]>, 2018.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2018-07-16 01:09+0100\n"
|
||||
"Last-Translator: enolp <[email protected]>\n"
|
||||
"Language-Team: Asturian <[email protected]>\n"
|
||||
"Language: ast\n"
|
||||
"X-Bugs: Report translation errors to the Language-Team address.\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Lokalize 2.0\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Sí"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Non"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "Aceutar"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Encaboxar"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "COLAR"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Adicional"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Ayuda"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Mes"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Añu"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Renomar"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Direutorios"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Ficheros"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Tuvo ésitu"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Falló"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Posóse"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Completóse"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Conseñóse"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Fecho"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Saltóse"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "En cursu"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/D"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Progresu xeneral"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Guetar"
|
||||
@@ -1,109 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2003-2006,2007 # Thomas Dickey
|
||||
# Ihar Hrachyshka <[email protected]>, 2007.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20070704\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2007-12-03 01:13+0200\n"
|
||||
"Last-Translator: Ihar Hrachyshka <[email protected]>\n"
|
||||
"Language-Team: Belarusian (Latin script) <[email protected]>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Tak"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Nie"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Anuluj"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "VYCHAD"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Dadatkova"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Dapamoha"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Miesiac"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Hod"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Źmiani nazvu"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Katalohi"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Fajły"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Paśpiachova"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Niaŭdała"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Projdziena"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Skončana"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Pravierana"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Zroblena"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Abminuta"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Dziejničaje"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "Niama"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Ahulny prahres"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Šukaj"
|
||||
@@ -1,112 +0,0 @@
|
||||
# Bulgarian translation of Dialog.
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Copyright (C) 2005 Thomas Dickey.
|
||||
# Ognyan Kulev <[email protected]>, 2004.
|
||||
#
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Dialog 1.0-20050116\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2004-09-13 09:02+0300\n"
|
||||
"Last-Translator: Ognyan Kulev <[email protected]>\n"
|
||||
"Language-Team: Bulgarian <[email protected]>\n"
|
||||
"Language: bg\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Да"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "Не"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Отказ"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr ""
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr ""
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr ""
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr ""
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr ""
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr ""
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr ""
|
||||
@@ -1,111 +0,0 @@
|
||||
# Catalan translation of Dialog.
|
||||
# Copyright © 2004, 2005, 2008 Free Software Foundation, Inc.
|
||||
# This file is distributed under the same licence as the dialog package.
|
||||
# Jordi Mallach <[email protected]>, 2004, 2005, 2008.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20070704\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2008-06-10 00:50+0200\n"
|
||||
"Last-Translator: Jordi Mallach <[email protected]>\n"
|
||||
"Language-Team: Catalan <[email protected]>\n"
|
||||
"Language: ca\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Sí"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "No"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "D'acord"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Cancel·la"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "SURT"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Extra"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Ajuda"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Mes"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "Any"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Canvia el nom"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Directoris"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "Fitxers"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Ha tingut èxit"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Ha fallat"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Ha passat"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "S'ha completat"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Activat"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Fet"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Omès"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "En progrés"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/D"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Progrés general"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "Cerca"
|
||||
@@ -1,114 +0,0 @@
|
||||
# Czech translations for dialog package.
|
||||
# Copyright (C) 2011 THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
#
|
||||
# Martin Povolny <[email protected]>
|
||||
# Marek Černocký <[email protected]>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2011-11-25 13:18+0100\n"
|
||||
"Last-Translator: Marek Černocký <[email protected]>\n"
|
||||
"Language-Team: Czech <[email protected]>\n"
|
||||
"Language: cs\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Ano"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Ne"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "Budiž"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Storno"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "Konec"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Další"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Nápověda"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Měsíc"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Rok"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Přejmenovat"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Složky"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Soubory"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Úspěšné"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Selhalo"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Pozastaveno"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Dokončeno"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Zkontrolováno"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Hotovo"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Přeskočeno"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Probíhá"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "Není známo"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Celkový průběh"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Hledat"
|
||||
@@ -1,111 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2003,2004 # Thomas Dickey
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Dialog\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2004-03-30 23:00+0100\n"
|
||||
"Last-Translator: Dafydd Harries <[email protected]>\n"
|
||||
"Language-Team: Welsh <[email protected]>\n"
|
||||
"Language: cy\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Ie"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "Na"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "Iawn"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Diddymu"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "GADAEL"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Ychwanegol"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Cymorth"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Mis"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "Blwyddyn"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Ailenwy"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Cyfeiriaduron"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "Ffeiliau"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:61
|
||||
#, fuzzy
|
||||
msgid "Failed"
|
||||
msgstr "Ffeiliau"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr ""
|
||||
|
||||
#: textbox.c:468
|
||||
#, fuzzy
|
||||
msgid "Search"
|
||||
msgstr "Search"
|
||||
@@ -1,112 +0,0 @@
|
||||
# Danish translation of Dialog.
|
||||
# Copyright (C) 2001-2007 Thomas Dickey.
|
||||
# This file is distributed under the same license as the Dialog package.
|
||||
# Morten Brix Pedersen <[email protected]>, 2001-2004.
|
||||
# Joe Hansen <[email protected]>, 2008.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog-1.1.20070704\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2008-08-20 22:53+0200\n"
|
||||
"Last-Translator: Keld Jørn Simonsen <[email protected]>\n"
|
||||
"Language-Team: Danish <[email protected]>\n"
|
||||
"Language: da\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Ja"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "Nej"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "O.K."
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Anullér"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "AFSLUT"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Ekstra"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Hjælp"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Måned"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "År"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Omdøb"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Kataloger"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "Filer"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Lykkedes"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Mislykkedes"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Bestod"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Færdig"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Kontrolleret"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Færdig"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Sprunget over"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "I gang"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Samlet status"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "Søg"
|
||||
@@ -1,115 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2001, # Thomas Dickey
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
#
|
||||
# Michael Piefel <[email protected]>, 2002.
|
||||
# Roland Illig <[email protected]>, 2009-2014.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2014-09-01 12:39+0100\n"
|
||||
"Last-Translator: Roland Illig <[email protected]>\n"
|
||||
"Language-Team: German <[email protected]>\n"
|
||||
"Language: de\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 1.6.9\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Ja"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Nein"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Abbrechen"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "VERLASSEN"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Extra"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Hilfe"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Monat"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Jahr"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Umbenennen"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Verzeichnisse"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Dateien"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Erfolgreich"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Fehlgeschlagen"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Bestanden"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Abgeschlossen"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Geprüft"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Erledigt"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Übersprungen"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "In Bearbeitung"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Gesamtfortschritt"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Suche"
|
||||
@@ -1,120 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2003-2020,2021 # Thomas Dickey
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.3.20210117\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-01-17 15:18-0500\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <[email protected]>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: buttons.c:500
|
||||
msgid "Yes"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:508
|
||||
msgid "No"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:516
|
||||
msgid "OK"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:524
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:532
|
||||
msgid "EXIT"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:540
|
||||
msgid "Extra"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:548
|
||||
msgid "Help"
|
||||
msgstr ""
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:463
|
||||
msgid "Month"
|
||||
msgstr ""
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:485
|
||||
msgid "Year"
|
||||
msgstr ""
|
||||
|
||||
#: dialog.c:744
|
||||
#, c-format
|
||||
msgid "Expected %d arguments, found only %d"
|
||||
msgstr ""
|
||||
|
||||
#: dialog.c:748
|
||||
#, c-format
|
||||
msgid "Expected %d arguments, found extra %d"
|
||||
msgstr ""
|
||||
|
||||
#: dialog.c:907
|
||||
msgid "Rename"
|
||||
msgstr ""
|
||||
|
||||
#: fselect.c:623
|
||||
msgid "Directories"
|
||||
msgstr ""
|
||||
|
||||
#: fselect.c:624
|
||||
msgid "Files"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr ""
|
||||
|
||||
#: textbox.c:515
|
||||
msgid "Search"
|
||||
msgstr ""
|
||||
@@ -1,111 +0,0 @@
|
||||
# Greek translation for dialog.
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
# Savvas Radevic <[email protected]>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2012-03-18 00:54+0100\n"
|
||||
"Last-Translator: Savvas Radevic <[email protected]>\n"
|
||||
"Language-Team: Greek <[email protected]>\n"
|
||||
"Language: el\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Ναι"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Όχι"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "Εντάξει"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Άκυρο"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "Έξοδος"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Πρόσθετα"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Βοήθεια"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Μήνας"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Έτος"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Μετονομασία"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Φάκελοι"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Αρχεία"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Επιτυχία"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Αποτυχία"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Πέρασε"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Ολοκλήρωση"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Έλεγχος"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Τέλος"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Παράλειψη"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Σε εξέλιξη"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "Μη Διαθέσιμο"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Συνολική πρόοδος"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Αναζήτηση"
|
||||
@@ -1,110 +0,0 @@
|
||||
# Esperanto translation of Dialog
|
||||
# Copyright (C) 2008 Felipe Castro
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Felipe Castro <[email protected]>, 2008
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20070704\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2008-08-03 15:50-0300\n"
|
||||
"Last-Translator: Felipe Castro <[email protected]>\n"
|
||||
"Language-Team: Esperanto <[email protected]>\n"
|
||||
"Language: eo\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Jes"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "Ne"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "Certe"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Rezigni"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "ELIRI"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Krome"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Helpo"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Monato"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "Jaro"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Renomigi"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Dosierujoj"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "Dosieroj"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Sukcesis"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Malsukcesis"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Pasite"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Kompletite"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Kontrolite"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Farite"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Preterpasite"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Evoluado"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Tuta Evoluo"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "Serĉi"
|
||||
@@ -1,112 +0,0 @@
|
||||
# Mensajes en español para dialog.
|
||||
# Copyright (C) 2001, 2003, 2004 Thomas Dickey.
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Santiago Vila Doncel <[email protected]>, 2001, 2003, 2004, 2010.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2010-02-14 14:26+0100\n"
|
||||
"Last-Translator: Santiago Vila Doncel <[email protected]>\n"
|
||||
"Language-Team: Spanish <[email protected]>\n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Sí"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "No"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "Aceptar"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Cancelar"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "Salir"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Extra"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Ayuda"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Mes"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Año"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Renombrar"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Directorios"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Ficheros"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Finalizado con éxito"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Falló"
|
||||
|
||||
# Esta no me convence mucho. Se admiten sugerencias
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Pasado"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Completado"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Comprobado"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Hecho"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Saltado"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "En progreso"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Progreso total"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Buscar"
|
||||
@@ -1,110 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2001, Thomas Dickey
|
||||
# Copyright 2001, Ivar Smolin
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Dialog\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2001-09-08 00:05+0200\n"
|
||||
"Last-Translator: Ivar Smolin <[email protected]>\n"
|
||||
"Language-Team: Estonian <[email protected]>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Jah"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Ei"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Tühista"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "Lõpeta"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr ""
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr ""
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Kuu"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Aasta"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr ""
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Kataloogid"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Failid"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:61
|
||||
#, fuzzy
|
||||
msgid "Failed"
|
||||
msgstr "Failid"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr ""
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr ""
|
||||
|
||||
#: textbox.c:489
|
||||
#, fuzzy
|
||||
msgid "Search"
|
||||
msgstr "Otsingu"
|
||||
@@ -1,112 +0,0 @@
|
||||
# translation of dialog-1.1.20070704.po to Euskara
|
||||
# Dialog
|
||||
# Copyright 2003,2004 # Thomas Dickey
|
||||
#
|
||||
# Piarres Beobide Egaña <[email protected]>, 2004, 2007.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog-1.1.20070704\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2007-09-20 00:01+0200\n"
|
||||
"Last-Translator: Piarres Beobide <[email protected]>\n"
|
||||
"Language-Team: Basque <[email protected]>\n"
|
||||
"Language: eu\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: KBabel 1.11.4\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Bai"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "Ez"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "Ados"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Utzi"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "IRTEN"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Gehigarria"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Laguntza"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Hilabetea"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "Urtea"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Berizendatu"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Direktorioak"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "Fitxategiak"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Lortua"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Huts eginda"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Pasata"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Osatua"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Egiaztatua"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Eginda"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Salto eginda"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Aurrerakuntza"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "E/G"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Aurrerapen nagusia"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "Bilaketa"
|
||||
@@ -1,113 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2003-2007,2008 # Thomas Dickey
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
#
|
||||
# Seyed Ali Akbar Najafian <[email protected]>, 2012.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2013-08-03 17:04+0330\n"
|
||||
"Last-Translator: سیدعلیاکبر نجفیان <[email protected]>\n"
|
||||
"Language-Team: Persian <[email protected]>\n"
|
||||
"Language: persian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.5.4\n"
|
||||
|
||||
#: buttons.c:385
|
||||
#, fuzzy
|
||||
msgid "Yes"
|
||||
msgstr "بله"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "خیر"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "باشه"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "لغو"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "خروج"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "اضافس"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "راهنما"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "ماه"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "سال"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "تغییر نام"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "مسیرها"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "پروندهها"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "موفقیت آمیز"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "شکست خورد"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "متوقف شد"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "کامل شد"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "بررسی شد"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "انجام شد"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "رها شد"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "در حال پیشرفت"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "پیشرفت جاری"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "جستجو"
|
||||
@@ -1,114 +0,0 @@
|
||||
# Finnish translation for dialog.
|
||||
# Copyright © 2010 Free Software Foundation, Inc.
|
||||
# Copyright © 2005 Lauri Nurmi <[email protected]>
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Lauri Nurmi <[email protected]>, 2005.
|
||||
# Jorma Karvonen <[email protected]>, 2010.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2010-09-06 21:24+0200\n"
|
||||
"Last-Translator: Jorma Karvonen <[email protected]>\n"
|
||||
"Language-Team: Finnish <[email protected]>\n"
|
||||
"Language: fi\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Kyllä"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "Ei"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "Valmis"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Peru"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "Poistu"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Painike"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Opaste"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Kuukausi"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "Vuosi"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Nimeä"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Kansiot"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "Tiedostot"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Onnistui"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Epäonnistui"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Hyväksytty"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Valmis"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Valittu"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Valmis"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Ohitettiin"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Edistyminen"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Kokonaisedistyminen"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "Etsi"
|
||||
@@ -1,111 +0,0 @@
|
||||
# French translation of Dialog.
|
||||
# Copyright (C) 2001 Thomas Dickey.
|
||||
# Frédéric L. W. Meunier <0 @ pervalidus.net>, 2001.
|
||||
# François-Xavier Coudert <[email protected]>, 2008.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20070704\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2008-03-28 23:14+0000\n"
|
||||
"Last-Translator: François-Xavier Coudert <[email protected]>\n"
|
||||
"Language-Team: French <[email protected]>\n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Oui"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "Non"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "Accepter"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "SORTIR"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Extra"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Aide"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Mois"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "Année"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Renommer"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Répertoires"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "Fichiers"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Succès"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Échec"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Passé"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Terminé"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Vérifié"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Fini"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Ignoré"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "En cours"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Avancement général"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "Rechercher"
|
||||
@@ -1,113 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2003-2007,2008 # Thomas Dickey
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Fabio Tomat <[email protected]>, 2016.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2016-11-20 07:14+0100\n"
|
||||
"Last-Translator: Fabio Tomat <[email protected]>\n"
|
||||
"Language-Team: Friulian <[email protected]>\n"
|
||||
"Language: fur\n"
|
||||
"X-Bugs: Report translation errors to the Language-Team address.\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.8.8\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Sì"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "No"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Anule"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "JES"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Adizionâl"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Jutori"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Mês"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "An"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Cambie non"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Cartelis"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "File"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Riessût"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Falît"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Superât"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Completât"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Controlât"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Fat"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Saltât"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "In cors"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/D"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Progrès gjenerâl"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Cîr"
|
||||
@@ -1,109 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2003,2004 # Thomas Dickey
|
||||
# Kevin Patrick Scannell <[email protected]>, 2005, 2007.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20070704\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2007-07-20 11:57-0500\n"
|
||||
"Last-Translator: Kevin Scannell <[email protected]>\n"
|
||||
"Language-Team: Irish <[email protected]>\n"
|
||||
"Language: ga\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Tá"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "Níl"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Cealaigh"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "SCOIR"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Breise"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Cabhair"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Mí"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "Bliain"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Athainmnigh"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Comhadlanna"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "Comhaid"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "D'éirigh leis"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Teipthe"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Ceadaithe"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Críochnaithe"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Deimhnithe"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Déanta"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Scipeáilte"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Faoi Shiúl"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A/F"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Dul Chun Cinn Iomlán"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "Cuardaigh"
|
||||
@@ -1,111 +0,0 @@
|
||||
# Scottish Gaelic translation of Dialog.
|
||||
# Copyright 2003-2007,2008 # Thomas Dickey
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# GunChleoc <[email protected]>, 2014.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2014-02-11 11:19-0000\n"
|
||||
"Last-Translator: GunChleoc <[email protected]>\n"
|
||||
"Language-Team: Scottish Gaelic <[email protected]>\n"
|
||||
"Language: gd\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Tha"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Chan eil"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "Ceart ma-thà"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Sguir dheth"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "FÀG AN-SEO"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Barrachd"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Cobhair"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Mìos"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Bliadhna"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Cuir ainm ùr air"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Pasganan"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Faidhlichean"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Soirbheachail"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Dh'fhàillig leis"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Soirbheachail"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Coileanta"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Air a dhearbhadh"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Dèanta"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Air a leigeil seachad"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "A' dol air adhart"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "Chan eil seo iomchaidh"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Adhartas san fharsaingeachd"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Lorg"
|
||||
@@ -1,119 +0,0 @@
|
||||
# Galician translation of dialog
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Copyright 2003-2006, 2007 Thomas Dickey
|
||||
# Copyright 2012 Leandro Regueiro
|
||||
#
|
||||
# Diego Pérez Montes <[email protected]>, 2008
|
||||
# Leandro Regueiro <[email protected]>, 2012.
|
||||
#
|
||||
# Proxecto Trasno - Adaptación do software libre á lingua galega: Se desexas
|
||||
# colaborar connosco, podes atopar máis información en <http://www.trasno.net>
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2012-11-10 13:53+0200\n"
|
||||
"Last-Translator: Leandro Regueiro <[email protected]>\n"
|
||||
"Language-Team: Galician <[email protected]>\n"
|
||||
"Language: gl\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Virtaal 0.7.0\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Si"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Non"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "Aceptar"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Cancelar"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "SAÍR"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Extra"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Axuda"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Mes"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Ano"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Renomear"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Directorios"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Ficheiros"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Conseguido"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Fallou"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Correcto"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Completado"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Seleccionado"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Feito"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Omitido"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "En progreso"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "Non dispoñíbel"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Progreso total"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Buscar"
|
||||
@@ -1,113 +0,0 @@
|
||||
# Hindi translation of Dialog.
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2007-07-18 11:06+0200\n"
|
||||
"Last-Translator: Deepika Mangla <[email protected]>\n"
|
||||
"Language-Team: <[email protected]>\n"
|
||||
"Language: hi\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: 2\n"
|
||||
"X-Poedit-Language: Hindi\n"
|
||||
"X-Poedit-Country: INDIA\n"
|
||||
"X-Generator: KBabel 1.11.4\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "हाँ"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "नहीं"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "ठीक"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "रद्द करें"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "निर्गम"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "अतिरिक्त"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "मदद"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "महीना"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "वर्ष"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "पुनःनामकरण"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "निर्देशिका"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "संचिका"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "सफल"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "सफल"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "पास"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "सम्पूरित"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "अवरुद्ध"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "सफल "
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "छोड़ दिया"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "प्रगति में है"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "लागू नहीं"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "समग्र प्रगति"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "अनुसन्धान"
|
||||
@@ -1,114 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2003-2007,2008 # Thomas Dickey
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Tomislav Krznar <[email protected]>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2017-03-26 15:31+0200\n"
|
||||
"Last-Translator: gogo <[email protected]>\n"
|
||||
"Language-Team: Croatian <[email protected]>\n"
|
||||
"Language: hr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Bugs: Report translation errors to the Language-Team address.\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"X-Generator: Poedit 1.8.7.1\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Da"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Ne"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "U redu"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Odustani"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "IZLAZ"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Dodatno"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Pomoć"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Mjesec"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Godina"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Preimenuj"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Direktoriji"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Datoteke"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Uspjeh"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Neuspjeh"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Prošlo"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Završeno"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Provjereno"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Gotovo"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Preskočeno"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "U tijeku"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "Nedostupno"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Ukupni napredak"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Pretraga"
|
||||
@@ -1,114 +0,0 @@
|
||||
# Hungarian translation of dialog
|
||||
# Copyright (C) 2003, 2014 Free Software Foundation, Inc.
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
#
|
||||
# Árpad Biró <[email protected]>, 2003.
|
||||
# Balázs Úr <[email protected]>, 2014.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2014-03-20 23:07+0100\n"
|
||||
"Last-Translator: Balázs Úr <[email protected]>\n"
|
||||
"Language-Team: Hungarian <[email protected]>\n"
|
||||
"Language: hu\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Lokalize 1.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Igen"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Nem"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Mégse"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "KILÉPÉS"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Extra"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Súgó"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Hónap"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Év"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Átnevezés"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Könyvtárak"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Fájlok"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Sikerült"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Meghiúsult"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Teljesült"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Befejezve"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Bejelölve"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Kész"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Kihagyva"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Folyamatban"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Teljes folyamat"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Keresés"
|
||||
@@ -1,111 +0,0 @@
|
||||
# Interlingua translation of Dialog
|
||||
# Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Nik Kalach <[email protected]>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2012-12-04 00:56+0400\n"
|
||||
"Last-Translator: Nik Kalach <[email protected]>\n"
|
||||
"Language-Team: Interlingua <[email protected]>\n"
|
||||
"Language: ia\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Si"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "No"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Annullar"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "SORTIR"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Extra"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Adjuta"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Mense"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Anno"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Renominar"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Directorios"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Files"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Succedite"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Fallite"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Passate"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Completate"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Controlate"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Facite"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Saltate"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "In curso"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Progresso general"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Cerca"
|
||||
@@ -1,111 +0,0 @@
|
||||
# Indonesian translations for dialog package.
|
||||
# Copyright 2003-2006,2007 # Thomas Dickey.
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Andhika Padmawan <[email protected]>, 2008.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2008-07-21 13:40+0700\n"
|
||||
"Last-Translator: Andhika Padmawan <[email protected]>\n"
|
||||
"Language-Team: Indonesian <[email protected]>\n"
|
||||
"Language: id\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Ya"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "Tidak"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Batal"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "KELUAR"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Ekstra"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Bantuan"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Bulan"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "Tahun"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Ganti Nama"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Kamus"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "Berkas"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Sukses"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Gagal"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Lulus"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Selesai"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Diperiksa"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Selesai"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Dilewati"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Dalam Proses"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "Tak Tersedia"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Keseluruhan Proses"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "Telusur"
|
||||
@@ -1,112 +0,0 @@
|
||||
# translation of dialog-1.1.20080819.po to Icelandic
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Copyright 2003-2007,2008 Thomas Dickey
|
||||
#
|
||||
# Sveinn í Felli <[email protected]>, 2009.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog-1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2009-09-03 17:02+0000\n"
|
||||
"Last-Translator: Sveinn í Felli <[email protected]>\n"
|
||||
"Language-Team: Icelandic <(nothing)>\n"
|
||||
"Language: is\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: KBabel 1.11.4\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Já"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "Nei"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "Í lagi"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Hætta við"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "LOKA"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Auka"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Hjálp"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Mánuður"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "Ár"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Endurnefna"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Möppur"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "Skrár"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Tókst"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Mistókst"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Stóðst prófun"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Fullgert"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Athugað"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Lokið"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Sleppt"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Í vinnslu"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "Ekki tiltækt"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Heildarframvinda"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "Leita"
|
||||
@@ -1,112 +0,0 @@
|
||||
# Italian messages for dialog.
|
||||
# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Marco Colombo <[email protected]>, 2005, 2007.
|
||||
# Marco Mariani <[email protected]>, 2004.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20070704\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2007-08-06 15:47+0100\n"
|
||||
"Last-Translator: Marco Colombo <[email protected]>\n"
|
||||
"Language-Team: Italian <[email protected]>\n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8-bit\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Sì"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "No"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Annulla"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "Esci"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Extra"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Aiuto"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Mese"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "Anno"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Rinomina"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Cartelle"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "File"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Riuscito"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Fallito"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Superato"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Completato"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Controllato"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Fatto"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Saltato"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "In corso"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "N/A"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Progresso complessivo"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "Ricerca"
|
||||
@@ -1,112 +0,0 @@
|
||||
# dialog Japanese po file.
|
||||
# Copyright 2000, Thomas Dickey
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Hirofumi Takeda <[email protected]>, 2000.
|
||||
# Takeshi Hamasaki <[email protected]>, 2008.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20070704\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2008-07-24 00:12+0900\n"
|
||||
"Last-Translator: Takeshi Hamasaki <[email protected]>\n"
|
||||
"Language-Team: Japanese <[email protected]>\n"
|
||||
"Language: ja\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "はい"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "いいえ"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "了解"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "取消"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "終了"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "拡張"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "ヘルプ"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "月"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "年"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "名前変更"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "ディレクトリ"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "ファイル"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "成功"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "失敗"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "パス"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "完了"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "確認終了"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "終了"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "スキップ"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "処理中"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "無効"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "全体の進行状況"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "調査"
|
||||
@@ -1,113 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2003-2006,2007 # Thomas Dickey
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
#
|
||||
# Erdal Ronahi <[email protected]>, 2008.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20070704\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-01-16 17:57-0500\n"
|
||||
"PO-Revision-Date: 2008-04-25 16:51+0200\n"
|
||||
"Last-Translator: Erdal Ronahi <[email protected]>\n"
|
||||
"Language-Team: Kurdish <[email protected]>\n"
|
||||
"Language: ku\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: KAider 0.1\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
|
||||
#: buttons.c:387
|
||||
msgid "Yes"
|
||||
msgstr "Erê"
|
||||
|
||||
#: buttons.c:395
|
||||
msgid "No"
|
||||
msgstr "Na"
|
||||
|
||||
#: buttons.c:403
|
||||
msgid "OK"
|
||||
msgstr "TEMAM"
|
||||
|
||||
#: buttons.c:411
|
||||
msgid "Cancel"
|
||||
msgstr "Betal"
|
||||
|
||||
#: buttons.c:419
|
||||
msgid "EXIT"
|
||||
msgstr "DERKETIN"
|
||||
|
||||
#: buttons.c:427
|
||||
msgid "Extra"
|
||||
msgstr "Ekstra"
|
||||
|
||||
#: buttons.c:435
|
||||
msgid "Help"
|
||||
msgstr "Alîkarî"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:298
|
||||
msgid "Month"
|
||||
msgstr "Meh"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:318
|
||||
msgid "Year"
|
||||
msgstr "Sal"
|
||||
|
||||
#: dialog.c:756
|
||||
msgid "Rename"
|
||||
msgstr "Nav guherandin"
|
||||
|
||||
#: fselect.c:571
|
||||
msgid "Directories"
|
||||
msgstr "Peldank"
|
||||
|
||||
#: fselect.c:572
|
||||
msgid "Files"
|
||||
msgstr "Pel"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Biserket"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Biserneket"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Derbas bû"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Temamkirî"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Kontrolkirî"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Xelas"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Derbaskirî"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Didome"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "Tune"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Pêşketina Giştî"
|
||||
|
||||
#: textbox.c:468
|
||||
msgid "Search"
|
||||
msgstr "Lêgerîn"
|
||||
@@ -1,112 +0,0 @@
|
||||
# translation of dialog to Lithuanian
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
# Gintautas Miliauskas <[email protected]>, 2008.
|
||||
# Rimas Kudelis <[email protected]>, 2013.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog-1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2013-06-28 18:38+0300\n"
|
||||
"Last-Translator: Rimas Kudelis <[email protected]>\n"
|
||||
"Language-Team: Lithuanian <[email protected]>\n"
|
||||
"Language: lt\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"X-Generator: Virtaal 0.7.1\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Taip"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Ne"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "Gerai"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Atsisakyti"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "IŠEITI"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Kita"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Žinynas"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Mėnuo"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Metai"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Pervadinti"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Aplankai"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Failai"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Pavyko"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Nepavyko"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Praėjo"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Užbaigta"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Patikrinta"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Atlikta"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Praleista"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Vykdoma"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "Nepasiekiama"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Bendras progresas"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Ieškoti"
|
||||
@@ -1,115 +0,0 @@
|
||||
# Dialog
|
||||
# Copyright 2003-2007,2008 # Thomas Dickey
|
||||
#
|
||||
# This file is distributed under the same license as the dialog package.
|
||||
#
|
||||
# Rihards Prieditis <[email protected]>, 2009.
|
||||
# Rūdolfs Mazurs <[email protected]>, 2014.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: dialog 1.1.20080819\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
|
||||
"PO-Revision-Date: 2014-04-20 14:12+0300\n"
|
||||
"Last-Translator: Rihards Prieditis <[email protected]>\n"
|
||||
"Language-Team: Latvian <[email protected]>\n"
|
||||
"Language: lv\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Lokalize 1.5\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n"
|
||||
|
||||
#: buttons.c:385
|
||||
msgid "Yes"
|
||||
msgstr "Jā"
|
||||
|
||||
#: buttons.c:393
|
||||
msgid "No"
|
||||
msgstr "Nē"
|
||||
|
||||
#: buttons.c:401
|
||||
msgid "OK"
|
||||
msgstr "Labi"
|
||||
|
||||
#: buttons.c:409
|
||||
msgid "Cancel"
|
||||
msgstr "Atcelt"
|
||||
|
||||
#: buttons.c:417
|
||||
msgid "EXIT"
|
||||
msgstr "IZIET"
|
||||
|
||||
#: buttons.c:425
|
||||
msgid "Extra"
|
||||
msgstr "Papildus"
|
||||
|
||||
#: buttons.c:433
|
||||
msgid "Help"
|
||||
msgstr "Palīdzība"
|
||||
|
||||
#. Headline "Month"
|
||||
#: calendar.c:273
|
||||
msgid "Month"
|
||||
msgstr "Mēnesis"
|
||||
|
||||
#. Headline "Year"
|
||||
#: calendar.c:293
|
||||
msgid "Year"
|
||||
msgstr "Gads"
|
||||
|
||||
#: dialog.c:741
|
||||
msgid "Rename"
|
||||
msgstr "Pārdēvēt"
|
||||
|
||||
#: fselect.c:550
|
||||
msgid "Directories"
|
||||
msgstr "Direktorijas"
|
||||
|
||||
#: fselect.c:551
|
||||
msgid "Files"
|
||||
msgstr "Datnes"
|
||||
|
||||
#: mixedgauge.c:58
|
||||
msgid "Succeeded"
|
||||
msgstr "Izdevies"
|
||||
|
||||
#: mixedgauge.c:61
|
||||
msgid "Failed"
|
||||
msgstr "Neizdevies"
|
||||
|
||||
#: mixedgauge.c:64
|
||||
msgid "Passed"
|
||||
msgstr "Iziets"
|
||||
|
||||
#: mixedgauge.c:67
|
||||
msgid "Completed"
|
||||
msgstr "Pabeigts"
|
||||
|
||||
#: mixedgauge.c:70
|
||||
msgid "Checked"
|
||||
msgstr "Pārbaudīts"
|
||||
|
||||
#: mixedgauge.c:73
|
||||
msgid "Done"
|
||||
msgstr "Pabeigts"
|
||||
|
||||
#: mixedgauge.c:76
|
||||
msgid "Skipped"
|
||||
msgstr "Izlaists"
|
||||
|
||||
#: mixedgauge.c:79
|
||||
msgid "In Progress"
|
||||
msgstr "Tiek apstrādāts"
|
||||
|
||||
#: mixedgauge.c:85
|
||||
msgid "N/A"
|
||||
msgstr "n/z"
|
||||
|
||||
#: mixedgauge.c:193
|
||||
msgid "Overall Progress"
|
||||
msgstr "Vispārējais progress"
|
||||
|
||||
#: textbox.c:489
|
||||
msgid "Search"
|
||||
msgstr "Meklēt"
|
||||
Loaded 100 of 390 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user