ClipIt-1.4.0-20110518001

+ Fixed: Re-enabled indicator support.
+ Added: We are now installing a sepparate icon for clipit (not using it
		yet, though).
+ Added: Search as you type in "Manage history" dialog.
+ Added: 1-0 shortcuts for fast selecting of menu items.
+ Added: Possiblity to select multiple items for deletion in the
		"Manage history" dialog.

Changes to be committed:

	modified:   ChangeLog
	modified:   Makefile.am
	modified:   Makefile.in
	modified:   TODO
	modified:   configure
	modified:   configure.in
	modified:   data/Makefile.am
	modified:   data/Makefile.in
	new file:   data/trayicon.svg
	modified:   src/Makefile.am
	modified:   src/Makefile.in
	modified:   src/main.c
	modified:   src/manage.c
This commit is contained in:
Cristian Henzel 2011-05-18 15:24:54 +03:00
parent bcedbfd1a5
commit 5d567d72ec
13 changed files with 394 additions and 88 deletions

View File

@ -1,3 +1,12 @@
ClipIt-1.4.0-20110518001 - 18 May. 2011
+ Fixed: Re-enabled indicator support.
+ Added: We are now installing a sepparate icon for clipit (not using it
yet, though).
+ Added: Search as you type in "Manage history" dialog.
+ Added: 1-0 shortcuts for fast selecting of menu items.
+ Added: Possiblity to select multiple items for deletion in the
"Manage history" dialog.
ClipIt-1.4.0-20110506001 - 06 May. 2011 ClipIt-1.4.0-20110506001 - 06 May. 2011
+ Added: Added option to automatically paste an entry after selecting it. + Added: Added option to automatically paste an entry after selecting it.
+ Fixed: Re-enabled indicator since it should now work properly. + Fixed: Re-enabled indicator since it should now work properly.

View File

@ -11,6 +11,7 @@ EXTRA_DIST = \
m4/ChangeLog \ m4/ChangeLog \
$(desktop_DATA) \ $(desktop_DATA) \
$(autostart_DATA) \ $(autostart_DATA) \
$(pixmaps_DATA) \
intltool-merge.in \ intltool-merge.in \
intltool-update.in \ intltool-update.in \
intltool-extract.in intltool-extract.in

View File

@ -259,6 +259,7 @@ EXTRA_DIST = \
m4/ChangeLog \ m4/ChangeLog \
$(desktop_DATA) \ $(desktop_DATA) \
$(autostart_DATA) \ $(autostart_DATA) \
$(pixmaps_DATA) \
intltool-merge.in \ intltool-merge.in \
intltool-update.in \ intltool-update.in \
intltool-extract.in intltool-extract.in

2
TODO
View File

@ -5,3 +5,5 @@
+ Redo Preferences dialog. + Redo Preferences dialog.
+ Clean up the code and indent it properly. + Clean up the code and indent it properly.
+ Move all pop-up and menu functions from main.c to menus.c. + Move all pop-up and menu functions from main.c to menus.c.
+ Use the shipped icon in the display.
+ Fix the allowed keys in the manage history dialog.

22
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.67 for clipit 1.3.13. # Generated by GNU Autoconf 2.67 for clipit 1.4.0.
# #
# Report bugs to <oss@rspwn.com>. # Report bugs to <oss@rspwn.com>.
# #
@ -552,8 +552,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='clipit' PACKAGE_NAME='clipit'
PACKAGE_TARNAME='clipit' PACKAGE_TARNAME='clipit'
PACKAGE_VERSION='1.3.13' PACKAGE_VERSION='1.4.0'
PACKAGE_STRING='clipit 1.3.13' PACKAGE_STRING='clipit 1.4.0'
PACKAGE_BUGREPORT='oss@rspwn.com' PACKAGE_BUGREPORT='oss@rspwn.com'
PACKAGE_URL='' PACKAGE_URL=''
@ -1328,7 +1328,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures clipit 1.3.13 to adapt to many kinds of systems. \`configure' configures clipit 1.4.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1398,7 +1398,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of clipit 1.3.13:";; short | recursive ) echo "Configuration of clipit 1.4.0:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1511,7 +1511,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
clipit configure 1.3.13 clipit configure 1.4.0
generated by GNU Autoconf 2.67 generated by GNU Autoconf 2.67
Copyright (C) 2010 Free Software Foundation, Inc. Copyright (C) 2010 Free Software Foundation, Inc.
@ -1880,7 +1880,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by clipit $as_me 1.3.13, which was It was created by clipit $as_me 1.4.0, which was
generated by GNU Autoconf 2.67. Invocation command line was generated by GNU Autoconf 2.67. Invocation command line was
$ $0 $@ $ $0 $@
@ -2696,7 +2696,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE=clipit PACKAGE=clipit
VERSION=1.3.13 VERSION=1.4.0
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -7487,7 +7487,7 @@ APPINDICATOR_REQUIRED_VERSION=0.2.4
if test "${enable_appindicator+set}" = set; then : if test "${enable_appindicator+set}" = set; then :
enableval=$enable_appindicator; enable_appindicator=$enableval enableval=$enable_appindicator; enable_appindicator=$enableval
else else
enable_appindicator="no" enable_appindicator="auto"
fi fi
@ -9764,7 +9764,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by clipit $as_me 1.3.13, which was This file was extended by clipit $as_me 1.4.0, which was
generated by GNU Autoconf 2.67. Invocation command line was generated by GNU Autoconf 2.67. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -9830,7 +9830,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
clipit config.status 1.3.13 clipit config.status 1.4.0
configured by $0, generated by GNU Autoconf 2.67, configured by $0, generated by GNU Autoconf 2.67,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View File

@ -2,7 +2,7 @@
# Autoconf/automake. # Autoconf/automake.
# ------------------------------------------------------------------------------- # -------------------------------------------------------------------------------
AC_PREREQ([2.5]) AC_PREREQ([2.5])
AC_INIT([clipit], [1.3.13], [oss@rspwn.com]) AC_INIT([clipit], [1.4.0], [oss@rspwn.com])
AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()]) AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
@ -37,7 +37,7 @@ APPINDICATOR_REQUIRED_VERSION=0.2.4
AC_ARG_ENABLE([appindicator], AC_ARG_ENABLE([appindicator],
AS_HELP_STRING([--enable-appindicator[=@<:@no/auto/yes@:>@]],[Build support for application indicators]), AS_HELP_STRING([--enable-appindicator[=@<:@no/auto/yes@:>@]],[Build support for application indicators]),
[enable_appindicator=$enableval], [enable_appindicator=$enableval],
[enable_appindicator="no"]) [enable_appindicator="auto"])
if test x$enable_appindicator = xauto ; then if test x$enable_appindicator = xauto ; then

View File

@ -8,9 +8,13 @@ autostartdir = $(sysconfdir)/xdg/autostart
autostart_in_file = clipit-startup.desktop.in autostart_in_file = clipit-startup.desktop.in
autostart_DATA = $(autostart_in_file:.desktop.in=.desktop) autostart_DATA = $(autostart_in_file:.desktop.in=.desktop)
pixmapsdir = $(datarootdir)/pixmaps/clipit
pixmaps_DATA = trayicon.svg
EXTRA_DIST = \ EXTRA_DIST = \
$(desktop_in_file) \ $(desktop_in_file) \
$(autostart_in_file) $(autostart_in_file) \
$(pixmaps_DATA)
CLEANFILES = \ CLEANFILES = \
$(desktop_DATA) \ $(desktop_DATA) \

View File

@ -73,8 +73,8 @@ am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(autostartdir)" \ am__installdirs = "$(DESTDIR)$(autostartdir)" \
"$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(pixmapsdir)"
DATA = $(autostart_DATA) $(desktop_DATA) DATA = $(autostart_DATA) $(desktop_DATA) $(pixmaps_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@ ACLOCAL = @ACLOCAL@
ALL_LINGUAS = @ALL_LINGUAS@ ALL_LINGUAS = @ALL_LINGUAS@
@ -224,9 +224,12 @@ desktop_DATA = $(desktop_in_file:.desktop.in=.desktop)
autostartdir = $(sysconfdir)/xdg/autostart autostartdir = $(sysconfdir)/xdg/autostart
autostart_in_file = clipit-startup.desktop.in autostart_in_file = clipit-startup.desktop.in
autostart_DATA = $(autostart_in_file:.desktop.in=.desktop) autostart_DATA = $(autostart_in_file:.desktop.in=.desktop)
pixmapsdir = $(datarootdir)/pixmaps/clipit
pixmaps_DATA = trayicon.svg
EXTRA_DIST = \ EXTRA_DIST = \
$(desktop_in_file) \ $(desktop_in_file) \
$(autostart_in_file) $(autostart_in_file) \
$(pixmaps_DATA)
CLEANFILES = \ CLEANFILES = \
$(desktop_DATA) \ $(desktop_DATA) \
@ -309,6 +312,26 @@ uninstall-desktopDATA:
test -n "$$files" || exit 0; \ test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(desktopdir)' && rm -f" $$files ")"; \ echo " ( cd '$(DESTDIR)$(desktopdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(desktopdir)" && rm -f $$files cd "$(DESTDIR)$(desktopdir)" && rm -f $$files
install-pixmapsDATA: $(pixmaps_DATA)
@$(NORMAL_INSTALL)
test -z "$(pixmapsdir)" || $(MKDIR_P) "$(DESTDIR)$(pixmapsdir)"
@list='$(pixmaps_DATA)'; test -n "$(pixmapsdir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pixmapsdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(pixmapsdir)" || exit $$?; \
done
uninstall-pixmapsDATA:
@$(NORMAL_UNINSTALL)
@list='$(pixmaps_DATA)'; test -n "$(pixmapsdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(pixmapsdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(pixmapsdir)" && rm -f $$files
tags: TAGS tags: TAGS
TAGS: TAGS:
@ -350,7 +373,7 @@ check-am: all-am
check: check-am check: check-am
all-am: Makefile $(DATA) all-am: Makefile $(DATA)
installdirs: installdirs:
for dir in "$(DESTDIR)$(autostartdir)" "$(DESTDIR)$(desktopdir)"; do \ for dir in "$(DESTDIR)$(autostartdir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(pixmapsdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done done
install: install-am install: install-am
@ -400,7 +423,8 @@ info: info-am
info-am: info-am:
install-data-am: install-autostartDATA install-desktopDATA install-data-am: install-autostartDATA install-desktopDATA \
install-pixmapsDATA
install-dvi: install-dvi-am install-dvi: install-dvi-am
@ -444,7 +468,8 @@ ps: ps-am
ps-am: ps-am:
uninstall-am: uninstall-autostartDATA uninstall-desktopDATA uninstall-am: uninstall-autostartDATA uninstall-desktopDATA \
uninstall-pixmapsDATA
.MAKE: install-am install-strip .MAKE: install-am install-strip
@ -454,11 +479,12 @@ uninstall-am: uninstall-autostartDATA uninstall-desktopDATA
install-data-am install-desktopDATA install-dvi install-dvi-am \ install-data-am install-desktopDATA install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \ install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \ install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \ install-pdf-am install-pixmapsDATA install-ps install-ps-am \
installcheck installcheck-am installdirs maintainer-clean \ install-strip installcheck installcheck-am installdirs \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ maintainer-clean maintainer-clean-generic mostlyclean \
pdf-am ps ps-am uninstall uninstall-am uninstall-autostartDATA \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-desktopDATA uninstall-autostartDATA uninstall-desktopDATA \
uninstall-pixmapsDATA
@INTLTOOL_DESKTOP_RULE@ @INTLTOOL_DESKTOP_RULE@

191
data/trayicon.svg Normal file
View File

@ -0,0 +1,191 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.0"
width="48"
height="48"
id="svg2">
<defs
id="defs4">
<linearGradient
id="linearGradient3620">
<stop
id="stop3622"
style="stop-color:#9d7d53;stop-opacity:1"
offset="0" />
<stop
id="stop3624"
style="stop-color:#ad8757;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient3846">
<stop
id="stop3848"
style="stop-color:#c1a581;stop-opacity:1"
offset="0" />
<stop
id="stop3850"
style="stop-color:#9b784b;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
x1="24.467497"
y1="0.47814167"
x2="25.464664"
y2="70.020134"
id="linearGradient4545"
xlink:href="#linearGradient3846"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.54289087,0,0,0.48890703,-0.0291956,-18.233335)" />
<linearGradient
id="linearGradient3600">
<stop
id="stop3602"
style="stop-color:#f4f4f4;stop-opacity:1"
offset="0" />
<stop
id="stop3604"
style="stop-color:#dbdbdb;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient3931">
<stop
id="stop3933"
style="stop-color:#747671;stop-opacity:1"
offset="0" />
<stop
id="stop3935"
style="stop-color:#cbcbcb;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
x1="25.132275"
y1="6.7287393"
x2="25.132275"
y2="47.013336"
id="linearGradient3192"
xlink:href="#linearGradient3600"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.5428805,0,0,0.4889072,18.970867,-6.233341)" />
<linearGradient
x1="-64.247643"
y1="14.969027"
x2="-22.573992"
y2="-19.797691"
id="linearGradient3194"
xlink:href="#linearGradient3931"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.4383743,0,0,0.4575444,51.223522,-6.778219)" />
<linearGradient
id="linearGradient3269">
<stop
id="stop3271"
style="stop-color:#787878;stop-opacity:1"
offset="0" />
<stop
id="stop3273"
style="stop-color:#bebebe;stop-opacity:1"
offset="0.34446934" />
<stop
id="stop3275"
style="stop-color:#c8c8c8;stop-opacity:1"
offset="0.3731544" />
<stop
id="stop3277"
style="stop-color:#e6e6e6;stop-opacity:1"
offset="0.48990577" />
<stop
id="stop3279"
style="stop-color:#8c8c8c;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient3257">
<stop
id="stop3261"
style="stop-color:#787878;stop-opacity:1"
offset="0" />
<stop
id="stop3263"
style="stop-color:#828282;stop-opacity:1"
offset="0.36563665" />
<stop
id="stop3265"
style="stop-color:#aaaaaa;stop-opacity:1"
offset="0.46209824" />
<stop
id="stop3922"
style="stop-color:#6a6a6a;stop-opacity:1"
offset="0.59657371" />
<stop
id="stop3920"
style="stop-color:#787878;stop-opacity:1"
offset="0.73104912" />
<stop
id="stop3267"
style="stop-color:#464646;stop-opacity:1"
offset="1" />
</linearGradient>
<linearGradient
x1="321.40091"
y1="83.497276"
x2="321.57819"
y2="96.245491"
id="linearGradient2964"
xlink:href="#linearGradient3269"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.41034562,0,0,0.51289447,-114.89528,-62.82218)" />
<linearGradient
x1="22.451862"
y1="26.645382"
x2="22.451862"
y2="40.185558"
id="linearGradient2966"
xlink:href="#linearGradient3257"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.41182453,0,0,0.51282072,6.5443502,-34.097634)" />
<linearGradient
x1="9.3157892"
y1="16"
x2="9.7894735"
y2="-17.999569"
id="linearGradient3626"
xlink:href="#linearGradient3620"
gradientUnits="userSpaceOnUse" />
</defs>
<g
transform="translate(0,24)"
id="layer1">
<path
d="m 3.4995742,-17.499994 26.0008518,4.3e-4 0,32.99999 -26.0008518,0 0,-33.00042 z"
id="rect2594"
style="fill:url(#linearGradient4545);fill-opacity:1;stroke:url(#linearGradient3626);stroke-width:0.99914837;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline" />
<path
d="m 4.5,-16.5 24,0 0,31 -24,0 0,-31 z"
id="path3852"
style="opacity:0.15;fill:none;stroke:#ffffff;stroke-width:0.99914837;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline" />
<path
d="m 22.49957,-5.5 22.00043,4.3e-4 0,27.000001 -22.00043,0 0,-27.000431 z"
id="path3064"
style="fill:url(#linearGradient3192);fill-opacity:1;stroke:url(#linearGradient3194);stroke-width:0.99913895;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline" />
<path
d="m 25,-1.99957 1.359538,0 0,1.00000002 -1.359538,0 0,-1.00000002 z m 1.544729,0 1.282784,0 0,1.00000002 -1.282784,0 0,-1.00000002 z m 1.467975,0 1.129269,0 0,1.00000002 -1.129269,0 0,-1.00000002 z m 1.314458,0 0.496023,0 0,1.00000002 -0.496023,0 0,-1.00000002 z m 0.68122,0 1.110075,0 0,1.00000002 -1.110075,0 0,-1.00000002 z m 1.295272,0 2.875482,0 0,1.00000002 -2.875482,0 0,-1.00000002 z m 3.060674,0 2.184672,0 0,1.00000002 -2.184672,0 0,-1.00000002 z m -9.364328,6 1.315079,0 0,1 -1.315079,0 0,-1 z m 1.494213,0 1.240835,0 0,1 -1.240835,0 0,-1 z m 1.419971,0 1.092338,0 0,1 -1.092338,0 0,-1 z m 1.271472,0 0.479802,0 0,1 -0.479802,0 0,-1 z m 0.658943,0 1.073773,0 0,1 -1.073773,0 0,-1 z m 1.252914,0 2.781449,0 0,1 -2.781449,0 0,-1 z m 2.960584,0 2.113229,0 0,1 -2.113229,0 0,-1 z m 2.29237,0 0.646852,0 0,1 -0.646852,0 0,-1 z m 0.825993,0 1.277954,0 0,1 -1.277954,0 0,-1 z M 25,4.3102435e-4 l 2.038983,0 0,0.99999997565 -2.038983,0 0,-0.99999997565 z m 2.225084,0 0.980966,0 0,0.99999997565 -0.980966,0 0,-0.99999997565 z m 1.167067,0 0.461237,0 0,0.99999997565 -0.461237,0 0,-0.99999997565 z m 0.647339,0 0.888159,0 0,0.99999997565 -0.888159,0 0,-0.99999997565 z m 1.074254,0 0.888158,0 0,0.99999997565 -0.888158,0 0,-0.99999997565 z m 1.074258,0 1.426446,0 0,0.99999997565 -1.426446,0 0,-0.99999997565 z m 1.612542,0 1.871931,0 0,0.99999997565 -1.871931,0 0,-0.99999997565 z m 2.058032,0 1.25939,0 0,0.99999997565 -1.25939,0 0,-0.99999997565 z m 1.445492,0 0.294181,0 0,0.99999997565 -0.294181,0 0,-0.99999997565 z M 25,2.00043 l 2.33597,0 0,1 -2.33597,0 0,-1 z m 2.519087,0 2.503019,0 0,1 -2.503019,0 0,-1 z m 2.686137,0 0.99953,0 0,1 -0.99953,0 0,-1 z m 1.182648,0 2.354528,0 0,1 -2.354528,0 0,-1 z m 4.332824,0 0.628292,0 0,1 -0.628292,0 0,-1 z m -1.795178,0 1.61206,0 0,1 -1.61206,0 0,-1 z m 2.606587,0 0.36843,0 0,1 -0.36843,0 0,-1 z m 0.551548,0 0.99953,0 0,1 -0.99953,0 0,-1 z M 25,13.000431 l 2.335971,0 0,1 -2.335971,0 0,-1 z m 2.519087,0 2.503021,0 0,1 -2.503021,0 0,-1 z m 2.686139,0 0.99953,0 0,1 -0.99953,0 0,-1 z m 1.182648,0 2.354529,0 0,1 -2.354529,0 0,-1 z m 4.332825,0 0.628293,0 0,1 -0.628293,0 0,-1 z m -1.795178,0 1.612061,0 0,1 -1.612061,0 0,-1 z m 2.606588,0 0.368431,0 0,1 -0.368431,0 0,-1 z m 0.551548,0 0.999531,0 0,1 -0.999531,0 0,-1 z M 25,8.00043 l 1.68631,0 0,1 -1.68631,0 0,-1 z m 1.865451,0 2.800009,0 0,1 -2.800009,0 0,-1 z m 2.979151,0 1.352197,0 0,1 -1.352197,0 0,-1 z m 2.969866,0 1.073775,0 0,1 -1.073775,0 0,-1 z m 1.252915,0 1.723435,0 0,1 -1.723435,0 0,-1 z m 1.902569,0 2.800015,0 0,1 -2.800015,0 0,-1 z m -4.594014,0 1.259396,0 0,1 -1.259396,0 0,-1 z M 25,11.000431 l 2.11323,0 0,1 -2.11323,0 0,-1 z m 2.287728,0 0.665418,0 0,1 -0.665418,0 0,-1 z m 0.839914,0 1.519259,0 0,1 -1.519259,0 0,-1 z m 1.693755,0 1.036655,0 0,1 -1.036655,0 0,-1 z m 1.211152,0 1.036649,0 0,1 -1.036649,0 0,-1 z m 1.211151,0 1.500695,0 0,1 -1.500695,0 0,-1 z m 1.675185,0 0.312751,0 0,1 -0.312751,0 0,-1 z m 0.487248,0 1.946174,0 0,1 -1.946174,0 0,-1 z m 2.120671,0 1.036654,0 0,1 -1.036654,0 0,-1 z m -11.526804,4 0.851034,0 0,1 -0.851034,0 0,-1 z m 1.071276,0 3.096997,0 0,1 -3.096997,0 0,-1 z m 7.458746,0 -0.851034,0 0,1 0.851034,0 0,-1 z m -1.071276,0 -3.096997,0 0,1 3.096997,0 0,-1 z"
id="path2950"
style="opacity:0.7;fill:#666666;fill-opacity:1;stroke:none;display:inline" />
<path
d="m 14.500502,-21.508 c 0.046,1.844225 -0.184182,5.989238 -1.815947,6.055813 -0.239147,0.513498 -0.363701,1.747107 0.218221,1.952187 l 7.437468,0 c 0.47136,-0.186897 0.01956,-1.708469 0,-1.879447 -1.831768,-0.173895 -1.787106,-4.324162 -1.787106,-6.128553 l -4.052636,0 z"
id="path4675"
style="fill:url(#linearGradient2964);fill-opacity:1;stroke:url(#linearGradient2966);stroke-width:0.99827468;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.50000001;display:inline;enable-background:new" />
<path
d="m 16.657514,4.3922276 a 0.32733107,0.1818506 0 1 1 -0.654662,0 0.32733107,0.1818506 0 1 1 0.654662,0 z"
transform="matrix(0.50261493,0,0,0.90470684,8.2922062,-23.473678)"
id="path3897"
style="fill:none;stroke:#ffffff;stroke-width:0.995;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@ -1,4 +1,6 @@
AM_CFLAGS = -I$(top_srcdir) -DCLIPITLOCALEDIR=\""$(clipitlocaledir)"\" AM_CPPFLAGS = -I$(top_srcdir)
AM_CFLAGS = -DCLIPITLOCALEDIR=\""$(clipitlocaledir)"\" \
-DCLIPITPIXMAPSDIR=\""$(datarootdir)"/pixmaps/clipit\"
INCLUDES = $(GTK_CFLAGS) $(APPINDICATOR_CFLAGS) INCLUDES = $(GTK_CFLAGS) $(APPINDICATOR_CFLAGS)
LDADD = $(GTK_LIBS) $(APPINDICATOR_LIBS) $(X11_LIBS) LDADD = $(GTK_LIBS) $(APPINDICATOR_LIBS) $(X11_LIBS)
AM_LDFLAGS = -Wl,--as-needed AM_LDFLAGS = -Wl,--as-needed
@ -8,11 +10,11 @@ bin_PROGRAMS = clipit
DISTCLEANFILES = *.bak *.log *~ .deps/*.P DISTCLEANFILES = *.bak *.log *~ .deps/*.P
clipit_SOURCES = main.c main.h \ clipit_SOURCES = main.c main.h \
utils.c utils.h \ utils.c utils.h \
clipit-i18n.h\ clipit-i18n.h\
daemon.c daemon.h \ daemon.c daemon.h \
history.c history.h \ history.c history.h \
keybinder.c keybinder.h \ keybinder.c keybinder.h \
preferences.c preferences.h \ preferences.c preferences.h \
manage.c manage.h \ manage.c manage.h \
eggaccelerators.c eggaccelerators.h eggaccelerators.c eggaccelerators.h

View File

@ -215,20 +215,23 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
AM_CFLAGS = -I$(top_srcdir) -DCLIPITLOCALEDIR=\""$(clipitlocaledir)"\" AM_CPPFLAGS = -I$(top_srcdir)
AM_CFLAGS = -DCLIPITLOCALEDIR=\""$(clipitlocaledir)"\" \
-DCLIPITPIXMAPSDIR=\""$(datarootdir)"/pixmaps/clipit\"
INCLUDES = $(GTK_CFLAGS) $(APPINDICATOR_CFLAGS) INCLUDES = $(GTK_CFLAGS) $(APPINDICATOR_CFLAGS)
LDADD = $(GTK_LIBS) $(APPINDICATOR_LIBS) $(X11_LIBS) LDADD = $(GTK_LIBS) $(APPINDICATOR_LIBS) $(X11_LIBS)
AM_LDFLAGS = -Wl,--as-needed AM_LDFLAGS = -Wl,--as-needed
DISTCLEANFILES = *.bak *.log *~ .deps/*.P DISTCLEANFILES = *.bak *.log *~ .deps/*.P
clipit_SOURCES = main.c main.h \ clipit_SOURCES = main.c main.h \
utils.c utils.h \ utils.c utils.h \
clipit-i18n.h\ clipit-i18n.h\
daemon.c daemon.h \ daemon.c daemon.h \
history.c history.h \ history.c history.h \
keybinder.c keybinder.h \ keybinder.c keybinder.h \
preferences.c preferences.h \ preferences.c preferences.h \
manage.c manage.h \ manage.c manage.h \
eggaccelerators.c eggaccelerators.h eggaccelerators.c eggaccelerators.h
all: all-am all: all-am

View File

@ -55,13 +55,13 @@ static gboolean status_menu_lock = FALSE;
static gboolean actions_lock = FALSE; static gboolean actions_lock = FALSE;
/* Init preferences structure */ /* Init preferences structure */
prefs_t prefs = {DEF_USE_COPY, DEF_USE_PRIMARY, DEF_SYNCHRONIZE, prefs_t prefs = {DEF_USE_COPY, DEF_USE_PRIMARY, DEF_SYNCHRONIZE,
DEF_SHOW_INDEXES, DEF_SAVE_URIS, DEF_SAVE_HISTORY, DEF_AUTOMATIC_PASTE, DEF_SHOW_INDEXES, DEF_SAVE_URIS,
DEF_HISTORY_LIMIT, DEF_ITEMS_MENU, DEF_HYPERLINKS_ONLY, DEF_SAVE_HISTORY, DEF_HISTORY_LIMIT, DEF_ITEMS_MENU,
DEF_CONFIRM_CLEAR, DEF_SINGLE_LINE, DEF_REVERSE_HISTORY, DEF_HYPERLINKS_ONLY, DEF_CONFIRM_CLEAR, DEF_SINGLE_LINE,
DEF_ITEM_LENGTH, DEF_ELLIPSIZE, INIT_HISTORY_KEY, DEF_REVERSE_HISTORY, DEF_ITEM_LENGTH, DEF_ELLIPSIZE,
INIT_ACTIONS_KEY, INIT_MENU_KEY, INIT_SEARCH_KEY, INIT_HISTORY_KEY, INIT_ACTIONS_KEY, INIT_MENU_KEY,
DEF_NO_ICON}; INIT_SEARCH_KEY, DEF_NO_ICON};
/* Called every CHECK_INTERVAL seconds to check for new items */ /* Called every CHECK_INTERVAL seconds to check for new items */
static gboolean item_check(gpointer data) static gboolean item_check(gpointer data)
@ -128,7 +128,7 @@ static gboolean item_check(gpointer data)
} }
} }
} }
/* Check if clipboard contents were lost */ /* Check if clipboard contents were lost */
if ((clipboard_temp == NULL) && (clipboard_text != NULL)) if ((clipboard_temp == NULL) && (clipboard_text != NULL))
{ {
@ -169,7 +169,7 @@ static gboolean item_check(gpointer data)
} }
} }
} }
/* Synchronization */ /* Synchronization */
if (prefs.synchronize) if (prefs.synchronize)
{ {
@ -186,7 +186,7 @@ static gboolean item_check(gpointer data)
gtk_clipboard_set_text(primary, clipboard_text, -1); gtk_clipboard_set_text(primary, clipboard_text, -1);
} }
} }
/* Cleanup */ /* Cleanup */
g_free(primary_temp); g_free(primary_temp);
g_free(clipboard_temp); g_free(clipboard_temp);
@ -229,7 +229,7 @@ static void action_selected(GtkButton *button, gpointer user_data)
g_free(command); g_free(command);
gchar* cmd = g_strconcat("/bin/sh -c ", shell_command, NULL); gchar* cmd = g_strconcat("/bin/sh -c ", shell_command, NULL);
g_free(shell_command); g_free(shell_command);
/* Execute action */ /* Execute action */
GPid pid; GPid pid;
gchar **argv; gchar **argv;
@ -302,22 +302,22 @@ static void show_about_dialog(GtkMenuItem *menu_item, gpointer user_data)
"\n" "\n"
"You should have received a copy of the GNU General Public License\n" "You should have received a copy of the GNU General Public License\n"
"along with this program. If not, see <http://www.gnu.org/licenses/>."; "along with this program. If not, see <http://www.gnu.org/licenses/>.";
/* Create the about dialog */ /* Create the about dialog */
GtkWidget* about_dialog = gtk_about_dialog_new(); GtkWidget* about_dialog = gtk_about_dialog_new();
gtk_window_set_icon((GtkWindow*)about_dialog, gtk_window_set_icon((GtkWindow*)about_dialog,
gtk_widget_render_icon(about_dialog, GTK_STOCK_ABOUT, GTK_ICON_SIZE_MENU, NULL)); gtk_widget_render_icon(about_dialog, GTK_STOCK_ABOUT, GTK_ICON_SIZE_MENU, NULL));
gtk_about_dialog_set_name((GtkAboutDialog*)about_dialog, "ClipIt"); gtk_about_dialog_set_name((GtkAboutDialog*)about_dialog, "ClipIt");
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
gtk_about_dialog_set_version((GtkAboutDialog*)about_dialog, VERSION); gtk_about_dialog_set_version((GtkAboutDialog*)about_dialog, VERSION);
#endif #endif
gtk_about_dialog_set_comments((GtkAboutDialog*)about_dialog, gtk_about_dialog_set_comments((GtkAboutDialog*)about_dialog,
_("Lightweight GTK+ clipboard manager.")); _("Lightweight GTK+ clipboard manager."));
gtk_about_dialog_set_website((GtkAboutDialog*)about_dialog, gtk_about_dialog_set_website((GtkAboutDialog*)about_dialog,
"http://clipit.rspwn.com/"); "http://clipit.rspwn.com/");
gtk_about_dialog_set_copyright((GtkAboutDialog*)about_dialog, "Copyright (C) 2010 Cristian Henzel"); gtk_about_dialog_set_copyright((GtkAboutDialog*)about_dialog, "Copyright (C) 2010 Cristian Henzel");
gtk_about_dialog_set_authors((GtkAboutDialog*)about_dialog, authors); gtk_about_dialog_set_authors((GtkAboutDialog*)about_dialog, authors);
gtk_about_dialog_set_translator_credits ((GtkAboutDialog*)about_dialog, gtk_about_dialog_set_translator_credits ((GtkAboutDialog*)about_dialog,
@ -339,7 +339,7 @@ static void show_about_dialog(GtkMenuItem *menu_item, gpointer user_data)
"Hedef Türkçe <iletisim@hedefturkce.com>\n" "Hedef Türkçe <iletisim@hedefturkce.com>\n"
"Lyman Li <lymanrb@gmail.com>\n" "Lyman Li <lymanrb@gmail.com>\n"
"Gilberto \"Xyhthyx\" Miralla <xyhthyx@gmail.com>"); "Gilberto \"Xyhthyx\" Miralla <xyhthyx@gmail.com>");
gtk_about_dialog_set_license((GtkAboutDialog*)about_dialog, license); gtk_about_dialog_set_license((GtkAboutDialog*)about_dialog, license);
gtk_about_dialog_set_logo_icon_name((GtkAboutDialog*)about_dialog, GTK_STOCK_PASTE); gtk_about_dialog_set_logo_icon_name((GtkAboutDialog*)about_dialog, GTK_STOCK_PASTE);
/* Run the about dialog */ /* Run the about dialog */
@ -372,7 +372,7 @@ static gboolean show_actions_menu(gpointer data)
/* Declare some variables */ /* Declare some variables */
GtkWidget *menu, *menu_item, GtkWidget *menu, *menu_item,
*menu_image, *item_label; *menu_image, *item_label;
/* Create menu */ /* Create menu */
menu = gtk_menu_new(); menu = gtk_menu_new();
g_signal_connect((GObject*)menu, "selection-done", (GCallback)gtk_widget_destroy, NULL); g_signal_connect((GObject*)menu, "selection-done", (GCallback)gtk_widget_destroy, NULL);
@ -518,11 +518,11 @@ static gboolean show_history_menu(gpointer data)
} }
menu_item = gtk_menu_item_new_with_label(list_item); menu_item = gtk_menu_item_new_with_label(list_item);
g_signal_connect((GObject*)menu_item, "activate", (GCallback)item_selected, GINT_TO_POINTER(element_number)); g_signal_connect((GObject*)menu_item, "activate", (GCallback)item_selected, GINT_TO_POINTER(element_number));
/* Modify menu item label properties */ /* Modify menu item label properties */
item_label = gtk_bin_get_child((GtkBin*)menu_item); item_label = gtk_bin_get_child((GtkBin*)menu_item);
gtk_label_set_single_line_mode((GtkLabel*)item_label, prefs.single_line); gtk_label_set_single_line_mode((GtkLabel*)item_label, prefs.single_line);
/* Check if item is also clipboard text and make bold */ /* Check if item is also clipboard text and make bold */
if ((clipboard_temp) && (g_strcmp0((gchar*)element->data, clipboard_temp) == 0)) if ((clipboard_temp) && (g_strcmp0((gchar*)element->data, clipboard_temp) == 0))
{ {
@ -569,6 +569,53 @@ static gboolean show_history_menu(gpointer data)
return FALSE; return FALSE;
} }
static gboolean menu_key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
{
switch (event->keyval) {
case 0x0030:
item_selected((GtkMenuItem*)widget, GINT_TO_POINTER(9));
gtk_widget_destroy(widget);
break;
case 0x0031:
item_selected((GtkMenuItem*)widget, GINT_TO_POINTER(0));
gtk_widget_destroy(widget);
break;
case 0x0032:
item_selected((GtkMenuItem*)widget, GINT_TO_POINTER(1));
gtk_widget_destroy(widget);
break;
case 0x0033:
item_selected((GtkMenuItem*)widget, GINT_TO_POINTER(2));
gtk_widget_destroy(widget);
break;
case 0x0034:
item_selected((GtkMenuItem*)widget, GINT_TO_POINTER(3));
gtk_widget_destroy(widget);
break;
case 0x0035:
item_selected((GtkMenuItem*)widget, GINT_TO_POINTER(4));
gtk_widget_destroy(widget);
break;
case 0x0036:
item_selected((GtkMenuItem*)widget, GINT_TO_POINTER(5));
gtk_widget_destroy(widget);
break;
case 0x0037:
item_selected((GtkMenuItem*)widget, GINT_TO_POINTER(6));
gtk_widget_destroy(widget);
break;
case 0x0038:
item_selected((GtkMenuItem*)widget, GINT_TO_POINTER(7));
gtk_widget_destroy(widget);
break;
case 0x0039:
item_selected((GtkMenuItem*)widget, GINT_TO_POINTER(8));
gtk_widget_destroy(widget);
break;
}
return FALSE;
}
#ifdef HAVE_APPINDICATOR #ifdef HAVE_APPINDICATOR
void create_app_indicator(gint create) void create_app_indicator(gint create)
@ -704,6 +751,7 @@ static gboolean show_clipit_menu()
/* Create the menu */ /* Create the menu */
statusicon_menu = gtk_menu_new(); statusicon_menu = gtk_menu_new();
g_signal_connect((GObject*)statusicon_menu, "selection-done", (GCallback)gtk_widget_destroy, NULL); g_signal_connect((GObject*)statusicon_menu, "selection-done", (GCallback)gtk_widget_destroy, NULL);
g_signal_connect((GObject*)statusicon_menu, "key-press-event", (GCallback)menu_key_pressed, NULL);
/* Items */ /* Items */
if ((history != NULL) && (history->data != NULL)) if ((history != NULL) && (history->data != NULL))
@ -947,7 +995,7 @@ int main(int argc, char **argv)
g_string_free(piped_string, TRUE); g_string_free(piped_string, TRUE);
} }
} }
/* Init ClipIt */ /* Init ClipIt */
clipit_init(); clipit_init();

View File

@ -107,13 +107,18 @@ static void edit_selected()
{ {
GtkTreeIter sel_iter; GtkTreeIter sel_iter;
GtkTreeSelection* search_selection = gtk_tree_view_get_selection((GtkTreeView*)treeview_search); GtkTreeSelection* search_selection = gtk_tree_view_get_selection((GtkTreeView*)treeview_search);
/* This helps prevent multiple instances and checks if there's anything selected */ /* This checks if there's anything selected */
if (gtk_tree_selection_get_selected(search_selection, NULL, &sel_iter)) gint selected_count = gtk_tree_selection_count_selected_rows(search_selection);
{ if (selected_count > 0) {
/* Create clipboard buffer and set its text */ /* Create clipboard buffer and set its text */
gint selected_item_nr; gint selected_item_nr;
gtk_tree_model_get((GtkTreeModel*)search_list, &sel_iter, 0, &selected_item_nr, -1); GList *selected_rows = gtk_tree_selection_get_selected_rows(search_selection, NULL);
GList *row_loop = g_list_first(selected_rows);
selected_item_nr = atoi((gchar*)gtk_tree_path_to_string(row_loop->data));
g_list_foreach(selected_rows, (GFunc)gtk_tree_path_free, NULL);
g_list_free(selected_rows);
GSList* element = g_slist_nth(history, selected_item_nr); GSList* element = g_slist_nth(history, selected_item_nr);
GSList* elementafter = element->next;
GString* s_selected_item = g_string_new((gchar*)element->data); GString* s_selected_item = g_string_new((gchar*)element->data);
GtkTextBuffer* clipboard_buffer = gtk_text_buffer_new(NULL); GtkTextBuffer* clipboard_buffer = gtk_text_buffer_new(NULL);
gtk_text_buffer_set_text(clipboard_buffer, s_selected_item->str, -1); gtk_text_buffer_set_text(clipboard_buffer, s_selected_item->str, -1);
@ -151,13 +156,13 @@ static void edit_selected()
/* Delete any duplicate */ /* Delete any duplicate */
delete_duplicate(gtk_text_buffer_get_text(clipboard_buffer, &start, &end, TRUE)); delete_duplicate(gtk_text_buffer_get_text(clipboard_buffer, &start, &end, TRUE));
/* Insert new element before the old one */
history = g_slist_insert_before(history, element->next,
g_strdup(gtk_text_buffer_get_text(clipboard_buffer, &start, &end, TRUE)));
/* Remove old entry */ /* Remove old entry */
history = g_slist_remove(history, element->data); history = g_slist_remove(history, element->data);
/* Insert new element where the old one was */
history = g_slist_insert_before(history, elementafter,
g_strdup(gtk_text_buffer_get_text(clipboard_buffer, &start, &end, TRUE)));
if(selected_item_nr == 0) if(selected_item_nr == 0)
{ {
GtkClipboard* clipboard; GtkClipboard* clipboard;
@ -173,21 +178,31 @@ static void edit_selected()
} }
} }
static void add_iter(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *piter, gpointer userdata)
{
GArray *sel = (GArray*)userdata;
GtkTreeIter iter = *piter;
g_array_append_val(sel, iter);
}
/* Called when Remove is selected from Manage dialog */ /* Called when Remove is selected from Manage dialog */
static void remove_selected() static void remove_selected()
{ {
GtkTreeIter sel_iter;
GtkTreeSelection* search_selection = gtk_tree_view_get_selection((GtkTreeView*)treeview_search); GtkTreeSelection* search_selection = gtk_tree_view_get_selection((GtkTreeView*)treeview_search);
/* This checks if there's anything selected */ gint selected_count = gtk_tree_selection_count_selected_rows(search_selection);
if (gtk_tree_selection_get_selected(search_selection, NULL, &sel_iter)) if (selected_count > 0) {
{ GtkListStore *store;
/* Get item to delete */ GArray *sel;
gint selected_item_nr; gint i;
gtk_tree_model_get((GtkTreeModel*)search_list, &sel_iter, 0, &selected_item_nr, -1); store = GTK_LIST_STORE(gtk_tree_view_get_model((GtkTreeView*)treeview_search));
GSList* element = g_slist_nth(history, selected_item_nr); sel = g_array_new(FALSE, FALSE, sizeof(GtkTreeIter));
/* Remove entry */ gtk_tree_selection_selected_foreach(search_selection, add_iter, sel);
history = g_slist_remove(history, element->data); gtk_tree_selection_unselect_all(search_selection);
search_history(); for (i = 0; i < sel->len; i++) {
GtkTreeIter *iter = &g_array_index(sel, GtkTreeIter, i);
gtk_list_store_remove(store, iter);
}
g_array_free(sel, TRUE);
} }
} }
@ -257,11 +272,14 @@ static gint search_click(GtkWidget *widget, GdkEventButton *event, GtkWidget *se
return FALSE; return FALSE;
} }
static gint search_key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer user_data) static gint search_key_released(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
{
search_history();
return FALSE;
}
static gboolean treeview_key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
{ {
/* Check if [Return] key was pressed */
if ((event->keyval == 0xff0d) || (event->keyval == 0xff8d))
search_history();
return FALSE; return FALSE;
} }
@ -301,7 +319,7 @@ gboolean show_search()
gtk_box_pack_start((GtkBox*)vbox_search, hbox, FALSE, FALSE, 0); gtk_box_pack_start((GtkBox*)vbox_search, hbox, FALSE, FALSE, 0);
search_entry = gtk_entry_new(); search_entry = gtk_entry_new();
gtk_box_pack_end((GtkBox*)hbox, search_entry, TRUE, TRUE, 0); gtk_box_pack_end((GtkBox*)hbox, search_entry, TRUE, TRUE, 0);
g_signal_connect((GObject*)search_entry, "key-press-event", (GCallback)search_key_pressed, NULL); g_signal_connect((GObject*)search_entry, "key-release-event", (GCallback)search_key_released, NULL);
/* Build the exclude treeview */ /* Build the exclude treeview */
GtkWidget* scrolled_window_search = gtk_scrolled_window_new( GtkWidget* scrolled_window_search = gtk_scrolled_window_new(
@ -336,8 +354,9 @@ gboolean show_search()
g_signal_connect((GObject*)close_button, "clicked", (GCallback)search_history, NULL); g_signal_connect((GObject*)close_button, "clicked", (GCallback)search_history, NULL);
GtkTreeSelection* search_selection = gtk_tree_view_get_selection((GtkTreeView*)treeview_search); GtkTreeSelection* search_selection = gtk_tree_view_get_selection((GtkTreeView*)treeview_search);
gtk_tree_selection_set_mode(search_selection, GTK_SELECTION_BROWSE); gtk_tree_selection_set_mode(search_selection, GTK_SELECTION_MULTIPLE);
g_signal_connect((GObject*)treeview_search, "button_press_event", (GCallback)search_click, search_dialog); g_signal_connect((GObject*)treeview_search, "button_press_event", (GCallback)search_click, search_dialog);
g_signal_connect((GObject*)treeview_search, "key-press-event", (GCallback)treeview_key_pressed, NULL);
g_signal_connect((GtkDialog*)search_dialog, "response", (GCallback)search_window_response, search_dialog); g_signal_connect((GtkDialog*)search_dialog, "response", (GCallback)search_window_response, search_dialog);
gtk_widget_show_all(vbox_search); gtk_widget_show_all(vbox_search);