Set sensitivity of needs_terminal_toggle (store_data): Set needs_terminal
2002-01-11 Bradford Hovinen <hovinen@ximian.com> * mime-edit-dialog.c (default_action_changed_cb): Set sensitivity of needs_terminal_toggle (store_data): Set needs_terminal (fill_dialog): Set needs_terminal_toggle
This commit is contained in:
parent
6a71b6f339
commit
b11fd58903
6 changed files with 49 additions and 3 deletions
|
@ -1,9 +1,16 @@
|
|||
2002-01-11 Bradford Hovinen <hovinen@ximian.com>
|
||||
|
||||
* mime-edit-dialog.c (default_action_changed_cb): Set sensitivity
|
||||
of needs_terminal_toggle
|
||||
(store_data): Set needs_terminal
|
||||
(fill_dialog): Set needs_terminal_toggle
|
||||
|
||||
* mime-type-info.c (mime_type_info_free): Remove from dirty list
|
||||
(mime_type_info_save): Use libuuid to generate a unique ID for the
|
||||
custom app
|
||||
(mime_type_info_load): Check for custom line based on name
|
||||
(mime_type_info_load): Fetch needs_terminal
|
||||
(mime_type_info_save): Store info->needs_terminal in app
|
||||
|
||||
* mime-edit-dialog.c (populate_application_list): Don't check
|
||||
default action id if default action is NULL
|
||||
|
|
|
@ -646,6 +646,21 @@
|
|||
<property name="fill">yes</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="needs_terminal_toggle">
|
||||
<property name="can_focus">yes</property>
|
||||
<property name="label" translatable="yes">Needs terminal</property>
|
||||
<property name="active">no</property>
|
||||
<property name="draw_indicator">yes</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">no</property>
|
||||
<property name="fill">no</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
|
|
@ -644,6 +644,20 @@
|
|||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkCheckButton</class>
|
||||
<name>needs_terminal_toggle</name>
|
||||
<can_focus>True</can_focus>
|
||||
<label>Needs terminal</label>
|
||||
<active>False</active>
|
||||
<draw_indicator>True</draw_indicator>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
|
|
@ -281,6 +281,8 @@ fill_dialog (MimeEditDialog *dialog)
|
|||
if (dialog->p->info->custom_line != NULL)
|
||||
gnome_file_entry_set_filename (GNOME_FILE_ENTRY (WID ("program_entry")), dialog->p->info->custom_line);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("needs_terminal_toggle")), dialog->p->info->needs_terminal);
|
||||
|
||||
if (dialog->p->info->mime_type != NULL && *dialog->p->info->mime_type != '\0')
|
||||
gtk_widget_set_sensitive (WID ("mime_type_entry"), FALSE);
|
||||
|
||||
|
@ -486,6 +488,8 @@ store_data (MimeEditDialog *dialog)
|
|||
g_free (dialog->p->info->custom_line);
|
||||
dialog->p->info->custom_line = g_strdup (gnome_file_entry_get_full_path (GNOME_FILE_ENTRY (WID ("program_entry")), FALSE));
|
||||
|
||||
dialog->p->info->needs_terminal = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("needs_terminal_toggle")));
|
||||
|
||||
ext_list = collect_filename_extensions (dialog);
|
||||
dialog->p->info->file_extensions = merge_ext_lists (dialog->p->info->file_extensions, ext_list);
|
||||
g_list_foreach (ext_list, (GFunc) g_free, NULL);
|
||||
|
@ -534,10 +538,13 @@ default_action_changed_cb (MimeEditDialog *dialog)
|
|||
menu = GTK_MENU_SHELL (gtk_option_menu_get_menu (option_menu));
|
||||
id = gtk_option_menu_get_history (option_menu);
|
||||
|
||||
if (id == g_list_length (menu->children) - 1)
|
||||
if (id == g_list_length (menu->children) - 1) {
|
||||
gtk_widget_set_sensitive (WID ("program_entry_box"), TRUE);
|
||||
else
|
||||
gtk_widget_set_sensitive (WID ("needs_terminal_toggle"), TRUE);
|
||||
} else {
|
||||
gtk_widget_set_sensitive (WID ("program_entry_box"), FALSE);
|
||||
gtk_widget_set_sensitive (WID ("needs_terminal_toggle"), FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -125,6 +125,8 @@ mime_type_info_load (GtkTreeModel *model, GtkTreeIter *iter)
|
|||
|
||||
if (info->default_action != NULL && !strcmp (info->default_action->name, tmp)) {
|
||||
info->custom_line = g_strdup (info->default_action->command);
|
||||
info->needs_terminal = gnome_vfs_application_registry_get_bool_value
|
||||
(info->default_action->id, "requires_terminal", NULL);
|
||||
gnome_vfs_mime_application_free (info->default_action);
|
||||
info->default_action = NULL;
|
||||
}
|
||||
|
@ -171,7 +173,7 @@ mime_type_info_save (const MimeTypeInfo *info)
|
|||
app.can_open_multiple_files = FALSE;
|
||||
app.expects_uris = FALSE;
|
||||
app.supported_uri_schemes = NULL;
|
||||
app.requires_terminal = FALSE;
|
||||
app.requires_terminal = info->needs_terminal;
|
||||
|
||||
gnome_vfs_application_registry_save_mime_application (&app);
|
||||
gnome_vfs_application_registry_sync ();
|
||||
|
|
|
@ -47,6 +47,7 @@ struct _MimeTypeInfo
|
|||
gchar *default_component_id;
|
||||
GnomeVFSMimeApplication *default_action;
|
||||
gchar *custom_line;
|
||||
gboolean needs_terminal;
|
||||
gchar *edit_line;
|
||||
gchar *print_line;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue