]> www.fi.muni.cz Git - evince.git/blob - shell/eggfindbar.c
hook up potentially-questionable "find results status text" feature -
[evince.git] / shell / eggfindbar.c
1 /* Copyright (C) 2004 Red Hat, Inc.
2
3 This library is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Library General Public License as
5 published by the Free Software Foundation; either version 2 of the
6 License, or (at your option) any later version.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public
14 License along with the Gnome Library; see the file COPYING.LIB.  If not,
15 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA.
17 */
18
19 #include <config.h>
20
21 #include "eggfindbar.h"
22
23 #include <glib/gi18n.h>
24 #include <gtk/gtkhbox.h>
25 #include <gtk/gtkentry.h>
26 #include <gtk/gtkcheckbutton.h>
27 #include <gtk/gtkvseparator.h>
28 #include <gtk/gtkstock.h>
29 #include <gtk/gtklabel.h>
30 #include <gdk/gdkkeysyms.h>
31 #include <gtk/gtkbindings.h>
32
33 #include <string.h>
34
35 typedef struct _EggFindBarPrivate EggFindBarPrivate;
36 struct _EggFindBarPrivate
37 {
38   gchar *search_string;
39   GtkWidget *hbox;
40   GtkWidget *close_button;
41   GtkWidget *find_entry;
42   GtkWidget *next_button;
43   GtkWidget *previous_button;
44   GtkWidget *case_button;
45   GtkWidget *status_separator;
46   GtkWidget *status_label;
47   guint case_sensitive : 1;
48 };
49
50 #define EGG_FIND_BAR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EGG_TYPE_FIND_BAR, EggFindBarPrivate))
51
52
53 enum
54   {
55     PROP_0,
56     PROP_SEARCH_STRING,
57     PROP_CASE_SENSITIVE
58   };
59
60 static void egg_find_bar_finalize      (GObject        *object);
61 static void egg_find_bar_get_property  (GObject        *object,
62                                         guint           prop_id,
63                                         GValue         *value,
64                                         GParamSpec     *pspec);
65 static void egg_find_bar_set_property  (GObject        *object,
66                                         guint           prop_id,
67                                         const GValue   *value,
68                                         GParamSpec     *pspec);
69 static void egg_find_bar_size_request  (GtkWidget      *widget,
70                                         GtkRequisition *requisition);
71 static void egg_find_bar_size_allocate (GtkWidget      *widget,
72                                         GtkAllocation  *allocation);
73
74 G_DEFINE_TYPE (EggFindBar, egg_find_bar, GTK_TYPE_BIN);
75
76 enum
77   {
78     NEXT,
79     PREVIOUS,
80     CLOSE,
81     LAST_SIGNAL
82   };
83
84 static guint find_bar_signals[LAST_SIGNAL] = { 0 };
85
86 static void
87 egg_find_bar_class_init (EggFindBarClass *klass)
88 {
89   GObjectClass *object_class;
90   GtkWidgetClass *widget_class;
91   GtkBinClass *bin_class;
92   GtkBindingSet *binding_set;
93
94   object_class = (GObjectClass *)klass;
95   widget_class = (GtkWidgetClass *)klass;
96   bin_class = (GtkBinClass *)klass;
97
98   object_class->set_property = egg_find_bar_set_property;
99   object_class->get_property = egg_find_bar_get_property;
100
101   object_class->finalize = egg_find_bar_finalize;
102
103   widget_class->size_request = egg_find_bar_size_request;
104   widget_class->size_allocate = egg_find_bar_size_allocate;
105
106   find_bar_signals[NEXT] =
107     g_signal_new ("next",
108                   G_OBJECT_CLASS_TYPE (object_class),
109                   G_SIGNAL_RUN_FIRST,
110                   0,
111                   NULL, NULL,
112                   g_cclosure_marshal_VOID__VOID,
113                   G_TYPE_NONE, 0);
114   find_bar_signals[PREVIOUS] =
115     g_signal_new ("previous",
116                   G_OBJECT_CLASS_TYPE (object_class),
117                   G_SIGNAL_RUN_FIRST,
118                   0,
119                   NULL, NULL,
120                   g_cclosure_marshal_VOID__VOID,
121                   G_TYPE_NONE, 0);
122   find_bar_signals[CLOSE] =
123     g_signal_new ("close",
124                   G_OBJECT_CLASS_TYPE (object_class),
125                   G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
126                   0,
127                   NULL, NULL,
128                   g_cclosure_marshal_VOID__VOID,
129                   G_TYPE_NONE, 0);
130
131   /**
132    * EggFindBar:search_string:
133    *
134    * The current string to search for. NULL or empty string
135    * both mean no current string.
136    *
137    */
138   g_object_class_install_property (object_class,
139                                    PROP_SEARCH_STRING,
140                                    g_param_spec_string ("search_string",
141                                                         _("Search string"),
142                                                         _("The name of the string to be found"),
143                                                         NULL,
144                                                         G_PARAM_READWRITE));
145
146   /**
147    * EggFindBar:case_sensitive:
148    *
149    * TRUE for a case sensitive search.
150    *
151    */
152   g_object_class_install_property (object_class,
153                                    PROP_CASE_SENSITIVE,
154                                    g_param_spec_boolean ("case_sensitive",
155                                                          _("Case sensitive"),
156                                                          _("TRUE for a case sensitive search"),
157                                                          FALSE,
158                                                          G_PARAM_READWRITE));
159
160   /* Style properties */
161   gtk_widget_class_install_style_property (widget_class,
162                                            g_param_spec_boxed ("all_matches_color",
163                                                                _("Highlight color"),
164                                                                _("Color of highlight for all matches"),
165                                                                GDK_TYPE_COLOR,
166                                                                G_PARAM_READABLE));
167
168   gtk_widget_class_install_style_property (widget_class,
169                                            g_param_spec_boxed ("current_match_color",
170                                                                _("Current color"),
171                                                                _("Color of highlight for the current match"),
172                                                                GDK_TYPE_COLOR,
173                                                                G_PARAM_READABLE));
174
175   g_type_class_add_private (object_class, sizeof (EggFindBarPrivate));
176
177   binding_set = gtk_binding_set_by_class (klass);
178
179   gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
180                                 "close", 0);
181 }
182
183 static void
184 egg_find_bar_emit_next (EggFindBar *find_bar)
185 {
186   g_signal_emit (find_bar, find_bar_signals[NEXT], 0);
187 }
188
189 static void
190 egg_find_bar_emit_previous (EggFindBar *find_bar)
191 {
192   g_signal_emit (find_bar, find_bar_signals[PREVIOUS], 0);
193 }
194
195 static void
196 egg_find_bar_emit_close (EggFindBar *find_bar)
197 {
198   g_signal_emit (find_bar, find_bar_signals[CLOSE], 0);
199 }
200
201 static void
202 close_clicked_callback (GtkButton *button,
203                         void      *data)
204 {
205   EggFindBar *find_bar = EGG_FIND_BAR (data);
206
207   egg_find_bar_emit_close (find_bar);
208 }
209
210 static void
211 next_clicked_callback (GtkButton *button,
212                        void      *data)
213 {
214   EggFindBar *find_bar = EGG_FIND_BAR (data);
215
216   egg_find_bar_emit_next (find_bar);
217 }
218
219 static void
220 previous_clicked_callback (GtkButton *button,
221                            void      *data)
222 {
223   EggFindBar *find_bar = EGG_FIND_BAR (data);
224
225   egg_find_bar_emit_previous (find_bar);
226 }
227
228 static void
229 case_sensitive_toggled_callback (GtkCheckButton *button,
230                                  void           *data)
231 {
232   EggFindBar *find_bar = EGG_FIND_BAR (data);
233
234   egg_find_bar_set_case_sensitive (find_bar,
235                                    gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)));
236 }
237
238 static void
239 entry_activate_callback (GtkEntry *entry,
240                           void     *data)
241 {
242   EggFindBar *find_bar = EGG_FIND_BAR (data);
243   EggFindBarPrivate *priv = (EggFindBarPrivate *)find_bar->private_data;
244
245   /* We activate the "next" button here so we'll get a nice
246      animation */
247   gtk_widget_activate (priv->next_button);
248 }
249
250 static void
251 entry_changed_callback (GtkEntry *entry,
252                         void     *data)
253 {
254   EggFindBar *find_bar = EGG_FIND_BAR (data);
255   char *text;
256
257   /* paranoid strdup because set_search_string() sets
258    * the entry text
259    */
260   text = g_strdup (gtk_entry_get_text (entry));
261
262   egg_find_bar_set_search_string (find_bar, text);
263
264   g_free (text);
265 }
266
267 static void
268 egg_find_bar_init (EggFindBar *find_bar)
269 {
270   EggFindBarPrivate *priv;
271   GtkWidget *label;
272   GtkWidget *separator;
273   GtkWidget *image;
274   GtkWidget *image_back;
275   GtkWidget *image_forward;
276
277   /* Data */
278   priv = EGG_FIND_BAR_GET_PRIVATE (find_bar);
279   find_bar->private_data = priv;
280
281   priv->search_string = NULL;
282
283   /* Widgets */
284   gtk_widget_push_composite_child ();
285   priv->hbox = gtk_hbox_new (FALSE, 6);
286   gtk_container_set_border_width (GTK_CONTAINER (priv->hbox), 3);
287
288   label = gtk_label_new_with_mnemonic (_("F_ind:"));
289   separator = gtk_vseparator_new ();
290
291   priv->close_button = gtk_button_new ();
292   gtk_button_set_relief (GTK_BUTTON (priv->close_button),
293                          GTK_RELIEF_NONE);
294   image = gtk_image_new_from_stock (GTK_STOCK_CLOSE,
295                                     GTK_ICON_SIZE_SMALL_TOOLBAR);
296   gtk_container_add (GTK_CONTAINER (priv->close_button), image);
297
298   priv->find_entry = gtk_entry_new ();
299   gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->find_entry);
300   
301   priv->previous_button = gtk_button_new_with_mnemonic (_("_Previous"));
302   priv->next_button = gtk_button_new_with_mnemonic (_("_Next"));
303
304   image_back = gtk_image_new_from_stock (GTK_STOCK_GO_BACK,
305                                          GTK_ICON_SIZE_BUTTON);
306   image_forward = gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD,
307                                             GTK_ICON_SIZE_BUTTON);
308
309   gtk_button_set_image (GTK_BUTTON (priv->previous_button),
310                         image_back);
311   gtk_button_set_image (GTK_BUTTON (priv->next_button),
312                         image_forward);
313   
314   priv->case_button = gtk_check_button_new_with_mnemonic (_("C_ase Sensitive"));
315
316   priv->status_separator = gtk_vseparator_new ();
317   
318   priv->status_label = gtk_label_new (NULL);
319   gtk_label_set_ellipsize (GTK_LABEL (priv->status_label),
320                            PANGO_ELLIPSIZE_END);
321   gtk_misc_set_alignment (GTK_MISC (priv->status_label), 0.0, 0.5);
322   
323 #if 0
324  {
325    GtkWidget *button_label;
326    /* This hack doesn't work because GtkCheckButton doesn't pass the
327     * larger size allocation to the label, it always gives the label
328     * its exact request. If you un-ifdef this, set the box back
329     * on case_button to TRUE, TRUE below
330     */
331    button_label = gtk_bin_get_child (GTK_BIN (priv->case_button));
332    gtk_label_set_ellipsize (GTK_LABEL (button_label),
333                             PANGO_ELLIPSIZE_END);
334  }
335 #endif
336   
337   gtk_box_pack_start (GTK_BOX (priv->hbox),
338                       priv->close_button, FALSE, FALSE, 0);
339   gtk_box_pack_start (GTK_BOX (priv->hbox),
340                       label, FALSE, FALSE, 0);
341   gtk_box_pack_start (GTK_BOX (priv->hbox),
342                       priv->find_entry, FALSE, FALSE, 0);
343   gtk_box_pack_start (GTK_BOX (priv->hbox),
344                       priv->previous_button, FALSE, FALSE, 0);
345   gtk_box_pack_start (GTK_BOX (priv->hbox),
346                       priv->next_button, FALSE, FALSE, 0);
347   gtk_box_pack_start (GTK_BOX (priv->hbox),
348                       separator, FALSE, FALSE, 0);
349   gtk_box_pack_start (GTK_BOX (priv->hbox),
350                       priv->case_button, FALSE, FALSE, 0);
351   gtk_box_pack_start (GTK_BOX (priv->hbox),
352                       priv->status_separator, FALSE, FALSE, 0);
353   gtk_box_pack_start (GTK_BOX (priv->hbox),
354                       priv->status_label, TRUE, TRUE, 0);
355   
356   gtk_container_add (GTK_CONTAINER (find_bar), priv->hbox);
357
358   gtk_widget_show (priv->hbox);
359   gtk_widget_show (priv->close_button);
360   gtk_widget_show (priv->find_entry);
361   gtk_widget_show (priv->previous_button);
362   gtk_widget_show (priv->next_button);
363   gtk_widget_show (separator);
364   gtk_widget_show (label);
365   gtk_widget_show (image);
366   gtk_widget_show (image_back);
367   gtk_widget_show (image_forward);
368   /* don't show status separator/label until they are set */
369
370   gtk_widget_pop_composite_child ();
371
372   gtk_widget_show_all (priv->hbox);
373
374   g_signal_connect (priv->close_button, "clicked",
375                     G_CALLBACK (close_clicked_callback),
376                     find_bar);
377   g_signal_connect (priv->find_entry, "changed",
378                     G_CALLBACK (entry_changed_callback),
379                     find_bar);
380   g_signal_connect (priv->find_entry, "activate",
381                     G_CALLBACK (entry_activate_callback),
382                     find_bar);
383   g_signal_connect (priv->next_button, "clicked",
384                     G_CALLBACK (next_clicked_callback),
385                     find_bar);
386   g_signal_connect (priv->previous_button, "clicked",
387                     G_CALLBACK (previous_clicked_callback),
388                     find_bar);
389   g_signal_connect (priv->case_button, "toggled",
390                     G_CALLBACK (case_sensitive_toggled_callback),
391                     find_bar);
392 }
393
394 static void
395 egg_find_bar_finalize (GObject *object)
396 {
397   EggFindBar *find_bar = EGG_FIND_BAR (object);
398   EggFindBarPrivate *priv = (EggFindBarPrivate *)find_bar->private_data;
399
400   g_free (priv->search_string);
401
402   G_OBJECT_CLASS (egg_find_bar_parent_class)->finalize (object);
403 }
404
405 static void
406 egg_find_bar_set_property (GObject      *object,
407                            guint         prop_id,
408                            const GValue *value,
409                            GParamSpec   *pspec)
410 {
411   EggFindBar *find_bar = EGG_FIND_BAR (object);
412
413   switch (prop_id)
414     {
415     case PROP_SEARCH_STRING:
416       egg_find_bar_set_search_string (find_bar, g_value_get_string (value));
417       break;
418     case PROP_CASE_SENSITIVE:
419       egg_find_bar_set_case_sensitive (find_bar, g_value_get_boolean (value));
420       break;
421     default:
422       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
423       break;
424     }
425 }
426
427 static void
428 egg_find_bar_get_property (GObject    *object,
429                            guint       prop_id,
430                            GValue     *value,
431                            GParamSpec *pspec)
432 {
433   EggFindBar *find_bar = EGG_FIND_BAR (object);
434   EggFindBarPrivate *priv = (EggFindBarPrivate *)find_bar->private_data;
435
436   switch (prop_id)
437     {
438     case PROP_SEARCH_STRING:
439       g_value_set_string (value, priv->search_string);
440       break;
441     case PROP_CASE_SENSITIVE:
442       g_value_set_boolean (value, priv->case_sensitive);
443       break;
444     default:
445       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
446       break;
447     }
448 }
449
450 static void
451 egg_find_bar_size_request (GtkWidget      *widget,
452                            GtkRequisition *requisition)
453 {
454   GtkBin *bin = GTK_BIN (widget);
455   GtkRequisition child_requisition;
456   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
457     {
458       gtk_widget_size_request (bin->child, &child_requisition);
459
460       *requisition = child_requisition;
461     }
462   else
463     {
464       requisition->width = 0;
465       requisition->height = 0;
466     }
467 }
468
469 static void
470 egg_find_bar_size_allocate (GtkWidget     *widget,
471                             GtkAllocation *allocation)
472 {
473   GtkBin *bin = GTK_BIN (widget);
474
475   widget->allocation = *allocation;
476
477   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
478     gtk_widget_size_allocate (bin->child, allocation);
479 }
480
481 /**
482  * egg_find_bar_new:
483  *
484  * Creates a new #EggFindBar.
485  *
486  * Returns: a newly created #EggFindBar
487  *
488  * Since: 2.6
489  */
490 GtkWidget *
491 egg_find_bar_new (void)
492 {
493   EggFindBar *find_bar;
494
495   find_bar = g_object_new (EGG_TYPE_FIND_BAR, NULL);
496
497   return GTK_WIDGET (find_bar);
498 }
499
500 /**
501  * egg_find_bar_set_search_string:
502  *
503  * Sets the string that should be found/highlighted in the document.
504  * Empty string is converted to NULL.
505  *
506  * Since: 2.6
507  */
508 void
509 egg_find_bar_set_search_string  (EggFindBar *find_bar,
510                                  const char *search_string)
511 {
512   EggFindBarPrivate *priv;
513
514   g_return_if_fail (EGG_IS_FIND_BAR (find_bar));
515
516   priv = (EggFindBarPrivate *)find_bar->private_data;
517
518   g_object_freeze_notify (G_OBJECT (find_bar));
519   
520   if (priv->search_string != search_string)
521     {
522       char *old;
523       
524       old = priv->search_string;
525
526       if (search_string && *search_string == '\0')
527         search_string = NULL;
528
529       /* Only update if the string has changed; setting the entry
530        * will emit changed on the entry which will re-enter
531        * this function, but we'll handle that fine with this
532        * short-circuit.
533        */
534       if ((old && search_string == NULL) ||
535           (old == NULL && search_string) ||
536           (old && search_string &&
537            strcmp (old, search_string) != 0))
538         {
539           priv->search_string = g_strdup (search_string);
540           g_free (old);
541           
542           gtk_entry_set_text (GTK_ENTRY (priv->find_entry),
543                               priv->search_string ?
544                               priv->search_string :
545                               "");
546           
547           g_object_notify (G_OBJECT (find_bar),
548                            "search_string");
549         }
550     }
551
552   g_object_thaw_notify (G_OBJECT (find_bar));
553 }
554
555
556 /**
557  * egg_find_bar_get_search_string:
558  *
559  * Gets the string that should be found/highlighted in the document.
560  *
561  * Returns: the string
562  *
563  * Since: 2.6
564  */
565 const char*
566 egg_find_bar_get_search_string  (EggFindBar *find_bar)
567 {
568   EggFindBarPrivate *priv;
569
570   g_return_val_if_fail (EGG_IS_FIND_BAR (find_bar), NULL);
571
572   priv = (EggFindBarPrivate *)find_bar->private_data;
573
574   return priv->search_string;
575 }
576
577 /**
578  * egg_find_bar_set_case_sensitive:
579  *
580  * Sets whether the search is case sensitive
581  *
582  * Since: 2.6
583  */
584 void
585 egg_find_bar_set_case_sensitive (EggFindBar *find_bar,
586                                  gboolean    case_sensitive)
587 {
588   EggFindBarPrivate *priv;
589
590   g_return_if_fail (EGG_IS_FIND_BAR (find_bar));
591
592   priv = (EggFindBarPrivate *)find_bar->private_data;
593
594   g_object_freeze_notify (G_OBJECT (find_bar));
595
596   case_sensitive = case_sensitive != FALSE;
597
598   if (priv->case_sensitive != case_sensitive)
599     {
600       priv->case_sensitive = case_sensitive;
601
602       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->case_button),
603                                     priv->case_sensitive);
604
605       g_object_notify (G_OBJECT (find_bar),
606                        "case_sensitive");
607     }
608
609   g_object_thaw_notify (G_OBJECT (find_bar));
610 }
611
612 /**
613  * egg_find_bar_get_case_sensitive:
614  *
615  * Gets whether the search is case sensitive
616  *
617  * Returns: TRUE if it's case sensitive
618  *
619  * Since: 2.6
620  */
621 gboolean
622 egg_find_bar_get_case_sensitive (EggFindBar *find_bar)
623 {
624   EggFindBarPrivate *priv;
625
626   g_return_val_if_fail (EGG_IS_FIND_BAR (find_bar), FALSE);
627
628   priv = (EggFindBarPrivate *)find_bar->private_data;
629
630   return priv->case_sensitive;
631 }
632
633 static void
634 get_style_color (EggFindBar *find_bar,
635                  const char *style_prop_name,
636                  GdkColor   *color)
637 {
638   GdkColor *style_color;
639
640   gtk_widget_ensure_style (GTK_WIDGET (find_bar));
641   gtk_widget_style_get (GTK_WIDGET (find_bar),
642                         "color", &style_color, NULL);
643   if (style_color)
644     {
645       *color = *style_color;
646       gdk_color_free (style_color);
647     }
648 }
649
650 /**
651  * egg_find_bar_get_all_matches_color:
652  *
653  * Gets the color to use to highlight all the
654  * known matches.
655  *
656  * Since: 2.6
657  */
658 void
659 egg_find_bar_get_all_matches_color (EggFindBar *find_bar,
660                                     GdkColor   *color)
661 {
662   GdkColor found_color = { 0, 0, 0, 0x0f0f };
663
664   get_style_color (find_bar, "all_matches_color", &found_color);
665
666   *color = found_color;
667 }
668
669 /**
670  * egg_find_bar_get_current_match_color:
671  *
672  * Gets the color to use to highlight the match
673  * we're currently on.
674  *
675  * Since: 2.6
676  */
677 void
678 egg_find_bar_get_current_match_color (EggFindBar *find_bar,
679                                       GdkColor   *color)
680 {
681   GdkColor found_color = { 0, 0, 0, 0xffff };
682
683   get_style_color (find_bar, "current_match_color", &found_color);
684
685   *color = found_color;
686 }
687
688 /**
689  * egg_find_bar_grab_focus:
690  *
691  * Focuses the text entry in the find bar; currently GTK+ doesn't have
692  * a way to make this work on gtk_widget_grab_focus(find_bar).
693  *
694  * Since: 2.6
695  */
696 void
697 egg_find_bar_grab_focus (EggFindBar *find_bar)
698 {
699   EggFindBarPrivate *priv;
700
701   g_return_if_fail (EGG_IS_FIND_BAR (find_bar));
702
703   priv = (EggFindBarPrivate *)find_bar->private_data;
704  
705   gtk_widget_grab_focus (priv->find_entry);
706 }
707
708 /**
709  * egg_find_bar_set_status_text:
710  *
711  * Sets some text to display if there's space; typical text would
712  * be something like "5 results on this page" or "No results"
713  *
714  * @text: the text to display
715  *
716  * Since: 2.6
717  */
718 void
719 egg_find_bar_set_status_text (EggFindBar *find_bar,
720                               const char *text)
721 {
722   EggFindBarPrivate *priv;
723
724   g_return_if_fail (EGG_IS_FIND_BAR (find_bar));
725
726   priv = (EggFindBarPrivate *)find_bar->private_data;
727   
728   if (text == NULL || *text == '\0')
729     {
730       gtk_widget_hide (priv->status_label);
731       gtk_widget_hide (priv->status_separator);
732       gtk_label_set_text (GTK_LABEL (priv->status_label), NULL);
733     }
734   else
735     {
736       gtk_label_set_text (GTK_LABEL (priv->status_label), text);
737       gtk_widget_show (priv->status_label);
738       gtk_widget_show (priv->status_separator);
739     }
740 }