Commit e36b5a2e authored by Ramiro Estrugo's avatar Ramiro Estrugo Committed by Ramiro Estrugo
Browse files

Add a small C wrapper for poking mozilla preferences.

2000-06-29  Ramiro Estrugo  <ramiro@eazel.com>

* components/mozilla/Makefile.am:
* components/mozilla/mozilla-preferences.cpp:
* components/mozilla/mozilla-preferences.h:
Add a small C wrapper for poking mozilla preferences.

* components/mozilla/nautilus-mozilla-content-view.c:
(nautilus_mozilla_content_view_initialize):
Poke some interesting preferences.

* configure.in:
If the mozilla component is being built, add a check for the c++
compiler which is needed by the mozilla preferences C wrapper.
parent 9f93e607
2000-06-29 Ramiro Estrugo <ramiro@eazel.com>
* components/mozilla/Makefile.am:
* components/mozilla/mozilla-preferences.cpp:
* components/mozilla/mozilla-preferences.h:
Add a small C wrapper for poking mozilla preferences.
* components/mozilla/nautilus-mozilla-content-view.c:
(nautilus_mozilla_content_view_initialize):
Poke some interesting preferences.
* configure.in:
If the mozilla component is being built, add a check for the c++
compiler which is needed by the mozilla preferences C wrapper.
2000-06-29 Ali Abdin <aliabdin@aucegypt.edu
* components/help/Makefile.am: Install the libvfs-help.so module
......
......@@ -21,6 +21,11 @@ nautilus_mozilla_content_view_SOURCES = \
nautilus-mozilla-content-view.h \
nautilus-mozilla-content-view.c \
main.c \
mozilla-preferences.cpp \
$(NULL)
noinst_HEADERS = \
mozilla-preferences.h \
$(NULL)
nautilus_mozilla_content_view_LDFLAGS = \
......
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2000 Eazel, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Author: Ramiro Estrugo <ramiro@eazel.com>
*
*/
/*
* mozilla-preferences.cpp - A small C wrapper for poking mozilla preferences
*/
#include <config.h>
#include "mozilla-preferences.h"
#include "nsIServiceManager.h"
#include "nsIPref.h"
extern "C" gboolean
mozilla_preference_set (const char *preference_name,
const char *new_value)
{
g_return_val_if_fail (preference_name != NULL, FALSE);
g_return_val_if_fail (new_value != NULL, FALSE);
nsCOMPtr<nsIPref> pref = do_CreateInstance(NS_PREF_PROGID);
if (pref)
{
nsresult rv = pref->SetCharPref (preference_name, new_value);
return NS_SUCCEEDED (rv) ? TRUE : FALSE;
}
return FALSE;
}
extern "C" gboolean
mozilla_preference_set_boolean (const char *preference_name,
gboolean new_boolean_value)
{
g_return_val_if_fail (preference_name != NULL, FALSE);
nsCOMPtr<nsIPref> pref = do_CreateInstance(NS_PREF_PROGID);
if (pref)
{
nsresult rv = pref->SetBoolPref (preference_name,
new_boolean_value ? PR_TRUE : PR_FALSE);
return NS_SUCCEEDED (rv) ? TRUE : FALSE;
}
return FALSE;
}
// pref->SetBoolPref("nglayout.widget.gfxscrollbars", PR_FALSE);
// pref->SetBoolPref("security.checkloaduri", PR_FALSE);
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2000 Eazel, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Author: Ramiro Estrugo <ramiro@eazel.com>
*
*/
/*
* mozilla-preferences.h - A small C wrapper for poking mozilla preferences
*/
#ifndef MOZILLA_PREFERENCES_H
#define MOZILLA_PREFERENCES_H
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
gboolean mozilla_preference_set (const char *preference_name,
const char *new_value);
gboolean mozilla_preference_set_boolean (const char *preference_name,
gboolean new_boolean_value);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* MOZILLA_PREFERENCES_H */
......@@ -34,6 +34,7 @@
#include "nautilus-mozilla-content-view.h"
#include "gtkmozembed.h"
#include "mozilla-preferences.h"
#include <bonobo/bonobo-control.h>
#include <gtk/gtksignal.h>
......@@ -94,6 +95,8 @@ nautilus_mozilla_content_view_initialize_class (NautilusMozillaContentViewClass
object_class->destroy = nautilus_mozilla_content_view_destroy;
}
static gboolean mozilla_preferences_poked = FALSE;
static void
nautilus_mozilla_content_view_initialize (NautilusMozillaContentView *view)
{
......@@ -104,6 +107,15 @@ nautilus_mozilla_content_view_initialize (NautilusMozillaContentView *view)
/* Conjure up the beast. May God have mercy on our souls. */
view->details->mozilla = gtk_moz_embed_new ();
if (!mozilla_preferences_poked)
{
mozilla_preferences_poked = TRUE;
mozilla_preference_set_boolean ("nglayout.widget.gfxscrollbars", FALSE);
mozilla_preference_set_boolean ("security.checkloaduri", FALSE);
mozilla_preference_set ("general.useragent.misc", "Nautilus");
}
/* Add callbacks to the beast */
gtk_signal_connect (GTK_OBJECT (view->details->mozilla),
"title",
......
......@@ -168,6 +168,7 @@ if test -n "$_mozilla_nspr_libs" -a \
-n "$_mozilla_gtk_super_win_libs" -a \
-n "$_mozilla_gtk_moz_embed_libs"
then
AC_PROG_CXX
AC_MSG_RESULT(yes)
found_mozilla=true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment