On Wed, Jul 08, 2015 at 04:12:07AM +0200, Gianni Lerro wrote:
> Package: synaptic
> Version: 0.81.3
> Severity: normal
> Tags: patch

Thanks for your bugreport and your patch!

> is possible to add to "Quick filter" text entry a button to clean it.

Absolutely, thanks a lot! This is merged and I uploaded it to sid
now. I also moved the code to git to make it easier to hack on it.

If you enjoy working on the code, I would love to get some help
hacking on synaptic. There is plenty of cool stuff that could be
done. Please let me know if you are interessted :)

Cheers and many thanks,
 Michael





> Thanks.
> 
> 
> 
> -- System Information:
> Debian Release: stretch/sid
>   APT prefers testing-updates
>   APT policy: (500, 'testing-updates'), (500, 'testing-proposed-updates'), 
> (500, 'testing'), (1, 'experimental')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386
> 
> Kernel: Linux 4.1-1.dmz.2-liquorix-amd64 (SMP w/2 CPU cores; PREEMPT)
> Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> 
> Versions of packages synaptic depends on:
> ii  hicolor-icon-theme   0.13-1
> ii  libapt-inst1.5       1.0.9.10
> ii  libapt-pkg4.12       1.0.9.10
> ii  libatk1.0-0          2.16.0-2
> ii  libc6                2.19-18
> ii  libcairo-gobject2    1.14.2-2
> ii  libcairo2            1.14.2-2
> ii  libept1.4.12         1.0.12.1
> ii  libgcc1              1:5.1.1-12
> ii  libgdk-pixbuf2.0-0   2.31.4-2
> ii  libglib2.0-0         2.44.1-1.1
> ii  libgtk-3-0           3.16.4-2
> ii  libpango-1.0-0       1.36.8-3
> ii  libpangocairo-1.0-0  1.36.8-3
> ii  libstdc++6           5.1.1-12
> ii  libvte-2.90-9        1:0.36.3-1
> ii  libx11-6             2:1.6.3-1
> ii  libxapian22          1.2.21-1
> ii  libxext6             2:1.3.3-1
> ii  zlib1g               1:1.2.8.dfsg-2+b1
> 
> Versions of packages synaptic recommends:
> ii  gksu           2.0.2-9
> ii  libgtk2-perl   2:1.2495-1
> ii  policykit-1    0.105-8
> ii  rarian-compat  0.8.1-6
> 
> Versions of packages synaptic suggests:
> ii  apt-xapian-index         0.47
> ii  deborphan                1.7.28.8-0.1
> pn  dwww                     <none>
> ii  menu                     2.1.47
> ii  software-properties-gtk  0.92.25debian1
> ii  tasksel                  3.32
> 
> -- no debconf information

> === modificato file gtk/rgmainwindow.h
> --- gtk/rgmainwindow.h        2014-03-18 19:58:18 +0000
> +++ gtk/rgmainwindow.h        2015-07-08 00:20:58 +0000
> @@ -181,6 +181,8 @@
>  
>     // helpers for search-as-you-type 
>     static void cbSearchEntryChanged(GtkWidget *editable, void *data);
> +   static void cbSearchEntryClean(GtkEntry *entry, GtkEntryIconPosition 
> icon_pos,
> +                                  GdkEvent *event, void *data);
>     static void xapianIndexUpdateFinished(GPid pid, gint status, void* data);
>     static gboolean xapianDoSearch(void *data);
>     static gboolean xapianDoIndexUpdate(void *data);
> 
> === modificato file gtk/gtkbuilder/window_main.ui
> --- gtk/gtkbuilder/window_main.ui     2013-10-26 19:20:45 +0000
> +++ gtk/gtkbuilder/window_main.ui     2015-07-08 00:20:02 +0000
> @@ -830,7 +830,9 @@
>                          <property name="has_focus">True</property>
>                          <property name="is_focus">True</property>
>                          <property name="invisible_char">●</property>
> +                        <property 
> name="secondary_icon_name">gtk-clear</property>
>                          <signal name="changed" 
> handler="on_entry_fast_search_changed" swapped="no"/>
> +                        <signal name="icon-press" 
> handler="on_entry_fast_search_icon_press" swapped="no"/>
>                        </object>
>                        <packing>
>                          <property name="expand">True</property>
> 
> === modificato file gtk/rgmainwindow.cc
> --- gtk/rgmainwindow.cc       2014-05-16 06:16:17 +0000
> +++ gtk/rgmainwindow.cc       2015-07-08 00:28:10 +0000
> @@ -1010,6 +1010,9 @@
>     g_signal_connect(gtk_builder_get_object(_builder, "entry_fast_search"),
>                      "changed",
>                      G_CALLBACK(cbSearchEntryChanged), this);
> +   g_signal_connect(gtk_builder_get_object(_builder, "entry_fast_search"),
> +                    "icon-press",
> +                    G_CALLBACK(cbSearchEntryClean), this);
>  
>     _propertiesB = GTK_WIDGET(gtk_builder_get_object(_builder, 
> "button_details"));
>     assert(_propertiesB);
> @@ -2855,6 +2858,15 @@
>     me->_fastSearchEventID = g_timeout_add(500, xapianDoSearch, me);
>  }
>  
> +void RGMainWindow::cbSearchEntryClean(GtkEntry *entry,
> +                                      GtkEntryIconPosition icon_pos,
> +                                      GdkEvent *event,
> +                                      void *data)
> +{
> +   if (icon_pos == GTK_ENTRY_ICON_SECONDARY)
> +      gtk_entry_set_text(GTK_ENTRY(entry), "");
> +}
> +
>  void RGMainWindow::cbUpdateClicked(GtkWidget *self, void *data)
>  {
>     RGMainWindow *me = (RGMainWindow *) data;
> 
> === modificato file gtk/rgmainwindow.h
> --- gtk/rgmainwindow.h        2014-03-18 19:58:18 +0000
> +++ gtk/rgmainwindow.h        2015-07-08 00:20:58 +0000
> @@ -181,6 +181,8 @@
>  
>     // helpers for search-as-you-type 
>     static void cbSearchEntryChanged(GtkWidget *editable, void *data);
> +   static void cbSearchEntryClean(GtkEntry *entry, GtkEntryIconPosition 
> icon_pos,
> +                                  GdkEvent *event, void *data);
>     static void xapianIndexUpdateFinished(GPid pid, gint status, void* data);
>     static gboolean xapianDoSearch(void *data);
>     static gboolean xapianDoIndexUpdate(void *data);
> 
> 


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to