#endif
#endif
- midori_app_setup (argv);
-
/* Parse cli options */
webapp = NULL;
config = NULL;
block_uris = NULL;
inactivity_reset = 0;
error = NULL;
- if (!gtk_init_with_args (&argc, &argv, _("[Addresses]"), entries,
- GETTEXT_PACKAGE, &error))
+ if (!midori_app_setup (&argc, &argv, entries, &error))
{
g_print ("%s - %s\n", _("Midori"), error->message);
g_error_free (error);
*
* Since: 0.4.2
**/
-void
-midori_app_setup (gchar** argument_vector)
+gboolean
+midori_app_setup (gint *argc,
+ gchar** *argument_vector,
+ const GOptionEntry *entries,
+ GError* *error)
{
GtkIconSource* icon_source;
GtkIconSet* icon_set;
GtkIconFactory* factory;
gsize i;
gchar* executable;
+ gboolean success;
static GtkStockItem items[] =
{
textdomain (GETTEXT_PACKAGE);
#endif
- g_type_init ();
+ /* Preserve argument vector */
+ command_line = g_strdupv (*argument_vector);
+ success = gtk_init_with_args (argc, argument_vector, _("[Addresses]"),
+ entries, GETTEXT_PACKAGE, error);
+
factory = gtk_icon_factory_new ();
for (i = 0; i < G_N_ELEMENTS (items); i++)
{
gtk_icon_factory_add_default (factory);
g_object_unref (factory);
- /* Preserve argument vector */
- command_line = g_strdupv (argument_vector);
#ifdef G_OS_WIN32
exec_path = g_win32_get_package_installation_directory_of_module (NULL);
#else
}
}
#endif
+
+ return success;
}
gboolean
const gchar* title,
const gchar* message);
-void
-midori_app_setup (gchar** argument_vector);
+gboolean
+midori_app_setup (gint *argc,
+ gchar** *argument_vector,
+ const GOptionEntry *entries,
+ GError* *error);
gchar**
midori_app_get_command_line (void);
//TestParameters default_params = {":memory:", TRUE, NULL, NULL};
TestParameters default_params = {":memory:", FALSE, NULL, NULL};
- midori_app_setup (argv);
- g_test_init (&argc, &argv, NULL);
- gtk_init_check (&argc, &argv);
+ midori_app_setup (&argc, &argv, NULL, NULL);
g_test_add ("/bookmarks/simple test",
BookmarksFixture, &default_params,
main (int argc,
char** argv)
{
- midori_app_setup (argv);
g_object_set_data (G_OBJECT (webkit_get_default_session ()),
"midori-session-initialized", (void*)1);
g_test_init (&argc, &argv, NULL);
- gtk_init_check (&argc, &argv);
+ midori_app_setup (&argc, &argv, NULL, NULL);
g_test_add_func ("/browser/create", browser_create);
g_test_add_func ("/browser/tooltips", browser_tooltips);
main (int argc,
char** argv)
{
- midori_app_setup (argv);
g_test_init (&argc, &argv, NULL);
- gtk_init_check (&argc, &argv);
+ midori_app_setup (&argc, &argv, NULL, NULL);
soup_session_add_feature_by_type (webkit_get_default_session (),
SOUP_TYPE_COOKIE_JAR);
main (int argc,
char** argv)
{
- midori_app_setup (argv);
g_test_init (&argc, &argv, NULL);
- gtk_init_check (&argc, &argv);
+ midori_app_setup (&argc, &argv, NULL, NULL);
g_test_add_func ("/magic-uri/uri", magic_uri_uri);
g_test_add_func ("/magic-uri/idn", magic_uri_idn);
main (int argc,
char** argv)
{
- midori_app_setup (argv);
g_object_set_data (G_OBJECT (webkit_get_default_session ()),
"midori-session-initialized", (void*)1);
g_test_init (&argc, &argv, NULL);
- gtk_init_check (&argc, &argv);
+ midori_app_setup (&argc, &argv, NULL, NULL);
g_test_add_data_func ("/properties/app",
(gconstpointer)MIDORI_TYPE_APP, properties_type_test);