From 417c2fc26dedefcc7290adcd925c6b3ef656345f Mon Sep 17 00:00:00 2001 From: Lincoln de Sousa Date: Tue, 24 Mar 2009 16:04:42 -0300 Subject: [PATCH] Adding an entry in the preferences menu to prefs windows. It is important to users that hides trayicon and needs to configure guake or just want to configure it without open it. --- .gitignore | 1 + configure.ac | 2 ++ data/Makefile.am | 2 +- data/guake-prefs.desktop.in | 14 ++++++++ m4/intltool.m4 | 64 +++++++++++++++++++++++-------------- po/POTFILES.in | 1 + src/Makefile.am | 2 +- src/guake-prefs.in | 24 ++++++++++++++ 8 files changed, 84 insertions(+), 26 deletions(-) create mode 100644 data/guake-prefs.desktop.in create mode 100644 src/guake-prefs.in diff --git a/.gitignore b/.gitignore index 4e9e13a6..27c161d7 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,6 @@ org.gnome.Guake.service Makefile.in.in guake_globals.py guake +guake-prefs autom4te.cache POTFILES \ No newline at end of file diff --git a/configure.ac b/configure.ac index 1ac0bfe6..154db8b5 100644 --- a/configure.ac +++ b/configure.ac @@ -94,6 +94,7 @@ AC_CONFIG_FILES([ Makefile data/Makefile data/guake.desktop + data/guake-prefs.desktop data/org.gnome.Guake.service data/pixmaps/Makefile po/Makefile.in @@ -101,6 +102,7 @@ AC_CONFIG_FILES([ src/globalhotkeys/Makefile src/guake_globals.py src/guake + src/guake-prefs ]) AC_OUTPUT diff --git a/data/Makefile.am b/data/Makefile.am index b5d592a6..74b01c5f 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -15,7 +15,7 @@ service_DATA = $(service_in_files:.service.in=.service) @INTLTOOL_DESKTOP_RULE@ desktopdir = $(datadir)/applications -desktop_in_files = guake.desktop.in +desktop_in_files = guake.desktop.in guake-prefs.desktop.in desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) @INTLTOOL_SCHEMAS_RULE@ diff --git a/data/guake-prefs.desktop.in b/data/guake-prefs.desktop.in new file mode 100644 index 00000000..c4b208d8 --- /dev/null +++ b/data/guake-prefs.desktop.in @@ -0,0 +1,14 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Guake Preferences +Name[pt_BR]=Preferências do Guake +Comment=Comment=Configure your Guake sessions +Comment[pt_BR]=Configurações do terminal Guake +TryExec=guake-prefs +Exec=guake-prefs +Icon=@DATADIR@/pixmaps/guake/guake.png +Terminal=false +Type=Application +StartupNotify=true +Categories=GTK;GNOME;Settings;X-GNOME-PersonalSettings; +X-Desktop-File-Install-Version=0.15 diff --git a/m4/intltool.m4 b/m4/intltool.m4 index 563981c7..122d773d 100644 --- a/m4/intltool.m4 +++ b/m4/intltool.m4 @@ -75,25 +75,25 @@ INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcar INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' -AC_SUBST(INTLTOOL_DESKTOP_RULE) -AC_SUBST(INTLTOOL_DIRECTORY_RULE) -AC_SUBST(INTLTOOL_KEYS_RULE) -AC_SUBST(INTLTOOL_PROP_RULE) -AC_SUBST(INTLTOOL_OAF_RULE) -AC_SUBST(INTLTOOL_PONG_RULE) -AC_SUBST(INTLTOOL_SERVER_RULE) -AC_SUBST(INTLTOOL_SHEET_RULE) -AC_SUBST(INTLTOOL_SOUNDLIST_RULE) -AC_SUBST(INTLTOOL_UI_RULE) -AC_SUBST(INTLTOOL_XAM_RULE) -AC_SUBST(INTLTOOL_KBD_RULE) -AC_SUBST(INTLTOOL_XML_RULE) -AC_SUBST(INTLTOOL_XML_NOMERGE_RULE) -AC_SUBST(INTLTOOL_CAVES_RULE) -AC_SUBST(INTLTOOL_SCHEMAS_RULE) -AC_SUBST(INTLTOOL_THEME_RULE) -AC_SUBST(INTLTOOL_SERVICE_RULE) -AC_SUBST(INTLTOOL_POLICY_RULE) +_IT_SUBST(INTLTOOL_DESKTOP_RULE) +_IT_SUBST(INTLTOOL_DIRECTORY_RULE) +_IT_SUBST(INTLTOOL_KEYS_RULE) +_IT_SUBST(INTLTOOL_PROP_RULE) +_IT_SUBST(INTLTOOL_OAF_RULE) +_IT_SUBST(INTLTOOL_PONG_RULE) +_IT_SUBST(INTLTOOL_SERVER_RULE) +_IT_SUBST(INTLTOOL_SHEET_RULE) +_IT_SUBST(INTLTOOL_SOUNDLIST_RULE) +_IT_SUBST(INTLTOOL_UI_RULE) +_IT_SUBST(INTLTOOL_XAM_RULE) +_IT_SUBST(INTLTOOL_KBD_RULE) +_IT_SUBST(INTLTOOL_XML_RULE) +_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) +_IT_SUBST(INTLTOOL_CAVES_RULE) +_IT_SUBST(INTLTOOL_SCHEMAS_RULE) +_IT_SUBST(INTLTOOL_THEME_RULE) +_IT_SUBST(INTLTOOL_SERVICE_RULE) +_IT_SUBST(INTLTOOL_POLICY_RULE) # Check the gettext tools to make sure they are GNU AC_PATH_PROG(XGETTEXT, xgettext) @@ -110,12 +110,17 @@ if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi -AC_PATH_PROG(INTLTOOL_PERL, [perl]) +AC_PATH_PROG(INTLTOOL_PERL, perl) if test -z "$INTLTOOL_PERL"; then - AC_MSG_ERROR([perl not found; required for intltool]) + AC_MSG_ERROR([perl not found]) fi -if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then - AC_MSG_ERROR([perl 5.x required for intltool]) +AC_MSG_CHECKING([for perl >= 5.8.1]) +$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 +if test $? -ne 0; then + AC_MSG_ERROR([perl 5.8.1 is required for intltool]) +else + IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`" + AC_MSG_RESULT([$IT_PERL_VERSION]) fi if test "x$2" != "xno-xml"; then AC_MSG_CHECKING([for XML::Parser]) @@ -171,7 +176,7 @@ dnl The following CONFIG_COMMANDS should be exetuted at the very end dnl of config.status. AC_CONFIG_COMMANDS_PRE([ AC_CONFIG_COMMANDS([$1/stamp-it], [ - if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" ]; then + if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) fi rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" @@ -193,6 +198,17 @@ AC_CONFIG_COMMANDS_PRE([ ])dnl ]) +# _IT_SUBST(VARIABLE) +# ------------------- +# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST +# +AC_DEFUN([_IT_SUBST], +[ +AC_SUBST([$1]) +m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) +] +) + # deprecated macros AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) # A hint is needed for aclocal from Automake <= 1.9.4: diff --git a/po/POTFILES.in b/po/POTFILES.in index 88765e58..bce7336a 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -3,6 +3,7 @@ data/about.glade data/guake.glade data/prefs.glade data/guake.desktop.in +data/guake-prefs.desktop.in src/dbusiface.py src/guake.py src/prefs.py diff --git a/src/Makefile.am b/src/Makefile.am index 4da2fea9..6778393b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ SUBDIRS = globalhotkeys guakedir = $(bindir) -bin_SCRIPTS = guake +bin_SCRIPTS = guake guake-prefs guakelibdir = $(libdir)/guake guakelib_DATA = \ diff --git a/src/guake-prefs.in b/src/guake-prefs.in new file mode 100644 index 00000000..fb549ac7 --- /dev/null +++ b/src/guake-prefs.in @@ -0,0 +1,24 @@ +#!/bin/bash +# +# Copyright (C) 2009 Lincoln de Sousa +# +# 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., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +GUAKEPATH="@LIBDIR@/guake" +PYTHONPATH="$PYTHONPATH:$GUAKEPATH" +PYTHON="/usr/bin/python" + +exec -a guake-prefs $PYTHON -OO $GUAKEPATH/prefs.py $@