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 683229 - implement new design for 'add printer' dialog
implement new design for 'add printer' dialog
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Printers
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-02 21:44 UTC by Matthias Clasen
Modified: 2013-02-15 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
asynchronous operations needed for redesigned new printer dialog (118.52 KB, patch)
2012-09-02 21:46 UTC, Matthias Clasen
none Details | Review
redesign of the new printer dialog (160.20 KB, patch)
2012-09-02 21:47 UTC, Matthias Clasen
none Details | Review
add support for samba printers (43.97 KB, patch)
2012-09-02 21:48 UTC, Matthias Clasen
needs-work Details | Review
Samba printer installation workflow 1/4 (36.49 KB, image/png)
2012-09-02 21:49 UTC, Matthias Clasen
  Details
Samba printer installation workflow 2/4 (54.15 KB, image/png)
2012-09-02 21:49 UTC, Matthias Clasen
  Details
Samba printer installation workflow 3/4 (31.30 KB, image/png)
2012-09-02 21:50 UTC, Matthias Clasen
  Details
Samba printer installation workflow 4/4 (31.94 KB, image/png)
2012-09-02 21:51 UTC, Matthias Clasen
  Details
Add PpCups object (7.51 KB, patch)
2012-09-03 12:46 UTC, Marek Kašík
reviewed Details | Review
Add methods for getting print devices (29.71 KB, patch)
2012-09-03 12:47 UTC, Marek Kašík
reviewed Details | Review
Add PpNewPrinter object for installation of new printer (68.12 KB, patch)
2012-09-03 12:49 UTC, Marek Kašík
reviewed Details | Review
Redesign of new printer dialog (216.91 KB, patch)
2012-09-03 12:57 UTC, Marek Kašík
reviewed Details | Review
screenshot of new new printer dialog (40.10 KB, image/png)
2012-09-03 16:50 UTC, Marek Kašík
  Details
Include missing header (725 bytes, patch)
2012-09-03 20:11 UTC, Marek Kašík
committed Details | Review
Move common constants to pp-utils.h (2.58 KB, patch)
2012-09-03 20:11 UTC, Marek Kašík
committed Details | Review
Add PpCups object for getting destinations (7.17 KB, patch)
2012-09-03 20:12 UTC, Marek Kašík
committed Details | Review
Add async method for getting print devices (11.41 KB, patch)
2012-09-03 20:13 UTC, Marek Kašík
committed Details | Review
Add PpHost object for getting print devices (18.64 KB, patch)
2012-09-03 20:13 UTC, Marek Kašík
committed Details | Review
Add PpMaintenanceCommand object for (15.49 KB, patch)
2012-09-03 20:13 UTC, Marek Kašík
committed Details | Review
Make get_paper_size_from_locale() available to other source files (1.34 KB, patch)
2012-09-03 20:14 UTC, Marek Kašík
committed Details | Review
Allow printer_get_ppd_async() to get PPD from remote host (3.97 KB, patch)
2012-09-03 20:14 UTC, Marek Kašík
committed Details | Review
Add PpNewPrinter object for installation of new printer (48.85 KB, patch)
2012-09-03 20:15 UTC, Marek Kašík
committed Details | Review
Return after callback (918 bytes, patch)
2012-09-03 20:15 UTC, Marek Kašík
committed Details | Review
Set longer timeouts (1.89 KB, patch)
2012-09-03 20:15 UTC, Marek Kašík
committed Details | Review
Redesign of new printer dialog (175.90 KB, patch)
2012-09-03 20:16 UTC, Marek Kašík
committed Details | Review
Remove redundant functions (41.37 KB, patch)
2012-09-03 20:16 UTC, Marek Kašík
committed Details | Review
samba installation workflow screenshot 1/6 (29.50 KB, image/png)
2013-02-07 15:04 UTC, Marek Kašík
  Details
samba installation workflow screenshot 2/6 (29.17 KB, image/png)
2013-02-07 15:05 UTC, Marek Kašík
  Details
