]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkaboutdialog.c
gtk: remove "gboolean homogeneous" from gtk_box_new()
[~andy/gtk] / gtk / gtkaboutdialog.c
index 7157b25b3d1f8af4a46fbddda50a22a605a4406b..633a3c7dc806564925842b3e36c945fe8cc9ff71 100644 (file)
  * SECTION:gtkaboutdialog
  * @Short_description: Display information about an application
  * @Title: GtkAboutDialog
- * @See_also:#GTK_STOCK_ABOUT
+ * @See_also: #GTK_STOCK_ABOUT
  *
- * The #GtkAboutDialog offers a simple way to display information about
+ * The GtkAboutDialog offers a simple way to display information about
  * a program like its logo, name, copyright, website and license. It is
  * also possible to give credits to the authors, documenters, translators
  * and artists who have worked on the program. An about dialog is typically
  * opened when the user selects the <literal>About</literal> option from
  * the <literal>Help</literal> menu. All parts of the dialog are optional.
  *
- * About dialog often contain links and email addresses. #GtkAboutDialog
- * supports this by offering global hooks, which are called when the user
- * clicks on a link or email address, see gtk_about_dialog_set_email_hook()
- * and gtk_about_dialog_set_url_hook(). Email addresses in the
- * authors, documenters and artists properties are recognized by looking for
- * <literal>&lt;user@<!-- -->host&gt;</literal>, URLs are
- * recognized by looking for <literal>http://url</literal>, with
- * <literal>url</literal> extending to the next space, tab or line break.
- *
- * <para id="gtk-about-dialog-hook-setup">
- * Since 2.18 #GtkAboutDialog provides default website and email hooks that
- * use gtk_show_uri().
- * </para>
- *
- * If you want provide your own hooks overriding the default ones, it is
- * important to do so before setting the website and email URL properties,
- * like this:
- * <informalexample><programlisting>
- * gtk_about_dialog_set_url_hook (GTK_ABOUT_DIALOG (dialog), launch_url, NULL, NULL);
- * gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog), app_url);
- * </programlisting></informalexample>
- * To disable the default hooks, you can pass %NULL as the hook func. Then,
- * the #GtkAboutDialog widget will not display the website or the
- * email addresses as clickable.
+ * About dialog often contain links and email addresses. GtkAboutDialog
+ * displays these as clickable links. By default, it calls gtk_show_uri()
+ * when a user clicks one. The behaviour can be overridden with the
+ * #GtkAboutDialog::activate-link signal.
  *
- * To make constructing a #GtkAboutDialog as convenient as possible, you can
+ * To make constructing a GtkAboutDialog as convenient as possible, you can
  * use the function gtk_show_about_dialog() which constructs and shows a dialog
  * and keeps it around so that it can be shown again.
  *
  * on the dialog window (where &percnt;s is replaced by the name of the
  * application, but in order to ensure proper translation of the title,
  * applications should set the title property explicitly when constructing
- * a #GtkAboutDialog, as shown in the following example:
+ * a GtkAboutDialog, as shown in the following example:
  * <informalexample><programlisting>
  * gtk_show_about_dialog (NULL,
  *                        "program-name", "ExampleCode",
  *                        "title" _("About ExampleCode"),
  *                        NULL);
  * </programlisting></informalexample>
- * Note that prior to GTK+ 2.12, the #GtkAboutDialog:program-name property
- * was called "name". This was changed to avoid the conflict with the
- * #GtkWidget:name property.
  */
 
 static GdkColor default_link_color = { 0, 0, 0, 0xeeee };
@@ -267,7 +244,7 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass)
    *
    * Returns: %TRUE if the link has been activated
    *
-   * Since: 3.0
+   * Since: 2.24
    */
   signals[ACTIVATE_LINK] =
     g_signal_new ("activate-link",
@@ -597,7 +574,7 @@ gtk_about_dialog_init (GtkAboutDialog *about)
   /* Widgets */
   gtk_widget_push_composite_child ();
 
-  vbox = gtk_vbox_new (FALSE, 8);
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
   gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
   gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
 
@@ -620,7 +597,8 @@ gtk_about_dialog_init (GtkAboutDialog *about)
   gtk_label_set_justify (GTK_LABEL (priv->copyright_label), GTK_JUSTIFY_CENTER);
   gtk_box_pack_start (GTK_BOX (vbox), priv->copyright_label, FALSE, FALSE, 0);
 
-  hbox = gtk_hbox_new (TRUE, 0);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+  gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, FALSE, 0);
 
   priv->website_label = button = gtk_label_new ("");
@@ -1302,9 +1280,6 @@ gtk_about_dialog_get_website (GtkAboutDialog *about)
  *
  * Sets the URL to use for the website link.
  *
- * Note that that the hook functions need to be set up
- * before calling this function.
- *
  * Since: 2.6
  */
 void
@@ -1957,7 +1932,7 @@ text_view_visibility_notify_event (GtkWidget          *text_view,
   GList *devices, *d;
   gint wx, wy, bx, by;
 
-  display = gdk_drawable_get_display (event->window);
+  display = gdk_window_get_display (event->window);
   device_manager = gdk_display_get_device_manager (display);
   devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
 
@@ -2102,9 +2077,17 @@ text_view_new (GtkAboutDialog  *about,
                                                 "underline", PANGO_UNDERLINE_SINGLE,
                                                 NULL);
               if (strcmp (link_type, "email") == 0)
-                 uri = g_strconcat ("mailto:", link, NULL);
+                {
+                  gchar *escaped;
+
+                  escaped = g_uri_escape_string (link, NULL, FALSE);
+                  uri = g_strconcat ("mailto:", escaped, NULL);
+                  g_free (escaped);
+                }
               else
-                 uri = g_strdup (link);
+                {
+                  uri = g_strdup (link);
+                }
               g_object_set_data_full (G_OBJECT (tag), I_("uri"), uri, g_free);
               gtk_text_buffer_insert_with_tags (buffer, &end, link, -1, tag, NULL);