25 #include <glib/gi18n.h>
58 if (properties->fonts_job) {
59 g_signal_handlers_disconnect_by_func (properties->fonts_job,
64 g_object_unref (properties->fonts_job);
65 properties->fonts_job = NULL;
68 G_OBJECT_CLASS (ev_properties_fonts_parent_class)->dispose (
object);
74 GObjectClass *g_object_class = G_OBJECT_CLASS (properties_class);
81 GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
87 gtk_tree_model_get (model, iter,
93 markup = g_strdup_printf (
"<b><big>%s</big></b>\n<small>%s</small>",
96 markup = g_strdup_printf (
"<b><big>%s</big></b>", name);
99 g_object_set (renderer,
"markup", markup, NULL);
110 GtkCellRenderer *renderer;
111 GtkTreeViewColumn *column;
113 gtk_container_set_border_width (GTK_CONTAINER (properties), 12);
114 gtk_box_set_spacing (GTK_BOX (properties), 6);
116 properties->fonts_summary = gtk_label_new (NULL);
117 g_object_set (G_OBJECT (properties->fonts_summary),
120 gtk_label_set_line_wrap (GTK_LABEL (properties->fonts_summary),
TRUE);
121 gtk_box_pack_start (GTK_BOX (properties),
122 properties->fonts_summary,
125 swindow = gtk_scrolled_window_new (NULL, NULL);
126 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swindow),
129 properties->fonts_treeview = gtk_tree_view_new ();
130 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (properties->fonts_treeview),
132 column = gtk_tree_view_column_new ();
133 gtk_tree_view_column_set_expand (GTK_TREE_VIEW_COLUMN (column),
TRUE);
134 gtk_tree_view_append_column (GTK_TREE_VIEW (properties->fonts_treeview),
137 renderer = GTK_CELL_RENDERER (g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
139 gtk_tree_view_column_pack_start (GTK_TREE_VIEW_COLUMN (column),
141 gtk_tree_view_column_set_title (GTK_TREE_VIEW_COLUMN (column),
143 gtk_tree_view_column_set_cell_data_func (column, renderer,
147 gtk_container_add (GTK_CONTAINER (swindow), properties->fonts_treeview);
148 gtk_widget_show (properties->fonts_treeview);
150 gtk_box_pack_start (GTK_BOX (properties), swindow,
152 gtk_widget_show (swindow);
154 properties->fonts_progress_label = gtk_label_new (NULL);
155 g_object_set (G_OBJECT (properties->fonts_progress_label),
158 gtk_box_pack_start (GTK_BOX (properties),
159 properties->fonts_progress_label,
161 gtk_widget_show (properties->fonts_progress_label);
169 progress_text = g_strdup_printf (
_(
"Gathering font information… %3d%%"),
170 (
int) (progress * 100));
171 gtk_label_set_text (GTK_LABEL (label), progress_text);
172 g_free (progress_text);
173 gtk_widget_show (label);
175 gtk_widget_hide (label);
183 const gchar *font_summary;
186 g_object_unref (properties->fonts_job);
187 properties->fonts_job = NULL;
191 gtk_label_set_text (GTK_LABEL (properties->fonts_summary),
195 gtk_widget_show (properties->fonts_summary);
207 model = gtk_tree_view_get_model (GTK_TREE_VIEW (properties->fonts_treeview));
216 GtkTreeView *tree_view = GTK_TREE_VIEW (properties->fonts_treeview);
217 GtkListStore *list_store;
219 properties->document = document;
222 G_TYPE_STRING, G_TYPE_STRING);
223 gtk_tree_view_set_model (tree_view, GTK_TREE_MODEL (list_store));
226 g_signal_connect (properties->fonts_job,
"updated",
229 g_signal_connect (properties->fonts_job,
"finished",
241 "orientation", GTK_ORIENTATION_VERTICAL,
244 return GTK_WIDGET (properties);