int main (int argc, char *argv[]) { GtkWidget *dialog; GOptionContext *context; GError *error; const GOptionEntry options[] = { { "print-uri", 0, 0, G_OPTION_ARG_NONE, &just_print_uri, N_("Print but do not open the URI"), NULL }, { NULL } }; bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); error = NULL; /* Translators: This is the --help description for the connect to server app, the initial newlines are between the command line arg and the description */ context = g_option_context_new (N_("\n\nAdd connect to server mount")); g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE); g_option_context_add_group (context, gtk_get_option_group (TRUE)); if (!g_option_context_parse (context, &argc, &argv, &error)) { g_critical ("Failed to parse arguments: %s", error->message); g_error_free (error); g_option_context_free (context); exit (1); } g_option_context_free (context); nemo_global_preferences_init (); gtk_window_set_default_icon_name (NEMO_ICON_FOLDER); dialog = nemo_connect_server_dialog_new (NULL); g_signal_connect (dialog, "destroy", G_CALLBACK (main_dialog_destroyed), NULL); gtk_widget_show (dialog); gtk_main (); return 0; }
static void add_preferences_callbacks (void) { nemo_global_preferences_init (); g_signal_connect_swapped (nemo_preferences, "changed::" NEMO_PREFERENCES_SHOW_HIDDEN_FILES, G_CALLBACK(filtering_changed_callback), NULL); g_signal_connect_swapped (nemo_preferences, "changed::" NEMO_PREFERENCES_SHOW_DIRECTORY_ITEM_COUNTS, G_CALLBACK (async_data_preference_changed_callback), NULL); g_signal_connect_swapped (nemo_preferences, "changed::" NEMO_PREFERENCES_DATE_FORMAT, G_CALLBACK(async_data_preference_changed_callback), NULL); }
static void nemo_application_startup (GApplication *app) { NemoApplication *self = NEMO_APPLICATION (app); /* chain up to the GTK+ implementation early, so gtk_init() * is called for us. */ G_APPLICATION_CLASS (nemo_application_parent_class)->startup (app); /* initialize the previewer singleton */ //nemo_previewer_get_singleton (); /* create an undo manager */ self->undo_manager = nemo_undo_manager_new (); /* create DBus manager */ self->priv->dbus_manager = nemo_dbus_manager_new (); self->priv->fdb_manager = nemo_freedesktop_dbus_new (); /* initialize preferences and create the global GSettings objects */ nemo_global_preferences_init (); /* register views */ nemo_icon_view_register (); nemo_desktop_icon_view_register (); nemo_list_view_register (); nemo_icon_view_compact_register (); #if ENABLE_EMPTY_VIEW nemo_empty_view_register (); #endif /* register property pages */ nemo_image_properties_page_register (); /* initialize theming */ init_icons_and_styles (); init_gtk_accels (); /* initialize nemo modules */ nemo_module_setup (); /* attach menu-provider module callback */ menu_provider_init_callback (); /* Initialize the UI handler singleton for file operations */ notify_init (GETTEXT_PACKAGE); self->priv->progress_handler = nemo_progress_ui_handler_new (); /* Watch for unmounts so we can close open windows */ /* TODO-gio: This should be using the UNMOUNTED feature of GFileMonitor instead */ self->priv->volume_monitor = g_volume_monitor_get (); g_signal_connect_object (self->priv->volume_monitor, "mount_removed", G_CALLBACK (mount_removed_callback), self, 0); g_signal_connect_object (self->priv->volume_monitor, "mount_added", G_CALLBACK (mount_added_callback), self, 0); g_signal_connect_swapped (nemo_window_state, "changed::" NEMO_WINDOW_STATE_START_WITH_MENU_BAR, G_CALLBACK (menu_state_changed_callback), self); /* Check the user's ~/.nemo directories and post warnings * if there are problems. */ check_required_directories (self); self->priv->cache_problem = FALSE; self->priv->ignore_cache_problem = FALSE; /* silently do a full check of the cache and fix if running as root. * If running as a normal user, do a quick check, and we'll notify the * user later if there's a problem via an infobar */ if (geteuid () == 0) { if (!gnome_desktop_thumbnail_cache_check_permissions (NULL, FALSE)) gnome_desktop_thumbnail_cache_fix_permissions (); } else { if (!gnome_desktop_thumbnail_cache_check_permissions (NULL, TRUE)) self->priv->cache_problem = TRUE; } if (geteuid() != 0) init_desktop (self); }
static void nemo_application_startup (GApplication *app) { NemoApplication *self = NEMO_APPLICATION (app); /* chain up to the GTK+ implementation early, so gtk_init() * is called for us. */ G_APPLICATION_CLASS (nemo_application_parent_class)->startup (app); /* initialize the previewer singleton */ //nemo_previewer_get_singleton (); /* create an undo manager */ self->undo_manager = nemo_undo_manager_new (); /* create DBus manager */ nemo_dbus_manager_start (app); nemo_freedesktop_dbus_start (self); /* initialize preferences and create the global GSettings objects */ nemo_global_preferences_init (); /* register views */ nemo_icon_view_register (); nemo_desktop_icon_view_register (); nemo_list_view_register (); nemo_icon_view_compact_register (); #if ENABLE_EMPTY_VIEW nemo_empty_view_register (); #endif /* register property pages */ nemo_image_properties_page_register (); /* initialize theming */ init_icons_and_styles (); init_gtk_accels (); /* initialize nemo modules */ nemo_module_setup (); /* attach menu-provider module callback */ menu_provider_init_callback (); /* Initialize the UI handler singleton for file operations */ notify_init (GETTEXT_PACKAGE); self->priv->progress_handler = nemo_progress_ui_handler_new (); /* Watch for unmounts so we can close open windows */ /* TODO-gio: This should be using the UNMOUNTED feature of GFileMonitor instead */ self->priv->volume_monitor = g_volume_monitor_get (); g_signal_connect_object (self->priv->volume_monitor, "mount_removed", G_CALLBACK (mount_removed_callback), self, 0); g_signal_connect_object (self->priv->volume_monitor, "mount_added", G_CALLBACK (mount_added_callback), self, 0); /* Check the user's ~/.nemo directories and post warnings * if there are problems. */ check_required_directories (self); init_desktop (self); }