samba installation workflow screenshot 3/6 (27.89 KB, image/png)
2013-02-07 15:05 UTC, Marek Kašík
  Details
samba installation workflow screenshot 4/6 (25.64 KB, image/png)
2013-02-07 15:06 UTC, Marek Kašík
  Details
samba installation workflow screenshot 5/6 (24.27 KB, image/png)
2013-02-07 15:07 UTC, Marek Kašík
  Details
samba installation workflow screenshot 6/6 (32.05 KB, image/png)
2013-02-07 15:07 UTC, Marek Kašík
  Details
mockups for password dialogs (169.78 KB, image/png)
2013-02-12 20:20 UTC, Allan Day
  Details
password dialog (33.50 KB, image/png)
2013-02-14 13:45 UTC, Marek Kašík
  Details
add function for clearing of passwords (1.42 KB, patch)
2013-02-14 16:20 UTC, Marek Kašík
reviewed Details | Review
add authentication dialog for samba printers (26.26 KB, patch)
2013-02-14 16:20 UTC, Marek Kašík
needs-work Details | Review
add class for searching for samba printers (20.47 KB, patch)
2013-02-14 16:21 UTC, Marek Kašík
reviewed Details | Review
search for samba printers in new printer dialog (23.60 KB, patch)
2013-02-14 16:21 UTC, Marek Kašík
reviewed Details | Review
authentication dialog for samba printers - modified (25.50 KB, patch)
2013-02-15 16:33 UTC, Marek Kašík
needs-work Details | Review
authentication dialog for samba printers - modified (25.51 KB, patch)
2013-02-15 16:48 UTC, Marek Kašík
committed Details | Review
class for searching for samba printers - modified (20.43 KB, patch)
2013-02-15 17:01 UTC, Marek Kašík
committed Details | Review
search for samba printers in new printer dialog - modififed (23.79 KB, patch)
2013-02-15 17:21 UTC, Marek Kašík
committed Details | Review

Description Matthias Clasen 2012-09-02 21:44:31 UTC
This is the continuation of bug 678637, with the pieces that didn't get done there.
Comment 1 Matthias Clasen 2012-09-02 21:46:21 UTC
Created attachment 223219 [details] [review]
asynchronous operations needed for redesigned new printer dialog
Comment 2 Matthias Clasen 2012-09-02 21:47:11 UTC
Created attachment 223220 [details] [review]
redesign of the new printer dialog
Comment 3 Matthias Clasen 2012-09-02 21:48:05 UTC
Created attachment 223221 [details] [review]
add support for samba printers
Comment 4 Matthias Clasen 2012-09-02 21:49:23 UTC
Created attachment 223222 [details]
Samba printer installation workflow 1/4
Comment 5 Matthias Clasen 2012-09-02 21:49:47 UTC
Created attachment 223223 [details]
Samba printer installation workflow 2/4
Comment 6 Matthias Clasen 2012-09-02 21:50:19 UTC
Created attachment 223224 [details]
Samba printer installation workflow 3/4
Comment 7 Matthias Clasen 2012-09-02 21:51:03 UTC
Created attachment 223226 [details]
Samba printer installation workflow 4/4
Comment 8 Marek Kašík 2012-09-03 12:46:42 UTC
Created attachment 223290 [details] [review]
Add PpCups object

This patch add PpCups object which represents local CUPS server. It contains asynchronous method pp_cups_get_dests_async() which is an asynchronous version of cupsGetDests() and corresponding finish function.
Comment 9 Marek Kašík 2012-09-03 12:47:58 UTC
Created attachment 223292 [details] [review]
Add methods for getting print devices

