Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
|
|
|
|
|
|
|
/* nautilus-mime-type-capplet.h
|
|
|
|
*
|
|
|
|
* Copyright (C) 1998 Redhat Software Inc.
|
|
|
|
* Copyright (C) 2000 Free Software Foundaton
|
|
|
|
* Copyright (C) 2000 Eazel, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* Authors: Jonathan Blandford <jrb@redhat.com>
|
|
|
|
* Gene Z. Ragan <gzr@eazel.com>
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
*/
|
2000-05-31 17:26:11 +00:00
|
|
|
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
#include <config.h>
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
#include <ctype.h>
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
#include <dirent.h>
|
2000-08-02 09:18:18 +00:00
|
|
|
#include <math.h>
|
2000-08-09 06:19:30 +00:00
|
|
|
#include <sys/types.h>
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
#include <regex.h>
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
#include <capplet-widget.h>
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
2000-07-28 23:07:34 +00:00
|
|
|
#include <gdk/gdkprivate.h>
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
#include <gnome.h>
|
|
|
|
#include <gtk/gtk.h>
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
|
|
|
|
#include <libgnomevfs/gnome-vfs-mime-info.h>
|
2000-09-02 01:32:18 +00:00
|
|
|
#include <libgnomevfs/gnome-vfs-init.h>
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
#include "nautilus-mime-type-capplet-dialogs.h"
|
New API to get and set icon data.
2000-07-14 Gene Z. Ragan <gzr@eazel.com>
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_get_icon), (gnome_vfs_mime_set_icon):
New API to get and set icon data.
* mime-type-capplet/Makefile.am:
Added new file
mime-type-capplet/nautilus-mime-type-icon-entry.c
* mime-type-capplet/nautilus-mime-type-icon-entry.c:
* mime-type-capplet/nautilus-mime-type-icon-entry.h:
(nautilus_mime_type_icon_entry_get_type),
(nautilus_mime_type_icon_entry_class_init), (entry_changed),
(entry_activated), (setup_preview), (ientry_destroy),
(browse_clicked), (icon_selected_cb), (cancel_pressed),
(gil_icon_selected_cb), (nautilus_mime_type_show_icon_selection),
(drag_data_received), (drag_data_get),
(nautilus_mime_type_icon_entry_init),
(nautilus_mime_type_icon_entry_new),
(nautilus_mime_type_icon_entry_gnome_file_entry),
(nautilus_mime_type_icon_entry_gnome_entry),
(nautilus_mime_type_icon_entry_gtk_entry),
(nautilus_mime_type_icon_entry_set_pixmap_subdir),
(nautilus_mime_type_icon_entry_set_icon),
(nautilus_mime_type_icon_entry_get_filename):
New file. This is a new verison of GnomeIconEntry.
I am customizing it to look and bahve in a way that
is compatible with Arlo's UI reccomendations.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(mime_list_selected_row_callback), (icon_changed),
(change_icon_clicked), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (populate_mime_list):
More UI cleanups. Removed GnomeIconEntry and replaced
with new NautilusMimeTypeIconEntry.
2000-07-15 01:56:53 +00:00
|
|
|
#include "nautilus-mime-type-icon-entry.h"
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
#include "nautilus-mime-type-capplet.h"
|
2000-06-14 02:14:20 +00:00
|
|
|
|
|
|
|
|
2000-07-08 00:57:36 +00:00
|
|
|
#define TOTAL_COLUMNS 4
|
|
|
|
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
/* Local Prototypes */
|
2000-08-02 09:18:18 +00:00
|
|
|
static void init_mime_capplet (void);
|
|
|
|
static void populate_application_menu (GtkWidget *menu,
|
|
|
|
const char *mime_string);
|
|
|
|
static void populate_viewer_menu (GtkWidget *menu,
|
|
|
|
const char *mime_string);
|
2000-11-16 04:53:55 +00:00
|
|
|
static void revert_mime_clicked (GtkWidget *widget,
|
|
|
|
gpointer data);
|
2000-08-02 09:18:18 +00:00
|
|
|
static void delete_mime_clicked (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void add_mime_clicked (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void edit_default_clicked (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static GtkWidget *create_mime_list_and_scroller (void);
|
|
|
|
static void ok_callback (void);
|
|
|
|
static void gtk_widget_make_bold (GtkWidget *widget);
|
|
|
|
static GdkFont *gdk_font_get_bold (const GdkFont *plain_font);
|
|
|
|
static void gtk_widget_set_font (GtkWidget *widget,
|
|
|
|
GdkFont *font);
|
|
|
|
static void gtk_style_set_font (GtkStyle *style,
|
|
|
|
GdkFont *font);
|
|
|
|
static GdkPixbuf *capplet_gdk_pixbuf_scale_to_fit (GdkPixbuf *pixbuf,
|
|
|
|
int max_width,
|
|
|
|
int max_height);
|
2000-11-13 23:33:57 +00:00
|
|
|
static void update_mime_list_action (const char *mime_string);
|
2000-08-02 09:18:18 +00:00
|
|
|
|
2000-06-14 02:14:20 +00:00
|
|
|
|
2000-09-02 01:32:18 +00:00
|
|
|
GtkWidget *capplet;
|
|
|
|
GtkWidget *delete_button;
|
|
|
|
GtkWidget *remove_button;
|
|
|
|
GtkWidget *add_button;
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
GtkWidget *icon_entry, *extension_list, *mime_list;
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
GtkWidget *default_menu;
|
|
|
|
GtkWidget *application_button, *viewer_button;
|
remove test on OAF compile.
2000-09-01 Mathieu Lacage <mathieu@eazel.com>
* libgnomevfs/gnome-vfs-init.c: (gnome_vfs_init):
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_get_default_action_without_fallback),
(gnome_vfs_mime_get_default_component), (join_str_list),
(gnome_vfs_mime_get_short_list_components),
(gnome_vfs_mime_get_all_components),
(gnome_vfs_mime_id_in_component_list),
(gnome_vfs_mime_id_list_from_component_list),
(gnome_vfs_mime_remove_component_from_list),
(gnome_vfs_mime_action_free), (gnome_vfs_mime_component_list_free),
(OAF_ServerInfoList_to_ServerInfo_g_list):
* libgnomevfs/gnome-vfs-mime-handlers.h:
* test/test-mime-handlers-set.c: (main):
* test/test-mime-handlers.c: (print_component), (print_action),
(print_component_list), (main):
remove test on OAF compile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_get_default_application): fix bug: we were passing
a NULL to some subroutine.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_mime_list), (create_mime_list_and_scroller):
fix misc warning at runtime. add debugging output. will remove soon.
* test/.cvsignore: chuuut.
2000-09-01 23:50:43 +00:00
|
|
|
GtkLabel *mime_label;
|
|
|
|
GtkWidget *description_entry;
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
|
2000-06-14 02:14:20 +00:00
|
|
|
/*
|
|
|
|
* main
|
|
|
|
*
|
|
|
|
* Display capplet
|
|
|
|
*/
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
int init_results;
|
|
|
|
|
|
|
|
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
|
|
|
|
textdomain (PACKAGE);
|
|
|
|
|
|
|
|
init_results = gnome_capplet_init("mime-type-capplet", VERSION,
|
|
|
|
argc, argv, NULL, 0, NULL);
|
|
|
|
|
|
|
|
if (init_results < 0) {
|
|
|
|
exit (0);
|
|
|
|
}
|
|
|
|
|
2000-09-02 01:32:18 +00:00
|
|
|
gnome_vfs_init ();
|
|
|
|
|
2000-06-14 02:14:20 +00:00
|
|
|
if (init_results == 0) {
|
|
|
|
init_mime_capplet ();
|
|
|
|
capplet_gtk_main ();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
static void
|
|
|
|
ok_callback ()
|
|
|
|
{
|
|
|
|
}
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
|
|
|
|
static void
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
populate_extension_list (const char *mime_type, GtkCList *list)
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
{
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
GList *extensions, *element;
|
|
|
|
gchar *extension[1];
|
|
|
|
gint row;
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
|
|
|
|
if (mime_type == NULL || list == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
/* Clear out old items */
|
|
|
|
gtk_clist_clear (list);
|
|
|
|
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
extensions = gnome_vfs_mime_get_extensions_list (mime_type);
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
if (extensions == NULL) {
|
|
|
|
return;
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
}
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
|
|
|
|
for (element = extensions; element != NULL; element = element->next) {
|
|
|
|
extension[0] = (char *)element->data;
|
2000-06-20 18:55:19 +00:00
|
|
|
if (strlen (element->data) > 0) {
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
row = gtk_clist_append (list, extension);
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
|
2000-06-20 18:55:19 +00:00
|
|
|
/* Set to deletable */
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
gtk_clist_set_row_data (list, row, GINT_TO_POINTER (FALSE));
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-07-08 00:57:36 +00:00
|
|
|
gnome_vfs_mime_extensions_list_free (extensions);
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
/* Select first item in extension list */
|
|
|
|
gtk_clist_select_row (list, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nautilus_mime_type_capplet_add_extension (const char *extension)
|
|
|
|
{
|
|
|
|
gchar *title[1];
|
2000-06-20 18:55:19 +00:00
|
|
|
gchar *token, *search_string;
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
gint rownumber;
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
const char *mime_type;
|
2000-06-20 18:55:19 +00:00
|
|
|
|
|
|
|
/* Check for empty string */
|
|
|
|
if (strlen (extension) <= 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for starting space in string */
|
|
|
|
if (extension[0] == ' ') {
|
|
|
|
return;
|
|
|
|
}
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
|
2000-06-20 18:55:19 +00:00
|
|
|
/* Copy only contiguous part of string. No spaces allowed. */
|
|
|
|
search_string = g_strdup (extension);
|
|
|
|
token = strtok (search_string, " ");
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
|
2000-06-20 18:55:19 +00:00
|
|
|
if (token == NULL) {
|
|
|
|
title[0] = g_strdup (extension);
|
|
|
|
} else if (strlen (token) <= 0) {
|
|
|
|
return;
|
|
|
|
}else {
|
|
|
|
title[0] = g_strdup (token);
|
|
|
|
}
|
|
|
|
g_free (search_string);
|
|
|
|
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
rownumber = gtk_clist_append (GTK_CLIST (extension_list), title);
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
gtk_clist_set_row_data (GTK_CLIST (extension_list), rownumber,
|
More work on adding applications and extension.
2000-06-21 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(initialize_edit_applications_dialog),
(nautilus_mime_type_capplet_show_new_extension_window),
(add_new_application), (show_new_application_window):
More work on adding applications and extension.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (none_button_toggled),
(application_button_toggled), (component_button_toggled),
(init_mime_capplet),
(nautilus_mime_type_capplet_get_selected_item_mime_type):
Changed use of GtkFixed to use layout. Layout is now messy
again, but I should be able to get it looking right.
2000-06-21 07:32:44 +00:00
|
|
|
GINT_TO_POINTER (TRUE));
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
|
More work on adding applications and extension.
2000-06-21 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(initialize_edit_applications_dialog),
(nautilus_mime_type_capplet_show_new_extension_window),
(add_new_application), (show_new_application_window):
More work on adding applications and extension.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (none_button_toggled),
(application_button_toggled), (component_button_toggled),
(init_mime_capplet),
(nautilus_mime_type_capplet_get_selected_item_mime_type):
Changed use of GtkFixed to use layout. Layout is now messy
again, but I should be able to get it looking right.
2000-06-21 07:32:44 +00:00
|
|
|
mime_type = nautilus_mime_type_capplet_get_selected_item_mime_type ();
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
g_assert (mime_type != NULL);
|
2000-06-20 18:55:19 +00:00
|
|
|
gnome_vfs_mime_add_extension (mime_type, extension);
|
More work on adding applications and extension.
2000-06-21 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(initialize_edit_applications_dialog),
(nautilus_mime_type_capplet_show_new_extension_window),
(add_new_application), (show_new_application_window):
More work on adding applications and extension.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (none_button_toggled),
(application_button_toggled), (component_button_toggled),
(init_mime_capplet),
(nautilus_mime_type_capplet_get_selected_item_mime_type):
Changed use of GtkFixed to use layout. Layout is now messy
again, but I should be able to get it looking right.
2000-06-21 07:32:44 +00:00
|
|
|
|
|
|
|
/* Select new item in list */
|
|
|
|
gtk_clist_select_row (GTK_CLIST (extension_list), rownumber, 0);
|
|
|
|
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
add_extension_clicked (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
nautilus_mime_type_capplet_show_new_extension_window ();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
remove_extension_clicked (GtkWidget *widget, gpointer data)
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
{
|
|
|
|
gint row;
|
|
|
|
gchar *text;
|
|
|
|
gchar *store;
|
2000-06-20 18:55:19 +00:00
|
|
|
const char *mime_type;
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
|
|
|
|
text = (gchar *)g_malloc (sizeof (gchar) * 1024);
|
|
|
|
gtk_clist_freeze (GTK_CLIST (extension_list));
|
|
|
|
row = GPOINTER_TO_INT (GTK_CLIST (extension_list)->selection->data);
|
|
|
|
gtk_clist_get_text (GTK_CLIST (extension_list), row, 0, &text);
|
|
|
|
store = g_strdup (text);
|
|
|
|
gtk_clist_remove (GTK_CLIST (extension_list), row);
|
|
|
|
gtk_clist_thaw (GTK_CLIST (extension_list));
|
|
|
|
|
|
|
|
|
More work on adding applications and extension.
2000-06-21 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(initialize_edit_applications_dialog),
(nautilus_mime_type_capplet_show_new_extension_window),
(add_new_application), (show_new_application_window):
More work on adding applications and extension.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (none_button_toggled),
(application_button_toggled), (component_button_toggled),
(init_mime_capplet),
(nautilus_mime_type_capplet_get_selected_item_mime_type):
Changed use of GtkFixed to use layout. Layout is now messy
again, but I should be able to get it looking right.
2000-06-21 07:32:44 +00:00
|
|
|
mime_type = nautilus_mime_type_capplet_get_selected_item_mime_type ();
|
2000-06-20 18:55:19 +00:00
|
|
|
if (mime_type != NULL) {
|
|
|
|
gnome_vfs_mime_remove_extension (mime_type, store);
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
}
|
More work on adding applications and extension.
2000-06-21 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(initialize_edit_applications_dialog),
(nautilus_mime_type_capplet_show_new_extension_window),
(add_new_application), (show_new_application_window):
More work on adding applications and extension.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (none_button_toggled),
(application_button_toggled), (component_button_toggled),
(init_mime_capplet),
(nautilus_mime_type_capplet_get_selected_item_mime_type):
Changed use of GtkFixed to use layout. Layout is now messy
again, but I should be able to get it looking right.
2000-06-21 07:32:44 +00:00
|
|
|
|
|
|
|
/* Select first item in list */
|
|
|
|
gtk_clist_select_row (GTK_CLIST (extension_list), 0, 0);
|
|
|
|
|
2000-06-20 18:55:19 +00:00
|
|
|
g_free (store);
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
extension_list_selected (GtkWidget *clist, gint row, gint column, gpointer data)
|
|
|
|
{
|
|
|
|
gboolean deletable;
|
|
|
|
|
|
|
|
deletable = GPOINTER_TO_INT (gtk_clist_get_row_data (GTK_CLIST (clist), row));
|
|
|
|
if (deletable)
|
|
|
|
gtk_widget_set_sensitive (remove_button, TRUE);
|
|
|
|
else
|
|
|
|
gtk_widget_set_sensitive (remove_button, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
extension_list_deselected (GtkWidget *clist, gint row, gint column, gpointer data)
|
|
|
|
{
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
if (g_list_length (GTK_CLIST (clist)->selection) == 0) {
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
gtk_widget_set_sensitive (remove_button, FALSE);
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
}
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
}
|
|
|
|
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
static void
|
|
|
|
mime_list_selected_row_callback (GtkWidget *widget, gint row, gint column, GdkEvent *event, gpointer data)
|
|
|
|
{
|
|
|
|
const char *mime_type;
|
New API to get and set icon data.
2000-07-14 Gene Z. Ragan <gzr@eazel.com>
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_get_icon), (gnome_vfs_mime_set_icon):
New API to get and set icon data.
* mime-type-capplet/Makefile.am:
Added new file
mime-type-capplet/nautilus-mime-type-icon-entry.c
* mime-type-capplet/nautilus-mime-type-icon-entry.c:
* mime-type-capplet/nautilus-mime-type-icon-entry.h:
(nautilus_mime_type_icon_entry_get_type),
(nautilus_mime_type_icon_entry_class_init), (entry_changed),
(entry_activated), (setup_preview), (ientry_destroy),
(browse_clicked), (icon_selected_cb), (cancel_pressed),
(gil_icon_selected_cb), (nautilus_mime_type_show_icon_selection),
(drag_data_received), (drag_data_get),
(nautilus_mime_type_icon_entry_init),
(nautilus_mime_type_icon_entry_new),
(nautilus_mime_type_icon_entry_gnome_file_entry),
(nautilus_mime_type_icon_entry_gnome_entry),
(nautilus_mime_type_icon_entry_gtk_entry),
(nautilus_mime_type_icon_entry_set_pixmap_subdir),
(nautilus_mime_type_icon_entry_set_icon),
(nautilus_mime_type_icon_entry_get_filename):
New file. This is a new verison of GnomeIconEntry.
I am customizing it to look and bahve in a way that
is compatible with Arlo's UI reccomendations.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(mime_list_selected_row_callback), (icon_changed),
(change_icon_clicked), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (populate_mime_list):
More UI cleanups. Removed GnomeIconEntry and replaced
with new NautilusMimeTypeIconEntry.
2000-07-15 01:56:53 +00:00
|
|
|
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
mime_type = (const char *) gtk_clist_get_row_data (GTK_CLIST (widget),row);
|
|
|
|
|
|
|
|
/* Update info on selection */
|
|
|
|
nautilus_mime_type_capplet_update_info (mime_type);
|
2000-06-20 22:37:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
application_button_toggled (GtkToggleButton *button, gpointer user_data)
|
2000-06-20 22:37:08 +00:00
|
|
|
{
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
const char *mime_type;
|
|
|
|
|
2000-06-20 22:37:08 +00:00
|
|
|
if (gtk_toggle_button_get_active (button)) {
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
|
|
|
|
mime_type = nautilus_mime_type_capplet_get_selected_item_mime_type ();
|
|
|
|
|
|
|
|
gnome_vfs_mime_set_default_action_type (mime_type, GNOME_VFS_MIME_ACTION_TYPE_APPLICATION);
|
|
|
|
|
|
|
|
/* Populate menu with application items */
|
2000-11-13 23:33:57 +00:00
|
|
|
populate_application_menu (default_menu, mime_type);
|
|
|
|
|
|
|
|
/* Update mime list */
|
|
|
|
update_mime_list_action (mime_type);
|
2000-06-20 22:37:08 +00:00
|
|
|
}
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
}
|
|
|
|
|
2000-06-20 22:37:08 +00:00
|
|
|
static void
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
viewer_button_toggled (GtkToggleButton *button, gpointer user_data)
|
2000-06-20 22:37:08 +00:00
|
|
|
{
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
const char *mime_type;
|
|
|
|
|
2000-06-20 22:37:08 +00:00
|
|
|
if (gtk_toggle_button_get_active (button)) {
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
mime_type = nautilus_mime_type_capplet_get_selected_item_mime_type ();
|
|
|
|
|
|
|
|
gnome_vfs_mime_set_default_action_type (mime_type, GNOME_VFS_MIME_ACTION_TYPE_COMPONENT);
|
|
|
|
|
|
|
|
/* Populate menu with viewer items */
|
|
|
|
populate_viewer_menu (default_menu, mime_type);
|
2000-11-13 23:33:57 +00:00
|
|
|
|
|
|
|
/* Update mime list */
|
|
|
|
update_mime_list_action (mime_type);
|
2000-06-20 22:37:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
New API to get and set icon data.
2000-07-14 Gene Z. Ragan <gzr@eazel.com>
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_get_icon), (gnome_vfs_mime_set_icon):
New API to get and set icon data.
* mime-type-capplet/Makefile.am:
Added new file
mime-type-capplet/nautilus-mime-type-icon-entry.c
* mime-type-capplet/nautilus-mime-type-icon-entry.c:
* mime-type-capplet/nautilus-mime-type-icon-entry.h:
(nautilus_mime_type_icon_entry_get_type),
(nautilus_mime_type_icon_entry_class_init), (entry_changed),
(entry_activated), (setup_preview), (ientry_destroy),
(browse_clicked), (icon_selected_cb), (cancel_pressed),
(gil_icon_selected_cb), (nautilus_mime_type_show_icon_selection),
(drag_data_received), (drag_data_get),
(nautilus_mime_type_icon_entry_init),
(nautilus_mime_type_icon_entry_new),
(nautilus_mime_type_icon_entry_gnome_file_entry),
(nautilus_mime_type_icon_entry_gnome_entry),
(nautilus_mime_type_icon_entry_gtk_entry),
(nautilus_mime_type_icon_entry_set_pixmap_subdir),
(nautilus_mime_type_icon_entry_set_icon),
(nautilus_mime_type_icon_entry_get_filename):
New file. This is a new verison of GnomeIconEntry.
I am customizing it to look and bahve in a way that
is compatible with Arlo's UI reccomendations.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(mime_list_selected_row_callback), (icon_changed),
(change_icon_clicked), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (populate_mime_list):
More UI cleanups. Removed GnomeIconEntry and replaced
with new NautilusMimeTypeIconEntry.
2000-07-15 01:56:53 +00:00
|
|
|
static void
|
|
|
|
change_icon_clicked (GtkWidget *entry, gpointer user_data)
|
|
|
|
{
|
|
|
|
nautilus_mime_type_show_icon_selection (NAUTILUS_MIME_ICON_ENTRY (user_data));
|
|
|
|
}
|
|
|
|
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
static void
|
2000-06-14 02:14:20 +00:00
|
|
|
init_mime_capplet (void)
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
{
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
GtkWidget *main_vbox;
|
2000-11-16 04:53:55 +00:00
|
|
|
GtkWidget *vbox, *hbox, *left_vbox;
|
More work on adding applications and extension.
2000-06-21 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(initialize_edit_applications_dialog),
(nautilus_mime_type_capplet_show_new_extension_window),
(add_new_application), (show_new_application_window):
More work on adding applications and extension.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (none_button_toggled),
(application_button_toggled), (component_button_toggled),
(init_mime_capplet),
(nautilus_mime_type_capplet_get_selected_item_mime_type):
Changed use of GtkFixed to use layout. Layout is now messy
again, but I should be able to get it looking right.
2000-06-21 07:32:44 +00:00
|
|
|
GtkWidget *button;
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
GtkWidget *mime_list_container;
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
GtkWidget *extension_scroller;
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *alignment;
|
|
|
|
GtkWidget *table, *extensions_table;
|
2000-07-08 00:57:36 +00:00
|
|
|
int index, list_width, column_width;
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
capplet = capplet_widget_new ();
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
|
|
|
/* Main vertical box */
|
|
|
|
main_vbox = gtk_vbox_new (FALSE, GNOME_PAD);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), GNOME_PAD_SMALL);
|
|
|
|
gtk_container_add (GTK_CONTAINER (capplet), main_vbox);
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
/* Main horizontal box and mime list*/
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
hbox = gtk_hbox_new (FALSE, GNOME_PAD);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), hbox, TRUE, TRUE, 0);
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
mime_list_container = create_mime_list_and_scroller ();
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), mime_list_container, TRUE, TRUE, 0);
|
2000-07-08 00:57:36 +00:00
|
|
|
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
2000-06-22 01:48:29 +00:00
|
|
|
/* Create table */
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
table = gtk_table_new (2, 2, FALSE);
|
2000-07-08 00:57:36 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);
|
2000-06-22 01:48:29 +00:00
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), GNOME_PAD_SMALL);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), GNOME_PAD_SMALL);
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
|
2000-11-16 04:53:55 +00:00
|
|
|
|
|
|
|
left_vbox = gtk_vbox_new (FALSE, 0);
|
|
|
|
/* Set up top left area. */
|
|
|
|
{
|
|
|
|
GtkWidget *small_table;
|
|
|
|
|
|
|
|
small_table = gtk_table_new (1, 2, FALSE);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (small_table), 7);
|
|
|
|
|
|
|
|
gtk_table_attach ( GTK_TABLE (table), small_table, 0, 1, 0, 1,
|
|
|
|
(GtkAttachOptions) (GTK_FILL),
|
|
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
|
|
|
|
|
|
icon_entry = nautilus_mime_type_icon_entry_new ("mime_icon_entry", NULL);
|
|
|
|
gtk_table_attach (GTK_TABLE (small_table), icon_entry, 0, 1, 0, 1,
|
|
|
|
(GtkAttachOptions) (GTK_FILL),
|
|
|
|
(GtkAttachOptions) (0), 0, 0);
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
|
2000-11-16 04:53:55 +00:00
|
|
|
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
|
|
|
|
gtk_table_attach (GTK_TABLE (small_table), vbox, 1, 2, 0, 1,
|
|
|
|
(GtkAttachOptions) (GTK_FILL),
|
|
|
|
(GtkAttachOptions) (GTK_FILL), 0, 0);
|
|
|
|
|
|
|
|
description_entry = gtk_entry_new ();
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), description_entry, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_make_bold (GTK_WIDGET (description_entry));
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (hbox), FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
mime_label = GTK_LABEL (gtk_label_new (_("Mime Type")));
|
|
|
|
gtk_label_set_justify (GTK_LABEL (mime_label), GTK_JUSTIFY_LEFT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (mime_label), FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
button = gtk_button_new_with_label (_("Change Icon"));
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked", change_icon_clicked, icon_entry);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
/* spacer */
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), gtk_vbox_new (FALSE, 0), FALSE, FALSE, 10);
|
|
|
|
|
|
|
|
button = gtk_button_new_with_label (_("Change File Extensions"));
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked", change_icon_clicked, icon_entry);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set up bottom left area. */
|
2000-07-08 00:57:36 +00:00
|
|
|
{
|
2000-11-16 04:53:55 +00:00
|
|
|
frame = gtk_frame_new (_("Default Action:"));
|
|
|
|
gtk_table_attach ( GTK_TABLE (table), frame, 0, 1, 1, 2,
|
|
|
|
(GtkAttachOptions) (GTK_FILL),
|
|
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
viewer_button = gtk_radio_button_new_with_label (NULL, _("Use Viewer"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), viewer_button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (viewer_button), "toggled",
|
|
|
|
GTK_SIGNAL_FUNC (viewer_button_toggled), NULL);
|
|
|
|
|
|
|
|
application_button = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (viewer_button),
|
|
|
|
_("Open With Application"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), application_button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (application_button), "toggled",
|
|
|
|
GTK_SIGNAL_FUNC (application_button_toggled), NULL);
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
default_menu = gtk_option_menu_new();
|
|
|
|
gtk_widget_set_usize (GTK_WIDGET (default_menu), 170, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), default_menu, TRUE, TRUE, 0);
|
|
|
|
|
|
|
|
button = gtk_button_new_with_label (_("Edit List"));
|
|
|
|
gtk_widget_set_usize (GTK_WIDGET (button), 70, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked", edit_default_clicked, mime_list);
|
2000-07-08 00:57:36 +00:00
|
|
|
}
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
|
2000-11-16 04:53:55 +00:00
|
|
|
/* Set up top right area.*/
|
|
|
|
{
|
|
|
|
GtkWidget *separator;
|
|
|
|
GtkWidget *small_table;
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
|
2000-11-16 04:53:55 +00:00
|
|
|
hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_table_attach_defaults ( GTK_TABLE (table), hbox, 1, 2, 0, 1);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
2000-11-16 04:53:55 +00:00
|
|
|
small_table = gtk_table_new (4, 1, FALSE);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (small_table), 7);
|
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), small_table, FALSE, FALSE, 0);
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
|
2000-09-02 01:32:18 +00:00
|
|
|
|
2000-11-16 04:53:55 +00:00
|
|
|
button = gtk_button_new_with_label (_("Add new Mime type..."));
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked", add_mime_clicked, NULL);
|
|
|
|
gtk_table_attach (GTK_TABLE (small_table), button, 0, 1, 0, 1,
|
|
|
|
(GtkAttachOptions) (GTK_FILL),
|
|
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
|
|
|
|
|
|
button = gtk_button_new_with_label (_("Delete this Mime type..."));
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked", delete_mime_clicked, NULL);
|
|
|
|
gtk_table_attach (GTK_TABLE (small_table), button, 0, 1, 1, 2,
|
|
|
|
(GtkAttachOptions) (GTK_FILL),
|
|
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
|
|
|
|
|
|
separator = gtk_hseparator_new ();
|
|
|
|
gtk_table_attach (GTK_TABLE (small_table), separator, 0, 1, 2, 3,
|
|
|
|
(GtkAttachOptions) (GTK_FILL),
|
|
|
|
(GtkAttachOptions) (GTK_FILL), 0, 0);
|
|
|
|
|
|
|
|
button = gtk_button_new_with_label (_("Revert to System Defaults"));
|
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked", revert_mime_clicked, NULL);
|
|
|
|
gtk_table_attach (GTK_TABLE (small_table), button, 0, 1, 3, 4,
|
|
|
|
(GtkAttachOptions) (GTK_FILL),
|
|
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2000-09-08 23:58:53 +00:00
|
|
|
|
2000-09-05 03:13:37 +00:00
|
|
|
/* FIXME bugzilla.eazel.com 2765: this call generates a
|
2000-09-02 01:32:18 +00:00
|
|
|
Gtk-WARNING **: gtk_signal_disconnect_by_data(): could not find handler containing data (0x80FA6F8)
|
|
|
|
*/
|
2000-09-08 23:58:53 +00:00
|
|
|
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
/* Yes, show all widgets */
|
2000-09-08 23:58:53 +00:00
|
|
|
gtk_widget_show_all (capplet);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
2000-07-08 00:57:36 +00:00
|
|
|
/* Make columns all fit within capplet list view bounds */
|
|
|
|
list_width = GTK_WIDGET (mime_list)->allocation.width;
|
|
|
|
column_width = list_width / TOTAL_COLUMNS;
|
|
|
|
for (index = 0; index < TOTAL_COLUMNS; index++) {
|
|
|
|
gtk_clist_set_column_width (GTK_CLIST (mime_list), index, column_width);
|
|
|
|
}
|
|
|
|
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
/* Setup capplet signals */
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
gtk_signal_connect(GTK_OBJECT(capplet), "ok",
|
|
|
|
GTK_SIGNAL_FUNC(ok_callback), NULL);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (mime_list),"select_row",
|
|
|
|
GTK_SIGNAL_FUNC (mime_list_selected_row_callback), NULL);
|
|
|
|
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
/* Select first item in list and update menus */
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
gtk_clist_select_row (GTK_CLIST (mime_list), 0, 0);
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
|
|
|
|
capplet_widget_state_changed (CAPPLET_WIDGET (capplet), FALSE);
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
}
|
|
|
|
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* nautilus_mime_type_capplet_update_info
|
|
|
|
*
|
|
|
|
* Update controls with info based on mime type
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
nautilus_mime_type_capplet_update_info (const char *mime_type) {
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
|
2000-06-20 22:37:08 +00:00
|
|
|
GnomeVFSMimeAction *action;
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
const char *icon_name, *description;
|
|
|
|
char *path;
|
|
|
|
|
|
|
|
/* Update text items */
|
|
|
|
gtk_label_set_text (GTK_LABEL (mime_label), mime_type);
|
|
|
|
|
fixes bugs 1119 and 1839
2000-08-31 Mathieu Lacage <mathieu@eazel.com>
fixes bugs 1119 and 1839
* data/mime/gnome-vfs.keys: add a mime type for testing.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_get_default_action_type),
(gnome_vfs_mime_edit_user_file_full),
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
update to API changes below. move saving code to gnome-vfs-mime-info.c
* libgnomevfs/gnome-vfs-mime-info.c: (does_string_contains_caps),
(context_new), (context_destroy_and_unlink), (language_level),
(context_add_key), (load_mime_type_info_from),
(load_mime_list_info_from), (mime_info_load), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(gnome_vfs_mime_freeze), (gnome_vfs_mime_thaw),
(gnome_vfs_mime_set_value), (gnome_vfs_mime_get_value),
(gnome_vfs_mime_keys_list_free), (gnome_vfs_mime_get_key_list),
(gnome_vfs_mime_get_program), (gnome_vfs_mime_get_program_name),
(gnome_vfs_mime_get_description), (str_cmp_callback),
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string),
(gnome_vfs_mime_get_extensions_pretty_string),
(gnome_vfs_mime_extensions_list_free), (gnome_vfs_mime_get_test),
(gnome_vfs_mime_get_composetyped),
(gnome_vfs_mime_get_copiousoutput),
(gnome_vfs_mime_get_needsterminal), (get_key_name),
(gnome_vfs_get_registered_mime_types),
(gnome_vfs_mime_registered_mime_type_list_free),
(gnome_vfs_mime_set_registered_type_key),
(write_back_mime_user_file_context_callback),
(write_back_mime_user_file_callback), (write_back_mime_user_file),
(write_back_keys_user_file_context_callback),
(write_back_keys_user_file_callback), (write_back_keys_user_file):
Basically, make it work. update copyright.
* libgnomevfs/gnome-vfs-mime-info.h: change some API.
* mime-type-capplet/nautilus-mime-type-capplet.c: update to new API.
(nautilus_mime_type_capplet_update_info), (populate_mime_list):
* test/Makefile.am: add tests.
* test/test-mime-info.c: (main): actual tests.
2000-08-31 07:04:59 +00:00
|
|
|
description = gnome_vfs_mime_get_description (mime_type);
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
if (description != NULL && strlen (description) > 0) {
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (description_entry), description);
|
|
|
|
} else {
|
2000-11-12 17:00:14 +00:00
|
|
|
gtk_entry_set_text (GTK_ENTRY (description_entry), _("No Description"));
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gtk_editable_set_editable (GTK_EDITABLE (description_entry), FALSE);
|
2000-06-20 22:37:08 +00:00
|
|
|
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
/* Update menus */
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (application_button))) {
|
|
|
|
populate_application_menu (default_menu, mime_type);
|
|
|
|
} else {
|
|
|
|
populate_viewer_menu (default_menu, mime_type);
|
|
|
|
}
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
/* Update extensions list */
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
populate_extension_list (mime_type, GTK_CLIST (extension_list));
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
|
|
|
|
/* Set icon for mime type */
|
New API to get and set icon data.
2000-07-14 Gene Z. Ragan <gzr@eazel.com>
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_get_icon), (gnome_vfs_mime_set_icon):
New API to get and set icon data.
* mime-type-capplet/Makefile.am:
Added new file
mime-type-capplet/nautilus-mime-type-icon-entry.c
* mime-type-capplet/nautilus-mime-type-icon-entry.c:
* mime-type-capplet/nautilus-mime-type-icon-entry.h:
(nautilus_mime_type_icon_entry_get_type),
(nautilus_mime_type_icon_entry_class_init), (entry_changed),
(entry_activated), (setup_preview), (ientry_destroy),
(browse_clicked), (icon_selected_cb), (cancel_pressed),
(gil_icon_selected_cb), (nautilus_mime_type_show_icon_selection),
(drag_data_received), (drag_data_get),
(nautilus_mime_type_icon_entry_init),
(nautilus_mime_type_icon_entry_new),
(nautilus_mime_type_icon_entry_gnome_file_entry),
(nautilus_mime_type_icon_entry_gnome_entry),
(nautilus_mime_type_icon_entry_gtk_entry),
(nautilus_mime_type_icon_entry_set_pixmap_subdir),
(nautilus_mime_type_icon_entry_set_icon),
(nautilus_mime_type_icon_entry_get_filename):
New file. This is a new verison of GnomeIconEntry.
I am customizing it to look and bahve in a way that
is compatible with Arlo's UI reccomendations.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(mime_list_selected_row_callback), (icon_changed),
(change_icon_clicked), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (populate_mime_list):
More UI cleanups. Removed GnomeIconEntry and replaced
with new NautilusMimeTypeIconEntry.
2000-07-15 01:56:53 +00:00
|
|
|
icon_name = gnome_vfs_mime_get_icon (mime_type);
|
2000-09-08 23:58:53 +00:00
|
|
|
if (icon_name != NULL) {
|
|
|
|
path = gnome_pixmap_file (icon_name);
|
|
|
|
if (path != NULL) {
|
|
|
|
nautilus_mime_type_icon_entry_set_icon (NAUTILUS_MIME_ICON_ENTRY (icon_entry), path);
|
|
|
|
g_free (path);
|
|
|
|
} else {
|
|
|
|
/* No icon */
|
|
|
|
nautilus_mime_type_icon_entry_set_icon (NAUTILUS_MIME_ICON_ENTRY (icon_entry), NULL);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* No icon */
|
|
|
|
nautilus_mime_type_icon_entry_set_icon (NAUTILUS_MIME_ICON_ENTRY (icon_entry), NULL);
|
|
|
|
}
|
2000-06-20 22:37:08 +00:00
|
|
|
|
|
|
|
/* Indicate default action */
|
|
|
|
action = gnome_vfs_mime_get_default_action (mime_type);
|
|
|
|
if (action != NULL) {
|
|
|
|
switch (action->action_type) {
|
|
|
|
case GNOME_VFS_MIME_ACTION_TYPE_APPLICATION:
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (application_button), TRUE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GNOME_VFS_MIME_ACTION_TYPE_COMPONENT:
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (viewer_button), TRUE);
|
2000-06-20 22:37:08 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (application_button), TRUE);
|
2000-06-20 22:37:08 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (application_button), TRUE);
|
2000-06-20 22:37:08 +00:00
|
|
|
}
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
}
|
|
|
|
|
2000-06-20 21:33:14 +00:00
|
|
|
static void
|
|
|
|
application_menu_activated (GtkWidget *menu_item, gpointer data)
|
|
|
|
{
|
|
|
|
const char *id;
|
|
|
|
const char *mime_type;
|
|
|
|
|
|
|
|
/* Get our stashed data */
|
|
|
|
id = gtk_object_get_data (GTK_OBJECT (menu_item), "id");
|
|
|
|
mime_type = gtk_object_get_data (GTK_OBJECT (menu_item), "mime_type");
|
|
|
|
|
|
|
|
if (id == NULL || mime_type == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
gnome_vfs_mime_set_default_application (mime_type, id);
|
2000-11-13 23:33:57 +00:00
|
|
|
update_mime_list_action (mime_type);
|
2000-06-20 21:33:14 +00:00
|
|
|
}
|
|
|
|
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
static void
|
|
|
|
populate_application_menu (GtkWidget *application_menu, const char *mime_type)
|
|
|
|
{
|
|
|
|
GtkWidget *new_menu, *menu_item;
|
|
|
|
GList *app_list, *copy_list;
|
|
|
|
GnomeVFSMimeApplication *default_app, *application;
|
|
|
|
gboolean has_none, found_match;
|
|
|
|
char *mime_copy;
|
2000-06-20 21:33:14 +00:00
|
|
|
const char *id;
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
GList *children;
|
|
|
|
int index;
|
|
|
|
|
|
|
|
has_none = TRUE;
|
|
|
|
found_match = FALSE;
|
|
|
|
|
|
|
|
mime_copy = g_strdup (mime_type);
|
|
|
|
|
|
|
|
new_menu = gtk_menu_new ();
|
|
|
|
|
|
|
|
/* Get the default application */
|
|
|
|
default_app = gnome_vfs_mime_get_default_application (mime_type);
|
|
|
|
|
|
|
|
/* Get the application short list */
|
|
|
|
app_list = gnome_vfs_mime_get_short_list_applications (mime_type);
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
if (app_list != NULL) {
|
|
|
|
for (copy_list = app_list; copy_list != NULL; copy_list = copy_list->next) {
|
|
|
|
has_none = FALSE;
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
application = copy_list->data;
|
|
|
|
menu_item = gtk_menu_item_new_with_label (application->name);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
2000-06-20 21:33:14 +00:00
|
|
|
/* Store copy of application name and mime type in item; free when item destroyed. */
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
2000-06-20 21:33:14 +00:00
|
|
|
"id",
|
|
|
|
g_strdup (application->id),
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
g_free);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
|
|
|
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
2000-06-20 21:33:14 +00:00
|
|
|
"mime_type",
|
|
|
|
g_strdup (mime_type),
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
g_free);
|
2000-06-20 21:33:14 +00:00
|
|
|
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
gtk_menu_append (GTK_MENU (new_menu), menu_item);
|
|
|
|
gtk_widget_show (menu_item);
|
|
|
|
|
2000-06-20 21:33:14 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
|
|
|
application_menu_activated, NULL);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
}
|
2000-06-20 21:33:14 +00:00
|
|
|
|
|
|
|
gnome_vfs_mime_application_list_free (app_list);
|
|
|
|
}
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
2000-06-20 21:33:14 +00:00
|
|
|
/* Find all applications or add a "None" item */
|
|
|
|
if (has_none && default_app == NULL) {
|
|
|
|
menu_item = gtk_menu_item_new_with_label (_("None"));
|
|
|
|
gtk_menu_append (GTK_MENU (new_menu), menu_item);
|
|
|
|
gtk_widget_show (menu_item);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
} else {
|
|
|
|
/* Check and see if default is in the short list */
|
|
|
|
if (default_app != NULL) {
|
|
|
|
/* Iterate */
|
|
|
|
children = gtk_container_children (GTK_CONTAINER (new_menu));
|
|
|
|
for (index = 0; children != NULL; children = children->next, ++index) {
|
2000-06-20 21:33:14 +00:00
|
|
|
id = (const char *)(gtk_object_get_data (GTK_OBJECT (children->data), "id"));
|
|
|
|
if (id != NULL) {
|
|
|
|
if (strcmp (default_app->id, id) == 0) {
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
found_match = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_list_free (children);
|
|
|
|
|
|
|
|
/* See if we have a match */
|
|
|
|
if (found_match) {
|
|
|
|
/* Have menu appear with default application selected */
|
|
|
|
gtk_menu_set_active (GTK_MENU (new_menu), index);
|
|
|
|
} else {
|
2000-06-20 21:33:14 +00:00
|
|
|
/* No match found. We need to insert a menu item
|
|
|
|
* and add the application to the default list */
|
|
|
|
menu_item = gtk_menu_item_new_with_label (default_app->name);
|
|
|
|
|
|
|
|
/* Store copy of application name and mime type in item; free when item destroyed. */
|
|
|
|
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
|
|
|
"id",
|
|
|
|
g_strdup (default_app->id),
|
|
|
|
g_free);
|
|
|
|
|
|
|
|
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
|
|
|
"mime_type",
|
|
|
|
g_strdup (mime_type),
|
|
|
|
g_free);
|
|
|
|
|
|
|
|
gtk_menu_append (GTK_MENU (new_menu), menu_item);
|
|
|
|
gtk_widget_show (menu_item);
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
|
|
|
application_menu_activated, NULL);
|
|
|
|
|
|
|
|
|
|
|
|
/* Iterate */
|
|
|
|
children = gtk_container_children (GTK_CONTAINER (new_menu));
|
|
|
|
for (index = 0; children != NULL; children = children->next, ++index) {
|
|
|
|
id = (const char *)(gtk_object_get_data (GTK_OBJECT (children->data), "id"));
|
|
|
|
if (id != NULL) {
|
|
|
|
if (strcmp (default_app->id, id) == 0) {
|
|
|
|
found_match = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_list_free (children);
|
|
|
|
|
|
|
|
/* Set it as active */
|
|
|
|
gtk_menu_set_active (GTK_MENU (new_menu), index);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
}
|
2000-10-16 21:27:40 +00:00
|
|
|
gnome_vfs_mime_application_free (default_app);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
gtk_option_menu_set_menu (GTK_OPTION_MENU (default_menu), new_menu);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-06-20 21:33:14 +00:00
|
|
|
static void
|
|
|
|
component_menu_activated (GtkWidget *menu_item, gpointer data)
|
|
|
|
{
|
|
|
|
const char *iid;
|
|
|
|
const char *mime_type;
|
|
|
|
|
|
|
|
/* Get our stashed data */
|
|
|
|
iid = gtk_object_get_data (GTK_OBJECT (menu_item), "iid");
|
|
|
|
mime_type = gtk_object_get_data (GTK_OBJECT (menu_item), "mime_type");
|
|
|
|
|
|
|
|
if (iid == NULL || mime_type == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
gnome_vfs_mime_set_default_component (mime_type, iid);
|
2000-11-13 23:33:57 +00:00
|
|
|
update_mime_list_action (mime_type);
|
2000-06-20 21:33:14 +00:00
|
|
|
}
|
|
|
|
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
static void
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
populate_viewer_menu (GtkWidget *component_menu, const char *mime_type)
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
{
|
2000-09-08 17:49:14 +00:00
|
|
|
GtkWidget *new_menu, *menu_item;
|
2000-06-20 21:33:14 +00:00
|
|
|
GList *component_list, *copy_list;
|
|
|
|
OAF_ServerInfo *default_component;
|
|
|
|
OAF_ServerInfo *info;
|
2000-09-08 17:49:14 +00:00
|
|
|
gboolean has_none, found_match;
|
|
|
|
char *mime_copy, *component_name;
|
2000-06-20 21:33:14 +00:00
|
|
|
const char *iid;
|
|
|
|
GList *children;
|
|
|
|
int index;
|
2000-09-08 17:49:14 +00:00
|
|
|
|
2000-06-20 21:33:14 +00:00
|
|
|
has_none = TRUE;
|
|
|
|
found_match = FALSE;
|
|
|
|
|
2000-09-08 17:49:14 +00:00
|
|
|
mime_copy = g_strdup (mime_type);
|
|
|
|
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
new_menu = gtk_menu_new ();
|
2000-06-20 21:33:14 +00:00
|
|
|
|
|
|
|
/* Get the default component */
|
|
|
|
default_component = gnome_vfs_mime_get_default_component (mime_type);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
2000-09-08 17:49:14 +00:00
|
|
|
/* Get the component short list */
|
2000-06-20 21:33:14 +00:00
|
|
|
component_list = gnome_vfs_mime_get_short_list_components (mime_type);
|
|
|
|
if (component_list != NULL) {
|
2000-09-08 17:49:14 +00:00
|
|
|
for (copy_list = component_list; copy_list != NULL; copy_list = copy_list->next) {
|
2000-06-20 21:33:14 +00:00
|
|
|
has_none = FALSE;
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
|
2000-09-08 17:49:14 +00:00
|
|
|
component_name = name_from_oaf_server_info (copy_list->data);
|
2000-06-20 21:33:14 +00:00
|
|
|
menu_item = gtk_menu_item_new_with_label (component_name);
|
2000-09-08 17:49:14 +00:00
|
|
|
g_free (component_name);
|
2000-06-20 21:33:14 +00:00
|
|
|
|
|
|
|
/* Store copy of component name and mime type in item; free when item destroyed. */
|
2000-09-08 17:49:14 +00:00
|
|
|
info = copy_list->data;
|
2000-06-20 21:33:14 +00:00
|
|
|
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
|
|
|
"iid",
|
|
|
|
g_strdup (info->iid),
|
|
|
|
g_free);
|
|
|
|
|
|
|
|
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
|
|
|
"mime_type",
|
|
|
|
g_strdup (mime_type),
|
|
|
|
g_free);
|
|
|
|
|
|
|
|
gtk_menu_append (GTK_MENU (new_menu), menu_item);
|
|
|
|
gtk_widget_show (menu_item);
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
|
|
|
component_menu_activated, NULL);
|
|
|
|
}
|
2000-09-08 17:49:14 +00:00
|
|
|
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
gnome_vfs_mime_component_list_free (component_list);
|
|
|
|
}
|
2000-09-08 17:49:14 +00:00
|
|
|
|
|
|
|
/* Find all components or add a "None" item */
|
2000-06-20 21:33:14 +00:00
|
|
|
if (has_none && default_component == NULL) {
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
menu_item = gtk_menu_item_new_with_label (_("None"));
|
|
|
|
gtk_menu_append (GTK_MENU (new_menu), menu_item);
|
|
|
|
gtk_widget_show (menu_item);
|
2000-06-20 21:33:14 +00:00
|
|
|
} else {
|
|
|
|
/* Check and see if default is in the short list */
|
|
|
|
if (default_component != NULL) {
|
|
|
|
/* Iterate */
|
|
|
|
children = gtk_container_children (GTK_CONTAINER (new_menu));
|
|
|
|
for (index = 0; children != NULL; children = children->next, ++index) {
|
|
|
|
iid = (const char *)(gtk_object_get_data (GTK_OBJECT (children->data), "iid"));
|
|
|
|
if (iid != NULL) {
|
|
|
|
if (strcmp (default_component->iid, iid) == 0) {
|
|
|
|
found_match = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_list_free (children);
|
|
|
|
|
|
|
|
/* See if we have a match */
|
|
|
|
if (found_match) {
|
2000-09-08 17:49:14 +00:00
|
|
|
/* Have menu appear with default component selected */
|
2000-06-20 21:33:14 +00:00
|
|
|
gtk_menu_set_active (GTK_MENU (new_menu), index);
|
|
|
|
} else {
|
|
|
|
/* No match found. We need to insert a menu item
|
2000-09-08 17:49:14 +00:00
|
|
|
* and add the component to the default list */
|
|
|
|
component_name = name_from_oaf_server_info (default_component);
|
2000-06-20 21:33:14 +00:00
|
|
|
menu_item = gtk_menu_item_new_with_label (component_name);
|
2000-09-08 17:49:14 +00:00
|
|
|
g_free (component_name);
|
2000-06-20 21:33:14 +00:00
|
|
|
|
2000-09-08 17:49:14 +00:00
|
|
|
/* Store copy of component name and mime type in item; free when item destroyed. */
|
2000-06-20 21:33:14 +00:00
|
|
|
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
|
|
|
"iid",
|
|
|
|
g_strdup (default_component->iid),
|
|
|
|
g_free);
|
|
|
|
|
|
|
|
gtk_object_set_data_full (GTK_OBJECT (menu_item),
|
|
|
|
"mime_type",
|
|
|
|
g_strdup (mime_type),
|
|
|
|
g_free);
|
|
|
|
|
|
|
|
gtk_menu_append (GTK_MENU (new_menu), menu_item);
|
|
|
|
gtk_widget_show (menu_item);
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
|
|
|
component_menu_activated, NULL);
|
|
|
|
|
|
|
|
|
|
|
|
/* Iterate */
|
|
|
|
children = gtk_container_children (GTK_CONTAINER (new_menu));
|
|
|
|
for (index = 0; children != NULL; children = children->next, ++index) {
|
|
|
|
iid = (const char *)(gtk_object_get_data (GTK_OBJECT (children->data), "iid"));
|
|
|
|
if (iid != NULL) {
|
|
|
|
if (strcmp (default_component->iid, iid) == 0) {
|
|
|
|
found_match = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_list_free (children);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
2000-06-20 21:33:14 +00:00
|
|
|
/* Set it as active */
|
|
|
|
gtk_menu_set_active (GTK_MENU (new_menu), index);
|
|
|
|
}
|
2000-10-16 21:27:40 +00:00
|
|
|
CORBA_free (default_component);
|
2000-06-20 21:33:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
gtk_option_menu_set_menu (GTK_OPTION_MENU (default_menu), new_menu);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-16 04:53:55 +00:00
|
|
|
static void
|
|
|
|
revert_mime_clicked (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
/*
|
|
|
|
* delete_mime_clicked
|
|
|
|
*
|
|
|
|
* Delete mime type if it is a user defined type.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
|
|
|
delete_mime_clicked (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
const char *mime_type;
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
gint row = 0;
|
|
|
|
|
|
|
|
if (GTK_CLIST (mime_list)->selection)
|
|
|
|
row = GPOINTER_TO_INT ((GTK_CLIST (mime_list)->selection)->data);
|
|
|
|
else
|
|
|
|
return;
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
mime_type = (const char *) gtk_clist_get_row_data (GTK_CLIST (mime_list), row);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
|
|
|
gtk_clist_remove (GTK_CLIST (mime_list), row);
|
2000-09-05 03:13:37 +00:00
|
|
|
/* FIXME bugzilla.eazel.com 2767: Get user mime info */
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
//g_hash_table_remove (user_mime_types, mi->mime_type);
|
|
|
|
//remove_mime_info (mi->mime_type);
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
add_mime_clicked (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
2000-11-13 23:33:57 +00:00
|
|
|
char *text[3];
|
2000-09-17 03:15:40 +00:00
|
|
|
const char *description, *action_icon_name, *description_icon_name;
|
|
|
|
char *extensions, *mime_string, *action_icon_path, *description_icon_path;
|
|
|
|
gint row;
|
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
GdkPixmap *pixmap;
|
|
|
|
GdkBitmap *bitmap;
|
|
|
|
GnomeVFSMimeAction *action;
|
|
|
|
GnomeVFSMimeApplication *default_app;
|
|
|
|
OAF_ServerInfo *default_component;
|
|
|
|
|
|
|
|
mime_string = nautilus_mime_type_capplet_show_new_mime_window ();
|
|
|
|
if (mime_string != NULL) {
|
|
|
|
/* Add new type to mime list */
|
|
|
|
pixbuf = NULL;
|
|
|
|
|
|
|
|
/* Add description to first column */
|
|
|
|
description = gnome_vfs_mime_get_description (mime_string);
|
|
|
|
if (description != NULL && strlen (description) > 0) {
|
|
|
|
text[0] = g_strdup (description);
|
|
|
|
} else {
|
2000-10-16 22:50:48 +00:00
|
|
|
text[0] = g_strdup ("");
|
2000-09-17 03:15:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Add mime type to second column */
|
|
|
|
text[1] = mime_string;
|
|
|
|
|
|
|
|
/* Add extension to third columns */
|
|
|
|
extensions = gnome_vfs_mime_get_extensions_pretty_string (mime_string);
|
|
|
|
if (extensions != NULL) {
|
|
|
|
text[2] = extensions;
|
|
|
|
} else {
|
|
|
|
text[2] = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add default action to fourth column */
|
2000-10-16 21:27:40 +00:00
|
|
|
text[3] = g_strdup(_("None"));
|
2000-09-17 03:15:40 +00:00
|
|
|
|
|
|
|
/* Insert item into list */
|
|
|
|
row = gtk_clist_insert (GTK_CLIST (mime_list), 1, text);
|
|
|
|
gtk_clist_set_row_data (GTK_CLIST (mime_list), row, g_strdup(mime_string));
|
|
|
|
|
|
|
|
/* Set description column icon */
|
|
|
|
description_icon_name = gnome_vfs_mime_get_icon (mime_string);
|
|
|
|
if (description_icon_name != NULL) {
|
|
|
|
/* Get custom icon */
|
|
|
|
description_icon_path = gnome_pixmap_file (description_icon_name);
|
|
|
|
if (description_icon_path != NULL) {
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file (description_icon_path);
|
|
|
|
g_free (description_icon_path);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* Use default icon */
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file ("/gnome/share/pixmaps/nautilus/i-regular-24.png");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pixbuf != NULL) {
|
|
|
|
pixbuf = capplet_gdk_pixbuf_scale_to_fit (pixbuf, 18, 18);
|
|
|
|
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &bitmap, 100);
|
|
|
|
gtk_clist_set_pixtext (GTK_CLIST (mime_list), row, 0, text[0], 5, pixmap, bitmap);
|
|
|
|
gdk_pixbuf_unref (pixbuf);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set up action column */
|
|
|
|
pixbuf = NULL;
|
|
|
|
action = gnome_vfs_mime_get_default_action (mime_string);
|
|
|
|
if (action != NULL) {
|
|
|
|
switch (action->action_type) {
|
|
|
|
case GNOME_VFS_MIME_ACTION_TYPE_APPLICATION:
|
|
|
|
/* Get the default application */
|
|
|
|
default_app = gnome_vfs_mime_get_default_application (mime_string);
|
2000-10-16 21:27:40 +00:00
|
|
|
g_free (text[3]);
|
|
|
|
text[3] = g_strdup (default_app->name);
|
2000-09-17 03:15:40 +00:00
|
|
|
action_icon_name = gnome_vfs_mime_get_icon (mime_string);
|
|
|
|
if (action_icon_name != NULL) {
|
|
|
|
/* Get custom icon */
|
|
|
|
action_icon_path = gnome_pixmap_file (action_icon_name);
|
|
|
|
if (action_icon_path != NULL) {
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file (action_icon_path);
|
|
|
|
g_free (action_icon_path);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* Use default icon */
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file ("/gnome/share/pixmaps/nautilus/i-executable.png");
|
|
|
|
}
|
2000-10-16 21:27:40 +00:00
|
|
|
gnome_vfs_mime_application_free (default_app);
|
2000-09-17 03:15:40 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GNOME_VFS_MIME_ACTION_TYPE_COMPONENT:
|
|
|
|
/* Get the default component */
|
|
|
|
default_component = gnome_vfs_mime_get_default_component (mime_string);
|
2000-10-16 21:27:40 +00:00
|
|
|
g_free (text[3]);
|
2000-09-17 03:15:40 +00:00
|
|
|
text[3] = name_from_oaf_server_info (default_component);
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file ("/gnome/share/pixmaps/nautilus/gnome-library.png");
|
2000-10-16 21:27:40 +00:00
|
|
|
CORBA_free (default_component);
|
2000-09-17 03:15:40 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (application_button), TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2000-10-16 21:27:40 +00:00
|
|
|
|
2000-09-17 03:15:40 +00:00
|
|
|
/* Set column icon */
|
|
|
|
if (pixbuf != NULL) {
|
|
|
|
pixbuf = capplet_gdk_pixbuf_scale_to_fit (pixbuf, 18, 18);
|
|
|
|
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &bitmap, 100);
|
|
|
|
gtk_clist_set_pixtext (GTK_CLIST (mime_list), row, 3, text[3], 5, pixmap, bitmap);
|
|
|
|
gdk_pixbuf_unref (pixbuf);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_free (text[0]);
|
2000-10-16 21:27:40 +00:00
|
|
|
g_free (text[3]);
|
2000-09-17 03:15:40 +00:00
|
|
|
g_free (extensions);
|
|
|
|
}
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
edit_default_clicked (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
GtkWidget *list;
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
const char *mime_type;
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
GList *p;
|
|
|
|
GtkCListRow *row;
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (data));
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
list = data;
|
|
|
|
row = NULL;
|
Work in progress on the File Types and Program capplet
2000-06-13 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the File Types and Program capplet
* mime-type-capplet/edit-window.c: (initialize_main_win):
* mime-type-capplet/mime-data.c: (get_priority), (add_to_key),
(mime_fill_from_file), (add_mime_vals_to_clist),
(selected_row_callback), (create_mime_clist), (add_new_mime_type):
* mime-type-capplet/mime-data.h:
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_component_menu),
(free_mime_info), (delete_mime_clicked), (add_mime_clicked),
(edit_applications_clicked), (edit_components_clicked):
2000-06-14 01:50:59 +00:00
|
|
|
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
/* Get first selected row. This will be the only selection for this list */
|
|
|
|
for (p = GTK_CLIST (list)->row_list; p != NULL; p = p->next) {
|
|
|
|
row = p->data;
|
|
|
|
if (row->state == GTK_STATE_SELECTED) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (row == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Show dialog */
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
mime_type = (const char *) row->data;
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (application_button))) {
|
|
|
|
show_edit_applications_dialog (mime_type);
|
|
|
|
} else {
|
|
|
|
show_edit_components_dialog (mime_type);
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
}
|
mime-type-capplet/edit-window.c, mime-type-capplet/edit-window.h,
* Makefile.am:
* configure.in:
* mime-type-capplet/.cvsignore:
* mime-type-capplet/Makefile.am:
* mime-type-capplet/edit-window.c,
* mime-type-capplet/edit-window.h,
* mime-type-capplet/mime-data.c,
* mime-type-capplet/mime-data.h,
* mime-type-capplet/mime-info.c,
* mime-type-capplet/mime-info.h,
* mime-type-capplet/mime-type-capplet.c,
* mime-type-capplet/mime-type.desktop,
* mime-type-capplet/new-mime-window.c,
* mime-type-capplet/new-mime-window.h:
Copy mime-type capplet from the control-center so that it can be
improved and made to use gnome-vfs.
This has the unfortunate side-effect of introducing a dependency
on libcapplet. This is temporary until the capplet can move back
to the control-center. At that time, the control-center will
depend on gnome-vfs and eveyone will live happily ever after.
2000-05-23 23:23:57 +00:00
|
|
|
}
|
New files. Trying to clean up current capplet source and organize it in a
2000-06-14 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
New files. Trying to clean up current capplet source and
organize it in a sensible way.
(edit_application_dialog_destroy), (edit_component_dialog_destroy),
(populate_default_applications_list),
(populate_preferred_applications_list), (component_is_in_list),
(component_button_toggled_callback),
(populate_default_components_box),
(populate_preferred_components_list),
(initialize_edit_applications_dialog),
(initialize_edit_components_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
Brand new functions.
* mime-type-capplet/Makefile.am:
Added new source file listed above.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(init_mime_capplet), (populate_application_menu),
(populate_component_menu), (edit_applications_clicked),
(edit_components_clicked):
Work on setting up info view.
2000-06-15 06:14:51 +00:00
|
|
|
|
2000-11-13 19:16:38 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
nautilus_mime_type_capplet_update_mime_list_icon (const char *mime_string)
|
|
|
|
{
|
2000-11-13 23:33:57 +00:00
|
|
|
char *text;
|
2000-11-13 19:16:38 +00:00
|
|
|
const char *description, *description_icon_name;
|
|
|
|
char *description_icon_path;
|
|
|
|
gint row;
|
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
GdkPixmap *pixmap;
|
|
|
|
GdkBitmap *bitmap;
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (mime_list);
|
|
|
|
|
|
|
|
pixbuf = NULL;
|
|
|
|
|
|
|
|
row = GPOINTER_TO_INT (clist->selection->data);
|
|
|
|
|
|
|
|
/* Get description text */
|
|
|
|
description = gnome_vfs_mime_get_description (mime_string);
|
|
|
|
if (description != NULL && strlen (description) > 0) {
|
2000-11-13 23:33:57 +00:00
|
|
|
text = g_strdup (description);
|
2000-11-13 19:16:38 +00:00
|
|
|
} else {
|
2000-11-13 23:33:57 +00:00
|
|
|
text = g_strdup ("");
|
2000-11-13 19:16:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Set description column icon */
|
|
|
|
description_icon_name = gnome_vfs_mime_get_icon (mime_string);
|
|
|
|
if (description_icon_name != NULL) {
|
|
|
|
/* Get custom icon */
|
|
|
|
description_icon_path = gnome_pixmap_file (description_icon_name);
|
|
|
|
if (description_icon_path != NULL) {
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file (description_icon_path);
|
|
|
|
g_free (description_icon_path);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* Use default icon */
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file ("/gnome/share/pixmaps/nautilus/i-regular-24.png");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pixbuf != NULL) {
|
|
|
|
pixbuf = capplet_gdk_pixbuf_scale_to_fit (pixbuf, 18, 18);
|
|
|
|
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &bitmap, 100);
|
2000-11-13 23:33:57 +00:00
|
|
|
gtk_clist_set_pixtext (clist, row, 0, text, 5, pixmap, bitmap);
|
2000-11-13 19:16:38 +00:00
|
|
|
gdk_pixbuf_unref (pixbuf);
|
|
|
|
}
|
|
|
|
|
2000-11-13 23:33:57 +00:00
|
|
|
g_free (text);
|
2000-11-13 19:16:38 +00:00
|
|
|
}
|
|
|
|
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
/*
|
|
|
|
* nautilus_mime_type_capplet_update_application_info
|
|
|
|
*
|
|
|
|
* Update state of the applications menu. This function is called
|
|
|
|
* when the Edit Applications dialog is closed with an OK.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
nautilus_mime_type_capplet_update_application_info (const char *mime_type)
|
|
|
|
{
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
populate_application_menu (default_menu, mime_type);
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* nautilus_mime_type_capplet_update_component_info
|
|
|
|
*
|
|
|
|
* Update state of the components menu. This function is called
|
|
|
|
* when the Edit Componests dialog is closed with an OK.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
nautilus_mime_type_capplet_update_viewer_info (const char *mime_type)
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
{
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
populate_viewer_menu (default_menu, mime_type);
|
Work in progress on the FIle Types and Programs Capplet Removed obsolete
2000-06-15 Gene Z. Ragan <gzr@eazel.com>
Work in progress on the FIle Types and Programs Capplet
* mime-type-capplet/Makefile.am:
Removed obsolete files form build.
* mime-type-capplet/edit-window.c:
* mime-type-capplet/edit-window.h:
Obsolete. Removed.
* mime-type-capplet/new-mime-window.c:
* mime-type-capplet/new-mime-window.h:
Obsolete. Removed.
* mime-type-capplet/mime-data.c: (add_mime_vals_to_clist),
(selected_row_callback):
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.h:
(edit_applications_dialog_destroy), (application_is_in_list),
(application_button_toggled_callback),
(populate_default_applications_box),
(populate_default_components_box),
(initialize_edit_applications_dialog),
(show_edit_applications_dialog), (show_edit_components_dialog),
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(revert_callback), (populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(add_extension_clicked), (remove_extension),
(extension_list_selected), (extension_list_deselected),
(init_mime_capplet), (nautilus_mime_type_capplet_update_info),
(add_mime_clicked), (edit_components_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_component_info):
2000-06-15 23:32:08 +00:00
|
|
|
}
|
|
|
|
|
2000-11-13 23:33:57 +00:00
|
|
|
static void
|
|
|
|
update_mime_list_action (const char *mime_string)
|
|
|
|
{
|
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
GdkPixmap *pixmap;
|
|
|
|
GdkBitmap *bitmap;
|
|
|
|
GnomeVFSMimeAction *action;
|
|
|
|
GnomeVFSMimeApplication *default_app;
|
|
|
|
OAF_ServerInfo *default_component;
|
|
|
|
const char *action_icon_name;
|
|
|
|
char *text;
|
|
|
|
char *action_icon_path;
|
|
|
|
int row;
|
|
|
|
|
|
|
|
pixbuf = NULL;
|
|
|
|
row = GPOINTER_TO_INT (GTK_CLIST (mime_list)->selection->data);
|
|
|
|
|
|
|
|
text = g_strdup(_("None"));
|
|
|
|
|
|
|
|
action = gnome_vfs_mime_get_default_action (mime_string);
|
|
|
|
if (action != NULL) {
|
|
|
|
switch (action->action_type) {
|
|
|
|
case GNOME_VFS_MIME_ACTION_TYPE_APPLICATION:
|
|
|
|
/* Get the default application */
|
|
|
|
default_app = gnome_vfs_mime_get_default_application (mime_string);
|
|
|
|
g_free (text);
|
|
|
|
text = g_strdup (default_app->name);
|
|
|
|
action_icon_name = gnome_vfs_mime_get_icon (mime_string);
|
|
|
|
if (action_icon_name != NULL) {
|
|
|
|
/* Get custom icon */
|
|
|
|
action_icon_path = gnome_pixmap_file (action_icon_name);
|
|
|
|
if (action_icon_path != NULL) {
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file (action_icon_path);
|
|
|
|
g_free (action_icon_path);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* Use default icon */
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file ("/gnome/share/pixmaps/nautilus/i-executable.png");
|
|
|
|
}
|
|
|
|
gnome_vfs_mime_application_free (default_app);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GNOME_VFS_MIME_ACTION_TYPE_COMPONENT:
|
|
|
|
/* Get the default component */
|
|
|
|
default_component = gnome_vfs_mime_get_default_component (mime_string);
|
|
|
|
g_free (text);
|
|
|
|
text = name_from_oaf_server_info (default_component);
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file ("/gnome/share/pixmaps/nautilus/gnome-library.png");
|
|
|
|
CORBA_free (default_component);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (application_button), TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set column icon */
|
|
|
|
if (pixbuf != NULL) {
|
|
|
|
pixbuf = capplet_gdk_pixbuf_scale_to_fit (pixbuf, 18, 18);
|
|
|
|
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &bitmap, 100);
|
|
|
|
gtk_clist_set_pixtext (GTK_CLIST (mime_list), row, 3, text, 5, pixmap, bitmap);
|
|
|
|
gdk_pixbuf_unref (pixbuf);
|
|
|
|
} else {
|
|
|
|
/* Just set text with no icon */
|
|
|
|
gtk_clist_set_text (GTK_CLIST (mime_list), row, 3, text);
|
|
|
|
}
|
|
|
|
g_free (text);
|
|
|
|
}
|
|
|
|
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
|
|
|
|
static void
|
2000-07-08 00:57:36 +00:00
|
|
|
populate_mime_list (GList *type_list, GtkCList *clist)
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
{
|
2000-11-13 23:33:57 +00:00
|
|
|
char *text[4];
|
2000-10-16 21:27:40 +00:00
|
|
|
const char *description, *description_icon_name;
|
|
|
|
const char *action_icon_name;
|
|
|
|
char *extensions, *mime_string, *description_icon_path;
|
|
|
|
char *action_icon_path;
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
gint row;
|
|
|
|
GList *element;
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
GdkPixmap *pixmap;
|
|
|
|
GdkBitmap *bitmap;
|
2000-07-08 00:57:36 +00:00
|
|
|
GnomeVFSMimeAction *action;
|
|
|
|
GnomeVFSMimeApplication *default_app;
|
|
|
|
OAF_ServerInfo *default_component;
|
2000-08-02 09:18:18 +00:00
|
|
|
|
2000-09-09 00:23:39 +00:00
|
|
|
//gtk_clist_set_row_height (clist, 20);
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
for (element = type_list; element != NULL; element= element->next) {
|
|
|
|
mime_string = (char *)element->data;
|
|
|
|
|
|
|
|
/* Make sure we do not include comments */
|
|
|
|
if (mime_string[0] != '#') {
|
|
|
|
|
2000-09-09 00:23:39 +00:00
|
|
|
pixbuf = NULL;
|
|
|
|
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
/* Add description to first column */
|
fixes bugs 1119 and 1839
2000-08-31 Mathieu Lacage <mathieu@eazel.com>
fixes bugs 1119 and 1839
* data/mime/gnome-vfs.keys: add a mime type for testing.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_get_default_action_type),
(gnome_vfs_mime_edit_user_file_full),
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
update to API changes below. move saving code to gnome-vfs-mime-info.c
* libgnomevfs/gnome-vfs-mime-info.c: (does_string_contains_caps),
(context_new), (context_destroy_and_unlink), (language_level),
(context_add_key), (load_mime_type_info_from),
(load_mime_list_info_from), (mime_info_load), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(gnome_vfs_mime_freeze), (gnome_vfs_mime_thaw),
(gnome_vfs_mime_set_value), (gnome_vfs_mime_get_value),
(gnome_vfs_mime_keys_list_free), (gnome_vfs_mime_get_key_list),
(gnome_vfs_mime_get_program), (gnome_vfs_mime_get_program_name),
(gnome_vfs_mime_get_description), (str_cmp_callback),
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string),
(gnome_vfs_mime_get_extensions_pretty_string),
(gnome_vfs_mime_extensions_list_free), (gnome_vfs_mime_get_test),
(gnome_vfs_mime_get_composetyped),
(gnome_vfs_mime_get_copiousoutput),
(gnome_vfs_mime_get_needsterminal), (get_key_name),
(gnome_vfs_get_registered_mime_types),
(gnome_vfs_mime_registered_mime_type_list_free),
(gnome_vfs_mime_set_registered_type_key),
(write_back_mime_user_file_context_callback),
(write_back_mime_user_file_callback), (write_back_mime_user_file),
(write_back_keys_user_file_context_callback),
(write_back_keys_user_file_callback), (write_back_keys_user_file):
Basically, make it work. update copyright.
* libgnomevfs/gnome-vfs-mime-info.h: change some API.
* mime-type-capplet/nautilus-mime-type-capplet.c: update to new API.
(nautilus_mime_type_capplet_update_info), (populate_mime_list):
* test/Makefile.am: add tests.
* test/test-mime-info.c: (main): actual tests.
2000-08-31 07:04:59 +00:00
|
|
|
description = gnome_vfs_mime_get_description (mime_string);
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
if (description != NULL && strlen (description) > 0) {
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
text[0] = g_strdup (description);
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
} else {
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
text[0] = g_strdup ("");
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
}
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
|
|
|
|
/* Add mime type to second column */
|
|
|
|
text[1] = mime_string;
|
|
|
|
|
|
|
|
/* Add extension to third columns */
|
2000-07-08 00:57:36 +00:00
|
|
|
extensions = gnome_vfs_mime_get_extensions_pretty_string (mime_string);
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
if (extensions != NULL) {
|
|
|
|
text[2] = extensions;
|
2000-07-08 00:57:36 +00:00
|
|
|
} else {
|
|
|
|
text[2] = "";
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Add default action to fourth column */
|
2000-10-16 21:27:40 +00:00
|
|
|
text[3] = g_strdup(_("None"));
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
|
|
|
|
/* Insert item into list */
|
|
|
|
row = gtk_clist_insert (GTK_CLIST (clist), 1, text);
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
gtk_clist_set_row_data (GTK_CLIST (clist), row, g_strdup(mime_string));
|
|
|
|
|
2000-08-02 09:18:18 +00:00
|
|
|
/* Set description column icon */
|
|
|
|
description_icon_name = gnome_vfs_mime_get_icon (mime_string);
|
|
|
|
if (description_icon_name != NULL) {
|
|
|
|
/* Get custom icon */
|
2000-09-08 23:58:53 +00:00
|
|
|
description_icon_path = gnome_pixmap_file (description_icon_name);
|
2000-09-09 00:23:39 +00:00
|
|
|
if (description_icon_path != NULL) {
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file (description_icon_path);
|
|
|
|
g_free (description_icon_path);
|
|
|
|
}
|
2000-08-02 09:18:18 +00:00
|
|
|
} else {
|
|
|
|
/* Use default icon */
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file ("/gnome/share/pixmaps/nautilus/i-regular-24.png");
|
|
|
|
}
|
|
|
|
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
if (pixbuf != NULL) {
|
2000-08-02 09:18:18 +00:00
|
|
|
pixbuf = capplet_gdk_pixbuf_scale_to_fit (pixbuf, 18, 18);
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &bitmap, 100);
|
|
|
|
gtk_clist_set_pixtext (clist, row, 0, text[0], 5, pixmap, bitmap);
|
|
|
|
gdk_pixbuf_unref (pixbuf);
|
|
|
|
}
|
|
|
|
|
2000-07-08 00:57:36 +00:00
|
|
|
/* Set up action column */
|
2000-08-02 22:10:17 +00:00
|
|
|
pixbuf = NULL;
|
2000-07-08 00:57:36 +00:00
|
|
|
action = gnome_vfs_mime_get_default_action (mime_string);
|
2000-10-16 21:27:40 +00:00
|
|
|
if (action != NULL) {
|
2000-07-08 00:57:36 +00:00
|
|
|
switch (action->action_type) {
|
|
|
|
case GNOME_VFS_MIME_ACTION_TYPE_APPLICATION:
|
|
|
|
/* Get the default application */
|
2000-10-16 21:27:40 +00:00
|
|
|
default_app = gnome_vfs_mime_get_default_application (mime_string);
|
|
|
|
g_free (text[3]);
|
|
|
|
text[3] = g_strdup (default_app->name);
|
|
|
|
|
2000-08-02 22:10:17 +00:00
|
|
|
action_icon_name = gnome_vfs_mime_get_icon (mime_string);
|
|
|
|
if (action_icon_name != NULL) {
|
|
|
|
/* Get custom icon */
|
2000-09-08 23:58:53 +00:00
|
|
|
action_icon_path = gnome_pixmap_file (action_icon_name);
|
2000-09-09 00:23:39 +00:00
|
|
|
if (action_icon_path != NULL) {
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file (action_icon_path);
|
|
|
|
g_free (action_icon_path);
|
|
|
|
}
|
2000-08-02 22:10:17 +00:00
|
|
|
} else {
|
|
|
|
/* Use default icon */
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file ("/gnome/share/pixmaps/nautilus/i-executable.png");
|
|
|
|
}
|
2000-10-16 21:27:40 +00:00
|
|
|
gnome_vfs_mime_application_free (default_app);
|
2000-07-08 00:57:36 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GNOME_VFS_MIME_ACTION_TYPE_COMPONENT:
|
|
|
|
/* Get the default component */
|
|
|
|
default_component = gnome_vfs_mime_get_default_component (mime_string);
|
2000-10-16 21:27:40 +00:00
|
|
|
g_free (text[3]);
|
2000-07-08 00:57:36 +00:00
|
|
|
text[3] = name_from_oaf_server_info (default_component);
|
2000-08-02 22:10:17 +00:00
|
|
|
pixbuf = gdk_pixbuf_new_from_file ("/gnome/share/pixmaps/nautilus/gnome-library.png");
|
2000-10-16 21:27:40 +00:00
|
|
|
CORBA_free (default_component);
|
2000-07-08 00:57:36 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (application_button), TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2000-08-02 22:10:17 +00:00
|
|
|
|
New API to get and set icon data.
2000-07-14 Gene Z. Ragan <gzr@eazel.com>
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_get_icon), (gnome_vfs_mime_set_icon):
New API to get and set icon data.
* mime-type-capplet/Makefile.am:
Added new file
mime-type-capplet/nautilus-mime-type-icon-entry.c
* mime-type-capplet/nautilus-mime-type-icon-entry.c:
* mime-type-capplet/nautilus-mime-type-icon-entry.h:
(nautilus_mime_type_icon_entry_get_type),
(nautilus_mime_type_icon_entry_class_init), (entry_changed),
(entry_activated), (setup_preview), (ientry_destroy),
(browse_clicked), (icon_selected_cb), (cancel_pressed),
(gil_icon_selected_cb), (nautilus_mime_type_show_icon_selection),
(drag_data_received), (drag_data_get),
(nautilus_mime_type_icon_entry_init),
(nautilus_mime_type_icon_entry_new),
(nautilus_mime_type_icon_entry_gnome_file_entry),
(nautilus_mime_type_icon_entry_gnome_entry),
(nautilus_mime_type_icon_entry_gtk_entry),
(nautilus_mime_type_icon_entry_set_pixmap_subdir),
(nautilus_mime_type_icon_entry_set_icon),
(nautilus_mime_type_icon_entry_get_filename):
New file. This is a new verison of GnomeIconEntry.
I am customizing it to look and bahve in a way that
is compatible with Arlo's UI reccomendations.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(mime_list_selected_row_callback), (icon_changed),
(change_icon_clicked), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (populate_mime_list):
More UI cleanups. Removed GnomeIconEntry and replaced
with new NautilusMimeTypeIconEntry.
2000-07-15 01:56:53 +00:00
|
|
|
/* Set column icon */
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
if (pixbuf != NULL) {
|
2000-08-02 09:18:18 +00:00
|
|
|
pixbuf = capplet_gdk_pixbuf_scale_to_fit (pixbuf, 18, 18);
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &bitmap, 100);
|
|
|
|
gtk_clist_set_pixtext (clist, row, 3, text[3], 5, pixmap, bitmap);
|
|
|
|
gdk_pixbuf_unref (pixbuf);
|
|
|
|
}
|
2000-10-16 21:27:40 +00:00
|
|
|
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
g_free (text[0]);
|
2000-10-16 21:27:40 +00:00
|
|
|
g_free (text[3]);
|
|
|
|
g_free (extensions);
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-07-07 04:30:42 +00:00
|
|
|
static void
|
|
|
|
column_clicked (GtkCList *clist, gint column, gpointer user_data)
|
|
|
|
{
|
|
|
|
gtk_clist_set_sort_column (clist, column);
|
|
|
|
|
|
|
|
/* Toggle sort type */
|
|
|
|
if (clist->sort_type == GTK_SORT_ASCENDING) {
|
|
|
|
gtk_clist_set_sort_type (clist, GTK_SORT_DESCENDING);
|
|
|
|
} else {
|
|
|
|
gtk_clist_set_sort_type (clist, GTK_SORT_ASCENDING);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_clist_sort (clist);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
static GtkWidget *
|
|
|
|
create_mime_list_and_scroller (void)
|
|
|
|
{
|
|
|
|
GtkWidget *window;
|
2000-07-08 00:57:36 +00:00
|
|
|
gchar *titles[TOTAL_COLUMNS];
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
GList *type_list;
|
2000-07-08 00:57:36 +00:00
|
|
|
int index;
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
|
|
|
|
titles[0] = _("Description");
|
|
|
|
titles[1] = _("Mime Type");
|
|
|
|
titles[2] = _("Extension");
|
|
|
|
titles[3] = _("Action");
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
|
|
|
|
window = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (window),
|
|
|
|
GTK_POLICY_AUTOMATIC,
|
|
|
|
GTK_POLICY_AUTOMATIC);
|
2000-07-08 00:57:36 +00:00
|
|
|
mime_list = gtk_clist_new_with_titles (TOTAL_COLUMNS, titles);
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
gtk_clist_set_selection_mode (GTK_CLIST (mime_list), GTK_SELECTION_BROWSE);
|
|
|
|
gtk_clist_set_auto_sort (GTK_CLIST (mime_list), TRUE);
|
|
|
|
|
|
|
|
type_list = gnome_vfs_get_registered_mime_types ();
|
2000-07-08 00:57:36 +00:00
|
|
|
populate_mime_list (type_list, GTK_CLIST (mime_list));
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
gnome_vfs_mime_registered_mime_type_list_free (type_list);
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
|
|
|
|
gtk_clist_columns_autosize (GTK_CLIST (mime_list));
|
|
|
|
gtk_clist_select_row (GTK_CLIST (mime_list), 0, 0);
|
|
|
|
gtk_container_add (GTK_CONTAINER (window), mime_list);
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
|
2000-07-07 04:30:42 +00:00
|
|
|
/* Enable all titles */
|
|
|
|
gtk_clist_column_titles_active (GTK_CLIST (mime_list));
|
|
|
|
gtk_signal_connect (GTK_OBJECT (mime_list), "click_column",
|
|
|
|
column_clicked, NULL);
|
|
|
|
|
2000-07-08 00:57:36 +00:00
|
|
|
/* Turn off autoresizing of columns */
|
|
|
|
for (index = 0; index < TOTAL_COLUMNS; index++) {
|
|
|
|
gtk_clist_set_column_auto_resize (GTK_CLIST (mime_list), index, FALSE);
|
|
|
|
}
|
|
|
|
|
File Types and Programs capplet work in progress.
2000-06-17 Gene Z. Ragan <gzr@eazel.com>
File Types and Programs capplet work in progress.
* mime-type-capplet/mime-info.c:
* mime-type-capplet/mime-info.h:
Removed obsolete files from capplet.
* mime-type-capplet/Makefile.am:
Remove above files form makefile.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(list_context_new), (context_destroy_and_unlink),
(load_mime_type_info_from),
(load_mime_list_info_from), (mime_list_load),
(load_mime_type_info), (gnome_vfs_mime_init),
(gnome_vfs_mime_info_clear), (gnome_vfs_mime_info_shutdown),
(get_key_name), (gnome_vfs_get_registered_mime_types):
Various fixes and modifications. Fixed a bug in the
mime key database parser that caused comments to be
read in incorrectly.
* mime-type-capplet/mime-data.c:
(add_to_key), (add_mime_vals_to_clist),
(add_new_mime_type), (add_new_mime_type),
(write_mime_foreach):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window):
Capplet work in progress.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(main), (g_list_free_deep), (try_callback), (revert_callback),
(ok_callback), (cancel_callback), (populate_extension_list),
(mime_list_selected_row_callback), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info), (delete_mime_clicked),
(edit_applications_clicked), (edit_components_clicked),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller):
Capplet work in progress.
2000-06-17 07:58:12 +00:00
|
|
|
return window;
|
|
|
|
}
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
|
More work on adding applications and extension.
2000-06-21 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(initialize_edit_applications_dialog),
(nautilus_mime_type_capplet_show_new_extension_window),
(add_new_application), (show_new_application_window):
More work on adding applications and extension.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (none_button_toggled),
(application_button_toggled), (component_button_toggled),
(init_mime_capplet),
(nautilus_mime_type_capplet_get_selected_item_mime_type):
Changed use of GtkFixed to use layout. Layout is now messy
again, but I should be able to get it looking right.
2000-06-21 07:32:44 +00:00
|
|
|
const char *
|
|
|
|
nautilus_mime_type_capplet_get_selected_item_mime_type (void)
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
{
|
|
|
|
const char *mime_type;
|
|
|
|
int row;
|
|
|
|
GtkCList *clist;
|
|
|
|
|
|
|
|
clist = GTK_CLIST (mime_list);
|
|
|
|
|
|
|
|
if (clist->selection == NULL) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This is a single selection list, so we just use the first item in
|
2000-11-02 08:37:45 +00:00
|
|
|
* the list to retrieve the data */
|
Removed obsolete files.
2000-06-19 Gene Z. Ragan <gzr@eazel.com>
* mime-type-capplet/mime-data.c:
* mime-type-capplet/mime-data.h:
Removed obsolete files.
* mime-type-capplet/Makefile.am:
Removed above files from Makefile.
* libgnomevfs/gnome-vfs-mime-handlers.c:
* libgnomevfs/gnome-vfs-mime-handlers.h:
(gnome_vfs_mime_add_extension_to_mime_type):
New function. Add extension mapping to named mime type
and save to .mime file.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(load_mime_list_info_from),
(load_mime_type_info), (gnome_vfs_mime_get_extensions),
(gnome_vfs_mime_extension_list_free):
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_registered_mime_type_list_free),
New function to deep free the list returned
by gnome_vfs_mime_get_extensions()
(gnome_vfs_mime_commit_registered_types):
Public function to commit internal hash table
of mime data to disk.
(gnome_vfs_mime_set_registered_type_key):
This functions sets the key data for the registered mime
type's hash table.
(write_mime_data_foreach), (write_mime_data):
New functions to write out mime data from hash table.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(nautilus_mime_type_capplet_show_new_mime_window),
(nautilus_mime_type_capplet_show_new_extension_window):
Clean up work on dialogs.
* mime-type-capplet/nautilus-mime-type-capplet.c:
(ok_callback),
(populate_extension_list),
(nautilus_mime_type_capplet_add_extension),
(remove_extension_clicked), (init_mime_capplet),
(delete_mime_clicked), (create_mime_list_and_scroller),
(get_selected_item_mime_type):
Clean up work on main capplet view.
2000-06-19 23:12:18 +00:00
|
|
|
row = GPOINTER_TO_INT (clist->selection->data);
|
|
|
|
|
|
|
|
mime_type = (const char *) gtk_clist_get_row_data (clist, row);
|
|
|
|
|
|
|
|
return mime_type;
|
|
|
|
}
|
More capplet work in progress. Modifying applet and code to support UI
2000-07-04 Gene Z. Ragan <gzr@eazel.com>
More capplet work in progress. Modifying applet and code
to support UI work done by Arlo.
* libgnomevfs/gnome-vfs-mime-handlers.c:
(gnome_vfs_mime_add_extension), (gnome_vfs_mime_remove_extension):
API changes to support new layout.
* libgnomevfs/gnome-vfs-mime-info.c:
* libgnomevfs/gnome-vfs-mime-info.h:
(gnome_vfs_mime_get_extensions_list),
(gnome_vfs_mime_get_extensions_string):
API changes to support new layout.
* mime-type-capplet/Makefile.am:
Added dependency to GdkPixbuf.
* mime-type-capplet/nautilus-mime-type-capplet-dialogs.c:
(show_edit_components_dialog), (add_new_application),
(show_new_application_window), (show_edit_application_window):
API changes to support new layout.
* mime-type-capplet/nautilus-mime-type-capplet.c:
* mime-type-capplet/nautilus-mime-type-capplet.h:
(populate_extension_list), (extension_list_deselected),
(application_button_toggled), (viewer_button_toggled),
(icon_changed), (init_mime_capplet),
(nautilus_mime_type_capplet_update_info),
(populate_application_menu), (populate_viewer_menu),
(edit_default_clicked),
(nautilus_mime_type_capplet_update_application_info),
(nautilus_mime_type_capplet_update_viewer_info),
(insert_mime_vals_into_clist), (create_mime_list_and_scroller),
(nautilus_mime_type_capplet_get_selected_item_mime_type),
(make_path), (pixmap_file):
API changes to support new layout.
2000-07-05 04:35:04 +00:00
|
|
|
|
2000-07-28 23:07:34 +00:00
|
|
|
/**
|
|
|
|
* gtk_label_make_bold.
|
|
|
|
*
|
|
|
|
* Switches the font of label to a bold equivalent.
|
|
|
|
* @label: The label.
|
|
|
|
**/
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_widget_make_bold (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkStyle *style;
|
|
|
|
GdkFont *bold_font;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
style = gtk_widget_get_style (widget);
|
|
|
|
|
|
|
|
bold_font = gdk_font_get_bold (style->font);
|
|
|
|
|
|
|
|
if (bold_font == NULL) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_set_font (widget, bold_font);
|
|
|
|
gdk_font_unref (bold_font);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_widget_set_font
|
|
|
|
*
|
|
|
|
* Sets the font for a widget's style, managing the style objects.
|
|
|
|
* @widget: The widget.
|
|
|
|
* @font: The font.
|
|
|
|
**/
|
|
|
|
static void
|
|
|
|
gtk_widget_set_font (GtkWidget *widget, GdkFont *font)
|
|
|
|
{
|
|
|
|
GtkStyle *new_style;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
g_return_if_fail (font != NULL);
|
|
|
|
|
|
|
|
new_style = gtk_style_copy (gtk_widget_get_style (widget));
|
|
|
|
|
|
|
|
gtk_style_set_font (new_style, font);
|
|
|
|
|
|
|
|
gtk_widget_set_style (widget, new_style);
|
|
|
|
gtk_style_unref (new_style);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_style_set_font
|
|
|
|
*
|
|
|
|
* Sets the font in a style object, managing the ref. counts.
|
|
|
|
* @style: The style to change.
|
|
|
|
* @font: The new font.
|
|
|
|
**/
|
|
|
|
static void
|
|
|
|
gtk_style_set_font (GtkStyle *style, GdkFont *font)
|
|
|
|
{
|
|
|
|
g_return_if_fail (style != NULL);
|
|
|
|
g_return_if_fail (font != NULL);
|
|
|
|
|
|
|
|
gdk_font_ref (font);
|
|
|
|
gdk_font_unref (style->font);
|
|
|
|
style->font = font;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gdk_font_get_bold
|
|
|
|
* @plain_font: A font.
|
|
|
|
* Returns: A bold variant of @plain_font or NULL.
|
|
|
|
*
|
|
|
|
* Tries to find a bold flavor of a given font. Returns NULL if none is available.
|
|
|
|
*/
|
|
|
|
static GdkFont *
|
|
|
|
gdk_font_get_bold (const GdkFont *plain_font)
|
|
|
|
{
|
|
|
|
const char *plain_name;
|
|
|
|
const char *scanner;
|
|
|
|
char *bold_name;
|
|
|
|
int count;
|
|
|
|
GSList *p;
|
|
|
|
GdkFont *result;
|
|
|
|
GdkFontPrivate *private_plain;
|
|
|
|
|
|
|
|
private_plain = (GdkFontPrivate *)plain_font;
|
|
|
|
|
|
|
|
if (private_plain->names == NULL) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* -foundry-family-weight-slant-sel_width-add-style-pixels-points-hor_res-ver_res-spacing-average_width-char_set_registry-char_set_encoding */
|
|
|
|
|
|
|
|
bold_name = NULL;
|
|
|
|
for (p = private_plain->names; p != NULL; p = p->next) {
|
|
|
|
plain_name = (const char *)p->data;
|
|
|
|
scanner = plain_name;
|
|
|
|
|
|
|
|
/* skip past foundry and family to weight */
|
|
|
|
for (count = 2; count > 0; count--) {
|
|
|
|
scanner = strchr (scanner + 1, '-');
|
|
|
|
if (!scanner) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!scanner) {
|
|
|
|
/* try the other names in the list */
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
g_assert (*scanner == '-');
|
|
|
|
|
|
|
|
/* copy "-foundry-family-" over */
|
|
|
|
scanner++;
|
|
|
|
bold_name = g_strndup (plain_name, scanner - plain_name);
|
|
|
|
|
|
|
|
/* skip weight */
|
|
|
|
scanner = strchr (scanner, '-');
|
|
|
|
g_assert (scanner != NULL);
|
|
|
|
|
|
|
|
/* add "bold" and copy everything past weight over */
|
|
|
|
bold_name = g_strconcat (bold_name, "bold", scanner, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bold_name == NULL) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
result = gdk_font_load (bold_name);
|
|
|
|
g_free (bold_name);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
2000-08-02 09:18:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* scale the passed in pixbuf to conform to the passed-in maximum width and height */
|
|
|
|
/* utility routine to scale the passed-in pixbuf to be smaller than the maximum allowed size, if necessary */
|
|
|
|
static GdkPixbuf *
|
|
|
|
capplet_gdk_pixbuf_scale_to_fit (GdkPixbuf *pixbuf, int max_width, int max_height)
|
|
|
|
{
|
|
|
|
double scale_factor;
|
|
|
|
double h_scale = 1.0;
|
|
|
|
double v_scale = 1.0;
|
|
|
|
|
|
|
|
int width = gdk_pixbuf_get_width(pixbuf);
|
|
|
|
int height = gdk_pixbuf_get_height(pixbuf);
|
|
|
|
|
|
|
|
if (width > max_width) {
|
|
|
|
h_scale = max_width / (double) width;
|
|
|
|
}
|
|
|
|
if (height > max_height) {
|
|
|
|
v_scale = max_height / (double) height;
|
|
|
|
}
|
|
|
|
scale_factor = MIN (h_scale, v_scale);
|
|
|
|
|
|
|
|
if (scale_factor < 1.0) {
|
|
|
|
GdkPixbuf *scaled_pixbuf;
|
|
|
|
/* the width and scale factor are always > 0, so it's OK to round by adding here */
|
|
|
|
int scaled_width = floor(width * scale_factor + .5);
|
|
|
|
int scaled_height = floor(height * scale_factor + .5);
|
|
|
|
|
|
|
|
scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf, scaled_width, scaled_height, GDK_INTERP_BILINEAR);
|
|
|
|
gdk_pixbuf_unref (pixbuf);
|
|
|
|
pixbuf = scaled_pixbuf;
|
|
|
|
}
|
|
|
|
|
|
|
|
return pixbuf;
|
|
|
|
}
|
2000-11-13 19:16:38 +00:00
|
|
|
|