summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLogan Rathbone <poprocks@gmail.com>2021-02-14 22:27:01 -0500
committerLogan Rathbone <poprocks@gmail.com>2021-02-14 22:27:01 -0500
commit2aac67b9c184ad533510d61569a5763e87ecf7f3 (patch)
tree9be8a26d0a33c78fd549890fd7655923028178d6
parent71744aa4b388754b20bbcdbf7dabf482202fee79 (diff)
downloadzenity-2aac67b9c184ad533510d61569a5763e87ecf7f3.tar.gz
Mass cleanup and finish meson migration.
Autotools purged.
-rw-r--r--COPYING216
-rw-r--r--MAINTAINERS7
-rw-r--r--Makefile.am32
-rw-r--r--NEWS3
-rw-r--r--README12
-rw-r--r--README.md18
-rw-r--r--THANKS158
-rw-r--r--TODO14
-rwxr-xr-xautogen.sh38
-rw-r--r--configure.ac140
-rw-r--r--data/Makefile.am23
-rw-r--r--data/gnome-tshirt.pngbin4147 -> 0 bytes
-rw-r--r--data/hawaii-shirt.pngbin13730 -> 0 bytes
-rw-r--r--data/meson.build1
-rw-r--r--data/monk.pngbin9773 -> 0 bytes
-rw-r--r--data/sunglasses.pngbin2721 -> 0 bytes
-rw-r--r--data/surfboard.pngbin14484 -> 0 bytes
-rw-r--r--data/zenity-calendar.pngbin2857 -> 0 bytes
-rw-r--r--data/zenity-entry.pngbin1669 -> 0 bytes
-rw-r--r--data/zenity-file.pngbin1343 -> 0 bytes
-rw-r--r--data/zenity-list.pngbin256 -> 0 bytes
-rw-r--r--data/zenity-notification.pngbin898 -> 0 bytes
-rw-r--r--data/zenity-progress.pngbin4509 -> 0 bytes
-rw-r--r--data/zenity-scale.pngbin240 -> 0 bytes
-rw-r--r--data/zenity-text.pngbin3523 -> 0 bytes
-rw-r--r--help/ChangeLog.pre-git (renamed from help/ChangeLog)0
-rw-r--r--help/LINGUAS1
-rw-r--r--help/Makefile.am45
-rw-r--r--help/meson.build48
-rw-r--r--icons/hicolor/48x48/apps/zenity.png (renamed from data/zenity.png)bin2342 -> 2342 bytes
-rw-r--r--icons/meson.build4
-rw-r--r--meson.build55
-rw-r--r--po/ChangeLog.pre-git (renamed from po/ChangeLog)0
-rw-r--r--po/Makevars78
-rw-r--r--po/POTFILES (renamed from po/POTFILES.in)0
-rw-r--r--po/POTFILES.skip2
-rw-r--r--po/meson.build4
-rw-r--r--src/Makefile.am57
-rw-r--r--src/about.c48
-rw-r--r--src/calendar.c5
-rw-r--r--src/color.c22
-rw-r--r--src/entry.c4
-rw-r--r--src/main.c21
-rw-r--r--src/meson.build10
-rw-r--r--src/msg.c20
-rw-r--r--src/notification.c12
-rw-r--r--src/progress.c33
-rw-r--r--src/scale.c4
-rw-r--r--src/text.c6
-rw-r--r--src/tree.c128
-rw-r--r--src/util.c105
51 files changed, 377 insertions, 997 deletions
diff --git a/COPYING b/COPYING
index bf50f20..4362b49 100644
--- a/COPYING
+++ b/COPYING
@@ -1,112 +1,125 @@
- GNU LIBRARY GENERAL PUBLIC LICENSE
- Version 2, June 1991
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
- Copyright (C) 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, 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 library GPL. It is
- numbered 2 because it goes with version 2 of the ordinary GPL.]
+[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
+ 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 Library General Public License, applies to some
-specially designated Free Software Foundation software, and to any
-other libraries whose authors decide to use it. You can use it for
-your libraries, too.
-
- When we speak of free software, we are referring to freedom, 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 or use pieces of it
-in new free programs; and that you know you can do these things.
+ 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
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if
-you distribute copies of the library, or if you modify it.
+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 a program 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
+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.
- Our method of protecting your rights has two steps: (1) copyright
-the library, and (2) offer you this license which gives you legal
+ 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.
- Also, for each distributor's protection, we want to make certain
-that everyone understands that there is no warranty for this free
-library. If the library is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original
-version, so that any problems introduced by others will not reflect on
-the original authors' reputations.
+ 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, any free program is threatened constantly by software
-patents. We wish to avoid the danger that companies distributing free
-software will individually obtain patent licenses, thus in effect
-transforming the program into proprietary software. To prevent this,
-we have made it clear that any patent must be licensed for everyone's
-free use or not licensed at all.
-
- Most GNU software, including some libraries, is covered by the ordinary
-GNU General Public License, which was designed for utility programs. This
-license, the GNU Library General Public License, applies to certain
-designated libraries. This license is quite different from the ordinary
-one; be sure to read it in full, and don't assume that anything in it is
-the same as in the ordinary license.
-
- The reason we have a separate public license for some libraries is that
-they blur the distinction we usually make between modifying or adding to a
-program and simply using it. Linking a program with a library, without
-changing the library, is in some sense simply using the library, and is
-analogous to running a utility program or application program. However, in
-a textual and legal sense, the linked executable is a combined work, a
-derivative of the original library, and the ordinary General Public License
-treats it as such.
-
- Because of this blurred distinction, using the ordinary General
-Public License for libraries did not effectively promote software
-sharing, because most developers did not use the libraries. We
-concluded that weaker conditions might promote sharing better.
-
- However, unrestricted linking of non-free programs would deprive the
-users of those programs of all benefit from the free status of the
-libraries themselves. This Library General Public License is intended to
-permit developers of non-free programs to use free libraries, while
-preserving your freedom as a user of such programs to change the free
-libraries that are incorporated in them. (We have not seen how to achieve
-this as regards changes in header files, but we have achieved it as regards
-changes in the actual functions of the Library.) The hope is that this
-will lead to faster development of free libraries.
+ 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, while the latter only
-works together with the library.
-
- Note that it is possible for a library to be covered by the ordinary
-General Public License rather than by this special one.
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
- GNU LIBRARY GENERAL PUBLIC LICENSE
+ GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- 0. This License Agreement applies to any software library which
-contains a notice placed by the copyright holder or other authorized
-party saying it may be distributed under the terms of this Library
-General Public License (also called "this License"). Each licensee is
-addressed as "you".
+ 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
@@ -133,7 +146,7 @@ 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
@@ -255,7 +268,7 @@ 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 compile or
+ 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
@@ -282,23 +295,31 @@ of these things:
Library will not necessarily be able to recompile the application
to use the modified definitions.)
- b) Accompany the work with a written offer, valid for at
+ 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.
- c) If distribution of the work is made by offering access to copy
+ 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.
- d) Verify that the user has already received a copy of these
+ 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 source code distributed need not include anything that is normally
-distributed (in either source or binary form) with the major
+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.
@@ -347,7 +368,7 @@ 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 to
+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
@@ -390,7 +411,7 @@ 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 Library General Public License from time to time.
+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.
@@ -411,7 +432,7 @@ 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
+ 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.
@@ -434,7 +455,7 @@ 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
+ END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
@@ -453,19 +474,18 @@ convey the exclusion of warranty; and each file should have at least the
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 Library General Public
+ modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
+ 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
- Library General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307 USA.
+ 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
diff --git a/MAINTAINERS b/MAINTAINERS
deleted file mode 100644
index b33bb87..0000000
--- a/MAINTAINERS
+++ /dev/null
@@ -1,7 +0,0 @@
-Luis Medinas
-E-mail: lmedinas@src.gnome.org
-Userid: lmedinas
-
-Arx Cruz
-E-mail: arxcruz@src.gnome.org
-Userid: arxcruz
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 81ae6a7..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-AM_CPPFLAGS = src
-
-SUBDIRS = \
- src \
- po \
- data \
- help
-
-EXTRA_DIST = \
- autogen.sh \
- config.rpath \
- COPYING \
- HACKING \
- ChangeLog \
- NEWS \
- README \
- AUTHORS
-
-dist-hook:
- @if test -d "$(srcdir)/.git"; \
- then \
- echo Creating ChangeLog && \
- ( cd "$(top_srcdir)" && \
- echo '# Generated by Makefile. Do not edit.'; echo; \
- $(top_srcdir)/missing --run git log --stat ) > ChangeLog.tmp \
- && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
- || ( rm -f ChangeLog.tmp ; \
- echo Failed to generate ChangeLog >&2 ); \
- else \
- echo A git clone is required to generate a ChangeLog >&2; \
- fi
diff --git a/NEWS b/NEWS
index 37d8e3d..4fc6c9b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Zenity 4.alpha.1
+ - Initial port to GTK4 (Logan Rathbone)
+
Zenity 3.32.0
- Fix autotools warnings (Javier Jardón)
- Use upstream autoreconf instead deprecated gnome-autogen (Javier Jardón)
diff --git a/README b/README
deleted file mode 100644
index d869950..0000000
--- a/README
+++ /dev/null
@@ -1,12 +0,0 @@
-Zen Understanding -
-===================
-This is zenity - a rewrite of gdialog, the GNOME port of dialog
-which allows you to display dialog boxes from the commandline
-and shell scripts. If you understand, things are just as they
-are. If you don't understand, things are just as they are.
-
-This software is licensed under the LGPL.
-
-Zen Requirements -
-==================
-gtk+-3.0
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..6a01086
--- /dev/null
+++ b/README.md
@@ -0,0 +1,18 @@
+# Zenity
+
+This is zenity the GNOME port of the venerable 'dialog' program,
+which allows you to display dialog boxes from the command-line
+and shell scripts.
+
+This software is licensed under the GNU Lesser General Public
+License, version 2.1, or, at your option, a later version.
+
+Please see COPYING for a full copy of the license.
+
+## Dependencies
+
+gtk >= 4.0.0
+
+## Optional Dependencies
+
+libnotify >= 0.6.1
diff --git a/THANKS b/THANKS
deleted file mode 100644
index 2ffed68..0000000
--- a/THANKS
+++ /dev/null
@@ -1,158 +0,0 @@
- "Authors",
- "=======",
- "Glynn Foster <glynn foster sun com>",
- "Mike Newman <mikegtn gnome org>",
- "Lucas Rocha <lucasr gnome org>",
-
- "Patches from the following people",
- "=================================",
- "Darren Adams <darrenadams dsl pipex com>"
- "Timo Aaltonen <tjaaltonen gnome cc hut fi>",
- "Peter Astrand <astrand lysator liu se>",
- "Jonathan Blandford <jrb redhat com>",
- "Paul Bolle <pebolle tiscali nl>",
- "Paolo Borelli <pborelli katamail com>",
- "Leonardo Boshell <p kapcoweb com>",
- "Ross Burton <ross burtonini com>",
- "Damien Carbery <damien carbery sun com>",
- "Anders Carlsson <andersca codefactory se>",
- "Ed Catmur <ed catmur co uk>",
- "Nicholas Curran <quasar austar net au>",
- "John Fleck <jfleck inkstain net>",
- "Sebastian Heinlein <glatzor pimpzkru de>",
- "James Henstridge <james daa com au>",
- "Chris Lahey <clahey ximian com>",
- "Mihai T Lazarescu <mihai email it>",
- "Sebastian Kapfer <sebastian_kapfer web de>",
- "Tomasz Koczko <kloczek pld org pl>",
- "Jordi Mallach <jordi sindominio net>",
- "Kjartan Maraas <kmaraas gnome org>",
- "Breda McColgan <breda mccolgan sun com>",
- "Baptiste Mille-Mathias <bmm80 free fr>",
- "Buhan Milne <bgmilne linux-mandrake com>",
- "Christian Monneckes <c-w-m gmx de>",
- "Ivan Noris <vix vazka sk>",
- "Carlos Parra <cparra emergya info>",
- "Havoc Pennington <hp redhat com>",
- "Jan Arne Petersen <jpetersen uni-bonn de>",
- "Kevin C Krinke <kckrinke opendoorsoftware com>",
- "Sriram Ramkrishna <sri aracnet com>",
- "Kristian Rietveld <kris gtk org>",
- "Lucas Rocha <lucasr im ufba br>",
- "Christian Rose <menthos menthos com>",
- "Jakub Steiner <jimmac ximian com>",
- "Luke Suchocki <gnome lukiepoo com>",
- "Daniel d'Surreal <dagmar speakeasy net>",
- "Hidetoshi Tajima <hidetoshi tajima sun com>",
- "Tom Tromey <tromey redhat com>",
- "Yann <bloch iie cnam fr>",
- "Norman Rasmussen <normanr gmail com>",
- "Benoît Dejean <tazforever dlfp org>",
- "",
- "And all the translators that rock my world",
- "==========================================",
- "Vincent van Adrighem <v vanadrighem dirck mine nu>",
- "Taneem Ahmed <taneem bengalinux org>",
- "Takeshi Aihana <aihana gnome gr jp>",
- "Amanpreet Singh Alam <amanlinux netscape net>",
- "Metin Amiroff <metin karegen com>",
- "Sanlig Badral <badral openmn org>",
- "John C Barstow <jbowtie amathaine com>",
- "Aygimantas Beruka <uid0 tuxfamily org>",
- "Alberto Fernandez Benito <afernn euskalnet net>",
- "Stefano Canepa <sc linux it>",
- "Young-Ho Cha <ganadist mizi com>",
- "Abel Cheung <maddog linux org hk>",
- "Zbigniew Chyla <cyba gnome pl>",
- "Mohammad Damt <mdamt bisnisweb com>",
- "Fatih Demir <kabalak gtranslator org>",
- "Laurent Dhima <laurenti alblinux net>",
- "Paul Duffy <dubhthach frink nuigalway ie>",
- "Laszlo Dvornik <dvornik gnome hu>",
- "Maxim Dziumanenko <mvd mylinux com ua>",
- "Francisco Javier Fernandez <serrador arrakis es>",
- "Artur Flinta <aflinta cvs gnome org>",
- "Alessio Frusciante <algol firenze linux it>",
- "Evandro Fernandes Giovanini <evandrofg ig com br>",
- "Pablo Gonzalo del Campo <pablodc bigfoot com>",
- "Dhurba Gnawali <dhurbagnawali hotmail com>",
- "Sammi Gunnarsson <sammi techattack nu>",
- "Martin Willemoes Hansen <mwh sysrq dk>",
- "Dafydd Harries <daf parnassus ath cx>",
- "Raphael Higino <raphaelh cvs gnome org>",
- "Wang Jian <lark linux net cn>",
- "Guntupalli Karunakar <karunakar freedomink org>",
- "Tomas Kuliavas <tokul users sourceforge net>",
- "Priit Laes <amd tt ee>",
- "Inaki Larranaga <dooteo euskalgnu org>",
- "Ole Laursen <olau hardworking dk>",
- "Toivo Leedjrv <toivo linux ee>",
- "David Lodge <dave cirt net>",
- "Duarte Loreto <happyguy_pt hotmail com>",
- "Johanna Makkonen <johanna makkonen iki fi>",
- "Jordi Mallach <jordi sindominio net>",
- "Kjartan Maraas <kmaraas gnome org>",
- "Jordi Mas <jmas softcatala org>",
- "Kamagasako Masatoshi <emerald gnome gr jp>",
- "Dmitry G Mastrukov <dmitry taurussoft org>",
- "Arafat Medini <lumina silverpen de>",
- "Christophe Merlet <redfox redfoxcenter org>",
- "Mike Newman <mikegtn gnome org>",
- "Ahmad Riza H Nst <rizahnst eriagempita co id>",
- "Alexandre Folle de Menezes <afmenez terra com br>",
- "Christian Neumair <chris gnome-de org>",
- "Metin Omirov <metin karegen com>",
- "Gareth Owen <gowen72 yahoo com>",
- "Kostas Papadimas <pkst gmx net>",
- "Ankit Patel <ankit redhat com>",
- "Sami Pesonen <sampeson iki fi>",
- "Roozbeh Pournader <roozbeh sharif edu>",
- "Jarkko Ranta <jjranta cc joensuu fi>",
- "Rostislav Raykov <zbrox dir bg>",
- "Hendrik Richter <hendrik gnome de org>",
- "Christian Rose <menthos menthos com>",
- "Changwoo Ryu <cwryu debian org>",
- "Pablo Saratxaga <pablo mandrakesoft com>",
- "Robert Sedak <robert sedak sk htnet hr>",
- "Paisa Seeluangsawat <paisa users sf net>",
- "Danilo Segan <dsegan gmx net>",
- "Alexander Shopov <ash contact bg>",
- "Aasmund Skjaveland <aasmunds fys uio no>",
- "Yuriy Syrota <rasta renome rovno ua>",
- "Marcel Telka <marcel telka sk>",
- "Andras Timar <timar gnome hu>",
- "Miloslav Trmac <mitr volny cz>",
- "Mugurel Tudor <mugurelu go ro>",
- "Daniel Yacob <locales geez org>",
- "Funda Wang <fundawang linux net cn>",
- "Alexander Winston <alexander winston comcast net>",
- "Theppitak Karoonboonyanan <thep linux thai net>",
- "Martin Willemoes Hansen <mwh sysrq dk>",
- "Ignacio Casal Quinteiro <nacho.resa gmail com>",
- "Pawan Chitrakar <pawan nplinux org>",
- "Rajesh Ranjan <rajeshkajha yahoo org>",
- "Vladimir Petkov <vpetkov i-space org>",
- "Abduxukur Abdurixit <abduxukur.abdurixit t-systems ch>",
- "Adi Attar <aattar cvs gnome org>",
- "Steve Murphy <murf e-tools com>",
- "Josep Puigdemont <josep imatge-sintetica com>",
- "Adam Weinberger <adamw gnome org>",
- "Ivar Smolin <okul linux ee>",
- "Jens Seidel <jensseidel users sf net>",
- "Benoît Dejean <tazforever dlfp org>",
- "Yair Hershkovitz <yairhr gmail com>",
- "Clytie Siddall <clytie riverland net au>",
- "Ilkka Tuohela <hile iki fi>",
- "Chao-Hsiung Liao <j_h_liau yahoo com tw>",
- "Žygimantas Beručka <zygis gnome org>",
- "Gabor Kelemen <kelemeng gnome hu>",
- "Telsa Gwynne <hobbit aloss ukuu org uk>",
- "Slobodan D. Sredojevic <ssl uns ns ac yu>",
- "Baris Cicek <baris teamforce name tr>",
- "Runa Bhattacharjee <runa bengalinux org>",
- "Erdal Ronahi <erdal.ronahi gmail com>",
- "Luca Ferretti <elle.uca infinito it>",
- "Lasse Bang Mikkelsen <lbm fatalerror dk>",
- "Vincent Untz <vuntz gnome org>",
- "Leonid Kanter <leon asplinux ru>",
- "Daniel Nylander <po danielnylander se>",
diff --git a/TODO b/TODO
deleted file mode 100644
index 98329fd..0000000
--- a/TODO
+++ /dev/null
@@ -1,14 +0,0 @@
-* Support extra buttons, help buttons with the ability to change the label on the button
- - Suggested by Kevin Krinke <kckrinke@opendoorsoftware.com>
-* Would be nice to have an option to use your own icon in the info/warning/message/question dialogs
- - Suggested by Kevin Krinke <kckrinke@opendoorsoftware.com>
-* Add pixmap support to list dialog
- - Suggested by Dani Brody <brodydani@hotmail.com>
-* Add new format
- --list --column=check,hide --column=pixmap --column=string,editable
- - Suggested by Dani Brody <brodydani@hotmail.com>
-* Add support for DML (Dialog Meta Language)
- - ftp://ftp.pld.org.pl/people/malekith/dml/
- - Suggested by Michal Moskal <malekith@pld-linux.org>
-
-For further information about future development, see http://live.gnome.org/Zenity
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index d9d12ec..0000000
--- a/autogen.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-test -n "$srcdir" || srcdir=$(dirname "$0")
-test -n "$srcdir" || srcdir=.
-
-olddir=$(pwd)
-
-cd $srcdir
-
-(test -f configure.ac) || {
- echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***"
- exit 1
-}
-
-# shellcheck disable=SC2016
-PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac)
-
-if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
- echo "*** WARNING: I am going to run 'configure' with no arguments." >&2
- echo "*** If you wish to pass any to it, please specify them on the" >&2
- echo "*** '$0' command line." >&2
- echo "" >&2
-fi
-
-autoreconf --verbose --force --install || exit 1
-
-cd "$olddir"
-if [ "$NOCONFIGURE" = "" ]; then
- $srcdir/configure "$@" || exit 1
-
- if [ "$1" = "--help" ]; then
- exit 0
- else
- echo "Now type 'make' to compile $PKG_NAME" || exit 1
- fi
-else
- echo "Skipping configure process."
-fi
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 5dccdb0..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,140 +0,0 @@
-AC_INIT([Zenity],[3.32.0],[https://bugzilla.gnome.org/enter_bug.cgi?product=zenity],[zenity])
-
-AC_PREREQ([2.69])
-
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_SRCDIR([src])
-AC_CONFIG_MACRO_DIR([m4])
-
-AM_INIT_AUTOMAKE([1.10 foreign no-dist-gzip dist-xz])
-AM_MAINTAINER_MODE([enable])
-
-m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
-
-# *******************************
-# Debug
-# *******************************
-
-AX_CHECK_ENABLE_DEBUG([yes],[GNOME_ENABLE_DEBUG])
-
-# Check for programs
-AC_PROG_CC
-
-GTK_REQUIRED=3.0.0
-
-PKG_CHECK_MODULES([ZENITY],[gtk+-3.0 >= $GTK_REQUIRED glib-2.0])
-AC_SUBST([ZENITY_CFLAGS])
-AC_SUBST([ZENITY_LIBS])
-
-dnl *************************
-dnl Check for the GTK+ backend, if it's X11, we -lX11
-dnl *************************
-
-zenity_save_cflags="$CFLAGS"
-# pull in the CFLAGS to locate gdkconfig.h
-CFLAGS=`$PKG_CONFIG --cflags gtk+-3.0`
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-#include <gdk/gdk.h>
-
-int main(void) {
-#ifndef GDK_WINDOWING_X11
-#error GDK_WINDOWING_X11 not defined
-#endif
- return 0;
-}
-])],
- GDK_BACKEND_X11=yes,
- GDK_BACKEND_X11=no)
-
-CFLAGS="$zenity_save_cflags"
-
-if test "x$GDK_BACKEND_X11" = "xyes"; then
- PKG_CHECK_MODULES(X, x11)
- ZENITY_CFLAGS="$ZENITY_CFLAGS $X_CFLAGS"
- ZENITY_LIBS="$ZENITY_LIBS $X_LIBS"
-fi
-
-# *******************************
-# perl check
-# *******************************
-
-AC_PATH_PROG([PERL],[perl],)
-
-# *******************************
-# libnotify check
-# *******************************
-
-LIBNOTIFY_REQUIRED=0.6.1
-
-AC_ARG_ENABLE([libnotify],
- [AS_HELP_STRING([--enable-libnotify],
- [Enable libnotify support])],
- [],
- [enable_libnotify=yes])
-
-if test x$enable_libnotify = xyes; then
- PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= $LIBNOTIFY_REQUIRED],
- [HAVE_LIBNOTIFY="yes"],[HAVE_LIBNOTIFY="no"])
- AC_SUBST([LIBNOTIFY_CFLAGS])
- AC_SUBST([LIBNOTIFY_LIBS])
- if test "x$HAVE_LIBNOTIFY" = "xyes"; then
- AC_DEFINE([HAVE_LIBNOTIFY], [1], [libnotify is available on this machine])
- fi
-fi
-
-# *******************************
-# webkit check
-# *******************************
-
-WEBKITGTK_REQUIRED=2.8.1
-
-AC_ARG_ENABLE([webkitgtk],
- [AS_HELP_STRING([--enable-webkitgtk],
- [Enable webkit support])],
- [],
- [enable_webkitgtk=yes])
-
-if test x$enable_webkitgtk = xyes; then
- PKG_CHECK_MODULES([WEBKIT], [webkit2gtk-4.0 >= $WEBKITGTK_REQUIRED],
- [HAVE_WEBKITGTK="yes"],[HAVE_WEBKITGTK="no"])
- AC_SUBST([WEBKIT_CFLAGS])
- AC_SUBST([WEBKIT_LIBS])
- if test "x$HAVE_WEBKITGTK" = "xyes"; then
- AC_DEFINE([HAVE_WEBKITGTK], [1], [webkitgtk is available on this machine])
- fi
-fi
-
-
-# *******************************
-# Internationalization
-# *******************************
-AM_GNU_GETTEXT_VERSION([0.19.4])
-AM_GNU_GETTEXT([external])
-
-GETTEXT_PACKAGE=zenity
-AC_SUBST([GETTEXT_PACKAGE])
-AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext domain])
-
-# *******************************
-# User manual
-# *******************************
-YELP_HELP_INIT
-
-# *******************************
-
-AC_SUBST([AM_CPPFLAGS])
-AC_SUBST([AM_CFLAGS])
-AC_SUBST([AM_LDFLAGS])
-
-# *******************************
-
-AC_CONFIG_FILES([
-Makefile
-po/Makefile.in
-src/Makefile
-src/gdialog
-data/Makefile
-help/Makefile
-])
-
-AC_OUTPUT
diff --git a/data/Makefile.am b/data/Makefile.am
deleted file mode 100644
index cc18511..0000000
--- a/data/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-clothesdir = $(datadir)/zenity/clothes
-clothes_DATA = \
- monk.png \
- gnome-tshirt.png \
- sunglasses.png \
- surfboard.png \
- hawaii-shirt.png
-
-imagesdir = $(datadir)/zenity
-images_DATA = \
- zenity.png \
- zenity-calendar.png \
- zenity-list.png \
- zenity-file.png \
- zenity-progress.png \
- zenity-text.png \
- zenity-scale.png \
- zenity-entry.png \
- zenity-notification.png
-
-man_MANS = zenity.1
-
-EXTRA_DIST = $(images_DATA) $(clothes_DATA) $(man_MANS)
diff --git a/data/gnome-tshirt.png b/data/gnome-tshirt.png
deleted file mode 100644
index 424ec61..0000000
--- a/data/gnome-tshirt.png
+++ /dev/null
Binary files differ
diff --git a/data/hawaii-shirt.png b/data/hawaii-shirt.png
deleted file mode 100644
index db4184c..0000000
--- a/data/hawaii-shirt.png
+++ /dev/null
Binary files differ
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..c85889e
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1 @@
+install_man('zenity.1')
diff --git a/data/monk.png b/data/monk.png
deleted file mode 100644
index 0c515dd..0000000
--- a/data/monk.png
+++ /dev/null
Binary files differ
diff --git a/data/sunglasses.png b/data/sunglasses.png
deleted file mode 100644
index c303684..0000000
--- a/data/sunglasses.png
+++ /dev/null
Binary files differ
diff --git a/data/surfboard.png b/data/surfboard.png
deleted file mode 100644
index 572d9de..0000000
--- a/data/surfboard.png
+++ /dev/null
Binary files differ
diff --git a/data/zenity-calendar.png b/data/zenity-calendar.png
deleted file mode 100644
index 873528a..0000000
--- a/data/zenity-calendar.png
+++ /dev/null
Binary files differ
diff --git a/data/zenity-entry.png b/data/zenity-entry.png
deleted file mode 100644
index 3621ea3..0000000
--- a/data/zenity-entry.png
+++ /dev/null
Binary files differ
diff --git a/data/zenity-file.png b/data/zenity-file.png
deleted file mode 100644
index bac6392..0000000
--- a/data/zenity-file.png
+++ /dev/null
Binary files differ
diff --git a/data/zenity-list.png b/data/zenity-list.png
deleted file mode 100644
index 5a593b7..0000000
--- a/data/zenity-list.png
+++ /dev/null
Binary files differ
diff --git a/data/zenity-notification.png b/data/zenity-notification.png
deleted file mode 100644
index 6b44ef9..0000000
--- a/data/zenity-notification.png
+++ /dev/null
Binary files differ
diff --git a/data/zenity-progress.png b/data/zenity-progress.png
deleted file mode 100644
index b789e02..0000000
--- a/data/zenity-progress.png
+++ /dev/null
Binary files differ
diff --git a/data/zenity-scale.png b/data/zenity-scale.png
deleted file mode 100644
index 8526c31..0000000
--- a/data/zenity-scale.png
+++ /dev/null
Binary files differ
diff --git a/data/zenity-text.png b/data/zenity-text.png
deleted file mode 100644
index 0756992..0000000
--- a/data/zenity-text.png
+++ /dev/null
Binary files differ
diff --git a/help/ChangeLog b/help/ChangeLog.pre-git
index e8b8ee5..e8b8ee5 100644
--- a/help/ChangeLog
+++ b/help/ChangeLog.pre-git
diff --git a/help/LINGUAS b/help/LINGUAS
new file mode 100644
index 0000000..9940fa3
--- /dev/null
+++ b/help/LINGUAS
@@ -0,0 +1 @@
+bg ca cs da de el en_GB es eu fi fr gl hu ja oc pl pt_BR ru sl sv uk zh_CN
diff --git a/help/Makefile.am b/help/Makefile.am
deleted file mode 100644
index d790472..0000000
--- a/help/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-@YELP_HELP_RULES@
-
-HELP_ID = zenity
-
-HELP_MEDIA = \
- figures/zenity-calendar-screenshot.png \
- figures/zenity-colorselection-screenshot.png \
- figures/zenity-entry-screenshot.png \
- figures/zenity-error-screenshot.png \
- figures/zenity-fileselection-screenshot.png \
- figures/zenity-forms-screenshot.png \
- figures/zenity-information-screenshot.png \
- figures/zenity-list-screenshot.png \
- figures/zenity-notification-listen-screenshot.png \
- figures/zenity-notification-screenshot.png \
- figures/zenity-password-screenshot.png \
- figures/zenity-progress-screenshot.png \
- figures/zenity-question-screenshot.png \
- figures/zenity-scale-screenshot.png \
- figures/zenity-text-screenshot.png \
- figures/zenity-warning-screenshot.png
-
-HELP_FILES = \
- legal.xml \
- calendar.page \
- color-selection.page \
- entry.page \
- error.page \
- file-selection.page \
- forms.page \
- index.page \
- info.page \
- intro.page \
- list.page \
- message.page \
- notification.page \
- password.page \
- progress.page \
- question.page \
- scale.page \
- text.page \
- usage.page \
- warning.page
-
-HELP_LINGUAS = bg ca cs da de el en_GB es eu fi fr gl hu ja oc pl pt_BR ru sl sv uk zh_CN
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 0000000..cd09412
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,48 @@
+help_pages = [
+ 'legal.xml',
+ 'calendar.page',
+ 'color-selection.page',
+ 'entry.page',
+ 'error.page',
+ 'file-selection.page',
+ 'forms.page',
+ 'index.page',
+ 'info.page',
+ 'intro.page',
+ 'list.page',
+ 'message.page',
+ 'notification.page',
+ 'password.page',
+ 'progress.page',
+ 'question.page',
+ 'scale.page',
+ 'text.page',
+ 'usage.page',
+ 'warning.page'
+]
+
+help_media = [
+ 'figures/zenity-calendar-screenshot.png',
+ 'figures/zenity-colorselection-screenshot.png',
+ 'figures/zenity-entry-screenshot.png',
+ 'figures/zenity-error-screenshot.png',
+ 'figures/zenity-fileselection-screenshot.png',
+ 'figures/zenity-forms-screenshot.png',
+ 'figures/zenity-information-screenshot.png',
+ 'figures/zenity-list-screenshot.png',
+ 'figures/zenity-notification-listen-screenshot.png',
+ 'figures/zenity-notification-screenshot.png',
+ 'figures/zenity-password-screenshot.png',
+ 'figures/zenity-progress-screenshot.png',
+ 'figures/zenity-question-screenshot.png',
+ 'figures/zenity-scale-screenshot.png',
+ 'figures/zenity-text-screenshot.png',
+ 'figures/zenity-warning-screenshot.png'
+]
+
+gnome.yelp(
+ meson.project_name(),
+ sources: help_pages,
+ media: help_media,
+ symlink_media: false
+)
diff --git a/data/zenity.png b/icons/hicolor/48x48/apps/zenity.png
index 3c9c59a..3c9c59a 100644
--- a/data/zenity.png
+++ b/icons/hicolor/48x48/apps/zenity.png
Binary files differ
diff --git a/icons/meson.build b/icons/meson.build
new file mode 100644
index 0000000..11fe0f6
--- /dev/null
+++ b/icons/meson.build
@@ -0,0 +1,4 @@
+install_subdir(
+ 'hicolor',
+ install_dir: zenity_iconsdir
+)
diff --git a/meson.build b/meson.build
index 9798bc4..a1a4031 100644
--- a/meson.build
+++ b/meson.build
@@ -1,7 +1,7 @@
project('zenity', 'c',
version: '4.alpha.1',
- meson_version: '>=0.50.0',
- license: 'LGPL-2.0-or-later'
+ meson_version: '>=0.53.0',
+ license: 'LGPL-2.1-or-later'
)
version_arr = meson.project_version().split('.')
@@ -10,11 +10,10 @@ zenity_version_minor = version_arr[1]
zenity_version_micro = version_arr[2].to_int()
zenity_prefix = get_option('prefix')
+zenity_bindir = join_paths(zenity_prefix, get_option('bindir'))
zenity_libdir = join_paths(zenity_prefix, get_option('libdir'))
-zenity_includedir = join_paths(zenity_prefix, get_option('includedir'))
zenity_datadir = join_paths(zenity_prefix, get_option('datadir'))
zenity_localedir = join_paths(zenity_prefix, get_option('localedir'))
-zenity_appdatadir = join_paths(zenity_datadir, 'metainfo')
zenity_iconsdir = join_paths(zenity_datadir, 'icons')
zenity_root_dir = include_directories('.')
@@ -53,28 +52,56 @@ endforeach
gtk_dep = dependency('gtk4', version: '>= 4.0.0')
+# Optional dependencies
+
+opt_missing_str = '''
+Requested optional @0@ support but library not found.
+Please ensure you have any required development libraries installed.'''
+
+libnotify = dependency('libnotify', version: '>= 0.6.1', required: false)
if get_option('libnotify')
- libnotify = dependency('libnotify', version: '>= 0.6.1')
- zenity_conf.set('HAVE_LIBNOTIFY', true)
+ if libnotify.found()
+ zenity_conf.set('HAVE_LIBNOTIFY', true)
+ else
+ error(opt_missing_str.format('libnotify'))
+ endif
endif
# TODO
+#webkitgtk = dependency('webkit2gtk-4.0', version: '>= 2.8.1', required: false)
#if get_option('webkitgtk')
-# webkitgtk = dependency('webkit2gtk-4.0', version: '>= 2.8.1')
-# zenity_conf.set('HAVE_WEBKITGTK', true)
+# if webkitgtk.found()
+# zenity_conf.set('HAVE_WEBKITGTK', true)
+# else
+# error(opt_missing_str.format('webkitgtk'))
+# endif
#endif
+perl = find_program('perl', required: false)
+if perl.found()
+ zenity_conf.set('PERL', perl.path())
+endif
+
configure_file(
output: 'config.h',
configuration: zenity_conf
)
-update_icon_cache_prg = find_program('gtk-update-icon-cache',
- required : false)
+# Print a summary of options at the end.
+
+summary({'prefix': zenity_prefix,
+ 'libdir': zenity_libdir,
+ 'datadir': zenity_datadir,
+ 'localedir': zenity_localedir,
+ 'iconsdir': zenity_iconsdir,
+ }, section: 'Directories')
-perl = find_program('perl', required: true)
+summary({'libnotify': get_option('libnotify'),
+ 'gdialog script': perl.found(),
+ }, section: 'Configuration')
subdir('src')
-#subdir('data')
-#subdir('po')
-#subdir('help')
+subdir('data')
+subdir('icons')
+subdir('po')
+subdir('help')
diff --git a/po/ChangeLog b/po/ChangeLog.pre-git
index 56dd74a..56dd74a 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog.pre-git
diff --git a/po/Makevars b/po/Makevars
deleted file mode 100644
index ac406bb..0000000
--- a/po/Makevars
+++ /dev/null
@@ -1,78 +0,0 @@
-# Makefile variables for PO directory in any package using GNU gettext.
-
-# Usually the message domain is the same as the package name.
-DOMAIN = $(PACKAGE)
-
-# These two variables depend on the location of this directory.
-subdir = po
-top_builddir = ..
-
-# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --add-comments
-
-# This is the copyright holder that gets inserted into the header of the
-# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
-# package. (Note that the msgstr strings, extracted from the package's
-# sources, belong to the copyright holder of the package.) Translators are
-# expected to transfer the copyright for their translations to this person
-# or entity, or to disclaim their copyright. The empty string stands for
-# the public domain; in this case the translators are expected to disclaim
-# their copyright.
-COPYRIGHT_HOLDER = Zenity authors
-
-# This tells whether or not to prepend "GNU " prefix to the package
-# name that gets inserted into the header of the $(DOMAIN).pot file.
-# Possible values are "yes", "no", or empty. If it is empty, try to
-# detect it automatically by scanning the files in $(top_srcdir) for
-# "GNU packagename" string.
-PACKAGE_GNU = no
-
-# This is the email address or URL to which the translators shall report
-# bugs in the untranslated strings:
-# - Strings which are not entire sentences, see the maintainer guidelines
-# in the GNU gettext documentation, section 'Preparing Strings'.
-# - Strings which use unclear terms or require additional context to be
-# understood.
-# - Strings which make invalid assumptions about notation of date, time or
-# money.
-# - Pluralisation problems.
-# - Incorrect English spelling.
-# - Incorrect formatting.
-# It can be your email address, or a mailing list address where translators
-# can write to without being subscribed, or the URL of a web page through
-# which the translators can contact you.
-MSGID_BUGS_ADDRESS = https://gitlab.gnome.org/GNOME/zenity/issues
-
-# This is the list of locale categories, beyond LC_MESSAGES, for which the
-# message catalogs shall be used. It is usually empty.
-EXTRA_LOCALE_CATEGORIES =
-
-# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
-# context. Possible values are "yes" and "no". Set this to yes if the
-# package uses functions taking also a message context, like pgettext(), or
-# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
-USE_MSGCTXT = yes
-
-# These options get passed to msgmerge.
-# Useful options are in particular:
-# --previous to keep previous msgids of translated messages,
-# --quiet to reduce the verbosity.
-MSGMERGE_OPTIONS =
-
-# These options get passed to msginit.
-# If you want to disable line wrapping when writing PO files, add
-# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
-# MSGINIT_OPTIONS.
-MSGINIT_OPTIONS =
-
-# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
-# has changed. Possible values are "yes" and "no". Set this to no if
-# the POT file is checked in the repository and the version control
-# program ignores timestamps.
-PO_DEPENDS_ON_POT = no
-
-# This tells whether or not to forcibly update $(DOMAIN).pot and
-# regenerate PO files on "make dist". Possible values are "yes" and
-# "no". Set this to no if the POT file and PO files are maintained
-# externally.
-DIST_DEPENDS_ON_UPDATE_PO = no
diff --git a/po/POTFILES.in b/po/POTFILES
index 3488a95..3488a95 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
deleted file mode 100644
index 0fb3682..0000000
--- a/po/POTFILES.skip
+++ /dev/null
@@ -1,2 +0,0 @@
-# List of source files that should *not* be translated.
-# Please keep this file sorted alphabetically.
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..66362aa
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,4 @@
+i18n.gettext(
+ meson.project_name(),
+ preset: 'glib'
+)
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index bcdd205..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,57 +0,0 @@
-bin_PROGRAMS = zenity
-
-bin_SCRIPTS = gdialog
-
-zenity_SOURCES = \
- about.c \
- calendar.c \
- entry.c \
- fileselection.c \
- main.c \
- msg.c \
- notification.c \
- option.c \
- option.h \
- progress.c \
- scale.c \
- text.c \
- tree.c \
- color.c \
- password.c \
- util.c \
- util.h \
- forms.c \
- zenity.h
-
-zenity_CPPFLAGS = \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- -DZENITY_DATADIR=\""$(pkgdatadir)"\" \
- $(AM_CPPFLAGS)
-
-zenity_CFLAGS = \
- $(ZENITY_CFLAGS) \
- $(LIBNOTIFY_CFLAGS) \
- $(WEBKIT_CFLAGS) \
- $(WARN_CFLAGS) \
- $(AM_CFLAGS)
-
-zenity_LDFLAGS = \
- $(AM_LDFLAGS)
-
-zenity_LDADD = \
- $(ZENITY_LIBS) \
- $(LIBNOTIFY_LIBS) \
- $(WEBKIT_LIBS)
-
-uidir = $(datadir)/zenity
-
-ui_DATA = \
- zenity.ui
-
-DISTCLEANFILES= \
- gdialog
-
-EXTRA_DIST = \
- $(ui_DATA) \
- gdialog \
- gdialog.in
diff --git a/src/about.c b/src/about.c
index 338cca3..cac56c8 100644
--- a/src/about.c
+++ b/src/about.c
@@ -34,18 +34,12 @@
#include <config.h>
-#define GTK_RESPONSE_CREDITS 0
-
-#define ZENITY_CANVAS_X 400.0
-#define ZENITY_CANVAS_Y 280.0
-
static GtkWidget *dialog;
-static void zenity_about_dialog_response (GtkWidget *widget,
- int response, gpointer data);
+static void zenity_about_close_cb (GtkWindow *window, gpointer data);
/* Sync with the people in the THANKS file */
-static const gchar *const authors[] = {"Glynn Foster <glynn foster sun com>",
+static const char *const authors[] = {"Glynn Foster <glynn foster sun com>",
"Lucas Rocha <lucasr gnome org>",
"Mike Newman <mikegtn gnome org>",
NULL};
@@ -56,8 +50,6 @@ static const char *documenters[] = {"Glynn Foster <glynn.foster@sun.com>",
"GNOME Documentation Project",
NULL};
-static gchar *translators;
-
static const char *license[] = {
N_ ("This program is free software; you can redistribute it and/or modify "
"it under the terms of the GNU Lesser General Public License as "
@@ -79,15 +71,13 @@ zenity_about (ZenityData *data)
{
char *license_trans;
- translators = _("translator-credits");
-
license_trans = g_strconcat (
_(license[0]), "\n", _(license[1]), "\n", _(license[2]), "\n", NULL);
dialog = gtk_about_dialog_new ();
g_object_set (G_OBJECT (dialog),
- "name",
+ "program-name",
"Zenity",
"version",
VERSION,
@@ -100,46 +90,32 @@ zenity_about (ZenityData *data)
authors,
"documenters",
documenters,
- "translator-credits",
- translators,
"website",
"https://gitlab.gnome.org/GNOME/zenity",
"wrap-license",
TRUE,
"license",
license_trans,
+ "icon-name",
+ "zenity",
+ "logo-icon-name",
+ "zenity",
NULL);
g_free (license_trans);
- zenity_util_set_window_icon (dialog,
- NULL, ZENITY_IMAGE_FULLPATH ("zenity.png"));
-
- g_signal_connect (G_OBJECT (dialog),
- "response",
- G_CALLBACK (zenity_about_dialog_response),
- data);
+ g_signal_connect (dialog, "close-request",
+ G_CALLBACK(zenity_about_close_cb), data);
zenity_util_show_dialog (dialog);
zenity_util_gapp_main (GTK_WINDOW (dialog));
}
static void
-zenity_about_dialog_response (GtkWidget *widget, int response, gpointer data)
+zenity_about_close_cb (GtkWindow *window, gpointer data)
{
ZenityData *zen_data = data;
- g_return_if_fail (GTK_IS_WINDOW (GTK_WINDOW(widget)));
-
- switch (response) {
- case GTK_RESPONSE_CLOSE:
- zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
- break;
-
- default:
- /* Esc dialog */
- zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC);
- break;
- }
- zenity_util_gapp_quit (GTK_WINDOW(widget));
+ zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
+ zenity_util_gapp_quit (window);
}
diff --git a/src/calendar.c b/src/calendar.c
index f674e4c..07696ab 100644
--- a/src/calendar.c
+++ b/src/calendar.c
@@ -64,9 +64,8 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data)
if (data->dialog_title)
gtk_window_set_title (GTK_WINDOW (dialog), data->dialog_title);
- zenity_util_set_window_icon (dialog,
- data->window_icon,
- ZENITY_IMAGE_FULLPATH ("zenity-calendar.png"));
+ gtk_window_set_icon_name (GTK_WINDOW(dialog),
+ "x-office-calendar");
if (data->width > -1 || data->height > -1)
gtk_window_set_default_size (GTK_WINDOW(dialog),
diff --git a/src/color.c b/src/color.c
index 3dd2624..4289407 100644
--- a/src/color.c
+++ b/src/color.c
@@ -39,7 +39,6 @@ void
zenity_colorselection (ZenityData *data, ZenityColorData *color_data)
{
GtkWidget *dialog;
- GtkWidget *button;
GdkRGBA color;
zen_data = data;
@@ -59,31 +58,13 @@ zenity_colorselection (ZenityData *data, ZenityColorData *color_data)
if (data->extra_label)
{
- int i = 0;
-
- while (data->extra_label[i] != NULL)
+ for (int i = 0; data->extra_label[i] != NULL; ++i)
{
gtk_dialog_add_button (GTK_DIALOG (dialog),
data->extra_label[i], i);
- i++;
}
}
- // FIXME
-#if 0
- if (data->ok_label) {
- g_object_get (G_OBJECT (dialog), "ok-button", &button, NULL);
- gtk_button_set_label (GTK_BUTTON (button), data->ok_label);
- g_object_unref (G_OBJECT (button));
- }
-
- if (data->cancel_label) {
- g_object_get (G_OBJECT (dialog), "cancel-button", &button, NULL);
- gtk_button_set_label (GTK_BUTTON (button), data->cancel_label);
- g_object_unref (G_OBJECT (button));
- }
-#endif
-
if (data->modal)
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
@@ -99,7 +80,6 @@ zenity_colorselection (ZenityData *data, ZenityColorData *color_data)
zenity_util_gapp_main (GTK_WINDOW(dialog));
}
-// FIXME - this shoudl probably use the color-activated signal
static void
zenity_colorselection_dialog_response (GtkWidget *widget,
int response, gpointer data)
diff --git a/src/entry.c b/src/entry.c
index 85323e7..f116069 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -78,8 +78,8 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data)
if (data->dialog_title)
gtk_window_set_title (GTK_WINDOW(dialog), data->dialog_title);
- zenity_util_set_window_icon (dialog,
- data->window_icon, ZENITY_IMAGE_FULLPATH ("zenity-entry.png"));
+ gtk_window_set_icon_name (GTK_WINDOW(dialog),
+ "insert-text");
if (data->width > -1 || data->height > -1)
gtk_window_set_default_size (GTK_WINDOW (dialog),
diff --git a/src/main.c b/src/main.c
index 3649ad5..01545be 100644
--- a/src/main.c
+++ b/src/main.c
@@ -39,11 +39,12 @@ typedef struct {
} ZenityArgs;
static void
-activate_cb (GtkApplication *app, gpointer user_data)
+command_line_cb (GtkApplication *app,
+ GApplicationCommandLine *command_line,
+ gpointer user_data)
{
ZenityArgs *args = user_data;
ZenityParsingOptions *results;
- int retval;
results = zenity_option_parse (args->argc, args->argv);
@@ -128,14 +129,11 @@ activate_cb (GtkApplication *app, gpointer user_data)
exit (-1);
}
- retval = results->data->exit_code;
-
zenity_option_free ();
g_free (args);
- /* FIXME - pass retval to gapplication properly.
- * exit (retval);
- */
+ g_application_command_line_set_exit_status (command_line,
+ results->data->exit_code);
}
int
@@ -157,9 +155,12 @@ main (int argc, char *argv[])
args->argc = argc;
args->argv = argv;
- app = gtk_application_new ("org.gnome.Zenity", G_APPLICATION_FLAGS_NONE);
- g_signal_connect (app, "activate",
- G_CALLBACK(activate_cb), args);
+ app = gtk_application_new ("org.gnome.Zenity",
+ G_APPLICATION_HANDLES_COMMAND_LINE);
+
+ g_signal_connect (app, "command-line",
+ G_CALLBACK(command_line_cb), args);
+
status = g_application_run (G_APPLICATION(app), 0, NULL);
g_object_unref (app);
diff --git a/src/meson.build b/src/meson.build
index 374e79a..1d3cd82 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -41,3 +41,13 @@ zenity = executable(
c_args: zenity_c_args,
install: true
)
+
+if perl.found()
+ configure_file(
+ input: 'gdialog.in',
+ output: 'gdialog',
+ configuration: zenity_conf,
+ install_dir: zenity_bindir,
+ install: true
+ )
+endif
diff --git a/src/msg.c b/src/msg.c
index e7af4f7..5b8e7a9 100644
--- a/src/msg.c
+++ b/src/msg.c
@@ -173,29 +173,29 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
switch (msg_data->mode)
{
case ZENITY_MSG_WARNING:
- zenity_util_set_window_icon_from_icon_name (
- dialog, data->window_icon, "dialog-warning");
+ gtk_window_set_icon_name (GTK_WINDOW(dialog),
+ "dialog-warning");
break;
case ZENITY_MSG_QUESTION:
- zenity_util_set_window_icon_from_icon_name (
- dialog, data->window_icon, "dialog-question");
+ gtk_window_set_icon_name (GTK_WINDOW(dialog),
+ "dialog-question");
zenity_msg_construct_question_dialog (dialog, msg_data, data);
break;
case ZENITY_MSG_SWITCH:
- zenity_util_set_window_icon_from_icon_name (
- dialog, data->window_icon, "dialog-question");
+ gtk_window_set_icon_name (GTK_WINDOW(dialog),
+ "dialog-question");
break;
case ZENITY_MSG_ERROR:
- zenity_util_set_window_icon_from_icon_name (
- dialog, data->window_icon, "dialog-error");
+ gtk_window_set_icon_name (GTK_WINDOW(dialog),
+ "dialog-error");
break;
case ZENITY_MSG_INFO:
- zenity_util_set_window_icon_from_icon_name (
- dialog, data->window_icon, "dialog-information");
+ gtk_window_set_icon_name (GTK_WINDOW(dialog),
+ "dialog-information");
break;
default:
diff --git a/src/notification.c b/src/notification.c
index 20a47f7..e5cfe27 100644
--- a/src/notification.c
+++ b/src/notification.c
@@ -75,7 +75,7 @@ on_notification_default_action (NotifyNotification *n,
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
- exit(zen_data->exit_code);
+ zenity_util_gapp_quit (NULL);
}
static GHashTable *
@@ -378,10 +378,7 @@ zenity_notification (ZenityData *data,
{
zenity_notification_listen_on_stdin (data);
- /* FIXME - gtk_main () was here. Possibly replace this with the
- * zenity_util_gapp_main function and a corresponding _quit in
- * place of the exit calls.
- */
+ zenity_util_gapp_main (NULL);
}
else
{
@@ -431,10 +428,7 @@ zenity_notification (ZenityData *data,
(GSourceFunc) zenity_util_timeout_handle,
NULL);
- /* FIXME - gtk_main () was here. Possibly replace this with the
- * zenity_util_gapp_main function and a corresponding _quit in
- * place of the exit calls.
- */
+ zenity_util_gapp_main (NULL);
}
}
diff --git a/src/progress.c b/src/progress.c
index 69836c4..06e54e0 100644
--- a/src/progress.c
+++ b/src/progress.c
@@ -156,12 +156,14 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition,
static ZenityProgressData *progress_data;
static GObject *progress_bar;
static GObject *progress_label;
+ static GtkWindow *parent;
float percentage = 0.0;
GIOStatus status = G_IO_STATUS_NORMAL;
progress_data = data;
progress_bar = gtk_builder_get_object (builder, "zenity_progress_bar");
progress_label = gtk_builder_get_object (builder, "zenity_progress_text");
+ parent = GTK_WINDOW(gtk_widget_get_native (GTK_WIDGET(progress_bar)));
if ((condition & G_IO_IN) != 0)
{
@@ -259,12 +261,12 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition,
gtk_widget_set_sensitive (GTK_WIDGET (button), TRUE);
gtk_widget_grab_focus (GTK_WIDGET (button));
- if (progress_data->autoclose) {
+ if (progress_data->autoclose)
+ {
zen_data->exit_code =
zenity_util_return_exit_code (ZENITY_OK);
- // FIXME - don't know how to replace gtk_main_quit
- // here.
- exit(zen_data->exit_code);
+
+ zenity_util_gapp_quit (parent);
}
}
}
@@ -296,10 +298,10 @@ zenity_progress_handle_stdin (GIOChannel *channel, GIOCondition condition,
g_object_unref (builder);
- if (progress_data->autoclose) {
+ if (progress_data->autoclose)
+ {
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
- // FIXME - not sure how to replace gtk_main_quit here
- exit(zen_data->exit_code);
+ zenity_util_gapp_quit (parent);
}
g_io_channel_shutdown (channel, TRUE, NULL);
@@ -330,18 +332,6 @@ zenity_progress_read_info (ZenityProgressData *progress_data)
}
}
-// FIXME - I don't have context as to what this is supposed to accomplish,
-// and it uses signals that are gone in gtk4, so I'm just going to remove
-// for now and see if necessary - if so will replace later.
-#if 0
-static void
-zenity_text_size_allocate (GtkWidget *widget, GtkAllocation *allocation,
- gpointer data)
-{
- gtk_widget_set_size_request (widget, allocation->width / 2, -1);
-}
-#endif
-
void
zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
{
@@ -372,9 +362,8 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
if (data->dialog_title)
gtk_window_set_title (GTK_WINDOW(dialog), data->dialog_title);
- zenity_util_set_window_icon (dialog,
- data->window_icon,
- ZENITY_IMAGE_FULLPATH ("zenity-progress.png"));
+ gtk_window_set_icon_name (GTK_WINDOW(dialog),
+ "appointment-soon");
if (data->width > -1 || data->height > -1)
gtk_window_set_default_size (GTK_WINDOW(dialog),
diff --git a/src/scale.c b/src/scale.c
index 180a0c3..62714a5 100644
--- a/src/scale.c
+++ b/src/scale.c
@@ -79,8 +79,8 @@ zenity_scale (ZenityData *data, ZenityScaleData *scale_data)
if (data->dialog_title)
gtk_window_set_title (GTK_WINDOW (dialog), data->dialog_title);
- zenity_util_set_window_icon (dialog, data->window_icon,
- ZENITY_IMAGE_FULLPATH ("zenity-scale.png"));
+ gtk_window_set_icon_name (GTK_WINDOW(dialog),
+ "dialog-question");
if (data->width > -1 || data->height > -1) {
gtk_window_set_default_size (GTK_WINDOW(dialog),
diff --git a/src/text.c b/src/text.c
index 291b5da..09c8c43 100644
--- a/src/text.c
+++ b/src/text.c
@@ -294,8 +294,8 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
if (data->dialog_title)
gtk_window_set_title (GTK_WINDOW(dialog), data->dialog_title);
- zenity_util_set_window_icon (dialog, data->window_icon,
- ZENITY_IMAGE_FULLPATH ("zenity-text.png"));
+ gtk_window_set_icon_name (GTK_WINDOW(dialog),
+ "accessories-text-editor");
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
@@ -373,7 +373,7 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
if (data->modal)
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
-// FIXME - TODO
+/* TODO once gtk4 support fully lands in webkitgtk. */
#ifdef HAVE_WEBKITGTK
if (text_data->html) {
web_kit = webkit_web_view_new ();
diff --git a/src/tree.c b/src/tree.c
index 26a9ca4..5f99583 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -35,10 +35,10 @@
#include <config.h>
-#define MAX_ELEMENTS_BEFORE_SCROLLING 5
#define PRINT_HIDE_COLUMN_SEPARATOR ","
static GtkBuilder *builder;
+static GtkTreeView *tree_view;
static GSList *selected;
static char *separator;
static gboolean print_all_columns = FALSE;
@@ -138,7 +138,6 @@ static gboolean
zenity_tree_handle_stdin (GIOChannel *channel, GIOCondition condition,
gpointer data)
{
- static GtkTreeView *tree_view;
GtkTreeModel *model;
static GtkTreeIter iter;
static int column_count = 0;
@@ -149,7 +148,9 @@ zenity_tree_handle_stdin (GIOChannel *channel, GIOCondition condition,
static gboolean first_time = TRUE;
GIOStatus status = G_IO_STATUS_NORMAL;
- tree_view = GTK_TREE_VIEW (data);
+ /* Make sure global is properly defined */
+ g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE);
+
n_columns =
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tree_view), "n_columns"));
editable =
@@ -195,8 +196,8 @@ zenity_tree_handle_stdin (GIOChannel *channel, GIOCondition condition,
if (status != G_IO_STATUS_NORMAL)
{
if (error) {
- g_warning (
- "zenity_tree_handle_stdin () : %s", error->message);
+ g_warning ("%s: %s",
+ __func__, error->message);
g_error_free (error);
error = NULL;
}
@@ -239,22 +240,6 @@ zenity_tree_handle_stdin (GIOChannel *channel, GIOCondition condition,
&iter, n_columns, TRUE, -1);
}
- if (row_count == MAX_ELEMENTS_BEFORE_SCROLLING)
- {
- GtkWidget *scrolled_window;
- GtkRequisition rectangle;
-
- gtk_widget_get_preferred_size (GTK_WIDGET(tree_view),
- &rectangle, NULL);
- scrolled_window = GTK_WIDGET(gtk_builder_get_object (builder,
- "zenity_tree_window"));
- gtk_widget_set_size_request (scrolled_window,
- -1, rectangle.height);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrolled_window),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- }
-
column_count++;
} while ((g_io_channel_get_buffer_condition (channel) & G_IO_IN) ==
@@ -273,9 +258,13 @@ zenity_tree_handle_stdin (GIOChannel *channel, GIOCondition condition,
}
static void
-zenity_tree_fill_entries_from_stdin (GtkTreeView *tree_view, gint n_columns,
+zenity_tree_fill_entries_from_stdin (GtkTreeView *loc_tv, int n_columns,
gboolean toggles, gboolean editable)
{
+ /* No reason this should fail. Sanity check. */
+ g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
+ g_assert (loc_tv == tree_view);
+
g_object_set_data (
G_OBJECT (tree_view), "n_columns", GINT_TO_POINTER (n_columns));
g_object_set_data (
@@ -286,18 +275,22 @@ zenity_tree_fill_entries_from_stdin (GtkTreeView *tree_view, gint n_columns,
channel = g_io_channel_unix_new (0);
g_io_channel_set_encoding (channel, NULL, NULL);
g_io_channel_set_flags (channel, G_IO_FLAG_NONBLOCK, NULL);
- g_io_add_watch (
- channel, G_IO_IN | G_IO_HUP, zenity_tree_handle_stdin, tree_view);
+ g_io_add_watch (channel,
+ G_IO_IN | G_IO_HUP, zenity_tree_handle_stdin, NULL);
}
static void
-zenity_tree_fill_entries (GtkTreeView *tree_view, const char **args,
+zenity_tree_fill_entries (GtkTreeView *loc_tv, const char **args,
int n_columns, gboolean toggles, gboolean editable)
{
GtkTreeModel *model;
GtkTreeIter iter;
int i = 0;
+ /* No reason this should fail. Sanity check. */
+ g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
+ g_assert (loc_tv == tree_view);
+
model = gtk_tree_view_get_model (tree_view);
g_object_set_data (
@@ -323,26 +316,10 @@ zenity_tree_fill_entries (GtkTreeView *tree_view, const char **args,
GTK_LIST_STORE (model), &iter, j, args[i + j], -1);
}
- if (editable)
- gtk_list_store_set (
- GTK_LIST_STORE (model), &iter, n_columns, TRUE, -1);
-
- if (i == MAX_ELEMENTS_BEFORE_SCROLLING)
- {
- GtkWidget *scrolled_window;
- GtkRequisition rectangle;
-
- gtk_widget_get_preferred_size (
- GTK_WIDGET (tree_view), &rectangle, NULL);
- scrolled_window = GTK_WIDGET (
- gtk_builder_get_object (builder, "zenity_tree_window"));
- gtk_widget_set_size_request (scrolled_window, -1, rectangle.height);
- gtk_scrolled_window_set_policy (
- GTK_SCROLLED_WINDOW (scrolled_window),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
+ if (editable) {
+ gtk_list_store_set (GTK_LIST_STORE(model),
+ &iter, n_columns, TRUE, -1);
}
-
i += n_columns;
}
}
@@ -384,7 +361,6 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
{
GtkWidget *dialog;
GtkWidget *button;
- GObject *tree_view;
GObject *text;
GtkTreeViewColumn *column;
GtkListStore *model;
@@ -477,15 +453,17 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
gtk_label_set_markup (GTK_LABEL(text),
g_strcompress (tree_data->dialog_text));
- zenity_util_set_window_icon (dialog, data->window_icon,
- ZENITY_IMAGE_FULLPATH ("zenity-list.png"));
+ gtk_window_set_icon_name (GTK_WINDOW(dialog),
+ "view-sort-ascending");
if (data->width > -1 || data->height > -1) {
gtk_window_set_default_size (GTK_WINDOW(dialog),
data->width, data->height);
}
- tree_view = gtk_builder_get_object (builder, "zenity_tree_view");
+ /* Define global tree_view. */
+ tree_view = GTK_TREE_VIEW(gtk_builder_get_object (builder,
+ "zenity_tree_view"));
if (!(tree_data->radiobox || tree_data->checkbox))
{
@@ -519,23 +497,23 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
else
gtk_list_store_set_column_types (model, n_columns, column_types);
- gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (model));
+ gtk_tree_view_set_model (tree_view, GTK_TREE_MODEL(model));
if (! (tree_data->radiobox || tree_data->checkbox))
{
if (tree_data->multi)
gtk_tree_selection_set_mode (
- gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
+ gtk_tree_view_get_selection (tree_view),
GTK_SELECTION_MULTIPLE);
else
gtk_tree_selection_set_mode (
- gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
+ gtk_tree_view_get_selection (tree_view),
GTK_SELECTION_SINGLE);
}
else
{
gtk_tree_selection_set_mode (
- gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
+ gtk_tree_view_get_selection (tree_view),
GTK_SELECTION_NONE);
}
@@ -585,7 +563,7 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
cell_renderer = gtk_cell_renderer_text_new ();
g_signal_connect (cell_renderer, "edited",
G_CALLBACK (zenity_cell_edited_callback),
- gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)));
+ gtk_tree_view_get_model (tree_view));
g_object_set_data (G_OBJECT (cell_renderer),
"column",
@@ -627,7 +605,7 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
cell_renderer = gtk_cell_renderer_text_new ();
g_signal_connect (cell_renderer, "edited",
G_CALLBACK (zenity_cell_edited_callback),
- gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)));
+ gtk_tree_view_get_model (tree_view));
g_object_set_data (G_OBJECT (cell_renderer),
"column",
@@ -657,24 +635,24 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
gtk_tree_view_column_set_visible (column, FALSE);
}
- gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
+ gtk_tree_view_append_column (tree_view, column);
column_index++;
}
if (tree_data->hide_header)
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE);
+ gtk_tree_view_set_headers_visible (tree_view, FALSE);
if (tree_data->radiobox || tree_data->checkbox)
{
if (tree_data->data && *tree_data->data) {
- zenity_tree_fill_entries (GTK_TREE_VIEW (tree_view),
+ zenity_tree_fill_entries (tree_view,
tree_data->data,
n_columns,
TRUE,
tree_data->editable);
}
else {
- zenity_tree_fill_entries_from_stdin (GTK_TREE_VIEW (tree_view),
+ zenity_tree_fill_entries_from_stdin (tree_view,
n_columns,
TRUE,
tree_data->editable);
@@ -683,13 +661,13 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
else
{
if (tree_data->data && *tree_data->data) {
- zenity_tree_fill_entries (GTK_TREE_VIEW (tree_view),
+ zenity_tree_fill_entries (tree_view,
tree_data->data,
n_columns,
FALSE,
tree_data->editable);
} else {
- zenity_tree_fill_entries_from_stdin (GTK_TREE_VIEW (tree_view),
+ zenity_tree_fill_entries_from_stdin (tree_view,
n_columns,
FALSE,
tree_data->editable);
@@ -699,7 +677,7 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
zenity_util_show_dialog (dialog);
if (tree_data->mid_search) {
- gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (tree_view),
+ gtk_tree_view_set_search_equal_func (tree_view,
(GtkTreeViewSearchEqualFunc) zenity_mid_search_func,
model,
NULL);
@@ -718,7 +696,7 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
static void
zenity_tree_dialog_get_selected (GtkTreeModel *model, GtkTreePath *path_buf,
- GtkTreeIter *iter, GtkTreeView *tree_view)
+ GtkTreeIter *iter, gpointer user_data)
{
GValue value = G_VALUE_INIT;
int n_columns, i;
@@ -749,7 +727,7 @@ zenity_tree_dialog_get_selected (GtkTreeModel *model, GtkTreePath *path_buf,
static gboolean
zenity_tree_dialog_toggle_get_selected (GtkTreeModel *model, GtkTreePath *path,
- GtkTreeIter *iter, GtkTreeView *tree_view)
+ GtkTreeIter *iter, gpointer user_data)
{
GValue toggle_value = G_VALUE_INIT;
int n_columns, i;
@@ -794,25 +772,25 @@ zenity_tree_dialog_toggle_get_selected (GtkTreeModel *model, GtkTreePath *path,
static void
zenity_tree_dialog_output (void)
{
- GObject *tree_view;
GtkTreeSelection *selection;
GtkTreeModel *model;
- tree_view = gtk_builder_get_object (builder, "zenity_tree_view");
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
+ g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
+
+ model = gtk_tree_view_get_model (tree_view);
if (gtk_tree_model_get_column_type (model, 0) == G_TYPE_BOOLEAN)
{
gtk_tree_model_foreach (model,
(GtkTreeModelForeachFunc) zenity_tree_dialog_toggle_get_selected,
- GTK_TREE_VIEW (tree_view));
+ NULL);
}
else
{
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
+ selection = gtk_tree_view_get_selection (tree_view);
gtk_tree_selection_selected_foreach (selection,
(GtkTreeSelectionForeachFunc) zenity_tree_dialog_get_selected,
- GTK_TREE_VIEW (tree_view));
+ NULL);
}
@@ -871,16 +849,22 @@ zenity_tree_dialog_response (GtkWidget *widget, int response, gpointer data)
}
static void
-zenity_tree_row_activated (GtkTreeView *tree_view, GtkTreePath *tree_path,
+zenity_tree_row_activated (GtkTreeView *loc_tv, GtkTreePath *tree_path,
GtkTreeViewColumn *tree_col, gpointer data)
{
+ GtkWindow *parent;
ZenityData *zen_data = data;
+ /* No reason this should fail. Sanity check. */
+ g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
+ g_assert (loc_tv == tree_view);
+
zenity_tree_dialog_output ();
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
- // FIXME - TEST - not sure how to replace gtk_main_quit here.
- exit(zen_data->exit_code);
+ parent = GTK_WINDOW(gtk_widget_get_native (GTK_WIDGET(tree_view)));
+
+ zenity_util_gapp_quit (parent);
}
static gboolean
diff --git a/src/util.c b/src/util.c
index 4a92149..51cfe27 100644
--- a/src/util.c
+++ b/src/util.c
@@ -178,6 +178,7 @@ zenity_util_fill_file_buffer (GtkTextBuffer *buffer, const char *filename) {
return TRUE;
}
+#if 0
const char *
zenity_util_icon_name_from_filename (const char *filename) {
if (!filename || !filename[0])
@@ -193,10 +194,13 @@ zenity_util_icon_name_from_filename (const char *filename) {
return "dialog-error";
return NULL;
}
+#endif
+#if 0
void
-zenity_util_set_window_icon_from_file (
- GtkWidget *widget, const char *filename) {
+zenity_util_set_window_icon_from_file (GtkWidget *widget,
+ const char *filename)
+{
const char *icon_name;
icon_name = zenity_util_icon_name_from_filename (filename);
@@ -207,10 +211,11 @@ zenity_util_set_window_icon_from_file (
__func__);
}
}
+#endif
+#if 0
void
-zenity_util_set_window_icon (GtkWidget *widget,
- const char *filename, const char *default_file)
+zenity_util_set_window_icon (GtkWidget *widget, const char *icon_name)
{
if (filename != NULL) {
zenity_util_set_window_icon_from_file (widget, filename);
@@ -219,15 +224,19 @@ zenity_util_set_window_icon (GtkWidget *widget,
__func__);
}
}
+#endif
+#if 0
void
-zenity_util_set_window_icon_from_icon_name (
- GtkWidget *widget, const char *filename, const char *default_icon_name) {
+zenity_util_set_window_icon_from_icon_name (GtkWidget *widget,
+ const char *filename, const char *default_icon_name)
+{
if (filename != NULL)
zenity_util_set_window_icon_from_file (widget, filename);
else
gtk_window_set_icon_name (GTK_WINDOW (widget), default_icon_name);
}
+#endif
void
zenity_util_show_help (GError **error) {
@@ -311,88 +320,7 @@ zenity_util_exit_code_with_data (ZenityExitCode value, ZenityData *zen_data)
zen_data->exit_code = zenity_util_return_exit_code (value);
}
-#if 0
-// FIXME - ???
-//#ifdef GDK_WINDOWING_X11
-
-static Window
-transient_get_xterm (void) {
- const char *wid_str = g_getenv ("WINDOWID");
- if (wid_str) {
- char *wid_str_end;
- int ret;
- Window wid = strtoul (wid_str, &wid_str_end, 10);
- if (*wid_str != '\0' && *wid_str_end == '\0' && wid != 0) {
- XWindowAttributes attrs;
- gdk_error_trap_push ();
- ret = XGetWindowAttributes (
- GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), wid, &attrs);
- gdk_flush ();
- if (gdk_error_trap_pop () != 0 || ret == 0) {
- return None;
- }
- return wid;
- }
- }
- return None;
-}
-
-static void
-transient_x_free (void *ptr) {
- if (ptr)
- XFree (ptr);
-}
-
-static gboolean
-transient_is_toplevel (Window wid) {
- XTextProperty prop;
- Display *dpy = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
- if (!XGetWMName (dpy, wid, &prop))
- return FALSE;
- transient_x_free (prop.value);
- return !!prop.value;
-}
-
-/*
- * GNOME Terminal doesn't give us its toplevel window, but the WM needs a
- * toplevel XID for proper stacking. Other terminals work fine without this
- * magic. We can't use GDK here since "xterm" is a foreign window.
- */
-
-static Window
-transient_get_xterm_toplevel (void) {
- Window xterm = transient_get_xterm ();
- Display *dpy = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
- while (xterm != None && !transient_is_toplevel (xterm)) {
- Window root, parent, *children;
- unsigned nchildren;
- XQueryTree (dpy, xterm, &root, &parent, &children, &nchildren);
- transient_x_free (children);
- if (parent == root)
- xterm = None;
- else
- xterm = parent;
- }
- return xterm;
-}
-
-static void
-zenity_util_make_transient (GdkWindow *window, Window parent) {
- Window parent_window = parent;
- if (parent_window == 0)
- parent_window = transient_get_xterm_toplevel ();
- if (parent_window != None) {
- XSetTransientForHint (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
- GDK_WINDOW_XID (window),
- parent_window);
- }
-}
-
-#endif /* GDK_WINDOWING_X11 */
-
-/* helper for common_set_gtkhex_font_from_settings.
- *
- * This function was written by Matthias Clasen and is included somewhere in
+/* This function was written by Matthias Clasen and is included somewhere in
* the GTK source tree.. I believe it is also included in libdazzle, but I
* didn't want to include a whole dependency just for one function. LGPL, but
* credit where credit is due!
@@ -522,7 +450,6 @@ zenity_util_pango_font_description_to_css (PangoFontDescription *desc)
void
zenity_util_show_dialog (GtkWidget *dialog)
{
- gtk_widget_realize (dialog); // FIXME - doubt this is necessary.
gtk_widget_show (dialog);
}