Commit fc073f21 authored by Felipe Borges's avatar Felipe Borges
Browse files

printers: Authenticate samba server also on double-click

The "Add Printer" dialog should be smart enough to know whether
an item listed in the dialog is a samba server or just a printer.
If it is a samba server, it should go for the authentication page
instead of emitting a GTK_RESPONSE_*.
parent 1504a4d5
......@@ -1974,8 +1974,30 @@ row_activated_cb (GtkTreeView *tree_view,
PpNewPrinterDialog *dialog = (PpNewPrinterDialog *) user_data;
PpNewPrinterDialogPrivate *priv = dialog->priv;
GtkTreeModel *model;
GtkTreeIter iter;
GtkWidget *widget;
gboolean authentication_needed;
gboolean selected;
gtk_dialog_response (GTK_DIALOG (priv->dialog), GTK_RESPONSE_OK);
selected = gtk_tree_selection_get_selected (gtk_tree_view_get_selection (priv->treeview),
if (selected)
gtk_tree_model_get (model, &iter, SERVER_NEEDS_AUTHENTICATION_COLUMN, &authentication_needed, -1);
if (authentication_needed)
widget = WID ("unlock-button");
authenticate_samba_server (GTK_BUTTON (widget), dialog);
gtk_dialog_response (GTK_DIALOG (priv->dialog), GTK_RESPONSE_OK);
static void
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment