After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694154 - Use GtkEntry instead of GtkSearchEntry for new printers
Use GtkEntry instead of GtkSearchEntry for new printers
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Printers
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
Control-Center Maintainers
3.10
: 725593 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-02-19 10:26 UTC by Marek Kašík
Modified: 2014-03-03 16:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot of using of GtkEntry instead of GtkSearchEntry for new printers (93.70 KB, image/png)
2013-02-19 10:26 UTC, Marek Kašík
  Details
Make search entry usage clearer for new printers (2.08 KB, patch)
2013-02-19 10:27 UTC, Marek Kašík
rejected Details | Review
Don't wait for activation to start search (9.91 KB, patch)
2014-01-27 14:17 UTC, Marek Kašík
committed Details | Review
Don't show tooltip on clear icon when searching for printers (1.58 KB, patch)
2014-01-27 14:17 UTC, Marek Kašík
committed Details | Review
Don't react to icon-press when searching for new printers (2.09 KB, patch)
2014-01-27 14:17 UTC, Marek Kašík
committed Details | Review
Delay searching for remote printers (10.37 KB, patch)
2014-01-27 14:19 UTC, Marek Kašík
needs-work Details | Review
Delay searching for remote printers (10.55 KB, patch)
2014-02-13 14:29 UTC, Marek Kašík
committed Details | Review

Description Marek Kašík 2013-02-19 10:26:11 UTC
Created attachment 236736 [details]
screenshot of using of GtkEntry instead of GtkSearchEntry for new printers

The search entry in new printer dialog uses GtkSearchEntry currently. It should use GtkEntry because it doesn't search as you type. The entry waits for press of "Enter" or of secondary icon and starts to search after that. Searching for available printers is long running process and can not be executed after each key-press.

Fix: replace GtkSearchEntry by GtkEntry and use magnifier icon for the right icon.

I'll ask for for UI freeze break if accepted.
Comment 1 Marek Kašík 2013-02-19 10:27:44 UTC
Created attachment 236737 [details] [review]
Make search entry usage clearer for new printers
Comment 2 Bastien Nocera 2013-02-19 10:49:15 UTC
Review of attachment 236737 [details] [review]:

That doesn't make usage any clearer. Add a button to the right of the entry and carry on using a GtkSearchEntry.
Comment 3 Marek Kašík 2014-01-27 14:17:03 UTC
Created attachment 267307 [details] [review]
Don't wait for activation to start search

This patch changes behaviour of the search entry so that it starts to search when "search-changed" signal is received. It cancels previous searches if needed.
Comment 4 Marek Kašík 2014-01-27 14:17:33 UTC
Created attachment 267308 [details] [review]
Don't show tooltip on clear icon when searching for printers
Comment 5 Marek Kašík 2014-01-27 14:17:52 UTC
Created attachment 267309 [details] [review]
Don't react to icon-press when searching for new printers
Comment 6 Marek Kašík 2014-01-27 14:19:13 UTC
Created attachment 267310 [details] [review]
Delay searching for remote printers

Start search for remote printers after 500ms of users inactivity instead of GtkSearchEntry's default 150ms.
Comment 7 Bastien Nocera 2014-02-13 13:07:03 UTC
Review of attachment 267307 [details] [review]:

That looks fine.
Comment 8 Bastien Nocera 2014-02-13 13:08:00 UTC
Review of attachment 267308 [details] [review]:

Fine by me.
Comment 9 Bastien Nocera 2014-02-13 13:08:38 UTC
Review of attachment 267309 [details] [review]:

Sure.
Comment 10 Bastien Nocera 2014-02-13 13:13:26 UTC
Review of attachment 267310 [details] [review]:

::: panels/printers/pp-new-printer-dialog.c
@@ +53,3 @@
 static void     actualize_devices_list (PpNewPrinterDialog *dialog);
 static void     populate_devices_list (PpNewPrinterDialog *dialog);
