[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: x_fileselect.c



  User: ahvezda 
  Date: 06/09/05 23:15:45

  Modified:    .        x_fileselect.c x_window.c
  Log:
  Applied a bunch of patches from Peter Clifton fixing various annoying bugs.
  
  
  
  
  Revision  Changes    Path
  1.25      +30 -13    eda/geda/gaf/gschem/src/x_fileselect.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_fileselect.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_fileselect.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -b -r1.24 -r1.25
  --- x_fileselect.c	22 Aug 2006 03:01:21 -0000	1.24
  +++ x_fileselect.c	6 Sep 2006 03:15:45 -0000	1.25
  @@ -728,6 +728,7 @@
   
       /* do nothing if SAVEAS_NONE */
     } else {
  +    x_fileselect_close (NULL, f_current);
       s_log_message(_("Specify a Filename!\n"));
     }
     if (string != NULL) {
  @@ -2331,6 +2332,7 @@
   						   
       } else if ( (filesel_type == SAVEAS) || (filesel_type == SAVEAS_CLOSE) ){
         title = g_strdup(_("Save As..."));
  +      if ( filesel_type == SAVEAS_CLOSE ) {
         f_current->xfwindow = gtk_file_chooser_dialog_new (title, 
   							 GTK_WINDOW(w_current->main_window),
   							 GTK_FILE_CHOOSER_ACTION_SAVE,
  @@ -2341,6 +2343,16 @@
   							 _("Discard changes"),
   							 GTK_RESPONSE_REJECT,
   							 NULL);	     
  +      } else {
  +        f_current->xfwindow = gtk_file_chooser_dialog_new (title, 
  +  							 GTK_WINDOW(w_current->main_window),
  +  							 GTK_FILE_CHOOSER_ACTION_SAVE,
  +  							 GTK_STOCK_SAVE_AS, 
  +  							 GTK_RESPONSE_ACCEPT,
  +  							 GTK_STOCK_CANCEL, 
  +  							 GTK_RESPONSE_CANCEL,
  +  							 NULL);
  +      }
         gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(f_current->xfwindow), 
   				  sch_filefilter);
         gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(f_current->xfwindow), 
  @@ -2367,9 +2379,6 @@
   	    g_free (filename);
   	  }
   	  break;
  -        case GTK_RESPONSE_CANCEL:
  -	  x_fileselect_close (NULL, f_current);
  -	  break;
   	  
           case GTK_RESPONSE_REJECT:
   	  x_fileselect_close (NULL, f_current);
  @@ -2378,6 +2387,14 @@
   	  w_current->page_current->CHANGED = 0;
   	  i_callback_page_close (w_current, 0, NULL);
   	  break;
  +
  +          /* Catch any cancel, and any mechanisms which close the dialog, 
  +           * e.g. "Escape" key which returns GTK_RESPONSE_DELETE_EVENT */
  +        case GTK_RESPONSE_CANCEL:
  +        case GTK_RESPONSE_DELETE_EVENT:
  +        default:
  +          x_fileselect_close (NULL, f_current);
  +          break;
         }
   
         g_free (title);
  
  
  
  1.38      +3 -1      eda/geda/gaf/gschem/src/x_window.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_window.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_window.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -b -r1.37 -r1.38
  --- x_window.c	4 Sep 2006 16:51:57 -0000	1.37
  +++ x_window.c	6 Sep 2006 03:15:45 -0000	1.38
  @@ -335,6 +335,8 @@
   
     gtk_box_pack_start (GTK_BOX (drawbox), w_current->drawing_area,
                         TRUE, TRUE, 0);
  +  GTK_WIDGET_SET_FLAGS (w_current->drawing_area, GTK_CAN_FOCUS );
  +  gtk_widget_grab_focus (w_current->drawing_area);
     gtk_widget_show (w_current->drawing_area);
   
   }
  @@ -357,10 +359,10 @@
       { "button_release_event", G_CALLBACK(x_event_button_released) },
       { "motion_notify_event",  G_CALLBACK(x_event_motion)          },
       { "configure_event",      G_CALLBACK(x_event_configure)       },
  +    { "key_press_event",      G_CALLBACK(x_event_key_press)       },
       { NULL,                   NULL                                } };
     struct event_reg_t main_window_events[] = {
       { "enter_notify_event",   G_CALLBACK(x_event_enter)           },
  -    { "key_press_event",      G_CALLBACK(x_event_key_press)       },
       { "scroll_event",         G_CALLBACK(x_event_scroll)          },
       { NULL,                   NULL                                } };
     struct event_reg_t *tmp;
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs