diff --git a/.gitignore b/.gitignore index 92a9c2b..e9d3966 100644 --- a/.gitignore +++ b/.gitignore @@ -1,41 +1,41 @@ *.lo *.o .deps/ .libs/ /aclocal.m4 /autom4te.cache /config.h.in /config.h /config.log /config.status /configure /Makefile.in autom4te.cache/ assuan/Makefile.in assuan/Makefile curses/Makefile.in curses/Makefile doc/Makefile.in doc/Makefile doc/pinentry.info doc/stamp-vti doc/version.texi gtk+-2/Makefile.in gtk+-2/Makefile gnome3/Makefile.in gnome3/Makefile pinentry/Makefile.in pinentry/Makefile -qt4/Makefile.in -qt4/Makefile +qt/Makefile.in +qt/Makefile secmem/Makefile.in secmem/Makefile w32/Makefile.in w32/Makefile tty/Makefile.in tty/Makefile -/qt4/pinentryconfirm.moc -/qt4/pinentrydialog.moc -/qt4/qsecurelineedit.moc +/qt/pinentryconfirm.moc +/qt/pinentrydialog.moc +/qt/qsecurelineedit.moc /m4/Makefile.in /emacs/Makefile.in diff --git a/Makefile.am b/Makefile.am index 22640df..7dcc0ae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,102 +1,102 @@ # Makefile.am # Copyright (C) 2002, 2012, 2015 g10 Code GmbH # # This file is part of PINENTRY. # # PINENTRY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PINENTRY 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 -DISTCHECK_CONFIGURE_FLAGS = --disable-pinentry-qt4 +DISTCHECK_CONFIGURE_FLAGS = --disable-pinentry-qt GITLOG_TO_CHANGELOG=gitlog-to-changelog EXTRA_DIST = autogen.sh autogen.rc README.GIT ChangeLog-old \ build-aux/gitlog-to-changelog \ build-aux/git-log-fix build-aux/git-log-footer if BUILD_PINENTRY_CURSES pinentry_curses = curses else pinentry_curses = endif if BUILD_PINENTRY_TTY pinentry_tty = tty else pinentry_tty = endif if BUILD_PINENTRY_EMACS pinentry_emacs = emacs else pinentry_emacs = endif if BUILD_PINENTRY_GTK_2 pinentry_gtk_2 = gtk+-2 else pinentry_gtk_2 = endif if BUILD_PINENTRY_GNOME_3 pinentry_gnome_3 = gnome3 else pinentry_gnome_3 = endif -if BUILD_PINENTRY_QT4 -pinentry_qt4 = qt4 +if BUILD_PINENTRY_QT +pinentry_qt = qt else -pinentry_qt4 = +pinentry_qt = endif if BUILD_PINENTRY_W32 pinentry_w32 = w32 else pinentry_w32 = endif SUBDIRS = m4 secmem pinentry ${pinentry_curses} ${pinentry_tty} \ ${pinentry_emacs} ${pinentry_gtk_2} ${pinentry_gnome_3} \ - ${pinentry_qt4} ${pinentry_w32} doc + ${pinentry_qt} ${pinentry_w32} doc install-exec-local: @list='$(bin_PROGRAMS)'; for p in $$list; do \ echo " $(SETCAP) cap_ipc_lock+p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(SETCAP) cap_ipc_lock+p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'` || true; \ done (cd $(DESTDIR)$(bindir); \ rm -f pinentry; \ $(LN_S) $(PINENTRY_DEFAULT)$(EXEEXT) pinentry) dist-hook: gen-ChangeLog echo "$(VERSION)" > $(distdir)/VERSION gen_start_date = 2012-08-08T00:00:00 .PHONY: gen-ChangeLog gen-ChangeLog: if test -d $(top_srcdir)/.git; then \ (cd $(top_srcdir) && \ $(GITLOG_TO_CHANGELOG) --append-dot --tear-off \ --amend=build-aux/git-log-fix \ --since=$(gen_start_date) ) > $(distdir)/cl-t; \ cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;\ rm -f $(distdir)/ChangeLog; \ mv $(distdir)/cl-t $(distdir)/ChangeLog; \ fi diff --git a/README b/README index d66d2d2..b80d466 100644 --- a/README +++ b/README @@ -1,67 +1,67 @@ PIN Entry --------- This is a collection of simple PIN or passphrase entry dialogs which utilize the Assuan protocol as described by the aegypten project; see http://www.gnupg.org/aegypten/ for details. There are programs for different toolkits available. For all GUIs it is automatically detected which modules can be built, but it can also be requested explicitly. GUI OPTION DEPENDENCIES Curses --enable-pinentry-curses Curses library, for example ncurses GTK+ V2.0 --enable-pinentry-gtk2 Gimp Toolkit Library, Version 2.0 eg. libgtk-x11-2.0 and libglib-2.0 -Qt4 --enable-pinentry-qt4 Qt4 +Qt --enable-pinentry-qt Qt (> 4.4.0) TTY --enable-pinentry-tty Simple TTY version, no dependencies The GTK+ and Qt pinentries can fall back to curses mode. The option to enable this is --enable-fallback-curses, but this is also detected automatically in the same way --enable-pinentry-curses is. The fallback to curses also works if --disable-pinentry-curses is specified. So to disable linking to curses completely you have to pass --disable-fallback-curses to the configure script as well. Examples: * To only build the GTK+ pinentry with curses support: ./configure --enable-pinentry-gtk2 --enable-fallback-curses \ - --disable-pinentry-curses --disable-pinentry-qt4 + --disable-pinentry-curses --disable-pinentry-qt * To build the Qt pinentry, and the other pinentries if they are supported: -./configure --enable-pinentry-qt4 +./configure --enable-pinentry-qt * To build everything that is supported (complete auto-detection): ./configure Some of the code is taken from Robert Bihlmeyer's Quintuple-Agent. For security reasons, all internationalization has been removed. The client is expected to tell the PIN entry the text strings to be displayed. Curses Pinentry --------------- The curses pinentry supports colors if the terminal does. The colors can be specified by the --colors=FG,BG,SO option, which sets the foreground, background and standout colors respectively. The standout color is used for error messages. Colors can be named by any of "black", "red", "green", "yellow", "blue", "magenta", "cyan" and "white". The foreground and standout color can be prefixed by "bright-", "bright", "bold-" and "bold", and any of these prefixes has the same effect of making the color bolder or brighter. Two special color names are defined as well: "default" chooses the default color, and "none" disables use of colors. The name "none" is only meaningful for the standout color and in this case a reversed effect is used for error messages. For the other colors, disabling colors means the same as using the defaults. The default colors are as follows: Foreground: Terminal default Background: Terminal default Standout: Bright red Note that color support is limited by the capabilities of the display terminal. Some color combinations can be very difficult to read, and please know that colors are perceived differently by different people. diff --git a/autogen.rc b/autogen.rc index bed429b..9be5e62 100644 --- a/autogen.rc +++ b/autogen.rc @@ -1,27 +1,27 @@ # autogen.sh configuration for Pinentry -*- sh -*- #version_parts=3 case "$myhost:$myhostsub" in w32:ce) - extraoptions="--disable-pinentry-gtk2 --disable-pinentry-qt4" + extraoptions="--disable-pinentry-gtk2 --disable-pinentry-qt" ;; w32:) extraoptions="" ;; esac case "$myhost" in w32) configure_opts=" --with-gpg-error-prefix=@SYSROOT@ --with-libassuan-prefix=@SYSROOT@ --with-libiconv-prefix=@SYSROOT@ PKG_CONFIG_LIBDIR=@SYSROOT@/lib/pkgconfig " ;; esac extra_aclocal_flags= final_info="./configure --enable-maintainer-mode && make" diff --git a/configure.ac b/configure.ac index f640a68..2ffea2d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,737 +1,726 @@ # configure.ac # Copyright (C) 1999 Robert Bihlmeyer # Copyright (C) 2001, 2002, 2003, 2004, 2007, 2015 g10 Code GmbH # # This file is part of PINENTRY. # # PINENTRY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PINENTRY 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA # (Process this file with autoconf to produce a configure script.) AC_PREREQ(2.69) min_automake_version="1.14" # To build a release you need to create a tag with the version number # (git tag -s pinentry-n.m.k) and run "./autogen.sh --force". Please # bump the version number immediately after the release, do another # commit, and a push so that the git magic is able to work. m4_define(mym4_version, [0.9.6]) # Below is m4 magic to extract and compute the git revision number, # the decimalized short revision number, a beta version string and a # flag indicating a development version (mym4_isgit). Note that the # m4 processing is done by autoconf and not during the configure run. m4_define([mym4_revision], m4_esyscmd([git branch -v 2>/dev/null \ | awk '/^\* / {printf "%s",$3}'])) m4_define([mym4_revision_dec], m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))])) m4_define([mym4_betastring], m4_esyscmd_s([git describe --match 'pinentry-[0-9].[0-9].*[0-9]' \ --long| awk -F- '$3!=0{print"-beta"$3}'])) m4_define([mym4_isgit],m4_if(mym4_betastring,[],[no],[yes])) m4_define([mym4_full_version],[mym4_version[]mym4_betastring]) AC_INIT([pinentry],[mym4_full_version], [http://bugs.gnupg.org]) AC_CONFIG_AUX_DIR([build-aux]) AM_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR(pinentry/pinentry.h) AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip]) AC_GNU_SOURCE AM_MAINTAINER_MODE AC_CANONICAL_HOST AH_TOP([ #ifndef PINENTRY_CONFIG_H_INCLUDED #define PINENTRY_CONFIG_H_INCLUDED /* Enable gpg-error's strerror macro under W32CE. */ #define GPG_ERR_ENABLE_ERRNO_MACROS 1 ]) AH_BOTTOM([ #endif /*PINENTRY_CONFIG_H_INCLUDED*/ ]) dnl Checks for programs. AC_PROG_MAKE_SET AM_SANITY_CHECK missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_RANLIB # We need to check for cplusplus here because we may not do the test # for Qt and autoconf does does not allow that. AC_PROG_CXX AC_PROG_LN_S AC_CHECK_TOOL(WINDRES, windres, :) AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog, [build-aux/gitlog-to-changelog]) have_dosish_system=no have_w32_system=no have_w32ce_system=no case "${host}" in *-mingw32*) AC_DEFINE(USE_ONLY_8DOT3,1, [Set this to limit filenames to the 8.3 format]) have_dosish_system=yes have_w32_system=yes case "${host}" in *-mingw32ce*) have_w32ce_system=yes ;; *) AC_DEFINE(HAVE_DRIVE_LETTERS,1, [Defined if the OS supports drive letters.]) ;; esac ;; i?86-emx-os2 | i?86-*-os2*emx ) # OS/2 with the EMX environment AC_DEFINE(HAVE_DRIVE_LETTERS) have_dosish_system=yes ;; i?86-*-msdosdjgpp*) # DOS with the DJGPP environment AC_DEFINE(HAVE_DRIVE_LETTERS) have_dosish_system=yes ;; esac if test "$have_dosish_system" = yes; then AC_DEFINE(HAVE_DOSISH_SYSTEM,1, [Defined if we run on some of the PCDOS like systems (DOS, Windoze. OS/2) with special properties like no file modes]) fi AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes) if test "$have_w32_system" = yes; then AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system]) if test "$have_w32ce_system" = yes; then AC_DEFINE(HAVE_W32CE_SYSTEM,1,[Defined if we run on WindowsCE]) fi fi AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes) AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes) dnl Checks for compiler features. if test "$GCC" = yes; then # Check whether gcc does not emit a diagnositc for unknown -Wno-* # options. This is the case for gcc >= 4.6 AC_MSG_CHECKING([if gcc ignores unknown -Wno-* options]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6 ) #kickerror #endif]],[])],[_gcc_silent_wno=yes],[_gcc_silent_wno=no]) AC_MSG_RESULT($_gcc_silent_wno) if test "$USE_MAINTAINER_MODE" = "yes"; then CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes" CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security" if test x"$_gcc_silent_wno" = xyes ; then _gcc_warn=yes else AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers]) _gcc_cflags_save=$CFLAGS CFLAGS="-Wno-missing-field-initializers" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], [_gcc_warn=yes],[_gcc_warn=no]) AC_MSG_RESULT($_gcc_warn) CFLAGS=$_gcc_cflags_save; fi if test x"$_gcc_warn" = xyes ; then CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers" fi AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement]) _gcc_cflags_save=$CFLAGS CFLAGS="-Wdeclaration-after-statement" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_warn=yes,_gcc_warn=no) AC_MSG_RESULT($_gcc_warn) CFLAGS=$_gcc_cflags_save; if test x"$_gcc_warn" = xyes ; then CFLAGS="$CFLAGS -Wdeclaration-after-statement" fi else # Not in maintainer mode: Use standard warnings. CFLAGS="$CFLAGS -Wall" fi CPPFLAGS="$CPPFLAGS -Wall" if test x"$_gcc_silent_wno" = xyes ; then _gcc_warn=yes else AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign]) _gcc_cflags_save=$CFLAGS CFLAGS="-Wno-pointer-sign" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[_gcc_warn=yes],[_gcc_warn=no]) AC_MSG_RESULT($_gcc_warn) CFLAGS=$_gcc_cflags_save; fi if test x"$_gcc_warn" = xyes ; then CFLAGS="$CFLAGS -Wno-pointer-sign" fi AC_MSG_CHECKING([if gcc supports -Wpointer-arith]) _gcc_cflags_save=$CFLAGS CFLAGS="-Wpointer-arith" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_warn=yes,_gcc_warn=no) AC_MSG_RESULT($_gcc_warn) CFLAGS=$_gcc_cflags_save; if test x"$_gcc_warn" = xyes ; then CFLAGS="$CFLAGS -Wpointer-arith" fi fi # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h utime.h wchar.h) dnl Checks for library functions. AC_CHECK_FUNCS(seteuid stpcpy mmap) GNUPG_CHECK_MLOCK dnl Checks for standard types. AC_TYPE_UINT32_T # Common libraries and cflags. COMMON_CFLAGS= COMMON_LIBS= AC_SUBST(COMMON_CFLAGS) AC_SUBST(COMMON_LIBS) dnl Checks for libgpg-error # # libgpg-error is a library with error codes shared between GnuPG # related projects. # NEED_GPG_ERROR_VERSION=1.16 have_gpg_error=no AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION", have_gpg_error=yes,have_gpg_error=no) COMMON_CFLAGS="$GPG_ERROR_CFLAGS $COMMON_CFLAGS" COMMON_LIBS="$GPG_ERROR_LIBS $COMMON_LIBS" AC_DEFINE_UNQUOTED(GPG_ERR_ENABLE_GETTEXT_MACROS, 1, [Under Windows we use the gettext code from libgpg-error]) AC_DEFINE_UNQUOTED(GPG_ERR_ENABLE_ERRNO_MACROS, 1, [Under WindowsCE we use the strerror replacement from libgpg-error.]) dnl Checks for libassuan. # # libassuan is used for IPC # NEED_LIBASSUAN_API=2 NEED_LIBASSUAN_VERSION=2.1.0 have_libassuan=no AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION", have_libassuan=yes,have_libassuan=no) if test "$have_libassuan" = "yes"; then AC_DEFINE_UNQUOTED(GNUPG_LIBASSUAN_VERSION, "$libassuan_version", [version of the libassuan library]) fi COMMON_CFLAGS="$LIBASSUAN_CFLAGS $COMMON_CFLAGS" COMMON_LIBS="$LIBASSUAN_LIBS $COMMON_LIBS" dnl Checks for libsecmem. GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF) GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF) dnl Check for libcap AC_ARG_WITH([libcap], AC_HELP_STRING([--without-libcap], [Disable support for capabilities library])) if test "x$with_libcap" != "xno"; then AC_PATH_PROG(SETCAP, setcap, :, "$PATH:/sbin:/usr/sbin") AC_CHECK_LIB(cap, cap_set_proc, [ AC_DEFINE(USE_CAPABILITIES,1,[The capabilities support library is installed]) LIBCAP=-lcap ]) fi AC_SUBST(LIBCAP) dnl dnl Check for curses pinentry program. dnl AC_ARG_ENABLE(pinentry-curses, AC_HELP_STRING([--enable-pinentry-curses], [build curses pinentry]), pinentry_curses=$enableval, pinentry_curses=maybe) AC_ARG_ENABLE(fallback-curses, AC_HELP_STRING([--enable-fallback-curses], [include curses fallback]), fallback_curses=$enableval, fallback_curses=maybe) dnl dnl Checks for curses libraries. Deal correctly with $pinentry_curses = maybe dnl and $fallback_curses = maybe. dnl if test "$pinentry_curses" != "no" -o "$fallback_curses" != "no"; then IU_LIB_CURSES fi if test "$LIBCURSES"; then if test "$pinentry_curses" != "no"; then pinentry_curses=yes fi if test "$fallback_curses" != "no"; then fallback_curses=yes AC_DEFINE(FALLBACK_CURSES, 1, [The GUI pinentries should fall back to curses if X is not available.]) fi else if test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes"; then AC_MSG_ERROR([[ *** *** The curses library is required. The latest version of *** ncurses is always available from ftp://ftp.gnu.org/gnu/ncurses/. ***]]) fi pinentry_curses=no fallback_curses=no fi AM_CONDITIONAL(BUILD_LIBPINENTRY_CURSES, test "$pinentry_curses" = "yes" -o "$fallback_curses" = "yes") AM_CONDITIONAL(BUILD_PINENTRY_CURSES, test "$pinentry_curses" = "yes") AM_CONDITIONAL(FALLBACK_CURSES, test "$fallback_curses" = "yes") if test "$pinentry_curses" = "yes"; then AC_DEFINE(PINENTRY_CURSES, 1, [The Curses version of Pinentry is to be build]) fi dnl dnl Check for tty pinentry program. dnl AC_ARG_ENABLE(pinentry-tty, AC_HELP_STRING([--enable-pinentry-tty], [build tty pinentry]), pinentry_tty=$enableval, pinentry_tty=maybe) AM_CONDITIONAL(BUILD_PINENTRY_TTY, test "$pinentry_tty" = "yes") if test "$pinentry_tty" = "yes"; then AC_DEFINE(PINENTRY_TTY, 1, [The TTY version of Pinentry is to be build]) fi dnl dnl Additional checks pinentry Curses. dnl if test "$pinentry_curses" = "yes" \ -o "$fallback_curses" = "yes" ; then AM_ICONV if test "$am_cv_func_iconv" != "yes"; then AC_MSG_ERROR([[ *** *** The iconv function is required. You can specify its location *** using the --with-libiconv-prefix=PREFIX option to configure. ***]]) fi fi dnl dnl Check for emacs pinentry program. dnl AC_ARG_ENABLE(pinentry-emacs, AC_HELP_STRING([--enable-pinentry-emacs], [build emacs pinentry]), pinentry_emacs=$enableval, pinentry_emacs=no) AC_ARG_ENABLE(inside-emacs, AC_HELP_STRING([--enable-inside-emacs], [include emacs hack]), inside_emacs=$enableval, inside_emacs=maybe) if test "$pinentry_emacs" != "no" -o "$inside_emacs" != "no"; then AC_MSG_CHECKING([if Unix domain socket is supported]) AC_TRY_COMPILE([ #include #include ], [int s = socket (AF_UNIX, SOCK_STREAM, 0);], [_unixsock_works=yes], [_unixsock_works=no]) AC_MSG_RESULT($_unixsock_works) if test "$_unixsock_works" = "yes"; then if test "$pinentry_emacs" != "no"; then pinentry_emacs=yes fi if test "$inside_emacs" != "no"; then inside_emacs=yes AC_DEFINE(INSIDE_EMACS, 1, [The GUI pinentries should respect INSIDE_EMACS envvar.]) fi else if test "$pinentry_emacs" = "yes" -o "$inside_emacs" = "yes"; then AC_MSG_ERROR([[ *** *** Support for Unix domain sockets is required. ***]]) fi pinentry_emacs=no inside_emacs=no fi fi AM_CONDITIONAL(BUILD_LIBPINENTRY_EMACS, test "$pinentry_emacs" = "yes" -o "$inside_emacs" = "yes") AM_CONDITIONAL(BUILD_PINENTRY_EMACS, test "$pinentry_emacs" = "yes") AM_CONDITIONAL(INSIDE_EMACS, test "$inside_emacs" = "yes") if test "$pinentry_emacs" = "yes"; then AC_DEFINE(PINENTRY_EMACS, 1, [The Emacs version of Pinentry is to be build]) fi dnl dnl Check for GTK+-2 / GNOME3 pinentry programs. dnl AC_ARG_ENABLE(pinentry-gtk2, AC_HELP_STRING([--enable-pinentry-gtk2], [build GTK+-2 pinentry]), pinentry_gtk_2=$enableval, pinentry_gtk_2=maybe) AC_ARG_ENABLE(pinentry-gnome3, AC_HELP_STRING([--enable-pinentry-gnome3], [build GNOME 3 pinentry]), pinentry_gnome_3=$enableval, pinentry_gnome_3=maybe) dnl check for pkg-config if test "$pinentry_gtk_2" != "no" -o "$pinentry_gnome_3" != "no"; then AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test x"${PKG_CONFIG}" = xno ; then pinentry_gtk_2=no pinentry_gnome_3=no fi fi dnl check if the module gtk+-2.0 exists if test "$pinentry_gtk_2" != "no" -o "$pinentry_gnome_3" != "no"; then AC_MSG_CHECKING([for gtk+-2]) "${PKG_CONFIG}" --exists gtk+-2.0 if test $? -ne 0 ; then AC_MSG_RESULT([no]) AC_MSG_WARN([pkg-config could not find the module gtk+-2.0]) pinentry_gtk_2=no pinentry_gnome_3=no else AC_MSG_RESULT([yes]) AC_MSG_CHECKING([gtk+-2 version >= 2.4.0]) modvers=`"${PKG_CONFIG}" --modversion gtk+-2.0` AC_MSG_RESULT([$modvers]) "${PKG_CONFIG}" --atleast-version=2.4.0 gtk+-2.0 if test $? -ne 0 ; then AC_MSG_WARN([building GTK+-2 pinentry disabled]) pinentry_gtk_2=no pinentry_gnome_3=no else GTK2CFLAGS=`"${PKG_CONFIG}" --cflags gtk+-2.0` GTK2LIBS=`"${PKG_CONFIG}" --libs gtk+-2.0` AC_SUBST(GTK2CFLAGS) AC_SUBST(GTK2LIBS) if test "$pinentry_gtk_2" != "no" then pinentry_gtk_2=yes fi if test "$pinentry_gnome_3" != "no" then pinentry_gnome_3=yes fi fi fi fi AM_CONDITIONAL(BUILD_PINENTRY_GTK_2, test "$pinentry_gtk_2" = "yes") if test "$pinentry_gnome_3" != "no"; then AC_MSG_CHECKING([for gcr]) "${PKG_CONFIG}" --exists gcr-3,gcr-base-3 if test $? -ne 0 ; then AC_MSG_RESULT([no]) AC_MSG_WARN([pkg-config could not find the module gcr-3,gcr-base-3]) pinentry_gnome_3=no else AC_MSG_RESULT([yes]) GNOME3CFLAGS=`"${PKG_CONFIG}" --cflags gcr-3,gcr-base-3` GNOME3LIBS=`"${PKG_CONFIG}" --libs gcr-3,gcr-base-3` AC_SUBST(GNOME3CFLAGS) AC_SUBST(GNOME3LIBS) AC_DEFINE(GCR_API_SUBJECT_TO_CHANGE, 1, [Nod nod]) pinentry_gnome_3=yes fi fi AM_CONDITIONAL(BUILD_PINENTRY_GNOME_3, test "$pinentry_gnome_3" = "yes") dnl dnl Check for libsecret. dnl AC_ARG_ENABLE(libsecret, AC_HELP_STRING([--enable-libsecret], [optionally cache passphrases using libsecret]), libsecret=$enableval, libsecret=maybe) dnl check for pkg-config -if test "$libsecret" != "no"; then +if test "$libsecret" != "no" -o "$pinentry-qt" != "no"; then AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - if test x"${PKG_CONFIG}" = xno ; then - libsecret=no - fi + if test x"${PKG_CONFIG}" = xno ; then + if test "$pinentry_qt" = "yes"; then + AC_MSG_ERROR([[ + *** + *** pkg-config is required to find the Qt libraries for pinentry-qt + ***]]) + else + pinentry_qt=no + fi + libsecret=no + fi fi dnl check if the module libsecret exists if test "$libsecret" != "no"; then AC_MSG_CHECKING([for libsecret]) "${PKG_CONFIG}" --exists 'libsecret-1' if test $? -ne 0 ; then AC_MSG_RESULT([no]) AC_MSG_WARN([pkg-config could not find the modules libsecret-1]) libsecret=no else AC_MSG_RESULT([yes]) LIBSECRET_CFLAGS=`"${PKG_CONFIG}" --cflags 'libsecret-1'` LIBSECRET_LIBS=`"${PKG_CONFIG}" --libs 'libsecret-1'` libsecret=yes fi fi AM_CONDITIONAL(BUILD_WITH_LIBSECRET, test "$libsecret" = "yes") if test "$libsecret" = "yes"; then AC_DEFINE(HAVE_LIBSECRET, 1, [The pinentries should optionally cache the passphrase using libsecret.]) COMMON_CFLAGS="$LIBSECRET_CFLAGS $COMMON_CFLAGS" COMMON_LIBS="$LIBSECRET_LIBS $COMMON_LIBS" fi dnl -dnl Check for Qt4 pinentry program. +dnl Check for Qt pinentry program. dnl -AC_ARG_ENABLE(pinentry-qt4, - AC_HELP_STRING([--enable-pinentry-qt4], [build Qt4 pinentry]), - pinentry_qt4=$enableval, pinentry_qt4=maybe) +AC_ARG_ENABLE(pinentry-qt, + AC_HELP_STRING([--enable-pinentry-qt], [build qt pinentry]), + pinentry_qt=$enableval, pinentry_qt=maybe) dnl -dnl Checks for Qt4 libraries. Deal correctly with $pinentry_qt4 = maybe. +dnl Checks for qt libraries. Deal correctly with $pinentry_qt = maybe. +dnl Tries to find Qt5, falls back on Qt4 dnl -if test "$pinentry_qt4" != "no"; then -PKG_CHECK_MODULES(QT4_CORE, QtCore,, -if test "$pinentry_qt4" = "yes"; then - AC_MSG_ERROR([[ -*** -*** Qt4 Core is required. -***]]) -else - pinentry_qt4=no -fi) -fi - -if test "$pinentry_qt4" != "no"; then - -QT_PATH_MOC -if test "$have_moc" != "yes"; then - if test "$pinentry_qt4" = "yes"; then +if test "$pinentry_qt" != "no"; then + FIND_QT + if test "$have_qt4_libs" != "yes" -a "$have_qt5_libs" != "yes"; then + if test "$pinentry_qt" = "yes"; then AC_MSG_ERROR([[ *** - *** Qt moc is required. + *** Qt4 (QtCore, QtGui) or Qt5 (Qt5Core, Qt5Gui, Qt5Widgets) is required. ***]]) else - pinentry_qt4=no + pinentry_qt=no fi + fi fi -PKG_CHECK_MODULES(QT4_GUI, QtGui,, -if test "$pinentry_qt4" = "yes"; then - AC_MSG_ERROR([[ -*** -*** Qt4 Gui is required. -***]]) -else - pinentry_qt4=no -fi) -fi +AC_SUBST(PINENTRY_QT_CFLAGS) +AC_SUBST(PINENTRY_QT_LIBS) +AC_SUBST(MOC) -dnl If we have come so far, Qt4 pinentry can be build. -if test "$pinentry_qt4" != "no"; then - pinentry_qt4=yes +dnl If we have come so far, qt pinentry can be build. +if test "$pinentry_qt" != "no"; then + pinentry_qt=yes fi -AM_CONDITIONAL(BUILD_PINENTRY_QT4, test "$pinentry_qt4" = "yes") -if test "$pinentry_qt4" = "yes"; then - AC_DEFINE(PINENTRY_QT4, 1, [The Qt4 version of Pinentry is to be build]) +AM_CONDITIONAL(BUILD_PINENTRY_QT, test "$pinentry_qt" = "yes") +if test "$pinentry_qt" = "yes"; then + AC_DEFINE(PINENTRY_QT, 1, [The qt version of Pinentry is to be build]) + if test "$have_qt4_libs" = "yes"; then + pinentry_qt_lib_version="(Qt4)" + else + pinentry_qt_lib_version="(Qt5)" + fi fi -dnl if test "$pinentry_qt4" = "yes"; then -dnl Additional checks for Qt4 pinentry. -dnl End of additional checks for Qt4 pinentry. -dnl fi - - # # Check whether we should build the W32 pinentry. This is actually # the simplest check as we do this only for that platform. # pinentry_w32=no test $have_w32_system = yes && pinentry_w32=yes AM_CONDITIONAL(BUILD_PINENTRY_W32, test "$pinentry_w32" = "yes") # Figure out the default pinentry. We are very conservative here. # Please change the order only after verifying that the preferred # pinentry really is better (more feature-complete and more secure). if test "$pinentry_gtk_2" = "yes"; then PINENTRY_DEFAULT=pinentry-gtk-2 else - if test "$pinentry_qt4" = "yes"; then - PINENTRY_DEFAULT=pinentry-qt4 + if test "$pinentry_qt" = "yes"; then + PINENTRY_DEFAULT=pinentry-qt else if test "$pinentry_gnome_3" = "yes"; then PINENTRY_DEFAULT=pinentry-gnome3 else if test "$pinentry_curses" = "yes"; then PINENTRY_DEFAULT=pinentry-curses else if test "$pinentry_tty" = "yes"; then PINENTRY_DEFAULT=pinentry-tty else if test "$pinentry_w32" = "yes"; then PINENTRY_DEFAULT=pinentry-w32 else AC_MSG_ERROR([[No pinentry enabled.]]) fi fi fi fi fi fi AC_SUBST(PINENTRY_DEFAULT) # # Print errors here so that they are visible all # together and the user can acquire them all together. # die=no if test "$have_gpg_error" = "no"; then die=yes AC_MSG_NOTICE([[ *** *** You need libgpg-error to build this program. ** This library is for example available at *** ftp://ftp.gnupg.org/gcrypt/libgpg-error *** (at least version $NEED_GPG_ERROR_VERSION is required.) ***]]) fi if test "$have_libassuan" = "no"; then die=yes AC_MSG_NOTICE([[ *** *** You need libassuan to build this program. *** This library is for example available at *** ftp://ftp.gnupg.org/gcrypt/libassuan/ *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required). ***]]) fi if test "$die" = "yes"; then AC_MSG_ERROR([[ *** *** Required libraries not found. Please consult the above messages *** and install them before running configure again. ***]]) fi # # To avoid double inclusion of config.h which might happen at some # places, we add the usual double inclusion protection at the top of # config.h. # AH_TOP([ #ifndef GNUPG_CONFIG_H_INCLUDED #define GNUPG_CONFIG_H_INCLUDED ]) # # Stuff which goes at the bottom of config.h. # AH_BOTTOM([ #ifdef GPG_ERR_SOURCE_DEFAULT # error GPG_ERR_SOURCE_DEFAULT already defined #endif #define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_PINENTRY #endif /*GNUPG_CONFIG_H_INCLUDED*/ ]) AC_CONFIG_FILES([ m4/Makefile secmem/Makefile pinentry/Makefile curses/Makefile tty/Makefile emacs/Makefile gtk+-2/Makefile gnome3/Makefile -qt4/Makefile +qt/Makefile w32/Makefile doc/Makefile Makefile ]) AC_OUTPUT AC_MSG_NOTICE([ Pinentry v${VERSION} has been configured as follows: Revision: mym4_revision (mym4_revision_dec) Platform: $host Curses Pinentry ..: $pinentry_curses TTY Pinentry .....: $pinentry_tty Emacs Pinentry ...: $pinentry_emacs GTK+-2 Pinentry ..: $pinentry_gtk_2 GNOME 3 Pinentry .: $pinentry_gnome_3 - Qt4 Pinentry .....: $pinentry_qt4 + Qt Pinentry ......: $pinentry_qt $pinentry_qt_lib_version W32 Pinentry .....: $pinentry_w32 Fallback to Curses: $fallback_curses Emacs integration : $inside_emacs libsecret ........: $libsecret Default Pinentry .: $PINENTRY_DEFAULT ]) diff --git a/m4/qt.m4 b/m4/qt.m4 index a6b849b..0a7ea99 100644 --- a/m4/qt.m4 +++ b/m4/qt.m4 @@ -1,706 +1,93 @@ -## -*- autoconf -*- - - -dnl This file is part of the KDE libraries/packages -dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) -dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org) -dnl (C) 2002 g10 Code GmbH -dnl Modified for PINENTRY by Marcus Brinkmann. +dnl qt.m4 +dnl Copyright (C) 2015 Intevation GmbH dnl -dnl This file is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Library General Public -dnl License as published by the Free Software Foundation; either -dnl version 2 of the License, or (at your option) any later version. - -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Library General Public License for more details. - -dnl You should have received a copy of the GNU Library General Public License -dnl along with this library; see the file COPYING.LIB. If not, write to -dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -dnl Boston, MA 02111-1307, USA. - -dnl ------------------------------------------------------------------------ -dnl Find a file (or one of more files in a list of dirs) -dnl ------------------------------------------------------------------------ +dnl This file is part of PINENTRY. dnl -AC_DEFUN([QT_FIND_FILE], -[ -$3=NO -for i in $2; -do - for j in $1; - do - echo "configure: __oline__: $i/$j" >&AS_MESSAGE_LOG_FD - if test -r "$i/$j"; then - echo "taking that" >&AS_MESSAGE_LOG_FD - $3=$i - break 2 - fi - done -done -]) - -dnl ------------------------------------------------------------------------ -dnl Find the meta object compiler in the PATH, -dnl in $QTDIR/bin, and some more usual places -dnl ------------------------------------------------------------------------ +dnl PINENTRY is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. dnl -AC_DEFUN([QT_PATH_MOC], -[ - qt_bindirs="" - for dir in $qt_dirs; do - qt_bindirs="$qt_bindirs:$dir/bin:$dir/src/moc" - done - qt_bindirs="$qt_bindirs:/usr/bin:/usr/X11R6/bin:/usr/local/qt/bin" - if test ! "$ac_qt_bindir" = "NO"; then - qt_bindirs="$ac_qt_bindir:$qt_bindirs" - fi - - AC_PATH_PROGS(MOC, [moc-qt4 moc], no, [$qt_bindirs]) - if test "$MOC" = no; then - #AC_MSG_ERROR([No Qt meta object compiler (moc) found! - #Please check whether you installed Qt correctly. - #You need to have a running moc binary. - #configure tried to run $ac_cv_path_moc and the test didn't - #succeed. If configure shouldn't have tried this one, set - #the environment variable MOC to the right one before running - #configure. - #]) - have_moc="no" - else - have_moc="yes" - AC_SUBST(MOC) - fi -]) - - -dnl ------------------------------------------------------------------------ -dnl Find the header files and libraries for the X Window System. -dnl Extended the macro AC_PATH_XTRA. -dnl ------------------------------------------------------------------------ +dnl PINENTRY is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. dnl -AC_DEFUN([QT_PATH_X], -[ -AC_ARG_ENABLE( - embedded, - [ --enable-embedded link to Qt-embedded, don't use X], - qt_use_emb=$enableval, - qt_use_emb=no -) - -AC_ARG_ENABLE( - palmtop, - [ --enable-palmtop link to Qt-embedded, don't use X, link to the Qt Palmtop Environment], - qt_use_emb_palm=$enableval, - qt_use_emb_palm=no -) +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA -if test "$qt_use_emb" = "no"; then - AC_PATH_X - AC_PATH_XTRA - if test "$no_x" = yes; then - AC_MSG_ERROR([Can't find X. Please check your installation and add the correct paths!]) - fi - QT_CXXFLAGS="$X_CFLAGS" - QT_LDFLAGS="$X_LIBS" - QT_LIBS="$X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS" - QTE_NORTTI="" -else - dnl We're using QT Embedded - QT_CXXFLAGS="-fno-rtti -DQWS" - QT_LDFLAGS="-DQWS" - QT_LIBS="" - QTE_NORTTI="-fno-rtti -DQWS" -fi -AC_SUBST(QT_CXXFLAGS) -AC_SUBST(QT_LDFLAGS) -AC_SUBST(QT_LIBS) -AC_SUBST(QTE_NORTTI) -]) - -AC_DEFUN([QT_PRINT_PROGRAM], -[ -AC_REQUIRE([QT_CHECK_VERSION]) -cat > conftest.$ac_ext < -#include -EOF -if test "$qt_ver" = "2"; then -cat >> conftest.$ac_ext < -#include -#include -EOF - -if test $qt_subver -gt 0; then -cat >> conftest.$ac_ext < -EOF -fi -fi - -if test "$qt_ver" = "3"; then -cat >> conftest.$ac_ext < -#include -#include -EOF -fi - -echo "#if ! ($qt_verstring)" >> conftest.$ac_ext -cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext < /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AS_MESSAGE_LOG_FD; fi - done -fi - -ac_qt_libraries="$qt_libdir" - -AC_LANG_PUSH(C++) - -ac_cxxflags_safe="$CXXFLAGS" -ac_ldflags_safe="$LDFLAGS" -ac_libs_safe="$LIBS" - -CXXFLAGS="$CXXFLAGS -I$qt_incdir $QT_CXXFLAGS" -LDFLAGS="$LDFLAGS -L$qt_libdir $QT_LDFLAGS" -LIBS="$LIBS $QT_LIBS" - -QT_PRINT_PROGRAM - -if AC_TRY_EVAL(ac_link) && test -s conftest; then - rm -f conftest* -else - echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD - ac_qt_libraries="NO" -fi -rm -f conftest* -CXXFLAGS="$ac_cxxflags_safe" -LDFLAGS="$ac_ldflags_safe" -LIBS="$ac_libs_safe" - -AC_LANG_POP(C++) -if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then - ac_cv_have_qt="have_qt=no" - ac_qt_notfound="" - missing_qt_mt="" - if test "$ac_qt_includes" = NO; then - if test "$ac_qt_libraries" = NO; then - ac_qt_notfound="(headers and libraries)"; - else - ac_qt_notfound="(headers)"; - fi - else - if test "x$qt_use_mt" = "xyes"; then - missing_qt_mt=" -Make sure that you have compiled Qt with thread support!" - ac_qt_notfound="(library $qtlib-mt)"; - else - ac_qt_notfound="(library $qtlib)"; - fi - fi - - #AC_MSG_ERROR([Qt ($qt_minversion) $ac_qt_notfound not found. Please check your installation! - #For more details about this problem, look at the end of config.log.$missing_qt_mt]) - have_qt="no" -else - have_qt="yes" -fi -]) - -eval "$ac_cv_have_qt" - -if test "$have_qt" != yes; then - AC_MSG_RESULT([$have_qt]); -else - ac_cv_have_qt="have_qt=yes \ - ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries" - AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT]) - - qt_libraries="$ac_qt_libraries" - qt_includes="$ac_qt_includes" -fi - -AC_SUBST(qt_libraries) -AC_SUBST(qt_includes) - -if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then - QT_INCLUDES="" -else - QT_INCLUDES="-I$qt_includes" -fi - -if test "$qt_libraries" != "$x_libraries" && test -n "$qt_libraries"; then - QT_LDFLAGS="$QT_LDFLAGS -L$qt_libraries" -fi -test -z "$QT_MT_LDFLAGS" || QT_LDFLAGS="$QT_LDFLAGS $QT_MT_LDFLAGS" - -AC_SUBST(QT_INCLUDES) -QT_PATH_MOC - - -AC_SUBST(LIB_QPE) -]) - -AC_DEFUN([QT_PATH], -[ -QT_PATH_1_3 -QT_CHECK_RPATH -]) - - -AC_DEFUN([QT_CHECK_COMPILER_FLAG], -[ -AC_MSG_CHECKING(whether $CXX supports -$1) -kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'` -AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache, -[ - AC_LANG_PUSH(C++) - save_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -$1" - AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], []) - CXXFLAGS="$save_CXXFLAGS" - AC_LANG_POP(C++) -]) -if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then - AC_MSG_RESULT(yes) - : - $2 -else - AC_MSG_RESULT(no) - : - $3 -fi -]) - -dnl QT_REMOVE_FORBIDDEN removes forbidden arguments from variables -dnl use: QT_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever]) -dnl it's all white-space separated -AC_DEFUN([QT_REMOVE_FORBIDDEN], -[ __val=$$1 - __forbid=" $2 " - if test -n "$__val"; then - __new="" - ac_save_IFS=$IFS - IFS=" " - for i in $__val; do - case "$__forbid" in - *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;; - *) # Careful to not add spaces, where there were none, because otherwise - # libtool gets confused, if we change e.g. CXX - if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;; - esac - done - IFS=$ac_save_IFS - $1=$__new - fi -]) - -dnl QT_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given -AC_DEFUN([QT_VALIDIFY_CXXFLAGS], -[dnl -if test "x$qt_use_emb" != "xyes"; then - QT_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath]) - QT_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath]) -else - QT_REMOVE_FORBIDDEN(CXX, [-rpath]) - QT_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath]) -fi -]) +dnl sets PINENTRY_QT_LIBS and PINENTRY_QT_CFLAGS +dnl +dnl if QT5 was found have_qt5_libs is set to yes +dnl if QT4 was found have_qt4_libs is set to yes +dnl +dnl The moc lookup code is based on libpoppler (rev. d821207) -AC_DEFUN([QT_CHECK_COMPILERS], +AC_DEFUN([FIND_QT], [ - AC_PROG_CXX - - QT_CHECK_COMPILER_FLAG(fexceptions,[QT_CXXFLAGS="$QT_CXXFLAGS -fexceptions"]) - - case "$host" in - *-*-irix*) test "$GXX" = yes && QT_CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $QT_CXXFLAGS" ;; - *-*-sysv4.2uw*) QT_CXXFLAGS="-D_UNIXWARE $QT_CXXFLAGS";; - *-*-sysv5uw7*) QT_CXXFLAGS="-D_UNIXWARE7 $QT_CXXFLAGS";; - *-*-solaris*) - if test "$GXX" = yes; then - libstdcpp=`$CXX -print-file-name=libstdc++.so` - if test ! -f $libstdcpp; then - AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with the Qt pinentry. Please recompile gcc with --enable-shared to receive a libstdc++.so]) - fi + PKG_CHECK_MODULES(PINENTRY_QT, + Qt5Core >= 5.0.0 Qt5Gui >= 5.0.0 Qt5Widgets >= 5.0.0, + [have_qt5_libs="yes"], + [have_qt5_libs="no"]) + + if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then + PINENTRY_QT_CFLAGS="$PINENTRY_QT_CFLAGS -fpic" + fi + + if test "$have_qt5_libs" = "yes"; then + AC_CHECK_TOOL(MOC, moc) + AC_MSG_CHECKING([moc version]) + mocversion=`$MOC -v 2>&1` + mocversiongrep=`echo $mocversion | grep "Qt 5\|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + AC_MSG_RESULT([no]) + # moc was not the qt5 one, try with moc-qt5 + AC_CHECK_TOOL(MOC2, moc-qt5) + mocversion=`$MOC2 -v 2>&1` + mocversiongrep=`echo $mocversion | grep "Qt 5\|moc-qt5 5\|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + AC_CHECK_TOOL(QTCHOOSER, qtchooser) + qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2` + mocversion=`$qt5tooldir/moc -v 2>&1` + mocversiongrep=`echo $mocversion | grep "Qt 5\|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + # no valid moc found + have_qt5_libs="no"; + else + MOC=$qt5tooldir/moc fi - ;; - esac - - QT_VALIDIFY_CXXFLAGS - - AC_PROG_CXXCPP -]) - -AC_DEFUN([QT_CHECK_RPATH], -[ -AC_MSG_CHECKING(for rpath) -AC_ARG_ENABLE(rpath, - [ --disable-rpath do not use the rpath feature of ld], - USE_RPATH=$enableval, USE_RPATH=yes) - -if test -z "$QT_RPATH" && test "$USE_RPATH" = "yes"; then - - QT_RPATH="" - if test -n "$qt_libraries"; then - QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(qt_libraries)" - fi - dnl $x_libraries is set to /usr/lib in case - if test -n "$X_LIBS"; then - QT_RPATH="$QT_RPATH -Wl,--rpath -Wl,\$(x_libraries)" - fi -fi -AC_SUBST(x_libraries) -AC_SUBST(QT_RPATH) -AC_MSG_RESULT($USE_RPATH) -]) - - -AC_DEFUN([QT_CHECK_LIBPTHREAD], -[ -AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] ) -AC_SUBST(LIBPTHREAD) -]) - -AC_DEFUN([QT_CHECK_PTHREAD_OPTION], -[ - AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.], - kde_use_kernthreads=$enableval, kde_use_kernthreads=no) - - if test "$kde_use_kernthreads" = "yes"; then - ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_CFLAGS="$CXXFLAGS" - CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS" - CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS" - AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h) - CXXFLAGS="$ac_save_CXXFLAGS" - CFLAGS="$ac_save_CFLAGS" - if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then - kde_use_kernthreads=no else - dnl Add proper -I and -l statements - AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD - if test "x$LIBPTHREAD" = "x"; then - kde_use_kernthreads=no + MOC=$MOC2 + fi + fi + fi + if test "$have_qt5_libs" != "yes"; then + PKG_CHECK_MODULES(PINENTRY_QT, + QtCore >= 4.4.0 QtGui >= 4.4.0, + [have_qt4_libs="yes"], + [have_qt4_libs="no"]) + if test "$have_qt4_libs" = "yes"; then + AC_CHECK_TOOL(MOC, moc) + AC_MSG_CHECKING([moc version]) + mocversion=`$MOC -v 2>&1` + mocversiongrep=`echo $mocversion | grep "Qt 4"` + if test x"$mocversiongrep" != x"$mocversion"; then + AC_MSG_RESULT([no]) + # moc was not the qt4 one, try with moc-qt4 + AC_CHECK_TOOL(MOC2, moc-qt4) + mocversion=`$MOC2 -v 2>&1` + mocversiongrep=`echo $mocversion | grep "Qt 4"` + if test x"$mocversiongrep" != x"$mocversion"; then + # no valid moc found + have_qt4_libs="no"; + MOC="not found" else - USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads" + MOC=$MOC2 fi fi - else - USE_THREADS="" - if test -z "$LIBPTHREAD"; then - QT_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] ) - fi - fi - - case $host_os in - solaris*) - QT_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"]) - QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4" - ;; - freebsd*) - QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE" - ;; - aix*) - QT_CXXFLAGS="$QT_CXXFLAGS -D_THREAD_SAFE" - LIBPTHREAD="$LIBPTHREAD -lc_r" - ;; - linux*) QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT" - if test "$CXX" = "KCC"; then - QT_CXXFLAGS="$QT_CXXFLAGS --thread_safe" - fi - ;; - *) - ;; - esac - AC_SUBST(USE_THREADS) - AC_SUBST(LIBPTHREAD) -]) - -AC_DEFUN([QT_CHECK_THREADING], -[ - AC_REQUIRE([QT_CHECK_LIBPTHREAD]) - AC_REQUIRE([QT_CHECK_PTHREAD_OPTION]) - dnl default is yes if libpthread is found and no if no libpthread is available - if test -z "$LIBPTHREAD"; then - if test -z "$USE_THREADS"; then - kde_check_threading_default=no - else - kde_check_threading_default=yes fi - else - kde_check_threading_default=yes - fi - AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ], - qt_use_threading=$enableval, qt_use_threading=$kde_check_threading_default) - if test "x$qt_use_threading" = "xyes"; then - AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)]) fi ]) diff --git a/qt4/Makefile.am b/qt/Makefile.am similarity index 85% rename from qt4/Makefile.am rename to qt/Makefile.am index 8462d4f..96d0880 100644 --- a/qt4/Makefile.am +++ b/qt/Makefile.am @@ -1,58 +1,58 @@ # Makefile.am # Copyright (C) 2002 g10 Code GmbH, Klarälvdalens Datakonsult AB # Copyright (C) 2008, 2015 g10 Code GmbH # # This file is part of PINENTRY. # # PINENTRY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PINENTRY 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ## Process this file with automake to produce Makefile.in -bin_PROGRAMS = pinentry-qt4 +bin_PROGRAMS = pinentry-qt EXTRA_DIST = document-encrypt.png pinentry.qrc if FALLBACK_CURSES ncurses_include = $(NCURSES_INCLUDE) libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV) else ncurses_include = libcurses = endif AM_CPPFLAGS = $(COMMON_CFLAGS) \ -I$(top_srcdir) -I$(top_srcdir)/secmem \ $(ncurses_include) -I$(top_srcdir)/pinentry -AM_CXXFLAGS = $(QT4_CORE_CFLAGS) $(QT4_GUI_CFLAGS) -pinentry_qt4_LDADD = \ +AM_CXXFLAGS = $(PINENTRY_QT_CFLAGS) +pinentry_qt_LDADD = \ ../pinentry/libpinentry.a $(top_builddir)/secmem/libsecmem.a \ - $(COMMON_LIBS) $(QT4_CORE_LIBS) $(QT4_GUI_LIBS) $(libcurses) $(LIBCAP) + $(COMMON_LIBS) $(PINENTRY_QT_LIBS) $(libcurses) $(LIBCAP) BUILT_SOURCES = \ pinentryconfirm.moc pinentrydialog.moc CLEANFILES = \ pinentryconfirm.moc pinentrydialog.moc -pinentry_qt4_SOURCES = pinentrydialog.h pinentrydialog.cpp \ +pinentry_qt_SOURCES = pinentrydialog.h pinentrydialog.cpp \ main.cpp qrc_pinentry.cpp pinentryconfirm.cpp pinentryconfirm.h -nodist_pinentry_qt4_SOURCES = \ +nodist_pinentry_qt_SOURCES = \ pinentryconfirm.moc pinentrydialog.moc .h.moc: $(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@ diff --git a/qt4/document-encrypt.png b/qt/document-encrypt.png similarity index 100% rename from qt4/document-encrypt.png rename to qt/document-encrypt.png diff --git a/qt4/main.cpp b/qt/main.cpp similarity index 97% rename from qt4/main.cpp rename to qt/main.cpp index 5bc6193..0500b7a 100644 --- a/qt4/main.cpp +++ b/qt/main.cpp @@ -1,316 +1,316 @@ /* - main.cpp - A (not yet) secure Qt 4 dialog for PIN entry. + main.cpp - A Qt dialog for PIN entry. Copyright (C) 2002, 2008 Klarälvdalens Datakonsult AB (KDAB) Copyright (C) 2003 g10 Code GmbH Copyright 2007 Ingo Klöcker Written by Steffen Hansen . Modified by Marcus Brinkmann . Modified by Marc Mutz This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "pinentryconfirm.h" #include "pinentrydialog.h" #include "pinentry.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef FALLBACK_CURSES #include #endif static QString escape_accel( const QString & s ) { QString result; result.reserve( s.size() ); bool afterUnderscore = false; for ( unsigned int i = 0, end = s.size() ; i != end ; ++i ) { const QChar ch = s[i]; if ( ch == QLatin1Char( '_' ) ) { if ( afterUnderscore ) // escaped _ { result += QLatin1Char( '_' ); afterUnderscore = false; } else // accel { afterUnderscore = true; } } else { if ( afterUnderscore || // accel ch == QLatin1Char( '&' ) ) // escape & from being interpreted by Qt result += QLatin1Char( '&' ); result += ch; afterUnderscore = false; } } if ( afterUnderscore ) // trailing single underscore: shouldn't happen, but deal with it robustly: result += QLatin1Char( '_' ); return result; } /* Hack for creating a QWidget with a "foreign" window ID */ class ForeignWidget : public QWidget { public: explicit ForeignWidget( WId wid ) : QWidget( 0 ) { QWidget::destroy(); create( wid, false, false ); } ~ForeignWidget() { destroy( false, false ); } }; namespace { class InvalidUtf8 : public std::invalid_argument { public: InvalidUtf8() : std::invalid_argument( "invalid utf8" ) {} ~InvalidUtf8() throw() {} }; } static const bool GPG_AGENT_IS_PORTED_TO_ONLY_SEND_UTF8 = false; static QString from_utf8( const char * s ) { const QString result = QString::fromUtf8( s ); if ( result.contains( QChar::ReplacementCharacter ) ) { if ( GPG_AGENT_IS_PORTED_TO_ONLY_SEND_UTF8 ) throw InvalidUtf8(); else return QString::fromLocal8Bit( s ); } return result; } static int qt_cmd_handler (pinentry_t pe) { QWidget *parent = 0; /* FIXME: Add parent window ID to pinentry and GTK. */ if (pe->parent_wid) parent = new ForeignWidget ((WId) pe->parent_wid); int want_pass = !!pe->pin; const QString ok = pe->ok ? escape_accel( from_utf8( pe->ok ) ) : pe->default_ok ? escape_accel( from_utf8( pe->default_ok ) ) : /* else */ QLatin1String( "&OK" ) ; const QString cancel = pe->cancel ? escape_accel( from_utf8( pe->cancel ) ) : pe->default_cancel ? escape_accel( from_utf8( pe->default_cancel ) ) : /* else */ QLatin1String( "&Cancel" ) ; const QString title = pe->title ? from_utf8( pe->title ) : - /* else */ QLatin1String( "pinentry-qt4" ) ; + /* else */ QLatin1String( "pinentry-qt" ) ; if (want_pass) { PinEntryDialog pinentry (parent, 0, pe->timeout, true, !!pe->quality_bar); pinentry.setPinentryInfo (pe); pinentry.setPrompt (escape_accel (from_utf8 (pe->prompt)) ); pinentry.setDescription (from_utf8 (pe->description)); if ( pe->title ) pinentry.setWindowTitle( from_utf8( pe->title ) ); /* If we reuse the same dialog window. */ pinentry.setPin (QString()); pinentry.setOkText (ok); pinentry.setCancelText (cancel); if (pe->error) pinentry.setError (from_utf8 (pe->error)); if (pe->quality_bar) pinentry.setQualityBar (from_utf8 (pe->quality_bar)); if (pe->quality_bar_tt) pinentry.setQualityBarTT (from_utf8 (pe->quality_bar_tt)); bool ret = pinentry.exec (); if (!ret) return -1; const char *pin = pinentry.pin().toUtf8().constData(); int len = strlen (pin); if (len >= 0) { pinentry_setbufferlen (pe, len + 1); if (pe->pin) { strcpy (pe->pin, pin); return len; } } return -1; } else { const QString desc = pe->description ? from_utf8 ( pe->description ) : QString(); const QString notok = pe->notok ? escape_accel (from_utf8 ( pe->notok )) : QString(); const QMessageBox::StandardButtons buttons = pe->one_button ? QMessageBox::Ok : pe->notok ? QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel : /* else */ QMessageBox::Ok|QMessageBox::Cancel ; PinentryConfirm box( QMessageBox::Information, pe->timeout, title, desc, buttons, parent ); const struct { QMessageBox::StandardButton button; QString label; } buttonLabels[] = { { QMessageBox::Ok, ok }, { QMessageBox::Yes, ok }, { QMessageBox::No, notok }, { QMessageBox::Cancel, cancel }, }; for ( size_t i = 0 ; i < sizeof buttonLabels / sizeof *buttonLabels ; ++i ) if ( (buttons & buttonLabels[i].button) && !buttonLabels[i].label.isEmpty() ) { box.button( buttonLabels[i].button )->setText( buttonLabels[i].label ); #ifndef QT_NO_ACCESSIBILITY box.button( buttonLabels[i].button )->setAccessibleDescription ( buttonLabels[i].label ); #endif } box.setIconPixmap( icon() ); if ( !pe->one_button ) box.setDefaultButton( QMessageBox::Cancel ); box.show(); raiseWindow( &box ); const int rc = box.exec(); if ( rc == QMessageBox::Cancel ) pe->canceled = true; return rc == QMessageBox::Ok || rc == QMessageBox::Yes ; } } static int qt_cmd_handler_ex (pinentry_t pe) { try { return qt_cmd_handler (pe); } catch ( const InvalidUtf8 & ) { pe->locale_err = true; return pe->pin ? -1 : false ; } catch ( ... ) { pe->canceled = true; return pe->pin ? -1 : false ; } } pinentry_cmd_handler_t pinentry_cmd_handler = qt_cmd_handler_ex; int main (int argc, char *argv[]) { - pinentry_init ("pinentry-qt4"); + pinentry_init ("pinentry-qt"); std::auto_ptr app; #ifdef FALLBACK_CURSES if (!pinentry_have_display (argc, argv)) pinentry_cmd_handler = curses_cmd_handler; else #endif { /* Qt does only understand -display but not --display; thus we are fixing that here. The code is pretty simply and may get confused if an argument is called "--display". */ char **new_argv, *p; size_t n; int i, done; for (n=0,i=0; i < argc; i++) n += strlen (argv[i])+1; n++; new_argv = (char**)calloc (argc+1, sizeof *new_argv); if (new_argv) *new_argv = (char*)malloc (n); if (!new_argv || !*new_argv) { - fprintf (stderr, "pinentry-qt4: can't fixup argument list: %s\n", + fprintf (stderr, "pinentry-qt: can't fixup argument list: %s\n", strerror (errno)); exit (EXIT_FAILURE); } for (done=0,p=*new_argv,i=0; i < argc; i++) if (!done && !strcmp (argv[i], "--display")) { new_argv[i] = strcpy (p, argv[i]+1); p += strlen (argv[i]+1) + 1; done = 1; } else { new_argv[i] = strcpy (p, argv[i]); p += strlen (argv[i]) + 1; } /* We use a modal dialog window, so we don't need the application window anymore. */ i = argc; app.reset (new QApplication (i, new_argv)); const QIcon icon( QLatin1String( ":/document-encrypt.png" ) ); app->setWindowIcon( icon ); } pinentry_parse_opts (argc, argv); return pinentry_loop () ? EXIT_FAILURE : EXIT_SUCCESS ; } diff --git a/qt4/pinentry.qrc b/qt/pinentry.qrc similarity index 100% rename from qt4/pinentry.qrc rename to qt/pinentry.qrc diff --git a/qt4/pinentryconfirm.cpp b/qt/pinentryconfirm.cpp similarity index 100% rename from qt4/pinentryconfirm.cpp rename to qt/pinentryconfirm.cpp diff --git a/qt4/pinentryconfirm.h b/qt/pinentryconfirm.h similarity index 100% rename from qt4/pinentryconfirm.h rename to qt/pinentryconfirm.h diff --git a/qt4/pinentrydialog.cpp b/qt/pinentrydialog.cpp similarity index 99% rename from qt4/pinentrydialog.cpp rename to qt/pinentrydialog.cpp index bfbb71d..c7885d3 100644 --- a/qt4/pinentrydialog.cpp +++ b/qt/pinentrydialog.cpp @@ -1,353 +1,353 @@ /* pinentrydialog.cpp - A (not yet) secure Qt 4 dialog for PIN entry. Copyright (C) 2002, 2008 Klarälvdalens Datakonsult AB (KDAB) Copyright 2007 Ingo Klöcker Written by Steffen Hansen . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "pinentrydialog.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef Q_WS_WIN #include #endif /* I [wk] have no idea for what this code was supposed to do. Foregrounding a window is heavily restricted by modern Windows versions. This is the reason why gpg-agent employs its AllowSetForegroundWindow callback machinery to ask the supposed to be be calling process to allow a pinentry to go into the foreground. [ah] This is a Hack to workaround the fact that Foregrounding a Window is so restricted that it AllowSetForegroundWindow does not always work (e.g. when the ForegroundWindow timeout has not expired. */ #ifdef Q_WS_WIN WINBOOL SetForegroundWindowEx( HWND hWnd ) { //Attach foreground window thread to our thread const DWORD ForeGroundID = GetWindowThreadProcessId(::GetForegroundWindow(),NULL); const DWORD CurrentID = GetCurrentThreadId(); WINBOOL retval; AttachThreadInput ( ForeGroundID, CurrentID, TRUE ); //Do our stuff here HWND hLastActivePopupWnd = GetLastActivePopup( hWnd ); retval = SetForegroundWindow( hLastActivePopupWnd ); //Detach the attached thread AttachThreadInput ( ForeGroundID, CurrentID, FALSE ); return retval; }// End SetForegroundWindowEx #endif void raiseWindow( QWidget* w ) { /* Maybe Qt will become agressive enough one day that * this is enough on windows too*/ w->raise(); #ifdef Q_WS_WIN /* In the meantime we do our own attention grabbing */ if (!SetForegroundWindow (w->winId()) && !SetForegroundWindowEx (w->winId())) { OutputDebugString("SetForegroundWindow (ex) failed"); /* Yet another fallback which will not work on some * versions and is not recommended by msdn */ if (!ShowWindow (w->winId(), SW_SHOWNORMAL)) { OutputDebugString ("ShowWindow failed."); } } #endif } QPixmap icon( QStyle::StandardPixmap which ) { QPixmap pm = qApp->windowIcon().pixmap( 48, 48 ); - + if ( which != QStyle::SP_CustomBase ) { const QIcon ic = qApp->style()->standardIcon( which ); QPainter painter( &pm ); const int emblemSize = 22; painter.drawPixmap( pm.width()-emblemSize, 0, ic.pixmap( emblemSize, emblemSize ) ); } return pm; } void PinEntryDialog::slotTimeout() { reject(); } PinEntryDialog::PinEntryDialog( QWidget* parent, const char* name, int timeout, bool modal, bool enable_quality_bar ) : QDialog( parent, Qt::WindowStaysOnTopHint ), _grabbed( false ) { setWindowFlags( windowFlags() & ~Qt::WindowContextHelpButtonHint ); if ( modal ) { setWindowModality( Qt::ApplicationModal ); } _icon = new QLabel( this ); _icon->setPixmap( icon() ); _error = new QLabel( this ); _error->setWordWrap(true); QPalette pal; pal.setColor( QPalette::WindowText, Qt::red ); _error->setPalette( pal ); _error->hide(); _desc = new QLabel( this ); _desc->setWordWrap(true); _desc->hide(); _prompt = new QLabel( this ); _prompt->hide(); _edit = new QLineEdit( this ); _edit->setMaxLength( 256 ); _edit->setEchoMode( QLineEdit::Password ); _prompt->setBuddy( _edit ); if (enable_quality_bar) { _quality_bar_label = new QLabel( this ); _quality_bar_label->setAlignment( Qt::AlignRight | Qt::AlignVCenter ); _quality_bar = new QProgressBar( this ); _quality_bar->setAlignment( Qt::AlignCenter ); _have_quality_bar = true; } else _have_quality_bar = false; QDialogButtonBox* const buttons = new QDialogButtonBox( this ); buttons->setStandardButtons( QDialogButtonBox::Ok | QDialogButtonBox::Cancel ); _ok = buttons->button( QDialogButtonBox::Ok ); _cancel = buttons->button( QDialogButtonBox::Cancel ); _ok->setDefault(true); if ( style()->styleHint( QStyle::SH_DialogButtonBox_ButtonsHaveIcons ) ) { _ok->setIcon( style()->standardIcon( QStyle::SP_DialogOkButton ) ); _cancel->setIcon( style()->standardIcon( QStyle::SP_DialogCancelButton ) ); } if (timeout > 0) { _timer = new QTimer(this); connect(_timer, SIGNAL(timeout()), this, SLOT(slotTimeout())); _timer->start(timeout*1000); } else _timer = NULL; connect( buttons, SIGNAL(accepted()), this, SLOT(accept()) ); connect( buttons, SIGNAL(rejected()), this, SLOT(reject()) ); connect( _edit, SIGNAL( textChanged(QString) ), this, SLOT( updateQuality(QString) ) ); _edit->setFocus(); QGridLayout* const grid = new QGridLayout( this ); grid->addWidget( _icon, 0, 0, 5, 1, Qt::AlignTop|Qt::AlignLeft ); grid->addWidget( _error, 1, 1, 1, 2 ); grid->addWidget( _desc, 2, 1, 1, 2 ); //grid->addItem( new QSpacerItem( 0, _edit->height() / 10, QSizePolicy::Minimum, QSizePolicy::Fixed ), 1, 1 ); grid->addWidget( _prompt, 3, 1 ); grid->addWidget( _edit, 3, 2 ); if( enable_quality_bar ) { grid->addWidget( _quality_bar_label, 4, 1 ); grid->addWidget( _quality_bar, 4, 2 ); } grid->addWidget( buttons, 5, 0, 1, 3 ); grid->setSizeConstraint( QLayout::SetFixedSize ); } void PinEntryDialog::hideEvent( QHideEvent* ev ) { if ( !_pinentry_info || _pinentry_info->grab ) _edit->releaseKeyboard(); _grabbed = false; QDialog::hideEvent( ev ); } void PinEntryDialog::showEvent( QShowEvent* event ) { QDialog::showEvent( event ); raiseWindow( this ); } void PinEntryDialog::setDescription( const QString& txt ) { _desc->setVisible( !txt.isEmpty() ); _desc->setText( txt ); #ifndef QT_NO_ACCESSIBILITY _desc->setAccessibleDescription ( txt ); #endif _icon->setPixmap( icon() ); setError( QString::null ); } QString PinEntryDialog::description() const { return _desc->text(); } void PinEntryDialog::setError( const QString& txt ) { if( !txt.isNull() )_icon->setPixmap( icon( QStyle::SP_MessageBoxCritical ) ); _error->setText( txt ); #ifndef QT_NO_ACCESSIBILITY _error->setAccessibleDescription ( txt ); #endif _error->setVisible( !txt.isEmpty() ); } QString PinEntryDialog::error() const { return _error->text(); } void PinEntryDialog::setPin( const QString & txt ) { _edit->setText( txt ); } QString PinEntryDialog::pin() const { return _edit->text(); } void PinEntryDialog::setPrompt( const QString& txt ) { _prompt->setText( txt ); _prompt->setVisible( !txt.isEmpty() ); } QString PinEntryDialog::prompt() const { return _prompt->text(); } void PinEntryDialog::setOkText( const QString& txt ) { _ok->setText( txt ); #ifndef QT_NO_ACCESSIBILITY _ok->setAccessibleDescription ( txt ); #endif _ok->setVisible( !txt.isEmpty() ); } void PinEntryDialog::setCancelText( const QString& txt ) { _cancel->setText( txt ); #ifndef QT_NO_ACCESSIBILITY _cancel->setAccessibleDescription ( txt ); #endif _cancel->setVisible( !txt.isEmpty() ); } void PinEntryDialog::setQualityBar( const QString& txt ) { if (_have_quality_bar) { _quality_bar_label->setText( txt ); #ifndef QT_NO_ACCESSIBILITY _quality_bar_label->setAccessibleDescription ( txt ); #endif } } void PinEntryDialog::setQualityBarTT( const QString& txt ) { if (_have_quality_bar) _quality_bar->setToolTip( txt ); } void PinEntryDialog::updateQuality(const QString & txt ) { int length; int percent; QPalette pal; if (_timer) _timer->stop(); if (!_have_quality_bar || !_pinentry_info) return; const char* pin = txt.toUtf8().constData(); length = strlen (pin); percent = length? pinentry_inq_quality (_pinentry_info, pin, length) : 0; if (!length) { _quality_bar->reset (); } else { pal = _quality_bar->palette (); if (percent < 0) { pal.setColor (QPalette::Highlight, QColor("red")); percent = -percent; } else { pal.setColor (QPalette::Highlight, QColor("green")); } _quality_bar->setPalette (pal); _quality_bar->setValue (percent); } } void PinEntryDialog::setPinentryInfo(pinentry_t peinfo) { _pinentry_info = peinfo; } void PinEntryDialog::paintEvent( QPaintEvent* event ) { // Grab keyboard. It might be a little weird to do it here, but it works! // Previously this code was in showEvent, but that did not work in Qt4. QDialog::paintEvent( event ); if ( !_grabbed && ( !_pinentry_info || _pinentry_info->grab ) ) { _edit->grabKeyboard(); _grabbed = true; } } #include "pinentrydialog.moc" diff --git a/qt4/pinentrydialog.h b/qt/pinentrydialog.h similarity index 100% rename from qt4/pinentrydialog.h rename to qt/pinentrydialog.h diff --git a/qt4/qrc_pinentry.cpp b/qt/qrc_pinentry.cpp similarity index 99% rename from qt4/qrc_pinentry.cpp rename to qt/qrc_pinentry.cpp index d15f01b..6ab2129 100644 --- a/qt4/qrc_pinentry.cpp +++ b/qt/qrc_pinentry.cpp @@ -1,180 +1,177 @@ /**************************************************************************** ** Resource object code ** ** Created: Wed Feb 17 23:35:02 2010 ** by: The Resource Compiler for Qt version 4.4.3 ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include static const unsigned char qt_resource_data[] = { // /home/marc/KDE/src/gnupg-backend/pinentry/qt4/document-encrypt.png 0x0,0x0,0x7,0x2b, 0x89, 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, 0x0,0x0,0x30,0x0,0x0,0x0,0x30,0x8,0x6,0x0,0x0,0x0,0x57,0x2,0xf9,0x87, 0x0,0x0,0x0,0x4,0x73,0x42,0x49,0x54,0x8,0x8,0x8,0x8,0x7c,0x8,0x64,0x88, 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x5,0x31,0x0,0x0,0x5,0x31, 0x1,0xb7,0xed,0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2,0xdd,0xd7, 0x25,0xd9,0x67,0x9c,0x5c,0x99,0xf8,0x59,0x8e,0xbf,0x37,0x66,0x76,0x2c,0x89,0x6d, 0x26,0x94,0x67,0xf7,0xff,0x26,0xdd,0x1d,0x7f,0xca,0xc6,0x52,0x28,0xeb,0xeb,0x4d, 0xb8,0x7,0x65,0x65,0x63,0xc3,0x0,0x56,0x36,0x36,0x45,0x4a,0x81,0x91,0x4d,0xeb, 0xa4,0xa4,0x88,0x25,0xb,0x80,0x0,0x94,0x34,0x92,0x27,0xf2,0x84,0x95,0x2,0x1c, 0x97,0x2f,0x20,0x81,0x5b,0x9c,0x34,0x17,0x80,0xf6,0xb2,0x74,0xf4,0x64,0xa5,0xe9, 0xb9,0xd7,0xc5,0xb4,0x3d,0x2f,0xc5,0xb9,0x62,0x7a,0x55,0xc8,0x18,0x7,0x65,0x8a, 0x92,0x33,0xeb,0x52,0xce,0xc4,0xb2,0x89,0x1d,0xd6,0x4c,0x20,0xad,0x90,0x65,0x44, 0x43,0x58,0xe0,0x15,0x81,0xb0,0x12,0x58,0x86,0x1a,0xde,0x81,0xcc,0x6,0xec,0x43, 0xe2,0x1d,0x95,0x58,0x97,0x6b,0x1,0x89,0x56,0x10,0x6c,0xc5,0x73,0x4b,0x9f,0x2e, 0xc4,0x9b,0xc,0xad,0x74,0x8,0x50,0xa9,0x28,0x22,0x2,0x71,0x84,0x33,0x12,0x39, 0xc6,0x32,0x89,0x19,0x82,0x4a,0x60,0xdc,0xa2,0xaf,0x74,0x1,0x84,0x90,0xce,0x13, 0xb1,0x44,0x92,0xc1,0x12,0x23,0xb1,0xe5,0xd7,0x1d,0xd6,0xc6,0x80,0xc3,0x1c,0xde, 0xe1,0x46,0x0,0xae,0x16,0xe9,0x10,0xb0,0x96,0xd6,0x73,0x30,0x25,0x3e,0x8a,0x8f, 0x84,0xb4,0x96,0xe8,0x4c,0x95,0x0,0x3e,0xc,0x38,0x6b,0x34,0x74,0x38,0x19,0x83, 0x44,0x88,0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f,0x30,0x9c,0x48,0x9f,0x0,0x13,0x53,0xc1,0xaa,0xe1, 0xe3,0x9f,0xa,0xb8,0x38,0xa2,0xf2,0xe8,0xf8,0x3c,0xd4,0x6b,0x83,0xf5,0x57,0x8a, 0x8,0x10,0x26,0x31,0x43,0x9,0xf0,0x21,0x87,0x7e,0xc,0xb8,0xdd,0xfc,0x99,0xd5, 0xd7,0x7f,0xf,0x25,0x61,0xab,0xca,0x9,0x9,0xb0,0x2f,0xc9,0x19,0x91,0x24,0x7d, 0x42,0x64,0xb7,0x8,0x38,0x47,0xc4,0x2a,0x13,0xab,0xd6,0xa2,0x76,0x6d,0x1d,0x59, 0xc0,0xed,0x2e,0x1,0x7f,0x18,0x29,0x1e,0x55,0x6a,0x3d,0x89,0xda,0xd2,0x5b,0x87, 0x54,0xff,0x5b,0x25,0xfd,0xf6,0x14,0x12,0x48,0xe1,0x97,0x7a,0x5f,0xce,0x32,0x40, 0xf0,0x18,0x58,0x2f,0x13,0x18,0x2f,0x89,0xfa,0xe6,0xaa,0x88,0xbd,0x4c,0x10,0x3d, 0x94,0x8f,0x41,0x48,0x9d,0x6b,0x9,0x50,0xe9,0xa0,0xaa,0x74,0x96,0x72,0x87,0x61, 0xab,0x8a,0x85,0x3b,0x88,0xa,0x50,0x66,0xff,0xbf,0x3c,0x60,0xeb,0x91,0x58,0xfd, 0x31,0xb0,0x89,0xe2,0xa,0xa9,0xb3,0xb4,0x87,0x7f,0xe,0xeb,0x3d,0x50,0xef,0x1d, 0xc2,0xfd,0x4b,0xe1,0x7f,0x0,0xd8,0x6e,0xc6,0xdd,0x5d,0xd6,0xb,0x18,0x0,0x0, 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - }; static const unsigned char qt_resource_name[] = { // document-encrypt.png 0x0,0x14, 0x8,0xbf,0x25,0x67, 0x0,0x64, 0x0,0x6f,0x0,0x63,0x0,0x75,0x0,0x6d,0x0,0x65,0x0,0x6e,0x0,0x74,0x0,0x2d,0x0,0x65,0x0,0x6e,0x0,0x63,0x0,0x72,0x0,0x79,0x0,0x70,0x0,0x74,0x0,0x2e, 0x0,0x70,0x0,0x6e,0x0,0x67, - }; static const unsigned char qt_resource_struct[] = { // : 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, // :/document-encrypt.png 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, }; QT_BEGIN_NAMESPACE extern bool qRegisterResourceData (int, const unsigned char *, const unsigned char *, const unsigned char *); extern bool qUnregisterResourceData (int, const unsigned char *, const unsigned char *, const unsigned char *); QT_END_NAMESPACE int QT_MANGLE_NAMESPACE(qInitResources_pinentry)() { QT_PREPEND_NAMESPACE(qRegisterResourceData) (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); return 1; } Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_pinentry)) int QT_MANGLE_NAMESPACE(qCleanupResources_pinentry)() { QT_PREPEND_NAMESPACE(qUnregisterResourceData) (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); return 1; } Q_DESTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qCleanupResources_pinentry)) -