Allow printers to hard-wire values of options

Ouverte
#2 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
35/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
perl, xml
Domaine
backend

Piste de recherche

Start with the option XML definition shown, especially constraints, enum_vals, arg_defval, and the proposed arg_val. Review how the engine handles per-printer values and determine whether direct driverval support can cover enum and free-valued options without enum boilerplate. Done means the supported behavior and its effect on user interfaces are defined and verified.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

I'm looking for a reasonable way to hard-wire the value of an option for a specific printer. For example, with the following shortened definition, I can define the default value of the option:

<option type="enum" id="opt/Resolution">
  <arg_longname><en>Resolution</en></arg_longname>
  <arg_shortname><en>Resolution</en></arg_shortname>
  <arg_execution> ... </arg_execution>
  <constraints>
    <constraint sense="true">
      <driver>driver</driver>
      <printer>printer</printer>
      <arg_defval>ev/300dpi</arg_defval>
    </constraint>
  </constraints>
  <enum_vals>
    <enum_val id="ev/300dpi">
      <ev_driverval>300</ev_driverval>
      ...
    </enum_val>
    <enum_val id="ev/600dpi">
      <ev_driverval>600</ev_driverval>
      ...
    </enum_val>
  </enum_vals>
</option>

If I add constraints on the enum_vals so that only a single option remains available for a printer, the option will disappear fro user interfaces and it will effectively be hard-wired.

However, for options that always have exactly one value for each supported printers, this still requires adding an enum for each possible choice, and some boilerplate code. It obviously doesn't work at all for options that have free values.

What I'd ideally like to do is to directly define the driverval, so something like <arg_val>300</arg_val> instead of <arg_defval>ev/300dpi</arg_defval>. Is there a way to do that already?

Langage dominant
Perl
Étoiles
8
Forks
5
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de OpenPrinting/foomatic-db-engine

Toutes les issues de OpenPrinting/foomatic-db-engine

Issues similaires

Plus d'issues Perl

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.