[gnome-control-center/wip/feborges/new-addprinter-dialog: 42/44] printers: Use "hostname" in the "Add Printer" dialog
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/feborges/new-addprinter-dialog: 42/44] printers: Use "hostname" in the "Add Printer" dialog
- Date: Sun, 11 Dec 2016 15:08:41 +0000 (UTC)
commit bb550cf4c9bb0542da680057de2bc1ae933a891e
Author: Felipe Borges <felipeborges gnome org>
Date: Sat Nov 12 18:41:23 2016 +0100
printers: Use "hostname" in the "Add Printer" dialog
https://bugzilla.gnome.org/show_bug.cgi?id=760783
panels/printers/new-printer-dialog.ui | 2 +-
panels/printers/pp-new-printer-dialog.c | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/panels/printers/new-printer-dialog.ui b/panels/printers/new-printer-dialog.ui
index bf583a7..479d9c8 100644
--- a/panels/printers/new-printer-dialog.ui
+++ b/panels/printers/new-printer-dialog.ui
@@ -332,7 +332,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel">
+ <object class="GtkLabel" id="authentication-title">
<property name="label" translatable="yes">Authentication Required</property>
<property name="xalign">0</property>
<attributes>
diff --git a/panels/printers/pp-new-printer-dialog.c b/panels/printers/pp-new-printer-dialog.c
index 7d67eb1..37636d6 100644
--- a/panels/printers/pp-new-printer-dialog.c
+++ b/panels/printers/pp-new-printer-dialog.c
@@ -375,6 +375,7 @@ on_authenticate (GtkWidget *button,
pp_samba_set_auth_info (PP_SAMBA (priv->samba_host), username, password);
+ gtk_header_bar_set_title (GTK_HEADER_BAR (WID ("headerbar")), _("Add Printer"));
go_to_page (dialog, ADDPRINTER_PAGE);
}
@@ -384,10 +385,25 @@ on_authentication_required (PpHost *host,
{
PpNewPrinterDialogPrivate *priv;
PpNewPrinterDialog *dialog = PP_NEW_PRINTER_DIALOG (user_data);
+ gchar *text, *hostname;
priv = dialog->priv;
gtk_header_bar_set_subtitle (GTK_HEADER_BAR (WID ("headerbar")), NULL);
+ gtk_header_bar_set_title (GTK_HEADER_BAR (WID ("headerbar")), _("Unlock Print Server"));
+
+ g_object_get (G_OBJECT (host), "hostname", &hostname, NULL);
+ /* Translators: Samba server needs authentication of the user to show list of its printers. */
+ text = g_strdup_printf (_("Unlock %s."), hostname);
+ gtk_label_set_text (GTK_LABEL (WID ("authentication-title")), text);
+ g_free (text);
+
+ /* Translators: Samba server needs authentication of the user to show list of its printers. */
+ text = g_strdup_printf (_("Enter username and password to view printers on %s."), hostname);
+ gtk_label_set_text (GTK_LABEL (WID ("authentication-text")), text);
+ g_free (hostname);
+ g_free (text);
+
go_to_page (dialog, AUTHENTICATION_PAGE);
g_signal_connect (WID ("authenticate-button"), "clicked", G_CALLBACK (on_authenticate), dialog);
@@ -430,6 +446,7 @@ on_go_back_button_clicked (GtkButton *button,
* selected entry. */
gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (priv->treeview));
+ gtk_header_bar_set_title (GTK_HEADER_BAR (WID ("headerbar")), _("Add Printer"));
go_to_page (dialog, ADDPRINTER_PAGE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]