LINUX.ORG.RU
решено ФорумAdmin

Выставить принтер по умолчанию.

 


0

3

Есть 3 сетевых принтера.В system-config-printer выставлен нужный принтер. В /etc/cups/lpoptions и ~/.cups/lpoptions прописан он же. Но в gedit и, например, просмотрищке изображений по умолчанию выбран другой принтер. В чем причина, как можно исправить?

Ответ на: комментарий от Elyas

А как это сделать, если принтер сетевой, и при нажатии на него происходит переход на страницу cups другого компьютера? Нагугливал такое решение: в строке браузера дописать ?cups op=set-as-default, но в текущей версии cups это не работает. Кроме того, в интернете пишут , что cups берет принтер по умолчанию из lpoptions, где он стоит тот, который нужен. Смотрю исходники gedit, там вызывает стандартный гномовский диалог печати: dialog = g_object_new (GNOME_TYPE_PRINT_DIALOG, «print_config», pji->config, NULL); Осталось найти, откуда он берет принтеры.

qwertyui
() автор топика
Ответ на: комментарий от qwertyui

Пока дошел до сюда:

* Loads the configured printers, should only be called once per * process. Use gpa_root_get_printers to get the list of printers. * * Return Value: a GPAList node with childs of type GPAPrinter **/ GPAList * gpa_printer_list_load (void) { GPAList *printers; GPANode *p; gchar *path;

if (gpa_root && gpa_root->printers != NULL) { g_warning («gpa_printer_list_load should only be called once»); return NULL; }

printers = gpa_list_new (GPA_TYPE_PRINTER, «Printers», TRUE);

path = g_build_filename (GPA_DATA_DIR, «printers», NULL); gpa_printer_list_load_from_dir (printers, path); g_free (path); gpa_printer_list_load_from_module_dir (printers, GPA_MODULES_DIR);

if (GPA_NODE (printers)->children == NULL) { g_warning («Could not load any Printer. Check your libgnomeprint installation\n»); gpa_node_unref (GPA_NODE (printers)); return NULL; }

p = gpa_node_get_child (GPA_NODE (printers), NULL); while (p) { gpa_printer_get_default_settings (GPA_PRINTER (p)); p = gpa_node_get_child (GPA_NODE (printers), p); } gpa_list_reverse (printers);

return printers; }

qwertyui
() автор топика
Ответ на: комментарий от anonymous

Вдогонку

  ~/.cups/lpoptions  -  user  defaults  and instances created by non-root        users.
  /etc/cups/lpoptions - system-wide defaults and instances created by the root user.
anonymous
()
Ответ на: комментарий от anonymous

Разобрался: не то прописывал в lpoptions Нужно Default <имя принтера> Всем спасибо!

qwertyui
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.