]> spindle.queued.net Git - midori/commitdiff
Construct entry in location action, obsoleting location entry class
authorChristian Dywan <christian@twotoasts.de>
Fri, 1 Jan 2010 23:28:44 +0000 (00:28 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sat, 2 Jan 2010 00:25:57 +0000 (01:25 +0100)
midori/midori-browser.c
midori/midori-locationaction.c
midori/midori-locationaction.h
midori/midori-locationentry.c [deleted file]
midori/midori-locationentry.h [deleted file]
midori/midori.h

index fbd0d5858b680f12a849f49d5c8eafa833a6d222..438c8819db982f28b68e9b42cbcd9fb1902ee83d 100644 (file)
@@ -391,7 +391,7 @@ _midori_browser_set_statusbar_text (MidoriBrowser* browser,
 {
     GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser));
     gboolean is_location = widget ?
-        MIDORI_IS_LOCATION_ENTRY (gtk_widget_get_parent (widget)) : FALSE;
+        GTK_IS_COMBO_BOX (gtk_widget_get_parent (widget)) : FALSE;
 
     katze_assign (browser->statusbar_text, sokoke_format_uri_for_display (text));
 
index ee8afad8dde001abfc352fbc0ccbc40144114a6c..053656eb314e260b278d636b778fb58b00a445b7 100644 (file)
@@ -240,6 +240,12 @@ midori_location_action_class_init (MidoriLocationActionClass* class)
                                      "The list of history items",
                                      KATZE_TYPE_ARRAY,
                                      G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+    /* We want location entries to have appears-as-list applied */
+    gtk_rc_parse_string ("style \"midori-location-entry-style\" {\n"
+                         "  GtkComboBox::appears-as-list = 1\n }\n"
+                         "widget \"*MidoriLocationEntry\" "
+                         "style \"midori-location-entry-style\"\n");
 }
 
 /* Allow this to be used in tests, it's otherwise private */
@@ -535,6 +541,10 @@ midori_location_action_create_tool_item (GtkAction* action)
     GtkWidget* toolitem;
     GtkWidget* alignment;
     GtkWidget* location_entry;
+    GtkWidget* entry;
+    #if HAVE_HILDON
+    HildonGtkInputMode mode;
+    #endif
 
     toolitem = GTK_WIDGET (gtk_tool_item_new ());
     gtk_tool_item_set_expand (GTK_TOOL_ITEM (toolitem), TRUE);
@@ -542,10 +552,26 @@ midori_location_action_create_tool_item (GtkAction* action)
     alignment = gtk_alignment_new (0.0f, 0.5f, 1.0f, 0.1f);
     gtk_widget_show (alignment);
     gtk_container_add (GTK_CONTAINER (toolitem), alignment);
-    location_entry = g_object_new (MIDORI_TYPE_LOCATION_ENTRY, NULL);
+    location_entry = gtk_combo_box_entry_new ();
+    gtk_widget_set_name (location_entry, "MidoriLocationEntry");
     gtk_widget_show (location_entry);
     gtk_container_add (GTK_CONTAINER (alignment), location_entry);
 
+    #if HAVE_HILDON
+    entry = gtk_entry_new ();
+    mode = hildon_gtk_entry_get_input_mode (GTK_ENTRY (entry));
+    mode &= ~HILDON_GTK_INPUT_MODE_AUTOCAP;
+    hildon_gtk_entry_set_input_mode (GTK_ENTRY (entry), mode);
+    #else
+    entry = gtk_icon_entry_new ();
+    gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
+         GTK_ICON_ENTRY_PRIMARY, GTK_STOCK_FILE);
+    gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (entry),
+         GTK_ICON_ENTRY_SECONDARY, TRUE);
+    #endif
+    gtk_widget_show (entry);
+    gtk_container_add (GTK_CONTAINER (location_entry), entry);
+
     return toolitem;
 }
 
index b3f1781f1f3c9cbfe84356e43a28737e68095c40..33c3a39ea7cc4789f68c5765df962ee7f8db5e07 100644 (file)
@@ -12,8 +12,6 @@
 #ifndef __MIDORI_LOCATION_ACTION_H__
 #define __MIDORI_LOCATION_ACTION_H__
 
-#include "midori-locationentry.h"
-
 #include <katze/katze.h>
 
 G_BEGIN_DECLS
