blob: 7a1da54f25b41c64dc6555336cc7ad78814c7e0e [file] [log] [blame]
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/cr_elements/cr_scrollable_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/cr_searchable_drop_down/cr_searchable_drop_down.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="cups_add_printer_dialog_elements.html">
<link rel="import" href="cups_printer_dialog_util.html">
<link rel="import" href="cups_printer_shared_css.html">
<link rel="import" href="cups_printers_browser_proxy.html">
<dom-module id="settings-cups-edit-printer-dialog">
<template>
<style include="cups-printer-shared"> </style>
<add-printer-dialog>
<div slot="dialog-title">$i18n{editPrinterDialogTitle}</div>
<div slot="dialog-body" scrollable>
<div class="settings-box first two-line">
<cr-input class="printer-name-input" autofocus
id="printerName"
value="{{pendingPrinter_.printerName}}"
on-input="onPrinterInfoChange_"
label="$i18n{printerName}"
maxlength=64>
</cr-input>
</div>
<div class="settings-box two-line">
<cr-input label="$i18n{printerAddress}"
id="printerAddress"
on-input="onPrinterInfoChange_"
value="{{pendingPrinter_.printerAddress}}"
disabled="[[!networkProtocolActive_]]"
maxlength=63>
</cr-input>
</div>
<div class="settings-box two-line">
<div class="start">
<div id="printerProtocol" class="label">$i18n{printerProtocol}</div>
<div class="secondary">
<select class="md-select" aria-labelledby="printerProtocol"
value="[[pendingPrinter_.printerProtocol]]"
on-change="onProtocolChange_"
disabled="[[!networkProtocolActive_]]">
<option value="ipp" disabled="[[!networkProtocolActive_]]">
$i18n{printerProtocolIpp}
</option>
<option value="ipps" disabled="[[!networkProtocolActive_]]">
$i18n{printerProtocolIpps}
</option>
<option value="http" disabled="[[!networkProtocolActive_]]">
$i18n{printerProtocolHttp}
</option>
<option value="https" disabled="[[!networkProtocolActive_]]">
$i18n{printerProtocolHttps}
</option>
<option value="socket" disabled="[[!networkProtocolActive_]]">
$i18n{printerProtocolAppSocket}
</option>
<option value="lpd" disabled="[[!networkProtocolActive_]]">
$i18n{printerProtocolLpd}
</option>
<option value="usb" disabled="[[networkProtocolActive_]]">
$i18n{printerProtocolUsb}
</option>
<option value="ippusb" disabled="[[networkProtocolActive_]]">
$i18n{printerProtocolIppUsb}
</option>
</select>
</div>
</div>
</div>
<div class="settings-box two-line">
<cr-input id="printerQueue" label="$i18n{printerQueue}"
value="{{pendingPrinter_.printerQueue}}"
on-input="onPrinterInfoChange_"
disabled="[[!networkProtocolActive_]]"
maxlength=64>
</cr-input>
</div>
<div class="settings-box two-line">
<cr-input label="$i18n{printerURI}" readonly
value="[[getPrinterURI_(pendingPrinter_)]]">
</cr-input>
</div>
<div class="settings-box two-line">
<cr-searchable-drop-down items="[[manufacturerList]]"
id="printerPPDManufacturer"
label="$i18n{printerManufacturer}"
value="{{pendingPrinter_.ppdManufacturer}}">
</cr-searchable-drop-down>
</div>
<div class="settings-box two-line">
<cr-searchable-drop-down items="[[modelList]]"
id="printerPPDModel"
label="$i18n{printerModel}"
value="{{pendingPrinter_.ppdModel}}">
</cr-searchable-drop-down>
</div>
<div class="settings-box two-line">
<cr-input class="browse-file-input" readonly tabindex="-1"
value="[[userPPD_]]" label="$i18n{selectDriver}"
error-message="$i18n{selectDriverErrorMessage}"
invalid="[[invalidPPD_]]">
</cr-input>
<paper-button class="browse-button" on-click="onBrowseFile_">
$i18n{selectDriverButtonText}
</paper-button>
</div>
<div class="eula" id="eulaUrl" hidden="[[!eulaUrl_]]">
<a href="[[eulaUrl_]]" target="_blank">$i18n{printerEulaNotice}</a>
</div>
</div>
<div slot="dialog-buttons">
<paper-button class="cancel-button secondary-button"
on-click="onCancelTap_">
$i18n{cancel}
</paper-button>
<paper-button class="action-button" on-click="onSaveTap_"
disabled="[[!canSavePrinter_(pendingPrinter_.*,
printerInfoChanged_)]]">
$i18n{editPrinterButtonText}
</paper-button>
</div>
</add-printer-dialog>
</template>
<script src="cups_edit_printer_dialog.js"></script>
</dom-module>