Make instant apply and add link to Help.
2002-04-23 Jody Goldberg <jody@gnome.org> * model-entry.c (model_entry_save) : wrap in vfs freeze/unfreeze. (model_entry_append_to_dirty_list) : delete. (model_entry_remove_from_dirty_list) : delete. (model_entry_commit_dirty_list) : delete. (model_entry_append_to_delete_list) : delete. (model_entry_commit_delete_list) : delete. * mime-category-edit-dialog.c (store_data) : make this instant apply. * mime-edit-dialog.c (store_data) : ditto. * service-edit-dialog.c (store_data) : ditto. * file-types-capplet.c (cb_file_type_dialog_response) : add help and change the buttons to help & close to be HIG compliant. (remove_cb) : make removal apply instantly. * file-types-properties.glade : Make the buttons Help & Close
This commit is contained in:
parent
c6e621aae2
commit
fa05cd9201
8 changed files with 64 additions and 87 deletions
|
@ -1,3 +1,21 @@
|
||||||
|
2002-04-23 Jody Goldberg <jody@gnome.org>
|
||||||
|
|
||||||
|
* model-entry.c (model_entry_save) : wrap in vfs freeze/unfreeze.
|
||||||
|
(model_entry_append_to_dirty_list) : delete.
|
||||||
|
(model_entry_remove_from_dirty_list) : delete.
|
||||||
|
(model_entry_commit_dirty_list) : delete.
|
||||||
|
(model_entry_append_to_delete_list) : delete.
|
||||||
|
(model_entry_commit_delete_list) : delete.
|
||||||
|
|
||||||
|
* mime-category-edit-dialog.c (store_data) : make this instant apply.
|
||||||
|
* mime-edit-dialog.c (store_data) : ditto.
|
||||||
|
* service-edit-dialog.c (store_data) : ditto.
|
||||||
|
|
||||||
|
* file-types-capplet.c (cb_file_type_dialog_response) : add help and
|
||||||
|
change the buttons to help & close to be HIG compliant.
|
||||||
|
(remove_cb) : make removal apply instantly.
|
||||||
|
* file-types-properties.glade : Make the buttons Help & Close
|
||||||
|
|
||||||
2002-04-22 Jody Goldberg <jody@gnome.org>
|
2002-04-22 Jody Goldberg <jody@gnome.org>
|
||||||
|
|
||||||
* mime-edit-dialog.c (validate_data) : tidy up.
|
* mime-edit-dialog.c (validate_data) : tidy up.
|
||||||
|
|
|
@ -171,7 +171,7 @@ remove_cb (GtkButton *button, GladeXML *dialog)
|
||||||
entry = MODEL_ENTRY_FROM_ITER (&iter);
|
entry = MODEL_ENTRY_FROM_ITER (&iter);
|
||||||
|
|
||||||
model_entry_remove_child (entry->parent, entry, model);
|
model_entry_remove_child (entry->parent, entry, model);
|
||||||
model_entry_append_to_delete_list (entry);
|
model_entry_delete (entry);
|
||||||
|
|
||||||
selection_changed_cb (selection, dialog);
|
selection_changed_cb (selection, dialog);
|
||||||
}
|
}
|
||||||
|
@ -179,9 +179,19 @@ remove_cb (GtkButton *button, GladeXML *dialog)
|
||||||
static void
|
static void
|
||||||
cb_file_type_dialog_response (GtkDialog *dialog, gint response_id)
|
cb_file_type_dialog_response (GtkDialog *dialog, gint response_id)
|
||||||
{
|
{
|
||||||
if (response_id == GTK_RESPONSE_APPLY)
|
if (response_id == GTK_RESPONSE_HELP) {
|
||||||
model_entry_commit_dirty_list ();
|
GError *error = NULL;
|
||||||
else
|
|
||||||
|
/* TODO : get this written */
|
||||||
|
gnome_help_display_desktop (NULL,
|
||||||
|
"config-file-type",
|
||||||
|
"config-file-type.xml",
|
||||||
|
"CONFIGURATION", &error);
|
||||||
|
if (error) {
|
||||||
|
g_warning ("help error: %s\n", error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
}
|
||||||
|
} else
|
||||||
gtk_main_quit ();
|
gtk_main_quit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,33 +28,33 @@
|
||||||
<property name="visible">yes</property>
|
<property name="visible">yes</property>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkButton" id="main_apply_button">
|
<widget class="GtkButton" id="help_button">
|
||||||
<property name="can_default">yes</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">yes</property>
|
<property name="can_default">True</property>
|
||||||
<property name="visible">yes</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="label">gtk-apply</property>
|
<property name="label">gtk-help</property>
|
||||||
<property name="use_stock">yes</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="use_underline">yes</property>
|
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||||
<property name="response_id">-10</property>
|
<property name="response_id">-11</property>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkButton" id="main_close_button">
|
<widget class="GtkButton" id="close_button">
|
||||||
<property name="can_default">yes</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">yes</property>
|
<property name="can_default">True</property>
|
||||||
<property name="visible">yes</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="label">gtk-close</property>
|
<property name="label">gtk-close</property>
|
||||||
<property name="use_stock">yes</property>
|
<property name="use_stock">True</property>
|
||||||
<property name="use_underline">yes</property>
|
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||||
<property name="response_id">-7</property>
|
<property name="response_id">-7</property>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="padding">0</property>
|
<property name="padding">0</property>
|
||||||
<property name="expand">no</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">yes</property>
|
<property name="fill">True</property>
|
||||||
<property name="pack_type">GTK_PACK_END</property>
|
<property name="pack_type">GTK_PACK_END</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
|
|
@ -400,7 +400,7 @@ store_data (MimeCategoryEditDialog *dialog)
|
||||||
dialog->p->info->use_parent_category =
|
dialog->p->info->use_parent_category =
|
||||||
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("use_category_toggle")));
|
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("use_category_toggle")));
|
||||||
|
|
||||||
model_entry_append_to_dirty_list (MODEL_ENTRY (dialog->p->info));
|
model_entry_save (MODEL_ENTRY (dialog->p->info));
|
||||||
|
|
||||||
mime_category_info_update (dialog->p->info);
|
mime_category_info_update (dialog->p->info);
|
||||||
}
|
}
|
||||||
|
|
|
@ -671,7 +671,7 @@ store_data (MimeEditDialog *dialog)
|
||||||
}
|
}
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
|
|
||||||
model_entry_append_to_dirty_list (MODEL_ENTRY (dialog->p->info));
|
model_entry_save (MODEL_ENTRY (dialog->p->info));
|
||||||
|
|
||||||
if (!cat_changed) {
|
if (!cat_changed) {
|
||||||
mime_types_model_construct_iter (MIME_TYPES_MODEL (dialog->p->model),
|
mime_types_model_construct_iter (MIME_TYPES_MODEL (dialog->p->model),
|
||||||
|
|
|
@ -31,11 +31,6 @@
|
||||||
#include "service-info.h"
|
#include "service-info.h"
|
||||||
#include "mime-types-model.h"
|
#include "mime-types-model.h"
|
||||||
|
|
||||||
/* List of MimeTypeInfo structures that have data to be committed */
|
|
||||||
|
|
||||||
static GList *dirty_list = NULL;
|
|
||||||
static GList *delete_list = NULL;
|
|
||||||
|
|
||||||
ModelEntry *
|
ModelEntry *
|
||||||
get_model_entries (GtkTreeModel *model)
|
get_model_entries (GtkTreeModel *model)
|
||||||
{
|
{
|
||||||
|
@ -164,6 +159,7 @@ model_entry_remove_child (ModelEntry *entry, ModelEntry *child, GtkTreeModel *mo
|
||||||
void
|
void
|
||||||
model_entry_save (ModelEntry *entry)
|
model_entry_save (ModelEntry *entry)
|
||||||
{
|
{
|
||||||
|
gnome_vfs_mime_freeze ();
|
||||||
switch (entry->type) {
|
switch (entry->type) {
|
||||||
case MODEL_ENTRY_MIME_TYPE:
|
case MODEL_ENTRY_MIME_TYPE:
|
||||||
mime_type_info_save (MIME_TYPE_INFO (entry));
|
mime_type_info_save (MIME_TYPE_INFO (entry));
|
||||||
|
@ -180,6 +176,7 @@ model_entry_save (ModelEntry *entry)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
gnome_vfs_mime_thaw ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -200,44 +197,3 @@ model_entry_delete (ModelEntry *entry)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
model_entry_append_to_dirty_list (ModelEntry *entry)
|
|
||||||
{
|
|
||||||
if (g_list_find (dirty_list, entry) == NULL)
|
|
||||||
dirty_list = g_list_prepend (dirty_list, entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
model_entry_remove_from_dirty_list (ModelEntry *entry)
|
|
||||||
{
|
|
||||||
dirty_list = g_list_remove (dirty_list, entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
model_entry_commit_dirty_list (void)
|
|
||||||
{
|
|
||||||
gnome_vfs_mime_freeze ();
|
|
||||||
g_list_foreach (dirty_list, (GFunc) model_entry_save, NULL);
|
|
||||||
gnome_vfs_mime_thaw ();
|
|
||||||
|
|
||||||
g_list_free (dirty_list);
|
|
||||||
dirty_list = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
model_entry_append_to_delete_list (ModelEntry *entry)
|
|
||||||
{
|
|
||||||
model_entry_remove_from_dirty_list (entry);
|
|
||||||
delete_list = g_list_prepend (delete_list, entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
model_entry_commit_delete_list (void)
|
|
||||||
{
|
|
||||||
g_list_foreach (delete_list, (GFunc) model_entry_delete, NULL);
|
|
||||||
|
|
||||||
g_list_free (delete_list);
|
|
||||||
delete_list = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -66,13 +66,6 @@ void model_entry_remove_child (ModelEntry *entry,
|
||||||
void model_entry_save (ModelEntry *entry);
|
void model_entry_save (ModelEntry *entry);
|
||||||
void model_entry_delete (ModelEntry *entry);
|
void model_entry_delete (ModelEntry *entry);
|
||||||
|
|
||||||
void model_entry_append_to_dirty_list (ModelEntry *entry);
|
|
||||||
void model_entry_remove_from_dirty_list (ModelEntry *entry);
|
|
||||||
void model_entry_commit_dirty_list (void);
|
|
||||||
|
|
||||||
void model_entry_append_to_delete_list (ModelEntry *entry);
|
|
||||||
void model_entry_commit_delete_list (void);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __MODEL_ENTRY_H */
|
#endif /* __MODEL_ENTRY_H */
|
||||||
|
|
|
@ -472,7 +472,7 @@ store_data (ServiceEditDialog *dialog)
|
||||||
= gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("needs_terminal_toggle")));
|
= gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (WID ("needs_terminal_toggle")));
|
||||||
}
|
}
|
||||||
|
|
||||||
model_entry_append_to_dirty_list (MODEL_ENTRY (dialog->p->info));
|
model_entry_save (MODEL_ENTRY (dialog->p->info));
|
||||||
|
|
||||||
if (dialog->p->is_add) {
|
if (dialog->p->is_add) {
|
||||||
model_entry_insert_child (get_services_category_entry (dialog->p->model),
|
model_entry_insert_child (get_services_category_entry (dialog->p->model),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue