Initial implementation of Printers panel

Created by Marek Kasik, modified by Jon McCann.
It has been implemented according to design at:
http://live.gnome.org/Design/SystemSettings/Printers
(not fully implemented yet)
This commit is contained in:
Marek Kasik 2010-12-17 13:58:45 +01:00
parent 34e473123e
commit 8c4511b52e
8 changed files with 1606 additions and 0 deletions

View file

@ -106,6 +106,10 @@ PKG_CHECK_MODULES(PULSEAUDIO,
libpulse-mainloop-glib >= $PA_REQUIRED_VERSION)
AC_SUBST(PULSEAUDIO_CFLAGS)
AC_SUBST(PULSEAUDIO_LIBS)
# check for cups
AC_CHECK_HEADERS(cups/cups.h cups/http.h cups/ipp.h)
CUPS_LIBS=-lcups
AC_SUBST(CUPS_LIBS)
gtk_lib_dir=`$PKG_CONFIG --variable libdir gtk+-3.0`
gtk_binary_version=`$PKG_CONFIG --variable gtk_binary_version gtk+-3.0`
@ -372,6 +376,8 @@ panels/info/Makefile
panels/info/gnome-info-panel.desktop.in
panels/power/Makefile
panels/power/gnome-power-panel.desktop.in
panels/printers/Makefile
panels/printers/gnome-printers-panel.desktop.in
panels/network/Makefile
panels/network/gnome-network-panel.desktop.in
panels/universal-access/Makefile

View file

@ -5,6 +5,7 @@ SUBDIRS= \
display \
media \
mouse \
printers \
region \
network \
info \

View file

@ -0,0 +1,33 @@
uidir = $(pkgdatadir)/ui/printers
dist_ui_DATA = \
printers.ui
INCLUDES = \
$(PANEL_CFLAGS) \
$(DBUS_CFLAGS) \
$(GNOMECC_CAPPLETS_CFLAGS) \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-DDATADIR="\"$(uidir)\"" \
$(NULL)
ccpanelsdir = $(PANELS_DIR)
ccpanels_LTLIBRARIES = libprinters.la
libprinters_la_SOURCES = \
printers-module.c \
cc-printers-panel.c \
cc-printers-panel.h
libprinters_la_LIBADD = $(PANEL_LIBS) $(CUPS_LIBS) $(DBUS_LIBS)
libprinters_la_LDFLAGS = $(PANEL_LDFLAGS)
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
desktop_in_files = gnome-printers-panel.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
CLEANFILES = $(desktop_in_files) $(desktop_DATA)
-include $(top_srcdir)/git.mk

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,72 @@
/*
* Copyright (C) 2010 Red Hat, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef _CC_PRINTERS_PANEL_H
#define _CC_PRINTERS_PANEL_H
#include <libgnome-control-center/cc-panel.h>
G_BEGIN_DECLS
#define CC_TYPE_PRINTERS_PANEL cc_printers_panel_get_type()
#define CC_PRINTERS_PANEL(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
CC_TYPE_PRINTERS_PANEL, CcPrintersPanel))
#define CC_PRINTERS_PANEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
CC_TYPE_PRINTERS_PANEL, CcPrintersPanelClass))
#define CC_IS_PRINTERS_PANEL(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
CC_TYPE_PRINTERS_PANEL))
#define CC_IS_PRINTERS_PANEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
CC_TYPE_PRINTERS_PANEL))
#define CC_PRINTERS_PANEL_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
CC_TYPE_PRINTERS_PANEL, CcPrintersPanelClass))
typedef struct _CcPrintersPanel CcPrintersPanel;
typedef struct _CcPrintersPanelClass CcPrintersPanelClass;
typedef struct _CcPrintersPanelPrivate CcPrintersPanelPrivate;
struct _CcPrintersPanel
{
CcPanel parent;
CcPrintersPanelPrivate *priv;
};
struct _CcPrintersPanelClass
{
CcPanelClass parent_class;
};
GType cc_printers_panel_get_type (void) G_GNUC_CONST;
void cc_printers_panel_register (GIOModule *module);
G_END_DECLS
#endif /* _CC_PRINTERS_PANEL_H */

View file

@ -0,0 +1,14 @@
[Desktop Entry]
_Name=Printers
_Comment=Change printer settings
Exec=gnome-control-center printers
Icon=printer
Terminal=false
Type=Application
StartupNotify=true
# The X-GNOME-Settings-Panel is necessary to show in the main shell UI
Categories=GNOME;GTK;Settings;HardwareSettings;X-GNOME-Settings-Panel;
OnlyShowIn=GNOME;
X-GNOME-Settings-Panel=printers
# Translators: those are keywords for the printing control-center panel
_X-GNOME-Keywords=Foo;Bar;Baz;

View file

@ -0,0 +1,39 @@
/*
* Copyright (C) 2010 Red Hat, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#include <config.h>
#include "cc-printers-panel.h"
#include <glib/gi18n.h>
void
g_io_module_load (GIOModule *module)
{
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
/* register the panel */
cc_printers_panel_register (module);
}
void
g_io_module_unload (GIOModule *module)
{
}

420
panels/printers/printers.ui Normal file
View file

@ -0,0 +1,420 @@
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.20"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkVBox" id="main-vbox">
<property name="border_width">10</property>
<property name="orientation">vertical</property>
<property name="spacing">10</property>
<child>
<object class="GtkHBox" id="hbox1">
<property name="width_request">675</property>
<property name="height_request">337</property>
<property name="visible">True</property>
<property name="spacing">10</property>
<child>
<object class="GtkVBox" id="vbox2">
<property name="width_request">180</property>
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkTreeView" id="printer-treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToolbar" id="toolbar1">
<property name="visible">True</property>
<property name="toolbar_style">icons</property>
<child>
<object class="GtkToolButton" id="printer-add-button">
<property name="visible">True</property>
<property name="tooltip_text" translatable="yes">Add new printer</property>
<property name="label" translatable="yes">AddPrinter</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-add</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="printer-delete-button">
<property name="visible">True</property>
<property name="tooltip_text" translatable="yes">Remove selected printer</property>
<property name="label" translatable="yes">RemovePrinter</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-remove</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="column_spacing">10</property>
<property name="row_spacing">10</property>
<child>
<object class="GtkVBox" id="vbox6">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkTreeView" id="allowed-users-treeview">
<property name="height_request">60</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToolbar" id="toolbar">
<property name="visible">True</property>
<child>
<object class="GtkToolButton" id="allowed-user-add-button">
<property name="visible">True</property>
<property name="label" translatable="yes">toolbutton7</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-add</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="allowed-user-remove-button">
<property name="visible">True</property>
<property name="label" translatable="yes">toolbutton8</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-remove</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">Share with these users:</property>
</object>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Printer URI:</property>
</object>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Ink:</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Location:</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label11">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Printer:</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="printer-URI-entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkDrawingArea" id="drawingarea1">
<property name="visible">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="printer-location-label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">---</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="printer-name-label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">---</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<property name="layout_style">edge</property>
<child>
<object class="GtkButton" id="print-test-page-button">
<property name="label" translatable="yes">Print Test Page</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="clean-print-heads-button">
<property name="label" translatable="yes">Clean Print Heads</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="printer-disable-button">
<property name="label" translatable="yes">Disable Printer</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="yalign">0.43999999761581421</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkExpander" id="expander1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkToolbar" id="toolbar2">
<property name="visible">True</property>
<child>
<object class="GtkToolButton" id="job-cancel-button">
<property name="visible">True</property>
<property name="tooltip_text" translatable="yes">Cancel selected job</property>
<property name="label" translatable="yes">toolbutton3</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-cancel</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="job-delete-button">
<property name="visible">True</property>
<property name="tooltip_text" translatable="yes">Delete selected job</property>
<property name="label" translatable="yes">toolbutton4</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-delete</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="job-pause-button">
<property name="visible">True</property>
<property name="tooltip_text" translatable="yes">Pause selected job</property>
<property name="label" translatable="yes">toolbutton5</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-media-pause</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="job-release-button">
<property name="visible">True</property>
<property name="tooltip_text" translatable="yes">Release selected job</property>
<property name="label" translatable="yes">toolbutton6</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-media-play</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkTreeView" id="job-treeview">
<property name="height_request">100</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="tooltip_text" translatable="yes">Show / hide printer's jobs</property>
<property name="label" translatable="yes">Printer Queue</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
</interface>