Re: [mlview-list][mlview-app-refactoring] dialog for open view selection
- From: Stephane Bonhomme <s bonhomme wanadoo fr>
- To: mlview-list gnome org
- Subject: Re: [mlview-list][mlview-app-refactoring] dialog for open view selection
- Date: Fri, 13 Feb 2004 22:35:38 +0100
Found a bug in my patch, Here is a new patch file that replaces the
previous one
Le mar 10/02/2004 à 00:22, Stephane Bonhomme a écrit :
> Hi,
>
> This patch adds a dialog window when activating the Open New view entry
> of the Action Menu, Displaying and letting the user choose between the
> avaiable types of views.
>
> CAUTION : this patchs applies only to the mlview-app-refactoring CVS
> branch
>
> Sincerly,
> Stephane.
--
Stéphane Bonhomme - Formations, Conseil et Réalisations
Ingénierie Documentaire - Technologies Web - Logiciels Libres
s bonhomme wanadoo fr - http://perso.wanadoo.fr/s.bonhomme
04 76 17 09 40 / 06 88 57 27 08
? Doxyfile
? diff.txt
? mlview.desktop
? schemas/Makefile
? schemas/Makefile.in
? src/mlv
Index: src/mlview-editor.c
===================================================================
RCS file: /cvs/gnome/mlview/src/mlview-editor.c,v
retrieving revision 1.70.4.8
diff -r1.70.4.8 mlview-editor.c
500a501,587
> static struct MlViewViewDesc *
> mlview_editor_sel_view_to_open ()
> {
> GtkWidget *dialog;
> GtkWidget *dialog_vbox;
> GtkWidget *hbox1;
> GtkWidget *label1;
> GtkWidget *option_menu;
> GtkWidget *menu;
> GtkWidget *menu_item;
> GtkWidget *dialog_action_area1;
> GtkWidget *button5;
> GtkWidget *button6;
> GtkWidget *sel_menu_item;
>
> enum MLVIEW_SELECTED_BUTTON button;
> struct MlViewViewDesc *result = NULL;
> struct MlViewViewDesc *view_desc_ptr = NULL ;
> gchar *base_name;
>
> dialog = gtk_dialog_new ();
> gtk_window_set_title (GTK_WINDOW (dialog), _("Select View"));
>
> dialog_vbox = GTK_DIALOG (dialog)->vbox;
> gtk_widget_show (dialog_vbox);
>
> hbox1 = gtk_hbox_new (FALSE, 0);
> gtk_widget_show (hbox1);
> gtk_box_pack_start (GTK_BOX (dialog_vbox), hbox1, TRUE, TRUE, 0);
> label1 = gtk_label_new (_("Select view to open"));
> gtk_widget_show (label1);
> gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 10);
>
> /* build select view menu */
> option_menu = gtk_option_menu_new();
> menu = gtk_menu_new();
> gtk_option_menu_set_menu (GTK_OPTION_MENU(option_menu), menu);
>
> gtk_widget_show (menu);
> gtk_widget_show (option_menu);
>
> gtk_box_pack_start (GTK_BOX (hbox1), option_menu, TRUE, TRUE, 0);
> for (view_desc_ptr = gv_view_types;
> view_desc_ptr && view_desc_ptr->view_type_name;
> view_desc_ptr ++) {
> base_name = view_desc_ptr->view_type_name;
> menu_item = gtk_menu_item_new_with_label(base_name);
> gtk_menu_shell_append (GTK_MENU_SHELL(menu), menu_item);
> gtk_widget_show(menu_item);
> g_object_set_data (G_OBJECT(menu_item), "mlview_view_desc", (gpointer)view_desc_ptr);
> }
> gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), 0);
>
> /* dialog box buttons */
> dialog_action_area1 = GTK_DIALOG (dialog)->action_area;
> gtk_widget_show (dialog_action_area1);
> gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
>
> button5 = gtk_button_new_from_stock ("gtk-cancel");
> gtk_widget_show (button5);
> gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button5, GTK_RESPONSE_CANCEL);
> GTK_WIDGET_SET_FLAGS (button5, GTK_CAN_DEFAULT);
>
> button6 = gtk_button_new_from_stock ("gtk-ok");
> gtk_widget_show (button6);
> gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button6, GTK_RESPONSE_OK);
> GTK_WIDGET_SET_FLAGS (button6, GTK_CAN_DEFAULT);
>
> /* show dialog */
> button = gtk_dialog_run (GTK_DIALOG (dialog));
>
>
> switch (button) {
> case GTK_RESPONSE_OK:
> sel_menu_item = gtk_menu_get_active(GTK_MENU(menu));
>
> result = (struct MlViewViewDesc *)g_object_get_data (G_OBJECT(sel_menu_item), "mlview_view_desc");
> break;
>
> default:
> result = NULL ;
> break;
> }
> gtk_widget_destroy (dialog);
> return result;
> }
>
784c871
<
---
>
799a887,889
>
> view_descriptor = mlview_editor_sel_view_to_open ();
>
807,808c897,898
< result = MLVIEW_IVIEW (view_descriptor->view_constructor
< (a_xml_doc, NULL,
---
> result = MLVIEW_IVIEW (view_descriptor->view_constructor
> (a_xml_doc, NULL,
811c901,902
< return result;
---
> return result;
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]