+static void     search_address_cb1 (GtkEntry *entry,

Please give those more descriptive names.

@@ +135,3 @@
   PpHost  *remote_cups_host;
   PpSamba *samba_host;
+  guint    host_search_id;

host_search_timeout_id? idle_id? something else?

@@ +1478,3 @@
+  gchar              *host_name;
+  gint                host_port;
+} THost;

A more descriptive name as well please.

@@ +1656,3 @@
+                                                           (GDestroyNotify) search_for_remote_printers_free);
+              else
+                g_idle_add_full (G_PRIORITY_DEFAULT,

Why do you leave a timeout dangling like that? Can't you call the function directly?
Comment 11 Marek Kašík 2014-02-13 14:29:17 UTC
Created attachment 269016 [details] [review]
Delay searching for remote printers

Hi,

thank you for the reviews.

(In reply to comment #10)
> Review of attachment 267310 [details] [review]:
> 
> ::: panels/printers/pp-new-printer-dialog.c
> @@ +53,3 @@
>  static void     actualize_devices_list (PpNewPrinterDialog *dialog);
>  static void     populate_devices_list (PpNewPrinterDialog *dialog);
> +static void     search_address_cb1 (GtkEntry *entry,
> 
> Please give those more descriptive names.

Done - search_entry_activated_cb(), search_entry_changed_cb().


> @@ +135,3 @@
>    PpHost  *remote_cups_host;
>    PpSamba *samba_host;
> +  guint    host_search_id;
> 
> host_search_timeout_id? idle_id? something else?

Done - host_search_timeout_id.


> @@ +1478,3 @@
> +  gchar              *host_name;
> +  gint                host_port;
> +} THost;
> 
> A more descriptive name as well please.

Done - THostSearchData.

> @@ +1656,3 @@
> +                                                           (GDestroyNotify)
> search_for_remote_printers_free);
> +              else
> +                g_idle_add_full (G_PRIORITY_DEFAULT,
> 
> Why do you leave a timeout dangling like that? Can't you call the function
> directly?

Fixed. You are right, I can call the function and the data free function directly.

Regards

Marek
Comment 12 Bastien Nocera 2014-02-13 14:34:21 UTC
Review of attachment 269016 [details] [review]:

Looks good overall.

::: panels/printers/pp-new-printer-dialog.c
@@ +48,3 @@
 #endif
 
+#define HOST_SEARCH_DELAY 350

That's 500 minus the default 150 msecs from the search entry.
Would be good to write it as such:
#define HOST_SEARCH_DELAY (500 - 150)
and clarify in a comment
Comment 13 Marek Kašík 2014-02-13 15:05:57 UTC
Comment on attachment 269016 [details] [review]
Delay searching for remote printers

Thank you again. I've pushed all those patches to master.


(In reply to comment #12)
> Review of attachment 269016 [details] [review]:
> 
> Looks good overall.
> 
> ::: panels/printers/pp-new-printer-dialog.c
> @@ +48,3 @@
>  #endif
> 
> +#define HOST_SEARCH_DELAY 350
> 
> That's 500 minus the default 150 msecs from the search entry.
> Would be good to write it as such:
> #define HOST_SEARCH_DELAY (500 - 150)
> and clarify in a comment

I've added the comment there and changed the value to (500 - 150).

Regards

Marek
Comment 14 Marek Kašík 2014-02-13 15:06:14 UTC
(In reply to comment #12)
> Review of attachment 269016 [details] [review]:
> 
> Looks good overall.
> 
> ::: panels/printers/pp-new-printer-dialog.c
> @@ +48,3 @@
>  #endif
> 
> +#define HOST_SEARCH_DELAY 350
> 
> That's 500 minus the default 150 msecs from the search entry.
> Would be good to write it as such:
> #define HOST_SEARCH_DELAY (500 - 150)
> and clarify in a comment
Comment 15 Marek Kašík 2014-03-03 16:18:07 UTC
*** Bug 725593 has been marked as a duplicate of this bug. ***