gnome-control-center/panels/printers/new-printer-dialog.ui
Brandon Nielsen 179bda1b64 Make PpNewPrinterDialog a GtkDialog instead of GObject
This is accomplished by moving the calls to pp_printer_add_async
directly to CcPrintersPanel. pp_printer_delete_async calls are already
done directly in the CcPrintersPanel so there is consistency gained by
this implementation in addition to PpNewPrinterDialog actually being a
GtkDialog.

A pp_new_printer_dialog_get_new_print_device method has been added to
PpNewPrinterDialog to allow getting the PpPrintDevice selected by the
user to add. This can be called anytime after a response callback
with a GTK_RESPONSE_OK reponse_id.

PpNewPrinterDialog still does asynchronous operations to populate the
dialog, but the create dialog -> receive signal -> destroy dialog flow
can all be handled like a traditional GtkDialog without additional
callbacks or signalling.
2021-07-26 16:03:05 +00:00

430 lines
20 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.14"/>
<object class="GtkListStore" id="devices_liststore">
<columns>
<!-- column-name device_gicon -->
<column type="GIcon"/>
<!-- column-name device_name -->
<column type="gchararray"/>
<!-- column-name device_display_name -->
<column type="gchararray"/>
<!-- column-name device_description -->
<column type="gchararray"/>
<!-- column-name server_needs_authentication -->
<column type="gboolean"/>
<!-- column-name device_visible -->
<column type="gboolean"/>
<!-- column-name device -->
<column type="PpPrintDevice"/>
</columns>
</object>
<object class="GtkTreeModelFilter" id="devices_model_filter">
<property name="child_model">devices_liststore</property>
</object>
<template class="PpNewPrinterDialog" parent="GtkDialog">
<property name="width_request">480</property>
<property name="height_request">490</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes" comments="Translators: This is the title presented at top of the dialog.">Add Printer</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<property name="use_header_bar">1</property>
<child internal-child="headerbar">
<object class="GtkHeaderBar" id="headerbar">
<property name="visible">True</property>
<property name="show-close-button">False</property>
<child>
<object class="GtkStack" id="headerbar_topleft_buttons">
<property name="visible">True</property>
<property name="valign">center</property>
<child>
<object class="GtkButton" id="new_printer_cancel_button">
<property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="name">addprinter-page</property>
</packing>
</child>
<child>
<object class="GtkButton" id="go_back_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">start</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">go-previous-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="name">authentication-page</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkStack" id="headerbar_topright_buttons">
<property name="visible">True</property>
<property name="valign">center</property>
<child>
<object class="GtkButton" id="new_printer_add_button">
<property name="label" translatable="yes">_Add</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="name">addprinter-page</property>
</packing>
</child>
<child>
<object class="GtkButton" id="unlock_button">
<property name="label" translatable="yes" comments="Translators: This button opens authentication dialog for selected server.">_Unlock</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="name">unlock_button</property>
</packing>
</child>
<child>
<object class="GtkButton" id="authenticate_button">
<property name="label" translatable="yes" comments="Translators: This buttons submits the credentials for the selected server.">_Unlock</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="name">authentication-page</property>
</packing>
</child>
</object>
<packing>
<property name="pack-type">GTK_PACK_END</property>
</packing>
</child>
</object>
</child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<property name="border_width">0</property>
<child>
<object class="GtkStack" id="dialog_stack">
<property name="visible">True</property>
<property name="border_width">0</property>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="transition-type">none</property>
<property name="has_focus">True</property>
<style>
<class name="view"/>
</style>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkTreeView" id="devices_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">devices_model_filter</property>
<property name="headers_visible">False</property>
<property name="enable-grid-lines">GTK_TREE_VIEW_GRID_LINES_HORIZONTAL</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection"/>
</child>
</object>
</child>
</object>
<packing>
<property name="name">standard-page</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">GTK_ORIENTATION_VERTICAL</property>
<property name="valign">GTK_ALIGN_CENTER</property>
<property name="spacing">10</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">GTK_ALIGN_START</property>
<property name="pixel_size">80</property>
<property name="icon_name">printer-symbolic</property>
<property name="opacity">0.6</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="no-devices-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="sensitive">False</property>
<property name="label" translatable="yes" comments="Translators: No printers were detected">No Printers Found</property>
<property name="opacity">0.6</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="name">no-printers-page</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<style>
<class name="view"/>
</style>
<child>
<object class="GtkSpinner" id="spinner">
<property name="visible">True</property>
<property name="active">True</property>
<property name="expand">True</property>
<property name="sensitive">False</property>
<property name="opacity">0.6</property>
</object>
</child>
</object>
<packing>
<property name="name">loading-page</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkToolbar" id="toolbar1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="toolbar_style">icons</property>
<property name="icon_size">1</property>
<style>
<class name="toolbar"/>
</style>
<child>
<object class="GtkToolItem" id="toolbutton1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">4</property>
<child>
<object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_tooltip">True</property>
<property name="invisible_char"></property>
<property name="truncate_multiline">True</property>
<property name="invisible_char_set">True</property>
<property name="placeholder_text" translatable="yes" comments="Translators: The entered text should contain network address of a printer or a text which will filter found devices (their names and locations)">Enter a network address or search for a printer</property>
<property name="margin_start">40</property>
<property name="margin_end">40</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="name">addprinter-page</property>
</packing>
</child>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="margin">20</property>
<property name="row_spacing">10</property>
<property name="column_spacing">15</property>
<property name="expand">True</property>
<style>
<class name="background"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="pixel_size">48</property>
<property name="icon_name">dialog-password-symbolic</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="authentication_title">
<property name="visible">True</property>
<property name="label" translatable="yes">Authentication Required</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="authentication_text">
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="max_width_chars">36</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Enter username and password to view printers on Print Server.</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Username</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="username_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="activates_default">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Password</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="password_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
<property name="invisible_char"></property>
<property name="activates_default">True</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
</object>
<packing>
<property name="name">authentication-page</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-6">new_printer_cancel_button</action-widget>
<action-widget response="-5">new_printer_add_button</action-widget>
</action-widgets>
</template>
<object class="GtkSizeGroup">
<widgets>
<widget name="new_printer_cancel_button"/>
<widget name="headerbar_topright_buttons"/>
</widgets>
</object>
</interface>