Don't create a separate dialog; just read from new_ext_entry

2002-01-11  Bradford Hovinen  <hovinen@ximian.com>

	* mime-edit-dialog.c (add_ext_cb): Don't create a separate dialog;
	just read from new_ext_entry
This commit is contained in:
Bradford Hovinen 2002-01-11 18:37:17 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent 9cd12bb3c2
commit e0bf4c9e25
5 changed files with 190 additions and 384 deletions

View file

@ -1,5 +1,8 @@
2002-01-11 Bradford Hovinen <hovinen@ximian.com>
* mime-edit-dialog.c (add_ext_cb): Don't create a separate dialog;
just read from new_ext_entry
* service-info.c (get_apps_for_service_type): Implement
* service-edit-dialog.c (program_changed_cb): Implement

View file

@ -7,7 +7,6 @@
- Implement tree cascading
- Fix gnome_url_show
- Don't have a separate add extension dialog, just put it in the same dialog as everything else
- Fill in list for Internet service apps
- Make add work
CVS Surgery

View file

@ -366,92 +366,106 @@
<property name="visible">yes</property>
<child>
<widget class="GtkHBox" id="hbox5">
<widget class="GtkTable" id="table1">
<property name="border_width">4</property>
<property name="homogeneous">no</property>
<property name="spacing">4</property>
<property name="row_spacing">4</property>
<property name="column_spacing">4</property>
<property name="n-rows">2</property>
<property name="n-columns">2</property>
<property name="visible">yes</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<widget class="GtkButton" id="add_ext_button">
<property name="can_default">yes</property>
<property name="can_focus">yes</property>
<property name="label" translatable="yes">Add</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="visible">yes</property>
<child>
<widget class="GtkTreeView" id="ext_list">
<property name="can_focus">yes</property>
<property name="headers-visible">no</property>
<property name="visible">yes</property>
<child>
<widget class="GtkLabel" id="label8">
<property name="child_name">CList:title</property>
<property name="label" translatable="yes">label8</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">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
</child>
</widget>
</child>
<child internal-child="hscrollbar">
<widget class="GtkHScrollbar" id="convertwidget3">
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
<property name="visible">yes</property>
</widget>
</child>
<child internal-child="vscrollbar">
<widget class="GtkVScrollbar" id="convertwidget4">
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
<property name="visible">yes</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_padding">0</property>
<property name="y_padding">0</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkVButtonBox" id="vbuttonbox3">
<property name="layout_style">GTK_BUTTONBOX_START</property>
<property name="spacing">10</property>
<widget class="GtkTreeView" id="ext_list">
<property name="can_focus">yes</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="headers-visible">no</property>
<property name="visible">yes</property>
<child>
<widget class="GtkButton" id="add_ext_button">
<property name="can_default">yes</property>
<property name="can_focus">yes</property>
<property name="label" translatable="yes">Add...</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="visible">yes</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="remove_ext_button">
<property name="can_default">yes</property>
<property name="can_focus">yes</property>
<property name="label" translatable="yes">Remove</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<widget class="GtkLabel" id="label8">
<property name="child_name">CList:title</property>
<property name="label" translatable="yes">label8</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">0</property>
<property name="ypad">0</property>
<property name="visible">yes</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">yes</property>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_padding">0</property>
<property name="y_padding">0</property>
<property name="x_options">expand|fill</property>
<property name="y_options">expand|fill</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="new_ext_entry">
<property name="can_focus">yes</property>
<property name="editable">yes</property>
<property name="text" translatable="yes"></property>
<property name="max-length">0</property>
<property name="visibility">yes</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_padding">0</property>
<property name="y_padding">0</property>
<property name="x_options">expand|fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="remove_ext_button">
<property name="can_default">yes</property>
<property name="can_focus">yes</property>
<property name="label" translatable="yes">Remove</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="visible">yes</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_padding">0</property>
<property name="y_padding">0</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
@ -509,7 +523,7 @@
<property name="visible">yes</property>
<child internal-child="menu">
<widget class="GtkMenu" id="convertwidget5">
<widget class="GtkMenu" id="convertwidget3">
<property name="visible">yes</property>
</widget>
</child>
@ -559,7 +573,7 @@
<property name="visible">yes</property>
<child internal-child="menu">
<widget class="GtkMenu" id="convertwidget6">
<widget class="GtkMenu" id="convertwidget4">
<property name="visible">yes</property>
</widget>
</child>
@ -656,121 +670,6 @@
</packing>
</child>
</widget>
<widget class="GtkDialog" id="add_ext_dialog">
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="modal">no</property>
<property name="allow_shrink">no</property>
<property name="allow_grow">no</property>
<property name="visible">no</property>
<property name="window-position">GTK_WIN_POS_NONE</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox3">
<property name="homogeneous">no</property>
<property name="spacing">8</property>
<property name="visible">yes</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area3">
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">8</property>
<property name="visible">yes</property>
<child>
<widget class="GtkButton" id="button7">
<property name="can_default">yes</property>
<property name="can_focus">yes</property>
<property name="visible">yes</property>
<property name="label" translatable="yes">gtk-ok</property>
<property name="use_stock">yes</property>
<property name="use_underline">yes</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="button8">
<property name="can_default">yes</property>
<property name="can_focus">yes</property>
<property name="visible">yes</property>
<property name="label" translatable="yes">gtk-apply</property>
<property name="use_stock">yes</property>
<property name="use_underline">yes</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="button9">
<property name="can_default">yes</property>
<property name="can_focus">yes</property>
<property name="visible">yes</property>
<property name="label" translatable="yes">gtk-cancel</property>
<property name="use_stock">yes</property>
<property name="use_underline">yes</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">no</property>
<property name="fill">yes</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="add_ext_widget">
<property name="homogeneous">no</property>
<property name="spacing">4</property>
<property name="visible">yes</property>
<child>
<widget class="GtkLabel" id="label14">
<property name="label" translatable="yes">New filename extension</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</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>
<child>
<widget class="GtkEntry" id="add_ext_entry">
<property name="can_focus">yes</property>
<property name="editable">yes</property>
<property name="text" translatable="yes"></property>
<property name="max-length">0</property>
<property name="visibility">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>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">4</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
<widget class="GtkDialog" id="internet_service_dialog">
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="modal">no</property>
@ -985,7 +884,7 @@
<property name="visible">yes</property>
<child internal-child="menu">
<widget class="GtkMenu" id="convertwidget7">
<widget class="GtkMenu" id="convertwidget5">
<property name="visible">yes</property>
</widget>
</child>

