only enable the remove button when there is a selection.
2002-07-17 Jody Goldberg <jody@gnome.org> * mime-edit-dialog.c (mime_edit_dialog_init) : only enable the remove button when there is a selection.
This commit is contained in:
parent
76214e33c0
commit
82c39eb541
3 changed files with 63 additions and 10 deletions
|
@ -1,3 +1,8 @@
|
|||
2002-07-17 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* mime-edit-dialog.c (mime_edit_dialog_init) : only enable the remove
|
||||
button when there is a selection.
|
||||
|
||||
2002-07-16 Jody Goldberg <jody@gnome.org>
|
||||
|
||||
* file-types-properties.glade (</) : rearrange the extensions area.
|
||||
|
|
|
@ -456,10 +456,31 @@
|
|||
<widget class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="n_columns">3</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="row_spacing">0</property>
|
||||
<property name="column_spacing">0</property>
|
||||
<property name="column_spacing">4</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="add_ext_label">
|
||||
<property name="label" translatable="yes">Add:</property>
|
||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
||||
<property name="wrap">no</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">4</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="visible">yes</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">1</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkEntry" id="new_ext_entry">
|
||||
|
@ -486,7 +507,7 @@
|
|||
<child>
|
||||
<widget class="GtkAlignment" id="alignment1">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">0</property>
|
||||
<property name="yscale">1</property>
|
||||
|
@ -544,8 +565,8 @@
|
|||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
|
|
|
@ -159,12 +159,29 @@ mime_edit_editable_enters (MimeEditDialog *dialog, GtkEditable *editable)
|
|||
GTK_WINDOW (dialog->p->dialog_win));
|
||||
}
|
||||
|
||||
static void
|
||||
check_for_content (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
|
||||
gpointer data)
|
||||
{
|
||||
*((gboolean *)data) = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
remove_ext_sensitivity_cb (GtkTreeSelection *selection, GtkWidget *button)
|
||||
{
|
||||
gboolean flag = FALSE;
|
||||
gtk_tree_selection_selected_foreach (selection, check_for_content, &flag);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (button), flag);
|
||||
}
|
||||
|
||||
static void
|
||||
mime_edit_dialog_init (MimeEditDialog *dialog, MimeEditDialogClass *class)
|
||||
{
|
||||
GtkSizeGroup *size_group;
|
||||
GtkTreeView *view;
|
||||
GtkCellRenderer *renderer;
|
||||
GtkWidget *remove_ext;
|
||||
GtkTreeSelection *selection;
|
||||
|
||||
dialog->p = g_new0 (MimeEditDialogPrivate, 1);
|
||||
dialog->p->dialog_xml = glade_xml_new
|
||||
|
@ -199,12 +216,22 @@ mime_edit_dialog_init (MimeEditDialog *dialog, MimeEditDialogClass *class)
|
|||
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog->p->dialog_win)->vbox), WID ("edit_widget"), TRUE, TRUE, 0);
|
||||
|
||||
g_signal_connect_swapped (G_OBJECT (WID ("new_ext_entry")), "activate", (GCallback) add_ext_cb, dialog);
|
||||
g_signal_connect_swapped (G_OBJECT (WID ("remove_ext_button")), "clicked", (GCallback) remove_ext_cb, dialog);
|
||||
g_signal_connect_swapped (G_OBJECT (WID ("choose_button")), "clicked", (GCallback) choose_cat_cb, dialog);
|
||||
g_signal_connect_swapped (G_OBJECT (WID ("default_action_select")), "changed", (GCallback) default_action_changed_cb, dialog);
|
||||
remove_ext = WID ("remove_ext_button");
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WID ("ext_list")));
|
||||
g_signal_connect (G_OBJECT (selection), "changed",
|
||||
(GCallback) remove_ext_sensitivity_cb, remove_ext);
|
||||
g_signal_connect_swapped (G_OBJECT (remove_ext), "clicked",
|
||||
(GCallback) remove_ext_cb, dialog);
|
||||
g_signal_connect_swapped (G_OBJECT (WID ("new_ext_entry")), "activate",
|
||||
(GCallback) add_ext_cb, dialog);
|
||||
g_signal_connect_swapped (G_OBJECT (WID ("choose_button")), "clicked",
|
||||
(GCallback) choose_cat_cb, dialog);
|
||||
g_signal_connect_swapped (G_OBJECT (WID ("default_action_select")), "changed",
|
||||
(GCallback) default_action_changed_cb, dialog);
|
||||
g_signal_connect_swapped (G_OBJECT (dialog->p->dialog_win), "response",
|
||||
(GCallback) response_cb, dialog);
|
||||
|
||||
g_signal_connect_swapped (G_OBJECT (dialog->p->dialog_win), "response", (GCallback) response_cb, dialog);
|
||||
remove_ext_sensitivity_cb (selection, (gpointer)remove_ext);
|
||||
|
||||
mime_edit_editable_enters (dialog, GTK_EDITABLE (WID ("description_entry")));
|
||||
mime_edit_editable_enters (dialog, GTK_EDITABLE (WID ("mime_type_entry")));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue