Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Settings
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
671
Issues
671
List
Boards
Labels
Service Desk
Milestones
Merge Requests
52
Merge Requests
52
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
Settings
Commits
23faa29f
Commit
23faa29f
authored
Jan 07, 2011
by
Marek Kašík
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
printers: Show printer's description instead of its name
parent
22f0ad39
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
panels/printers/cc-printers-panel.c
panels/printers/cc-printers-panel.c
+21
-13
panels/printers/printers.ui
panels/printers/printers.ui
+2
-2
No files found.
panels/printers/cc-printers-panel.c
View file @
23faa29f
...
...
@@ -132,9 +132,9 @@ printer_selection_changed_cb (GtkTreeSelection *selection,
const
gchar
*
none
=
"---"
;
GtkWidget
*
widget
;
gboolean
paused
=
FALSE
;
gchar
*
instance
=
NULL
;
gchar
*
location
=
NULL
;
gchar
*
description
=
NULL
;
gchar
*
device_uri
=
NULL
;
gchar
*
location
=
NULL
;
int
id
,
i
;
priv
=
PRINTERS_PANEL_PRIVATE
(
self
);
...
...
@@ -155,16 +155,6 @@ printer_selection_changed_cb (GtkTreeSelection *selection,
priv
->
current_dest
<
priv
->
num_dests
&&
priv
->
dests
!=
NULL
)
{
if
(
priv
->
dests
[
id
].
instance
)
instance
=
g_strdup_printf
(
"%s / %s"
,
priv
->
dests
[
id
].
name
,
priv
->
dests
[
id
].
instance
);
else
instance
=
g_strdup
(
priv
->
dests
[
id
].
name
);
widget
=
(
GtkWidget
*
)
gtk_builder_get_object
(
priv
->
builder
,
"printer-name-label"
);
gtk_label_set_text
(
GTK_LABEL
(
widget
),
instance
);
g_free
(
instance
);
for
(
i
=
0
;
i
<
priv
->
dests
[
id
].
num_options
;
i
++
)
{
if
(
g_strcmp0
(
priv
->
dests
[
id
].
options
[
i
].
name
,
"printer-location"
)
==
0
)
...
...
@@ -173,6 +163,8 @@ printer_selection_changed_cb (GtkTreeSelection *selection,
device_uri
=
g_strdup
(
priv
->
dests
[
id
].
options
[
i
].
value
);
else
if
(
g_strcmp0
(
priv
->
dests
[
id
].
options
[
i
].
name
,
"printer-state"
)
==
0
)
paused
=
(
g_strcmp0
(
priv
->
dests
[
id
].
options
[
i
].
value
,
"5"
)
==
0
);
else
if
(
g_strcmp0
(
priv
->
dests
[
id
].
options
[
i
].
name
,
"printer-info"
)
==
0
)
description
=
g_strdup
(
priv
->
dests
[
id
].
options
[
i
].
value
);
}
widget
=
(
GtkWidget
*
)
...
...
@@ -186,8 +178,10 @@ printer_selection_changed_cb (GtkTreeSelection *selection,
else
gtk_label_set_text
(
GTK_LABEL
(
widget
),
none
);
widget
=
(
GtkWidget
*
)
gtk_builder_get_object
(
priv
->
builder
,
"printer-URI-entry"
);
if
(
device_uri
)
{
gtk_entry_set_text
(
GTK_ENTRY
(
widget
),
device_uri
);
...
...
@@ -196,8 +190,22 @@ printer_selection_changed_cb (GtkTreeSelection *selection,
else
gtk_entry_set_text
(
GTK_ENTRY
(
widget
),
none
);
widget
=
(
GtkWidget
*
)
gtk_builder_get_object
(
priv
->
builder
,
"printer-description-label"
);
if
(
description
)
{
gtk_label_set_text
(
GTK_LABEL
(
widget
),
description
);
g_free
(
description
);
}
else
gtk_label_set_text
(
GTK_LABEL
(
widget
),
none
);
widget
=
(
GtkWidget
*
)
gtk_builder_get_object
(
priv
->
builder
,
"printer-disable-button"
);
gtk_widget_set_sensitive
(
widget
,
TRUE
);
g_signal_handlers_block_by_func
(
G_OBJECT
(
widget
),
printer_disable_cb
,
self
);
gtk_toggle_button_set_active
(
GTK_TOGGLE_BUTTON
(
widget
),
paused
);
...
...
@@ -206,7 +214,7 @@ printer_selection_changed_cb (GtkTreeSelection *selection,
else
{
widget
=
(
GtkWidget
*
)
gtk_builder_get_object
(
priv
->
builder
,
"printer-
name
-label"
);
gtk_builder_get_object
(
priv
->
builder
,
"printer-
description
-label"
);
gtk_label_set_text
(
GTK_LABEL
(
widget
),
""
);
widget
=
(
GtkWidget
*
)
...
...
panels/printers/printers.ui
View file @
23faa29f
...
...
@@ -194,7 +194,7 @@
<object
class=
"GtkLabel"
id=
"label11"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"xalign"
>
1
</property>
<property
name=
"label"
translatable=
"yes"
>
Printer
:
</property>
<property
name=
"label"
translatable=
"yes"
>
Description
:
</property>
</object>
<packing>
<property
name=
"x_options"
>
GTK_FILL
</property>
...
...
@@ -242,7 +242,7 @@
</packing>
</child>
<child>
<object
class=
"GtkLabel"
id=
"printer-
name
-label"
>
<object
class=
"GtkLabel"
id=
"printer-
description
-label"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"xalign"
>
0
</property>
<property
name=
"label"
translatable=
"yes"
>
---
</property>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment