]> spindle.queued.net Git - midori/commitdiff
The location is empty and focused by default
authorChristian Dywan <christian@twotoasts.de>
Sun, 30 Mar 2008 14:55:46 +0000 (16:55 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 30 Mar 2008 14:55:46 +0000 (16:55 +0200)
When a new tab is opened it won't default to about:blank
but be empty and also gain focus automatically.

src/midori-browser.c
src/midori-webview.c

index 2aa20f575b37239c047ef088ad527291d4add443..5c0da7ffd9a431c88529fc38ce8e520adb2eff79 100644 (file)
@@ -573,14 +573,14 @@ static void
 _action_window_new_activate (GtkAction*     action,
                              MidoriBrowser* browser)
 {
-    g_signal_emit (browser, signals[NEW_WINDOW], 0, "about:blank");
+    g_signal_emit (browser, signals[NEW_WINDOW], 0, "");
 }
 
 static void
 _action_tab_new_activate (GtkAction*     action,
                           MidoriBrowser* browser)
 {
-    midori_browser_append_uri (browser, "about:blank");
+    midori_browser_append_uri (browser, "");
 }
 
 static void
@@ -2865,7 +2865,10 @@ midori_browser_append_tab (MidoriBrowser* browser,
 
     n = gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook), scrolled);
     if (!config->openTabsInTheBackground)
+    {
         gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), n);
+        gtk_window_set_focus (GTK_WINDOW (browser), priv->location);
+    }
     return n;
 }
 
index 14fcec6212878f4599fa7fce7941994545c06e64..944934e20c2667c00d1ba084612824d58dc73778 100644 (file)
@@ -224,7 +224,7 @@ midori_web_view_class_init (MidoriWebViewClass* class)
                                      "uri",
                                      "Uri",
                                      _("The URI of the currently loaded page"),
-                                     "about:blank",
+                                     "",
                                      flags));
 
     g_object_class_install_property (gobject_class,
@@ -669,9 +669,12 @@ midori_web_view_set_property (GObject*      object,
                                               priv->icon);
         break;
     case PROP_URI:
-        // FIXME: Autocomplete the uri
-        webkit_web_view_open (WEBKIT_WEB_VIEW (web_view),
-                              g_value_get_string (value));
+        if (priv->uri && *priv->uri)
+        {
+            // FIXME: Autocomplete the uri
+            webkit_web_view_open (WEBKIT_WEB_VIEW (web_view),
+                                  g_value_get_string (value));
+        }
         break;
     case PROP_TITLE:
         katze_assign (priv->title, g_value_dup_string (value));
@@ -1030,19 +1033,19 @@ midori_web_view_get_progress (MidoriWebView* web_view)
  * @web_view: a #MidoriWebView
  *
  * Retrieves a string that is suitable for displaying, particularly an
- * empty uri is represented as "about:blank".
+ * empty URI is represented as "".
  *
  * You can assume that the string is not %NULL.
  *
- * Return value: an uri string
+ * Return value: an URI string
  **/
 const gchar*
 midori_web_view_get_display_uri (MidoriWebView* web_view)
 {
-    g_return_val_if_fail (MIDORI_IS_WEB_VIEW (web_view), "about:blank");
+    g_return_val_if_fail (MIDORI_IS_WEB_VIEW (web_view), "");
 
     MidoriWebViewPrivate* priv = web_view->priv;
-    return priv->uri ? priv->uri : "about:blank";
+    return priv->uri ? priv->uri : "";
 }
 
 /**
@@ -1050,7 +1053,7 @@ midori_web_view_get_display_uri (MidoriWebView* web_view)
  * @web_view: a #MidoriWebView
  *
  * Retrieves a string that is suitable for displaying as a title. Most of the
- * time this will be the title or the current uri.
+ * time this will be the title or the current URI.
  *
  * You can assume that the string is not %NULL.
  *
@@ -1077,7 +1080,7 @@ midori_web_view_get_display_title (MidoriWebView* web_view)
  * Retrieves the uri of the currently focused link, particularly while the
  * mouse hovers a link or a context menu is being opened.
  *
- * Return value: an uri string, or %NULL if there is no link focussed
+ * Return value: an URI string, or %NULL if there is no link focussed
  **/
 const gchar*
 midori_web_view_get_link_uri (MidoriWebView* web_view)