View file

@ -370,82 +370,121 @@
</child>
<widget>
<class>GtkHBox</class>
<name>hbox5</name>
<class>GtkTable</class>
<name>table1</name>
<border_width>4</border_width>
<rows>2</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<spacing>4</spacing>
<row_spacing>4</row_spacing>
<column_spacing>4</column_spacing>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow2</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<class>GtkButton</class>
<name>add_ext_button</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Add</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkCList</class>
<name>ext_list</name>
<can_focus>True</can_focus>
<columns>1</columns>
<column_widths>80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>False</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>True</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
<widget>
<class>GtkCList</class>
<name>ext_list</name>
<can_focus>True</can_focus>
<columns>1</columns>
<column_widths>80</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
<show_titles>False</show_titles>
<shadow_type>GTK_SHADOW_IN</shadow_type>
<widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label8</name>
<label>label8</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
<class>GtkLabel</class>
<child_name>CList:title</child_name>
<name>label8</name>
<label>label8</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
</widget>
</widget>
<widget>
<class>GtkVButtonBox</class>
<name>vbuttonbox3</name>
<layout_style>GTK_BUTTONBOX_START</layout_style>
<spacing>10</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<class>GtkEntry</class>
<name>new_ext_entry</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>add_ext_button</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Add...</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>remove_ext_button</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Remove</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>remove_ext_button</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Remove</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
</widget>
</widget>
@ -611,118 +650,6 @@
</widget>
</widget>
<widget>
<class>GnomeDialog</class>
<name>add_ext_dialog</name>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>False</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>dialog-vbox3</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area3</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>button7</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<widget>
<class>GtkButton</class>
<name>button8</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
</widget>
<widget>
<class>GtkButton</class>
<name>button9</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
<widget>
<class>GtkVBox</class>
<name>add_ext_widget</name>
<homogeneous>False</homogeneous>
<spacing>4</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label14</name>
<label>New filename extension</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>add_ext_entry</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
</widget>
</widget>
</widget>
<widget>
<class>GnomeDialog</class>
<name>internet_service_dialog</name>

View file

@ -490,37 +490,15 @@ store_data (MimeEditDialog *dialog)
static void
add_ext_cb (MimeEditDialog *dialog)
{
GladeXML *add_dialog_xml;
GtkWidget *add_dialog;
GtkWidget *add_widget;
GtkWidget *ext_entry;
gint response_id;
GtkTreeIter iter;
const gchar *ext_name;
add_dialog_xml = glade_xml_new (GNOMECC_DATA_DIR "/interfaces/file-types-properties.glade", "add_ext_widget", NULL);
ext_name = gtk_entry_get_text (GTK_ENTRY (WID ("new_ext_entry")));
add_dialog = gtk_dialog_new_with_buttons
(_("Add filename extension"), NULL, -1,
GTK_STOCK_OK, GTK_RESPONSE_OK,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
NULL);
add_widget = glade_xml_get_widget (add_dialog_xml, "add_ext_widget");
ext_entry = glade_xml_get_widget (add_dialog_xml, "add_ext_entry");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (add_dialog)->vbox), add_widget, TRUE, TRUE, 0);
gtk_widget_show_all (add_dialog);
response_id = gtk_dialog_run (GTK_DIALOG (add_dialog));
if (response_id == GTK_RESPONSE_OK) {
if (ext_name != NULL && *ext_name != '\0') {
gtk_tree_store_append (dialog->p->ext_store, &iter, NULL);
gtk_tree_store_set (dialog->p->ext_store, &iter, 0,
gtk_entry_get_text (GTK_ENTRY (ext_entry)), -1);
gtk_tree_store_set (dialog->p->ext_store, &iter, 0, ext_name, -1);
}
gtk_widget_destroy (GTK_WIDGET (add_dialog));
g_object_unref (G_OBJECT (add_dialog_xml));
}
static void