Fix background tabs, strings and new tab focus.

This commit is contained in:
Christian Dywan 2008-04-18 02:40:53 +02:00
parent fae6058c26
commit f98b652996
3 changed files with 30 additions and 27 deletions

View file

@ -111,7 +111,7 @@ katze_property_proxy (gpointer object,
GParamSpec* pspec = g_object_class_find_property (class, property);
if (!pspec)
{
g_warning ("Property '%s' is invalid for %s",
g_warning (_("Property '%s' is invalid for %s"),
property, G_OBJECT_CLASS_NAME (class));
return gtk_label_new (property);
}
@ -124,7 +124,7 @@ katze_property_proxy (gpointer object,
gchar* string = NULL;
if (type == G_TYPE_PARAM_BOOLEAN)
{
widget = gtk_check_button_new_with_label (nick);
widget = gtk_check_button_new_with_label (gettext (nick));
gboolean toggled;
g_object_get (object, property, &toggled, NULL);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), toggled);
@ -196,7 +196,7 @@ katze_property_proxy (gpointer object,
gint i = 0;
while (i < enum_class->n_values)
{
const gchar* label = enum_class->values[i].value_nick;
const gchar* label = gettext (enum_class->values[i].value_nick);
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), label);
i++;
}
@ -208,7 +208,7 @@ katze_property_proxy (gpointer object,
g_type_class_unref (enum_class);
}
else
widget = gtk_label_new (nick);
widget = gtk_label_new (gettext (nick));
g_free (string);
gtk_widget_set_sensitive (widget, pspec->flags & G_PARAM_WRITABLE);
@ -236,7 +236,7 @@ katze_property_label (gpointer object,
GParamSpec* pspec = g_object_class_find_property (class, property);
if (!pspec)
{
g_warning ("Property '%s' is invalid for %s",
g_warning (_("Property '%s' is invalid for %s"),
property, G_OBJECT_CLASS_NAME (class));
return gtk_label_new (property);
}

View file

@ -422,6 +422,7 @@ midori_web_view_new_tab_cb (GtkWidget* web_view,
MidoriBrowser* browser)
{
midori_browser_append_uri (browser, uri);
gtk_widget_grab_focus (web_view);
}
static void
@ -2941,10 +2942,10 @@ midori_browser_append_tab (MidoriBrowser* browser,
gboolean open_tabs_in_the_background;
g_object_get (priv->settings, "open-tabs-in-the-background",
&open_tabs_in_the_background, NULL);
if (open_tabs_in_the_background)
if (!open_tabs_in_the_background)
{
gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), n);
gtk_window_set_focus (GTK_WINDOW (browser), priv->location);
gtk_widget_grab_focus (priv->location);
}
return n;
}
@ -2999,6 +3000,8 @@ midori_browser_append_xbel_item (MidoriBrowser* browser,
/**
* midori_browser_append_uri:
* @browser: a #MidoriBrowser
* @uri: an URI
*
* Appends an uri in the form of a new tab.
*

View file

@ -127,9 +127,9 @@ midori_startup_get_type (void)
if (!type)
{
static const GEnumValue values[] = {
{ MIDORI_STARTUP_BLANK, "MIDORI_STARTUP_BLANK", "Blank" },
{ MIDORI_STARTUP_HOMEPAGE, "MIDORI_STARTUP_HOMEPAGE", "Homepage" },
{ MIDORI_STARTUP_LAST_OPEN_PAGES, "MIDORI_STARTUP_LAST_OPEN_PAGES", "Last open pages" },
{ MIDORI_STARTUP_BLANK, "MIDORI_STARTUP_BLANK", N_("Blank") },
{ MIDORI_STARTUP_HOMEPAGE, "MIDORI_STARTUP_HOMEPAGE", N_("Homepage") },
{ MIDORI_STARTUP_LAST_OPEN_PAGES, "MIDORI_STARTUP_LAST_OPEN_PAGES", N_("Last open pages") },
{ 0, NULL, NULL }
};
type = g_enum_register_static ("MidoriStartup", values);
@ -144,12 +144,12 @@ midori_preferred_encoding_get_type (void)
if (!type)
{
static const GEnumValue values[] = {
{ MIDORI_ENCODING_CHINESE, "MIDORI_ENCODING_CHINESE", "Chinese (BIG5)" },
{ MIDORI_ENCODING_JAPANESE, "MIDORI_ENCODING_JAPANESE", "Japanese (SHIFT_JIS)" },
{ MIDORI_ENCODING_RUSSIAN, "MIDORI_ENCODING_RUSSIAN", "Russian (KOI8-R)" },
{ MIDORI_ENCODING_UNICODE, "MIDORI_ENCODING_UNICODE", "Unicode (UTF-8)" },
{ MIDORI_ENCODING_WESTERN, "MIDORI_ENCODING_WESTERN", "Western (ISO-8859-1)" },
{ MIDORI_ENCODING_WESTERN, "MIDORI_ENCODING_CUSTOM", "Custom..." },
{ MIDORI_ENCODING_CHINESE, "MIDORI_ENCODING_CHINESE", N_("Chinese (BIG5)") },
{ MIDORI_ENCODING_JAPANESE, "MIDORI_ENCODING_JAPANESE", N_("Japanese (SHIFT_JIS)") },
{ MIDORI_ENCODING_RUSSIAN, "MIDORI_ENCODING_RUSSIAN", N_("Russian (KOI8-R)") },
{ MIDORI_ENCODING_UNICODE, "MIDORI_ENCODING_UNICODE", N_("Unicode (UTF-8)") },
{ MIDORI_ENCODING_WESTERN, "MIDORI_ENCODING_WESTERN", N_("Western (ISO-8859-1)") },
{ MIDORI_ENCODING_WESTERN, "MIDORI_ENCODING_CUSTOM", N_("Custom...") },
{ 0, NULL, NULL }
};
type = g_enum_register_static ("MidoriPreferredEncoding", values);
@ -164,9 +164,9 @@ midori_new_page_get_type (void)
if (!type)
{
static const GEnumValue values[] = {
{ MIDORI_NEW_PAGE_TAB, "MIDORI_NEW_PAGE_TAB", "New tab" },
{ MIDORI_NEW_PAGE_WINDOW, "MIDORI_NEW_PAGE_WINDOW", "New window" },
{ MIDORI_NEW_PAGE_CURRENT, "MIDORI_NEW_PAGE_CURRENT", "Current tab" },
{ MIDORI_NEW_PAGE_TAB, "MIDORI_NEW_PAGE_TAB", N_("New tab") },
{ MIDORI_NEW_PAGE_WINDOW, "MIDORI_NEW_PAGE_WINDOW", N_("New window") },
{ MIDORI_NEW_PAGE_CURRENT, "MIDORI_NEW_PAGE_CURRENT", N_("Current tab") },
{ 0, NULL, NULL }
};
type = g_enum_register_static ("MidoriNewPage", values);
@ -181,11 +181,11 @@ midori_toolbar_style_get_type (void)
if (!type)
{
static const GEnumValue values[] = {
{ MIDORI_TOOLBAR_DEFAULT, "MIDORI_TOOLBAR_DEFAULT", "Default" },
{ MIDORI_TOOLBAR_ICONS, "MIDORI_TOOLBAR_ICONS", "Icons" },
{ MIDORI_TOOLBAR_TEXT, "MIDORI_TOOLBAR_TEXT", "Text" },
{ MIDORI_TOOLBAR_BOTH, "MIDORI_TOOLBAR_BOTH", "Both" },
{ MIDORI_TOOLBAR_BOTH_HORIZ, "MIDORI_TOOLBAR_BOTH_HORIZ", "Both horizontal" },
{ MIDORI_TOOLBAR_DEFAULT, "MIDORI_TOOLBAR_DEFAULT", N_("Default") },
{ MIDORI_TOOLBAR_ICONS, "MIDORI_TOOLBAR_ICONS", N_("Icons") },
{ MIDORI_TOOLBAR_TEXT, "MIDORI_TOOLBAR_TEXT", N_("Text") },
{ MIDORI_TOOLBAR_BOTH, "MIDORI_TOOLBAR_BOTH", N_("Both") },
{ MIDORI_TOOLBAR_BOTH_HORIZ, "MIDORI_TOOLBAR_BOTH_HORIZ", N_("Both horizontal") },
{ 0, NULL, NULL }
};
type = g_enum_register_static ("MidoriToolbarStyle", values);
@ -200,9 +200,9 @@ midori_accept_cookies_get_type (void)
if (!type)
{
static const GEnumValue values[] = {
{ MIDORI_ACCEPT_COOKIES_ALL, "MIDORI_ACCEPT_COOKIES_ALL", "All cookies" },
{ MIDORI_ACCEPT_COOKIES_SESSION, "MIDORI_ACCEPT_COOKIES_SESSION", "Session cookies" },
{ MIDORI_ACCEPT_COOKIES_NONE, "MIDORI_ACCEPT_COOKIES_NONE", "None" },
{ MIDORI_ACCEPT_COOKIES_ALL, "MIDORI_ACCEPT_COOKIES_ALL", N_("All cookies") },
{ MIDORI_ACCEPT_COOKIES_SESSION, "MIDORI_ACCEPT_COOKIES_SESSION", N_("Session cookies") },
{ MIDORI_ACCEPT_COOKIES_NONE, "MIDORI_ACCEPT_COOKIES_NONE", N_("None") },
{ 0, NULL, NULL }
};
type = g_enum_register_static ("MidoriAcceptCookies", values);