This patch adds PpHost object which represents a remote host from which we want to get printers. It contains pp_host_get_snmp_devices_async() function, pp_host_get_remote_cups_devices_async() function and corresponding finish functions.
pp_host_get_snmp_devices_async() gets printers list from the specified host using snmp backend of CUPS.
pp_host_get_remote_cups_devices_async() connects directly to the CUPS server of the remote host and get printers list from it.
It also adds get_cups_devices_async() function which consequently
executes CUPS callbacks and returns found devices by a callback.
Comment 10 Marek Kašík 2012-09-03 12:49:17 UTC
Created attachment 223293 [details] [review]
Add PpNewPrinter object for installation of new printer

The PpNewPrinter object contains function pp_new_printer_add_async() which installs new printer. The new printer is specified by given parameters (e.g. name, device-id, device-uri, ppd-name, info, location, ...).
The object also contains function function pp_new_printer_add_finish() which returns TRUE if the addition of new printer succeeded.
Comment 11 Marek Kašík 2012-09-03 12:57:24 UTC
Created attachment 223295 [details] [review]
Redesign of new printer dialog

This is the last patch needed for replacement of patches https://bugzilla.gnome.org/attachment.cgi?id=223219 and https://bugzilla.gnome.org/attachment.cgi?id=223220. This patch and the three patches attached right before this one are modified version of previous patches for redesign of new printer dialog. These should agree with Bastien's requests.

The PpNewPrinterDialog is a descendant of GObject now. It emits signal "pre-response" when dialog is closed and the printer is being added and signal "response" when the the dialog added new printer, failed to add new printer or was cancelled.

Regards

Marek
Comment 12 Bastien Nocera 2012-09-03 15:55:27 UTC
Review of attachment 223290 [details] [review]:

::: panels/printers/pp-utils.h
@@ +24,3 @@
 #include <gtk/gtk.h>
+#include <cups/cups.h>
+#include <cups/ppd.h>

Why do we add the headers in pp-utils.h instead of pp-cups.[ch] directly?
Comment 13 Bastien Nocera 2012-09-03 16:04:20 UTC
Review of attachment 223292 [details] [review]:

You don't seem to check anywhere whether the cancellable has actually been cancelled.

The commit message is also uncomprehensible. You don't need to repeat the name of the functions you're adding, tell us what those functions do.

And if the pp-utils.[ch] additions are stand-alone, make sure to commit them in a separate commit.
Comment 14 Bastien Nocera 2012-09-03 16:07:15 UTC
Review of attachment 223293 [details] [review]:

Same comment about the commit log. Please split up your changes (especially the new objects/files) into more commits.

::: panels/printers/pp-utils.h
@@ +293,3 @@
 void        pp_print_device_free (PpPrintDevice *device);
 
+const gchar *get_paper_size_from_locale (void);

This isn't something from this commit...
Comment 15 Bastien Nocera 2012-09-03 16:14:08 UTC
Review of attachment 223295 [details] [review]:

> The PpNewPrinterDialog is a descendant of GObject.

Stating the obvious here :)

Please keep the commit messages informative, you don't need to explain the design of the printer dialogue for example, put a link to the design page.

::: panels/printers/pp-utils.h
@@ -86,3 @@
                            const char *attr);
 
