MidoriBrowser* browser)
{
gboolean active = gtk_toggle_action_get_active (action);
- if (browser->settings)
+ if (1)
{
#if !HAVE_HILDON
if (active)
MidoriBrowser* browser)
{
gboolean active = gtk_toggle_action_get_active (action);
- if (browser->settings)
- g_object_set (browser->settings, "show-navigationbar", active, NULL);
+ g_object_set (browser->settings, "show-navigationbar", active, NULL);
sokoke_widget_set_visible (browser->navigationbar, active);
g_object_set_data (G_OBJECT (browser), "midori-toolbars-visible",
MidoriBrowser* browser)
{
gboolean active = gtk_toggle_action_get_active (action);
- if (browser->settings)
- g_object_set (browser->settings, "show-bookmarkbar", active, NULL);
+ g_object_set (browser->settings, "show-bookmarkbar", active, NULL);
sokoke_widget_set_visible (browser->bookmarkbar, active);
}
MidoriBrowser* browser)
{
gboolean active = gtk_toggle_action_get_active (action);
- if (browser->settings)
- g_object_set (browser->settings, "show-transferbar", active, NULL);
+ g_object_set (browser->settings, "show-transferbar", active, NULL);
sokoke_widget_set_visible (browser->transferbar, active);
}
MidoriBrowser* browser)
{
gboolean active = gtk_toggle_action_get_active (action);
- if (browser->settings)
- g_object_set (browser->settings, "show-statusbar", active, NULL);
+ g_object_set (browser->settings, "show-statusbar", active, NULL);
#if !HAVE_HILDON
sokoke_widget_set_visible (browser->statusbar, active);
#endif
if (!(view = midori_browser_get_current_tab (browser)))
return;
- if (browser->settings)
- g_object_get (browser->settings, "text-editor", &text_editor, NULL);
- else
- text_editor = NULL;
+ g_object_get (browser->settings, "text-editor", &text_editor, NULL);
uri = midori_view_get_display_uri (MIDORI_VIEW (view));
if (!(text_editor && *text_editor))
MidoriBrowser* browser)
{
gboolean active = gtk_toggle_action_get_active (action);
- if (browser->settings)
- g_object_set (browser->settings, "show-panel", active, NULL);
+ g_object_set (browser->settings, "show-panel", active, NULL);
sokoke_widget_set_visible (browser->panel, active);
}
{
gboolean position = gtk_paned_get_position (GTK_PANED (hpaned));
MidoriBrowser* browser = midori_browser_get_for_widget (hpaned);
- if (browser->settings)
- g_object_set (browser->settings, "last-panel-position", position, NULL);
+ g_object_set (browser->settings, "last-panel-position", position, NULL);
browser->panel_timeout = 0;
return FALSE;
}
MidoriBrowser* browser)
{
gboolean show_titles = katze_object_get_boolean (panel, "show-titles");
- if (browser->settings)
- {
- g_signal_handlers_block_by_func (browser->settings,
- midori_browser_settings_notify, browser);
- g_object_set (browser->settings, "compact-sidepanel", !show_titles, NULL);
- g_signal_handlers_unblock_by_func (browser->settings,
- midori_browser_settings_notify, browser);
- }
+ g_signal_handlers_block_by_func (browser->settings,
+ midori_browser_settings_notify, browser);
+ g_object_set (browser->settings, "compact-sidepanel", !show_titles, NULL);
+ g_signal_handlers_unblock_by_func (browser->settings,
+ midori_browser_settings_notify, browser);
}
static void
MidoriBrowser* browser)
{
gboolean show_controls = katze_object_get_boolean (panel, "show-controls");
- if (browser->settings)
- {
- g_signal_handlers_block_by_func (browser->settings,
- midori_browser_settings_notify, browser);
- g_object_set (browser->settings, "show-panel-controls", show_controls, NULL);
- g_signal_handlers_unblock_by_func (browser->settings,
- midori_browser_settings_notify, browser);
- }
+ g_signal_handlers_block_by_func (browser->settings,
+ midori_browser_settings_notify, browser);
+ g_object_set (browser->settings, "show-panel-controls", show_controls, NULL);
+ g_signal_handlers_unblock_by_func (browser->settings,
+ midori_browser_settings_notify, browser);
}
static void
gint paned_position = gtk_paned_get_position (GTK_PANED (hpaned));
gint paned_size = hpaned->allocation.width;
- if (browser->settings)
- g_object_set (browser->settings, "right-align-sidepanel",
- right_aligned, NULL);
+ g_object_set (browser->settings, "right-align-sidepanel",
+ right_aligned, NULL);
g_object_ref (browser->panel);
g_object_ref (vpaned);
gint n;
GtkWidget* view;
- if (browser->settings)
- view = g_object_new (MIDORI_TYPE_VIEW,
- "settings", browser->settings,
- "net", browser->net, NULL);
- else
- view = midori_view_new (browser->net);
+ view = g_object_new (MIDORI_TYPE_VIEW,
+ "settings", browser->settings,
+ "net", browser->net, NULL);
midori_view_set_uri (MIDORI_VIEW (view), "");
gtk_widget_show (view);
g_object_set_data (G_OBJECT (view), "midori-view-append", (void*)1);
{
MidoriBrowser* browser = MIDORI_BROWSER (object);
- if (browser->settings)
- g_signal_handlers_disconnect_by_func (browser->settings,
- midori_browser_settings_notify,
- browser);
+ g_signal_handlers_disconnect_by_func (browser->settings,
+ midori_browser_settings_notify,
+ browser);
katze_assign (browser->statusbar_text, NULL);
_midori_browser_set_statusbar_text (browser, g_value_get_string (value));
break;
case PROP_SETTINGS:
- if (browser->settings)
- g_signal_handlers_disconnect_by_func (browser->settings,
- midori_browser_settings_notify,
- browser);
+ g_signal_handlers_disconnect_by_func (browser->settings,
+ midori_browser_settings_notify,
+ browser);
katze_object_assign (browser->settings, g_value_dup_object (value));
- if (browser->settings)
- {
- _midori_browser_update_settings (browser);
- g_signal_connect (browser->settings, "notify",
- G_CALLBACK (midori_browser_settings_notify), browser);
- }
+ if (!browser->settings)
+ browser->settings = midori_web_settings_new ();
+
+ _midori_browser_update_settings (browser);
+ g_signal_connect (browser->settings, "notify",
+ G_CALLBACK (midori_browser_settings_notify), browser);
gtk_container_foreach (GTK_CONTAINER (browser->notebook),
(GtkCallback) midori_view_set_settings, browser->settings);
break;
_midori_browser_update_actions (browser);
break;
case PROP_SEARCH_ENGINES:
+ {
+ guint i;
+
/* FIXME: Disconnect handlers */
katze_object_assign (browser->search_engines, g_value_dup_object (value));
- if (browser->settings)
- {
- if (katze_object_get_boolean (browser->settings,
- "search-engines-in-completion"))
- midori_location_action_set_search_engines (MIDORI_LOCATION_ACTION (
- _action_by_name (browser, "Location")), browser->search_engines);
- else
- midori_location_action_set_search_engines (MIDORI_LOCATION_ACTION (
- _action_by_name (browser, "Location")), NULL);
- }
+ if (katze_object_get_boolean (browser->settings,
+ "search-engines-in-completion"))
+ midori_location_action_set_search_engines (MIDORI_LOCATION_ACTION (
+ _action_by_name (browser, "Location")), browser->search_engines);
+ else
+ midori_location_action_set_search_engines (MIDORI_LOCATION_ACTION (
+ _action_by_name (browser, "Location")), NULL);
midori_search_action_set_search_engines (MIDORI_SEARCH_ACTION (
_action_by_name (browser, "Search")), browser->search_engines);
/* FIXME: Connect to updates */
- if (browser->settings)
- {
- guint i;
- g_object_get (browser->settings, "last-web-search",
- &last_web_search, NULL);
- item = katze_array_get_nth_item (browser->search_engines,
- last_web_search);
- midori_search_action_set_current_item (MIDORI_SEARCH_ACTION (
- _action_by_name (browser, "Search")), item);
+ g_object_get (browser->settings, "last-web-search", &last_web_search, NULL);
+ item = katze_array_get_nth_item (browser->search_engines, last_web_search);
+ midori_search_action_set_current_item (MIDORI_SEARCH_ACTION (
+ _action_by_name (browser, "Search")), item);
- i = 0;
- while ((item = katze_array_get_nth_item (browser->search_engines, i++)))
- if (!g_strcmp0 (katze_item_get_uri (item), browser->location_entry_search))
- {
- midori_search_action_set_default_item (MIDORI_SEARCH_ACTION (
- _action_by_name (browser, "Search")), item);
- break;
- }
- }
+ i = 0;
+ while ((item = katze_array_get_nth_item (browser->search_engines, i++)))
+ if (!g_strcmp0 (katze_item_get_uri (item), browser->location_entry_search))
+ {
+ midori_search_action_set_default_item (MIDORI_SEARCH_ACTION (
+ _action_by_name (browser, "Search")), item);
+ break;
+ }
break;
+ }
case PROP_HISTORY:
midori_browser_set_history (browser, g_value_get_object (value));
break;
g_return_val_if_fail (MIDORI_IS_BROWSER (browser), -1);
g_return_val_if_fail (uri != NULL, -1);
- if (browser->settings)
- view = g_object_new (MIDORI_TYPE_VIEW, "settings", browser->settings,
- "net", browser->net, NULL);
- else
- view = midori_view_new (browser->net);
+ view = g_object_new (MIDORI_TYPE_VIEW, "settings", browser->settings,
+ "net", browser->net, NULL);
midori_view_set_uri (MIDORI_VIEW (view), uri);
gtk_widget_show (view);