static void
path_bar_location_changed_callback (GtkWidget *widget,
                                    GFile *location,
                                    CajaNavigationWindowPane *pane)
{
    CajaNavigationWindowSlot *slot;
    CajaWindowPane *win_pane;
    int i;

    g_assert (CAJA_IS_NAVIGATION_WINDOW_PANE (pane));

    win_pane = CAJA_WINDOW_PANE(pane);

    slot = CAJA_NAVIGATION_WINDOW_SLOT (win_pane->active_slot);

    /* check whether we already visited the target location */
    i = bookmark_list_get_uri_index (slot->back_list, location);
    if (i >= 0)
    {
        caja_navigation_window_back_or_forward (CAJA_NAVIGATION_WINDOW (win_pane->window), TRUE, i, FALSE);
    }
    else
    {
        caja_window_slot_go_to (win_pane->active_slot, location, FALSE);
    }
}
static void
navigation_bar_location_changed_callback (GtkWidget *widget,
        const char *uri,
        CajaNavigationWindowPane *pane)
{
    GFile *location;

    if (caja_navigation_window_pane_hide_temporary_bars (pane))
    {
        caja_navigation_window_restore_focus_widget (CAJA_NAVIGATION_WINDOW (CAJA_WINDOW_PANE (pane)->window));
    }

    location = g_file_new_for_uri (uri);
    caja_window_slot_go_to (CAJA_WINDOW_PANE (pane)->active_slot, location, FALSE);
    g_object_unref (location);
}
Beispiel #3
0
static void
action_go_to_trash_callback (GtkAction *action,
                             gpointer user_data)
{
    CajaWindow *window;
    CajaWindowSlot *slot;
    GFile *trash;

    window = CAJA_WINDOW (user_data);
    slot = caja_window_get_active_slot (window);

    trash = g_file_new_for_uri ("trash:///");
    caja_window_slot_go_to (slot,
                            trash,
                            should_open_in_new_tab ());
    g_object_unref (trash);
}
Beispiel #4
0
static void
action_go_to_network_callback (GtkAction *action,
                               gpointer user_data)
{
    CajaWindow *window;
    CajaWindowSlot *slot;
    GFile *network;

    window = CAJA_WINDOW (user_data);
    slot = caja_window_get_active_slot (window);

    network = g_file_new_for_uri (NETWORK_URI);
    caja_window_slot_go_to (slot,
                            network,
                            should_open_in_new_tab ());
    g_object_unref (network);
}
Beispiel #5
0
static void
action_go_to_computer_callback (GtkAction *action,
                                gpointer user_data)
{
    CajaWindow *window;
    CajaWindowSlot *slot;
    GFile *computer;

    window = CAJA_WINDOW (user_data);
    slot = caja_window_get_active_slot (window);

    computer = g_file_new_for_uri (COMPUTER_URI);
    caja_window_slot_go_to (slot,
                            computer,
                            should_open_in_new_tab ());
    g_object_unref (computer);
}
Beispiel #6
0
static void
action_go_to_templates_callback (GtkAction *action,
                                 gpointer user_data)
{
    CajaWindow *window;
    CajaWindowSlot *slot;
    char *path;
    GFile *location;

    window = CAJA_WINDOW (user_data);
    slot = caja_window_get_active_slot (window);

    path = caja_get_templates_directory ();
    location = g_file_new_for_path (path);
    g_free (path);
    caja_window_slot_go_to (slot,
                            location,
                            should_open_in_new_tab ());
    g_object_unref (location);
}
static void
search_bar_activate_callback (CajaSearchBar *bar,
                              CajaNavigationWindowPane *pane)
{
    char *uri, *current_uri;
    CajaDirectory *directory;
    CajaSearchDirectory *search_directory;
    CajaQuery *query;
    GFile *location;

    uri = caja_search_directory_generate_new_uri ();
    location = g_file_new_for_uri (uri);
    g_free (uri);

    directory = caja_directory_get (location);

    g_assert (CAJA_IS_SEARCH_DIRECTORY (directory));

    search_directory = CAJA_SEARCH_DIRECTORY (directory);

    query = caja_search_bar_get_query (CAJA_SEARCH_BAR (pane->search_bar));
    if (query != NULL)
    {
        CajaWindowSlot *slot = CAJA_WINDOW_PANE (pane)->active_slot;
        if (!caja_search_directory_is_indexed (search_directory))
        {
            current_uri = caja_window_slot_get_location_uri (slot);
            caja_query_set_location (query, current_uri);
            g_free (current_uri);
        }
        caja_search_directory_set_query (search_directory, query);
        g_object_unref (query);
    }

    caja_window_slot_go_to (CAJA_WINDOW_PANE (pane)->active_slot, location, FALSE);

    caja_directory_unref (directory);
    g_object_unref (location);
}
Beispiel #8
0
static void
activate_bookmark_in_menu_item (GtkAction *action, gpointer user_data)
{
    CajaWindowSlot *slot;
    BookmarkHolder *holder;
    GFile *location;

    holder = (BookmarkHolder *)user_data;

    if (caja_bookmark_uri_known_not_to_exist (holder->bookmark))
    {
        holder->failed_callback (holder->window, holder->bookmark);
    }
    else
    {
        location = caja_bookmark_get_location (holder->bookmark);
        slot = caja_window_get_active_slot (holder->window);
        caja_window_slot_go_to (slot,
                                location,
                                should_open_in_new_tab ());
        g_object_unref (location);
    }
}