diff --git a/midori/midori-locationentry.c b/midori/midori-locationentry.c
deleted file mode 100644 (file)
index 80d3637..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright (C) 2008 Dale Whittaker <dayul@users.sf.net>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- See the file COPYING for the full license text.
-*/
-
-#include "midori-locationentry.h"
-
-#include "gtkiconentry.h"
-#include "sokoke.h"
-#include <gdk/gdkkeysyms.h>
-
-struct _MidoriLocationEntry
-{
-    GtkComboBoxEntry parent_instance;
-};
-
-struct _MidoriLocationEntryClass
-{
-    GtkComboBoxEntryClass parent_class;
-};
-
-G_DEFINE_TYPE (MidoriLocationEntry,
-    midori_location_entry, GTK_TYPE_COMBO_BOX_ENTRY)
-
-static void
-midori_location_entry_class_init (MidoriLocationEntryClass* class)
-{
-
-}
-
-static void
-midori_location_entry_init (MidoriLocationEntry* location_entry)
-{
-    GtkWidget* entry;
-    #if HAVE_HILDON
-    HildonGtkInputMode mode;
-    #endif
-
-    /* We want the widget to have appears-as-list applied */
-    gtk_rc_parse_string ("style \"midori-location-entry-style\" {\n"
-                         "  GtkComboBox::appears-as-list = 1\n }\n"
-                         "widget_class \"*MidoriLocationEntry\" "
-                         "style \"midori-location-entry-style\"\n");
-
-    #if HAVE_HILDON
-    entry = gtk_entry_new ();
-    mode = hildon_gtk_entry_get_input_mode (GTK_ENTRY (entry));
-    mode &= ~HILDON_GTK_INPUT_MODE_AUTOCAP;
-    hildon_gtk_entry_set_input_mode (GTK_ENTRY (entry), mode);
-    #else
-    entry = gtk_icon_entry_new ();
-    gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
-         GTK_ICON_ENTRY_PRIMARY, GTK_STOCK_FILE);
-    gtk_icon_entry_set_icon_highlight (GTK_ICON_ENTRY (entry),
-         GTK_ICON_ENTRY_SECONDARY, TRUE);
-    #endif
-    gtk_widget_show (entry);
-    gtk_container_add (GTK_CONTAINER (location_entry), entry);
-}
diff --git a/midori/midori-locationentry.h b/midori/midori-locationentry.h
deleted file mode 100644 (file)
index 0c4041e..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Copyright (C) 2008 Dale Whittaker <dayul@users.sf.net>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- See the file COPYING for the full license text.
-*/
-
-#ifndef __MIDORI_LOCATION_ENTRY_H__
-#define __MIDORI_LOCATION_ENTRY_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-#define MIDORI_TYPE_LOCATION_ENTRY            (midori_location_entry_get_type ())
-#define MIDORI_LOCATION_ENTRY(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), MIDORI_TYPE_LOCATION_ENTRY, MidoriLocationEntry))
-#define MIDORI_LOCATION_ENTRY_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  MIDORI_TYPE_LOCATION_ENTRY, MidoriLocationEntryClass))
-#define MIDORI_IS_LOCATION_ENTRY(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIDORI_TYPE_LOCATION_ENTRY))
-#define MIDORI_IS_LOCATION_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  MIDORI_TYPE_LOCATION_ENTRY))
-#define MIDORI_LOCATION_ENTRY_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  MIDORI_TYPE_LOCATION_ENTRY, MidoriLocationEntryClass))
-
-typedef struct _MidoriLocationEntry         MidoriLocationEntry;
-typedef struct _MidoriLocationEntryClass    MidoriLocationEntryClass;
-
-GType
-midori_location_entry_get_type             (void);
-
-G_END_DECLS
-
-#endif /* __MIDORI_LOCATION_ENTRY_H__ */
index 0886b7cd99cc8530e91354a161b7adf811372ef9..44c47821704015f839a1fe2e80465e96153c7268 100644 (file)
@@ -17,7 +17,6 @@
 #include "midori-browser.h"
 #include "midori-extension.h"
 #include "midori-locationaction.h"
-#include "midori-locationentry.h"
 #include "midori-panel.h"
 #include "midori-preferences.h"
 #include "midori-searchaction.h"