Exemplo n.º 1
0
static void
open_window (NautilusApplication *application,
	     GFile *location, GdkScreen *screen, const char *geometry)
{
	NautilusWindow *window;

	nautilus_profile_start (NULL);
	window = nautilus_application_create_window (application, screen);

	if (location != NULL) {
		nautilus_window_go_to (window, location);
	} else {
		nautilus_window_slot_go_home (nautilus_window_get_active_slot (window), 0);
	}

	if (geometry != NULL && !gtk_widget_get_visible (GTK_WIDGET (window))) {
		/* never maximize windows opened from shell if a
		 * custom geometry has been requested.
		 */
		gtk_window_unmaximize (GTK_WINDOW (window));
		eel_gtk_window_set_initial_geometry_from_string (GTK_WINDOW (window),
								 geometry,
								 APPLICATION_WINDOW_MIN_WIDTH,
								 APPLICATION_WINDOW_MIN_HEIGHT,
								 FALSE);
	}

	nautilus_profile_end (NULL);
}
static void
action_go_to_trash_callback (GtkAction *action,
                             gpointer user_data)
{
    GFile *trash;
    trash = g_file_new_for_uri ("trash:///");
    nautilus_window_go_to (NAUTILUS_WINDOW (user_data),
                           trash);
    g_object_unref (trash);
}
static void
action_go_to_network_callback (GtkAction *action,
                               gpointer user_data)
{
    GFile *network;
    network = g_file_new_for_uri (NETWORK_URI);
    nautilus_window_go_to (NAUTILUS_WINDOW (user_data),
                           network);
    g_object_unref (network);
}
static void
action_go_to_computer_callback (GtkAction *action,
                                gpointer user_data)
{
    GFile *computer;
    computer = g_file_new_for_uri (COMPUTER_URI);
    nautilus_window_go_to (NAUTILUS_WINDOW (user_data),
                           computer);
    g_object_unref (computer);
}
Exemplo n.º 5
0
static void
open_selected_bookmark (gpointer user_data, GdkScreen *screen)
{
	NautilusBookmark *selected;
	NautilusWindow *window;
	GFile *location;
	
	selected = get_selected_bookmark ();

	if (!selected) {
		return;
	}

	location = nautilus_bookmark_get_location (selected);
	if (location == NULL) { 
		return;
	}

	if (NAUTILUS_IS_NAVIGATION_WINDOW (user_data)) {
		nautilus_window_go_to (NAUTILUS_WINDOW (user_data), location);
	} else if (NAUTILUS_IS_SPATIAL_WINDOW (user_data)) {
		window = nautilus_application_present_spatial_window (application, 
								      NULL,
								      NULL,
								      location,
								      screen);
	} else { /* window that opened bookmarks window has been closed */
		if (parent_is_browser_window || eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
			window = nautilus_application_create_navigation_window (application, 
										NULL,
										screen);
			nautilus_window_go_to (window, location);
		} else {
			window = nautilus_application_present_spatial_window (application, 
									      NULL,
									      NULL,
									      location,
									      screen);
		}
	}

	g_object_unref (location);
}
static void
action_go_to_burn_cd_callback (GtkAction *action,
                               gpointer user_data)
{
    GFile *burn;
    burn = g_file_new_for_uri (BURN_CD_URI);
    nautilus_window_go_to (NAUTILUS_WINDOW (user_data),
                           burn);
    g_object_unref (burn);

}
static void
action_go_to_templates_callback (GtkAction *action,
                                 gpointer user_data)
{
    char *path;
    GFile *location;

    path = nautilus_get_templates_directory ();
    location = g_file_new_for_path (path);
    g_free (path);
    nautilus_window_go_to (NAUTILUS_WINDOW (user_data),
                           location);
    g_object_unref (location);
}
static void
activate_bookmark_in_menu_item (GtkAction *action, gpointer user_data)
{
    BookmarkHolder *holder;
    GFile *location;

    holder = (BookmarkHolder *)user_data;

    if (nautilus_bookmark_uri_known_not_to_exist (holder->bookmark)) {
        holder->failed_callback (holder->window, holder->bookmark);
    } else {
        location = nautilus_bookmark_get_location (holder->bookmark);
        nautilus_window_go_to (holder->window, location);
        g_object_unref (location);
    }
}
void
nautilus_connect_server_dialog_present_uri (NautilusApplication *application,
					    GFile *location,
					    GtkWidget *widget)
{
	NautilusWindow *window;

	if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
		window = nautilus_application_create_navigation_window (application,
									NULL,
									gtk_widget_get_screen (widget));
		nautilus_window_go_to (window, location);
	} else {
		nautilus_application_present_spatial_window (application,
							     NULL,
							     NULL,
							     location,
							     gtk_widget_get_screen (widget));
	}

	gtk_widget_destroy (widget);
	g_object_unref (location);
}
static void
open_selected_bookmark (gpointer user_data, GdkScreen *screen)
{
	NautilusBookmark *selected;
	NautilusWindow *window;
	GFile *location;
	
	selected = get_selected_bookmark ();

	if (!selected) {
		return;
	}

	location = nautilus_bookmark_get_location (selected);
	if (location == NULL) { 
		return;
	}

	window = user_data;
	nautilus_window_go_to (window, location);

	g_object_unref (location);
}
Exemplo n.º 11
0
static void
on_row_activated (GtkTreeView       *view,
                  GtkTreePath       *path,
                  GtkTreeViewColumn *column,
                  gpointer           user_data)
{
	NautilusBookmarksWindow *self = user_data;
	NautilusBookmark *selected;
	GFile *location;

	selected = get_selected_bookmark (self);

	if (!selected) {
		return;
	}

	location = nautilus_bookmark_get_location (selected);
	if (location == NULL) {
		return;
	}

	nautilus_window_go_to (self->priv->parent_window, location);
	g_object_unref (location);
}