static void
real_sync_title (NautilusWindow *window,
		 NautilusWindowSlot *slot)
{
	NautilusNavigationWindow *navigation_window;
	NautilusNavigationWindowPane *pane;
	NautilusNotebook *notebook;
	char *full_title;
	char *window_title;

	navigation_window = NAUTILUS_NAVIGATION_WINDOW (window);

	EEL_CALL_PARENT (NAUTILUS_WINDOW_CLASS,
			 sync_title, (window, slot));

	if (slot == window->details->active_pane->active_slot) {
		/* if spatial mode is default, we keep "File Browser" in the window title
		 * to recognize browser windows. Otherwise, we default to the directory name.
		 */
		if (!eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER)) {
			full_title = g_strdup_printf (_("%s - File Browser"), slot->title);
			window_title = eel_str_middle_truncate (full_title, MAX_TITLE_LENGTH);
			g_free (full_title);
		} else {
			window_title = eel_str_middle_truncate (slot->title, MAX_TITLE_LENGTH);
		}

		gtk_window_set_title (GTK_WINDOW (window), window_title);
		g_free (window_title);
	}

	pane = NAUTILUS_NAVIGATION_WINDOW_PANE (slot->pane);
	notebook = NAUTILUS_NOTEBOOK (pane->notebook);
	nautilus_notebook_sync_tab_label (notebook, slot);
}
static void
finalize (GObject *object)
{
	NautilusSearchEngineBeagle *beagle;

	beagle = NAUTILUS_SEARCH_ENGINE_BEAGLE (object);
	
	if (beagle->details->current_query) {
		g_object_unref (beagle->details->current_query);
		beagle->details->current_query = NULL;
		g_free (beagle->details->current_query_uri_prefix);
		beagle->details->current_query_uri_prefix = NULL;
	}

	if (beagle->details->query) {
		g_object_unref (beagle->details->query);
		beagle->details->query = NULL;
	}

	if (beagle->details->client) {
		g_object_unref (beagle->details->client);
		beagle->details->client = NULL;
	}

	g_free (beagle->details);

	EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
示例#3
0
static void
fm_ogl_model_finalize (GObject *object)
{
	FMOGLModel *model;

	model = FM_OGL_MODEL (object);

	g_free (model->details);
	
	EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
static void
nautilus_module_finalize (GObject *object)
{
	NautilusModule *module;
	
	module = NAUTILUS_MODULE (object);

	g_free (module->path);
	
	EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
示例#5
0
static void
caja_module_finalize (GObject *object)
{
    CajaModule *module;

    module = CAJA_MODULE (object);

    g_free (module->path);

    EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
示例#6
0
static void
nautilus_directory_finalize (GObject *object)
{
	NautilusDirectory *directory;

	directory = NAUTILUS_DIRECTORY (object);

	g_hash_table_remove (directories, directory->details->location);

	nautilus_directory_cancel (directory);
	g_assert (directory->details->count_in_progress == NULL);
	g_assert (directory->details->top_left_read_state == NULL);

	if (directory->details->monitor_list != NULL) {
		g_warning ("destroying a NautilusDirectory while it's being monitored");
		g_list_free_full (directory->details->monitor_list, g_free);
	}

	if (directory->details->monitor != NULL) {
		nautilus_monitor_cancel (directory->details->monitor);
	}

	if (directory->details->dequeue_pending_idle_id != 0) {
		g_source_remove (directory->details->dequeue_pending_idle_id);
	}

	if (directory->details->call_ready_idle_id != 0) {
		g_source_remove (directory->details->call_ready_idle_id);
	}

	if (directory->details->location) {
		g_object_unref (directory->details->location);
	}

	g_assert (directory->details->file_list == NULL);
	g_hash_table_destroy (directory->details->file_hash);

	if (directory->details->hidden_file_hash) {
		g_hash_table_destroy (directory->details->hidden_file_hash);
	}
	
	nautilus_file_queue_destroy (directory->details->high_priority_queue);
	nautilus_file_queue_destroy (directory->details->low_priority_queue);
	nautilus_file_queue_destroy (directory->details->extension_queue);
	g_assert (directory->details->directory_load_in_progress == NULL);
	g_assert (directory->details->count_in_progress == NULL);
	g_assert (directory->details->dequeue_pending_idle_id == 0);
	g_list_free_full (directory->details->pending_file_info, g_object_unref);

	EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
示例#7
0
static void
caja_side_pane_dispose (GObject *object)
{
    CajaSidePane *side_pane;

    side_pane = CAJA_SIDE_PANE (object);

    if (side_pane->details->menu)
    {
        gtk_menu_detach (GTK_MENU (side_pane->details->menu));
        side_pane->details->menu = NULL;
    }

    EEL_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
}
示例#8
0
static void
caja_side_pane_finalize (GObject *object)
{
    CajaSidePane *side_pane;
    GList *l;

    side_pane = CAJA_SIDE_PANE (object);

    for (l = side_pane->details->panels; l != NULL; l = l->next)
    {
        side_panel_free (l->data);
    }

    g_list_free (side_pane->details->panels);

    EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
示例#9
0
static void
real_close_slot (CajaWindowPane *pane,
                 CajaWindowSlot *slot)
{
    int page_num;
    GtkNotebook *notebook;

    notebook = GTK_NOTEBOOK (CAJA_NAVIGATION_WINDOW_PANE (pane)->notebook);

    page_num = gtk_notebook_page_num (notebook, slot->content_box);
    g_assert (page_num >= 0);

    caja_navigation_window_pane_remove_page (CAJA_NAVIGATION_WINDOW_PANE (pane), page_num);

    gtk_notebook_set_show_tabs (notebook,
                                gtk_notebook_get_n_pages (notebook) > 1);

    EEL_CALL_PARENT (CAJA_WINDOW_CLASS,
                     close_slot, (pane, slot));
}
示例#10
0
static void
fm_ogl_model_dispose (GObject *object)
{
	FMOGLModel *model;
	int i;

	model = FM_OGL_MODEL (object);

	if (model->details->files) {
		g_sequence_free (model->details->files);
		model->details->files = NULL;
	}
	
	if (model->details->top_reverse_map) {
		g_hash_table_destroy (model->details->top_reverse_map);
		model->details->top_reverse_map = NULL;
	}
	if (model->details->directory_reverse_map) {
		g_hash_table_destroy (model->details->directory_reverse_map);
		model->details->directory_reverse_map = NULL;
	}
	
	EEL_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
}
static void
nautilus_keep_last_vertical_box_size_allocate (GtkWidget *widget,
        GtkAllocation *allocation)
{
    GtkBox *box;
    GtkWidget *last_child, *child;
    GList *children, *l;
    GtkAllocation last_child_allocation, child_allocation, tiny_allocation;

    g_return_if_fail (NAUTILUS_IS_KEEP_LAST_VERTICAL_BOX (widget));
    g_return_if_fail (allocation != NULL);

    EEL_CALL_PARENT (GTK_WIDGET_CLASS, size_allocate, (widget, allocation));

    box = GTK_BOX (widget);
    children = gtk_container_get_children (GTK_CONTAINER(widget));
    l = g_list_last (children);

    if (l != NULL) {
        last_child = l->data;
        l = l->prev;

        gtk_widget_get_allocation (last_child, &last_child_allocation);

        /* If last child doesn't fit vertically, prune items from the end of the
         * list one at a time until it does.
         */
        if (last_child_allocation.y + last_child_allocation.height >
                allocation->y + allocation->height) {

            while (l != NULL) {
                child = l->data;
                l = l->prev;

                gtk_widget_get_allocation (child, &child_allocation);

                /* Reallocate this child's position so that it does not appear.
                 * Setting the width & height to 0 is not enough, as
                 * one pixel is still drawn. Must also move it outside
                 * visible range. For the cases I've seen, -1, -1 works fine.
                 * This might not work in all future cases. Alternatively, the
                 * items that don't fit could be hidden, but that would interfere
                 * with having other hidden children.
                 *
                 * Note that these children are having their size allocated twice,
                 * once by gtk_vbox_size_allocate and then again here. I don't
                 * know of any problems with this, but holler if you do.
                 */
                tiny_allocation.x = tiny_allocation.y = -1;
                tiny_allocation.height = tiny_allocation.width = 0;
                gtk_widget_size_allocate (child, &tiny_allocation);

                /* We're done if the special last item fits now. */
                if (child_allocation.y + last_child_allocation.height <=
                        allocation->y + allocation->height) {
                    last_child_allocation.y = child_allocation.y;
                    gtk_widget_size_allocate (last_child, &last_child_allocation);
                    break;
                }

                /* If the special last item still doesn't fit, but we've
                 * run out of earlier items, then the special last item is
                 * just too darn tall. Let's squash it down to fit in the box's
                 * allocation.
                 */
                if (l == NULL) {
                    last_child_allocation.y = allocation->y;
                    last_child_allocation.height = allocation->height;
                    gtk_widget_size_allocate (last_child, &last_child_allocation);
                }
            }
        }
    }
    g_list_free (children);
}
示例#12
0
static void
fm_empty_view_update_menus (FMDirectoryView *view)
{
    EEL_CALL_PARENT (FM_DIRECTORY_VIEW_CLASS, update_menus, (view));
}