Пример #1
0
static void
nemo_window_pane_hide_temporary_bars (NemoWindowPane *pane)
{
	NemoWindowSlot *slot;
	NemoDirectory *directory;

	slot = pane->active_slot;

	if (pane->temporary_navigation_bar) {
		directory = nemo_directory_get (slot->location);

		pane->temporary_navigation_bar = FALSE;

		/* if we're in a search directory, hide the main bar, and show the search
		 * bar again; otherwise, just hide the whole toolbar.
		 */
		if (NEMO_IS_SEARCH_DIRECTORY (directory)) {
			nemo_toolbar_set_show_main_bar (NEMO_TOOLBAR (pane->tool_bar), FALSE);
			nemo_toolbar_set_show_search_bar (NEMO_TOOLBAR (pane->tool_bar), TRUE);
		} else {
			gtk_widget_hide (pane->tool_bar);
		}

		nemo_directory_unref (directory);
	}
}
Пример #2
0
static void
search_bar_activate_callback (NemoSearchBar *bar,
			      NemoWindowPane *pane)
{
	char *uri, *current_uri;
	NemoDirectory *directory;
	NemoSearchDirectory *search_directory;
	NemoQuery *query;
	GFile *location;

	uri = nemo_search_directory_generate_new_uri ();
	location = g_file_new_for_uri (uri);

	directory = nemo_directory_get (location);
	g_assert (NEMO_IS_SEARCH_DIRECTORY (directory));
	search_directory = NEMO_SEARCH_DIRECTORY (directory);
	query = nemo_search_bar_get_query (NEMO_SEARCH_BAR (pane->search_bar));

	if (query != NULL) {
		current_uri = nemo_window_slot_get_location_uri (pane->active_slot);

		nemo_query_set_location (query, current_uri);
		nemo_search_directory_set_query (search_directory, query);

		g_free (current_uri);
		g_object_unref (query);
	}

	nemo_window_slot_go_to (pane->active_slot, location, FALSE);

	nemo_directory_unref (directory);
	g_object_unref (location);	
	g_free (uri);
}
Пример #3
0
void
nemo_window_pane_sync_search_widgets (NemoWindowPane *pane)
{
	NemoWindowSlot *slot;
	NemoDirectory *directory;
	NemoSearchDirectory *search_directory;

	slot = pane->active_slot;
	search_directory = NULL;

	directory = nemo_directory_get (slot->location);
	if (NEMO_IS_SEARCH_DIRECTORY (directory)) {
		search_directory = NEMO_SEARCH_DIRECTORY (directory);
	}

	if (search_directory != NULL) {
		if (!nemo_search_directory_is_saved_search (search_directory)) {
			nemo_toolbar_set_show_search_bar (NEMO_TOOLBAR (pane->tool_bar), TRUE);
			pane->temporary_search_bar = FALSE;
		} else {
			toggle_toolbar_search_button (pane);
		}
	} else {
		search_bar_cancel_callback (pane->search_bar, pane);
	}

	nemo_directory_unref (directory);
}
Пример #4
0
static void
remove_all_extra_location_widgets (GtkWidget *widget,
				   gpointer data)
{
	NemoWindowSlot *slot = data;
	NemoDirectory *directory;

	directory = nemo_directory_get (slot->location);
	if (widget != GTK_WIDGET (slot->query_editor_revealer)) {
		gtk_container_remove (GTK_CONTAINER (slot->extra_location_widgets), widget);
	}

	nemo_directory_unref (directory);
}
Пример #5
0
static void
create_new_search (NemoWindowSlot *slot)
{
	char *uri;
	NemoDirectory *directory;
	GFile *location;

	uri = nemo_search_directory_generate_new_uri ();
	location = g_file_new_for_uri (uri);

	directory = nemo_directory_get (location);
	g_assert (NEMO_IS_SEARCH_DIRECTORY (directory));

	nemo_window_slot_open_location_full (slot, location, NEMO_WINDOW_OPEN_FLAG_SEARCH, NULL, sync_search_location_cb, slot);

	nemo_directory_unref (directory);
	g_object_unref (location);
	g_free (uri);
}
Пример #6
0
static void
update_query_editor (NemoWindowSlot *slot)
{
	NemoDirectory *directory;
	NemoSearchDirectory *search_directory;

	directory = nemo_directory_get (slot->location);

	if (NEMO_IS_SEARCH_DIRECTORY (directory)) {
		NemoQuery *query;
		search_directory = NEMO_SEARCH_DIRECTORY (directory);
		query = nemo_search_directory_get_query (search_directory);
		if (query != NULL) {
			nemo_query_editor_set_query (slot->query_editor,
							 query);
			g_object_unref (query);
		}
	} else {
		nemo_query_editor_set_location (slot->query_editor, slot->location);
	}

	nemo_directory_unref (directory);
}