-ipp_t      *execute_maintenance_command (const char *printer_name,

Remove that function in a separate cleanup commit please.
Comment 16 Bastien Nocera 2012-09-03 16:16:02 UTC
The patches looks good overall, and no UI changes should happen between this patchset and the release. Can you please request freeze break approval for this?
Comment 17 Marek Kašík 2012-09-03 16:49:21 UTC
Hi,

thank you for those reviews. I'm going to request the approval in a minute. I'll just prepare a screenshot to have a quick reference to this change.

Marek
Comment 18 Marek Kašík 2012-09-03 16:50:28 UTC
Created attachment 223347 [details]
screenshot of new new printer dialog
Comment 19 Marek Kašík 2012-09-03 20:10:25 UTC
(In reply to comment #12)
> Review of attachment 223290 [details] [review]:
> 
> ::: panels/printers/pp-utils.h
> @@ +24,3 @@
>  #include <gtk/gtk.h>
> +#include <cups/cups.h>
> +#include <cups/ppd.h>
> 
> Why do we add the headers in pp-utils.h instead of pp-cups.[ch] directly?

For cups.h, there are functions in pp-utils.h which needs types defined in cups.h. The ppd.h shouldn't be included there. I've created a separate commit for it.

(In reply to comment #13)
> Review of attachment 223292 [details] [review]:
> 
> You don't seem to check anywhere whether the cancellable has actually been
> cancelled.

I think that I check it correctly. The get_cups_devices_async() checks the cancellable in several places and in the PpHost I set g_simple_async_result_set_check_cancellable() and check it by g_simple_async_result_propagate_error() later.

> The commit message is also uncomprehensible. You don't need to repeat the name
> of the functions you're adding, tell us what those functions do.

Fixed.

> And if the pp-utils.[ch] additions are stand-alone, make sure to commit them 
> in a separate commit.

Done.


(In reply to comment #14)
> Review of attachment 223293 [details] [review]:
> 
> Same comment about the commit log. Please split up your changes (especially
> the new objects/files) into more commits.

Done.


> ::: panels/printers/pp-utils.h
> @@ +293,3 @@
>  void        pp_print_device_free (PpPrintDevice *device);
> 
> +const gchar *get_paper_size_from_locale (void);
> 
> This isn't something from this commit...

Done.


(In reply to comment #15)
> Review of attachment 223295 [details] [review]:
> 
> > The PpNewPrinterDialog is a descendant of GObject.
> 
> Stating the obvious here :)

Removed.

> Please keep the commit messages informative, you don't need to explain the
> design of the printer dialogue for example, put a link to the design page.

Tried :).

> ::: panels/printers/pp-utils.h
> @@ -86,3 @@
>                             const char *attr);
> 
> -ipp_t      *execute_maintenance_command (const char *printer_name,
> 
> Remove that function in a separate cleanup commit please.

Done.

(In reply to comment #16)
> The patches looks good overall, and no UI changes should happen between this
> patchset and the release. Can you please request freeze break approval for
> this?

Thank you very much. I've requested the approval from release, i18n and docs teams.

I've split those changes to 13 patches :).
Comment 20 Marek Kašík 2012-09-03 20:11:15 UTC
Created attachment 223364 [details] [review]
Include missing header

The first patch.
Comment 21 Marek Kašík 2012-09-03 20:11:38 UTC
Created attachment 223365 [details] [review]
Move common constants to pp-utils.h
Comment 22 Marek Kašík 2012-09-03 20:12:00 UTC
Created attachment 223366 [details] [review]
Add PpCups object for getting destinations
Comment 23 Marek Kašík 2012-09-03 20:13:07 UTC
Created attachment 223367 [details] [review]
Add async method for getting print devices
Comment 24 Marek Kašík 2012-09-03 20:13:30 UTC
Created attachment 223368 [details] [review]
Add PpHost object for getting print devices
Comment 25 Marek Kašík 2012-09-03 20:13:57 UTC
Created attachment 223369 [details] [review]
Add PpMaintenanceCommand object for
Comment 26 Marek Kašík 2012-09-03 20:14:32 UTC
Created attachment 223370 [details] [review]
Make get_paper_size_from_locale() available to other source files
Comment 27 Marek Kašík 2012-09-03 20:14:56 UTC
Created attachment 223371 [details] [review]
Allow printer_get_ppd_async() to get PPD from remote host
Comment 28 Marek Kašík 2012-09-03 20:15:22 UTC
Created attachment 223372 [details] [review]
Add PpNewPrinter object for installation of new printer
Comment 29 Marek Kašík 2012-09-03 20:15:39 UTC
Created attachment 223373 [details] [review]
Return after callback
Comment 30 Marek Kašík 2012-09-03 20:15:58 UTC
Created attachment 223374 [details] [review]
Set longer timeouts
Comment 31 Marek Kašík 2012-09-03 20:16:20 UTC
Created attachment 223375 [details] [review]
Redesign of new printer dialog
Comment 32 Marek Kašík 2012-09-03 20:16:44 UTC
Created attachment 223376 [details] [review]
Remove redundant functions

The last patch.
Comment 33 Bastien Nocera 2012-09-03 20:53:48 UTC
Review of attachment 223364 [details] [review]:

+
Comment 34 Bastien Nocera 2012-09-03 20:54:32 UTC
Review of attachment 223365 [details] [review]:

++
Comment 35 Bastien Nocera 2012-09-03 20:57:25 UTC
Review of attachment 223366 [details] [review]:

"destinations"?

Other than that, looks good.
Comment 36 Bastien Nocera 2012-09-03 20:59:58 UTC
Review of attachment 223367 [details] [review]:

"getting" print devices? Do you mean listing, enumerating, discovering?
Comment 37 Bastien Nocera 2012-09-03 21:00:31 UTC
Review of attachment 223368 [details] [review]:

Again "getting".
Comment 38 Bastien Nocera 2012-09-03 21:02:18 UTC
Review of attachment 223369 [details] [review]:

"PpMaintenanceCommand object represents CUPS' maintenance command."
You already said that in the subject line.
Comment 39 Bastien Nocera 2012-09-03 21:03:24 UTC
Review of attachment 223370 [details] [review]:

++
Comment 40 Bastien Nocera 2012-09-03 21:07:25 UTC
Review of attachment 223371 [details] [review]:

Don't repeat in the commit message information that's already in the subject line.
Comment 41 Bastien Nocera 2012-09-03 21:08:15 UTC
Review of attachment 223372 [details] [review]:

++
Comment 42 Bastien Nocera 2012-09-03 21:09:19 UTC
Review of attachment 223373 [details] [review]:

++
Comment 43 Bastien Nocera 2012-09-03 21:10:33 UTC
Review of attachment 223374 [details] [review]:

++
Comment 44 Bastien Nocera 2012-09-03 21:11:53 UTC
Review of attachment 223375 [details] [review]:

Looks good (though you shouldn't start a sentence with "Also").
Comment 45 Bastien Nocera 2012-09-03 21:12:32 UTC
Review of attachment 223376 [details] [review]:

++
Comment 46 Marek Kašík 2012-09-04 08:56:53 UTC
(In reply to comment #35)
> Review of attachment 223366 [details] [review]:
> 
> "destinations"?
> 
> Other than that, looks good.

CUPS uses "destinations" for elements of the array it returns by the cupsGetDests() function. I would like to keep it as it is.


(In reply to comment #36)
> Review of attachment 223367 [details] [review]:
> 
> "getting" print devices? Do you mean listing, enumerating, discovering?

I replaced this by listing.


(In reply to comment #37)
> Review of attachment 223368 [details] [review]:
> 
> Again "getting".

Replaced by listing.

(In reply to comment #38)
> Review of attachment 223369 [details] [review]:
> 
> "PpMaintenanceCommand object represents CUPS' maintenance command."
> You already said that in the subject line.

I changed it a little. I usually try to be more specific in the main message than in the title. It means that I need to repeat part of the information sometimes.


(In reply to comment #40)
> Review of attachment 223371 [details] [review]:
> 
> Don't repeat in the commit message information that's already in the subject
> line.

I changed this.


(In reply to comment #44)
> Review of attachment 223375 [details] [review]:
> 
> Looks good (though you shouldn't start a sentence with "Also").

I removed the "Also".


I'm waiting for approvals from i18n and docs teams right now. I'll commit the patches as soon as I'll have those approvals.
Comment 47 Marek Kašík 2012-09-04 12:29:02 UTC
I've committed those patches to the master. I'm leaving this bug opened for the samba support yet.
Comment 48 Marek Kašík 2013-02-07 15:04:38 UTC
Created attachment 235409 [details]
samba installation workflow screenshot 1/6

Attached are new screenshots of workflow of addition of samba printer using Printers panel.

There are 3 workflows, one for the case when password is needed to access the server to which the printer is attached. Second one for the case when password is needed just for the printer. And third one which doesn't need a password at all.
First workflow is 1,2,3,4,6, the second one is 1,3,4,5,6 and the third one is 1,3,4,6.
Maybe we could use the shell auth dialog for the first case as noted in https://bugzilla.gnome.org/show_bug.cgi?id=690494.

It is not needed to enter an address in both cases, it finds the samba servers automatically (if they are visible). But you can enter an address for a specific server or a workgroup for a specific workgroup.

I would need review from design point of view so I can finish the patch and send it for review.

Regards

Marek
Comment 49 Marek Kašík 2013-02-07 15:05:09 UTC
Created attachment 235410 [details]
samba installation workflow screenshot 2/6
Comment 50 Marek Kašík 2013-02-07 15:05:43 UTC
Created attachment 235412 [details]
samba installation workflow screenshot 3/6
Comment 51 Marek Kašík 2013-02-07 15:06:19 UTC
Created attachment 235413 [details]
samba installation workflow screenshot 4/6
Comment 52 Marek Kašík 2013-02-07 15:07:02 UTC
Created attachment 235414 [details]
samba installation workflow screenshot 5/6
Comment 53 Marek Kašík 2013-02-07 15:07:40 UTC
Created attachment 235416 [details]
samba installation workflow screenshot 6/6
Comment 54 Allan Day 2013-02-11 17:37:41 UTC
Hi Marek, thanks for the screenshots - they're really useful. In general this is looking good. The dialogs are suffering from bug 690447 - fixing that will be an improvement.

Apart from that, the main issue is the password dialogs. I won't go through the issues with those here, but will instead point you to the mockup we already have for shell modal dialogs here:

http://bugzilla-attachments.gnome.org/attachment.cgi?id=231873

In the case where you need to authenticate in order to list samba printers, there should be an extra string to explain. Something like "Authentication needed to view remote printers."
Comment 55 Allan Day 2013-02-12 20:20:41 UTC
Created attachment 235813 [details]
mockups for password dialogs

After some debate on IRC, it seems that using GTK for the password dialogs is the best option right now. Here's some design guidance for how the dialogs should look at behave.
Comment 56 Marek Kašík 2013-02-14 13:45:51 UTC
Created attachment 236056 [details]
password dialog

This is the password dialog. There will be just one such dialog which will ask user for password when a samba server needs authentication to show its printers. We've agreed that it won't have the "Remember Password" checkbox because it would save the password in plaintext to "/etc/cups/printers.conf" which is not good.

(The icon of the key is not just available on my local build of 3.8 libraries but it will be there when running it in full 3.8 session).
Comment 57 Marek Kašík 2013-02-14 16:20:18 UTC
Created attachment 236094 [details] [review]
add function for clearing of passwords

Following patches implement searching for samba printers in new printer dialog.
Comment 58 Marek Kašík 2013-02-14 16:20:44 UTC
Created attachment 236095 [details] [review]
add authentication dialog for samba printers
Comment 59 Marek Kašík 2013-02-14 16:21:04 UTC
Created attachment 236096 [details] [review]
add class for searching for samba printers
Comment 60 Marek Kašík 2013-02-14 16:21:27 UTC
Created attachment 236097 [details] [review]
search for samba printers in new printer dialog
Comment 61 Marek Kašík 2013-02-14 16:23:41 UTC
The first patch just implements a function for clearing password strings. The second one implements the authentication dialog used for listing printers on authenticated samba server. The third one is a class similar to PpHost and PpCups for searching for samba printers. The last patch uses previous 3 patches in new printer dialog.
Comment 62 Marek Kašík 2013-02-14 16:27:16 UTC
Btw, we agreed with Allan on the design of the authentication dialog.
Comment 63 Bastien Nocera 2013-02-15 14:44:02 UTC
Review of attachment 236094 [details] [review]:

::: panels/printers/pp-utils.c
@@ +3965,3 @@
+  if (password && *password)
+    {
+      memset (*password, 0, strlen (*password));

Why the memset?
Just the g_clear_pointer() call should be enough.
Comment 64 Bastien Nocera 2013-02-15 14:47:47 UTC
Review of attachment 236095 [details] [review]:

::: panels/printers/Makefile.am
@@ +37,1 @@
 	pp-options-dialog.h		\

You forgot to add the .ui file somewhere in Makefile.am, it would fail distcheck.

::: panels/printers/pp-authentication-dialog.c
@@ +210,3 @@
+  if (response_id == GTK_RESPONSE_OK)
+    {
+      username = g_strdup (gtk_entry_get_text (

Split those off in separate functions, the code for getting the password and the username are the exact same.

@@ +244,3 @@
+
+  password_entry = (GtkWidget *)
+    gtk_builder_get_object (priv->builder, "password-entry");

Maybe a "WID()" macro as in some other panels would be useful.

::: panels/printers/pp-authentication-dialog.h
@@ +56,3 @@
+PpAuthenticationDialog *pp_authentication_dialog_new      (GtkWindow   *parent,
+                                                           const gchar *text,
+                                                           const gchar *username);

default_username, as it can be changed in the dialogue itself.
Comment 65 Bastien Nocera 2013-02-15 14:49:33 UTC
Review of attachment 236096 [details] [review]:

::: configure.ac
@@ +148,3 @@
 PKG_CHECK_MODULES(PRINTERS_PANEL, $COMMON_MODULES
+                  polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION
+                  smbclient)

Don't forget to send a mail to the release-team about this, and ensure that libsmbclient is in jhbuild.

::: panels/printers/pp-host.h
@@ -38,3 @@
-typedef struct{
-  GList *devices;
-} PpDevicesList;

You should move it in a separate patch if it's unused outside pp-utils.c
Comment 66 Bastien Nocera 2013-02-15 14:52:11 UTC
Review of attachment 236097 [details] [review]:

::: panels/printers/pp-new-printer-dialog.c
@@ +317,3 @@
   priv->remote_cups_searching = FALSE;
   priv->snmp_searching = FALSE;
+  priv->samba_host_searching = FALSE;

Those shouldn't be necessary, the private section of GObjects is zeroed when instantiated.

@@ +1653,3 @@
+                         priv->new_device->network_device);
+
+#ifdef GDK_WINDOWING_X11

We don't support running on non-X11 for now, remove.

@@ +1755,2 @@
 #ifdef GDK_WINDOWING_X11
+              window_id = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (_dialog)));

Ditto.
Comment 67 Marek Kašík 2013-02-15 15:21:20 UTC
(In reply to comment #63)
> Review of attachment 236094 [details] [review]:
> 
> ::: panels/printers/pp-utils.c
> @@ +3965,3 @@
> +  if (password && *password)
> +    {
> +      memset (*password, 0, strlen (*password));
> 
> Why the memset?
> Just the g_clear_pointer() call should be enough.

The memset overwrites the password so nobody will be able to read it by dumping memory. This should improve security.
Comment 68 Bastien Nocera 2013-02-15 16:31:36 UTC
(In reply to comment #67)
> The memset overwrites the password so nobody will be able to read it by dumping
> memory. This should improve security.

It wouldn't, really. If you're interested in enhancing security, please file a separate bug and talk to stefw about what to do here. I really doubt that running memset() is sufficient.
Comment 69 Marek Kašík 2013-02-15 16:33:53 UTC
Created attachment 236269 [details] [review]
authentication dialog for samba printers - modified

(In reply to comment #64)
> Review of attachment 236095 [details] [review]:
> 
> ::: panels/printers/Makefile.am
> @@ +37,1 @@
>      pp-options-dialog.h        \
> 
> You forgot to add the .ui file somewhere in Makefile.am, it would fail
> distcheck.

All ui files are listed in printers.gresource.xml.


> ::: panels/printers/pp-authentication-dialog.c
> @@ +210,3 @@
> +  if (response_id == GTK_RESPONSE_OK)
> +    {
> +      username = g_strdup (gtk_entry_get_text (
> 
> Split those off in separate functions, the code for getting the password and
> the username are the exact same.

Done.


> @@ +244,3 @@
> +
> +  password_entry = (GtkWidget *)
> +    gtk_builder_get_object (priv->builder, "password-entry");
> 
> Maybe a "WID()" macro as in some other panels would be useful.

Done.


> ::: panels/printers/pp-authentication-dialog.h
> @@ +56,3 @@
> +PpAuthenticationDialog *pp_authentication_dialog_new      (GtkWindow  
> *parent,
> +                                                           const gchar *text,
> +                                                           const gchar
> *username);
> 
> default_username, as it can be changed in the dialogue itself.

Done.
Comment 70 Marek Kašík 2013-02-15 16:39:17 UTC
(In reply to comment #68)
> (In reply to comment #67)
> > The memset overwrites the password so nobody will be able to read it by dumping
> > memory. This should improve security.
> 
> It wouldn't, really. If you're interested in enhancing security, please file a
> separate bug and talk to stefw about what to do here. I really doubt that
> running memset() is sufficient.

ok, I'm going to remove the function and modify the rest of the patches to not include it.
Comment 71 Marek Kašík 2013-02-15 16:40:07 UTC
Comment on attachment 236269 [details] [review]
authentication dialog for samba printers - modified

I have to remove using of the clear_password() yet.
Comment 72 Marek Kašík 2013-02-15 16:48:19 UTC
Created attachment 236270 [details] [review]
authentication dialog for samba printers - modified

(In reply to comment #71)
> (From update of attachment 236269 [details] [review])
> I have to remove using of the clear_password() yet.

I've removed usage of the clear_password().
Comment 73 Marek Kašík 2013-02-15 17:01:12 UTC
Created attachment 236273 [details] [review]
class for searching for samba printers - modified

(In reply to comment #65)
> Review of attachment 236096 [details] [review]:
> 
> ::: configure.ac
> @@ +148,3 @@
>  PKG_CHECK_MODULES(PRINTERS_PANEL, $COMMON_MODULES
> +                  polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION
> +                  smbclient)
> 
> Don't forget to send a mail to the release-team about this, and ensure that
> libsmbclient is in jhbuild.

I will handle this at Monday.


> ::: panels/printers/pp-host.h
> @@ -38,3 @@
> -typedef struct{
> -  GList *devices;
> -} PpDevicesList;
> 
> You should move it in a separate patch if it's unused outside pp-utils.c

It is used outside pp-utils.c. This is needed by PpSamba for return value of pp_samba_get_devices_finish(). The value is used in PpNewPrinterDialog.

I removed the usage of clear_password().
Comment 74 Marek Kašík 2013-02-15 17:21:45 UTC
Created attachment 236275 [details] [review]
search for samba printers in new printer dialog - modififed

(In reply to comment #66)
> Review of attachment 236097 [details] [review]:
> 
> ::: panels/printers/pp-new-printer-dialog.c
> @@ +317,3 @@
>    priv->remote_cups_searching = FALSE;
>    priv->snmp_searching = FALSE;
> +  priv->samba_host_searching = FALSE;
> 
> Those shouldn't be necessary, the private section of GObjects is zeroed when
> instantiated.

I've removed them.

> @@ +1653,3 @@
> +                         priv->new_device->network_device);
> +
> +#ifdef GDK_WINDOWING_X11
> 
> We don't support running on non-X11 for now, remove.
> 
> @@ +1755,2 @@
>  #ifdef GDK_WINDOWING_X11
> +              window_id = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET
> (_dialog)));
> 
> Ditto.

Done.
Comment 75 Marek Kašík 2013-02-15 17:27:21 UTC
I've committed those patches and hence I'm closing this bug.

Thank you all for your help :).
Comment 76 Allan Day 2013-02-15 17:42:33 UTC
Great news, Marek!