Re: Control Center



On Sun, Dec 13, 1998 at 10:08:17PM -0500, Gleef scribbled:
> 
> Sounds useful to me.  Unfortunately, the only attachment I saw with your
> email was your pgp signature.  There was no diff file there :-(.
> 
> Best of Luck,
> -Gleef
> 

  !!!!!!!!!!!!!!!!!!!!!!!!!!!

  I sent the diff file to someone instead of to the list at first (incidentally,
thanks for letting me know!) and it looks like now I didn't send it to the list
at all!!  Here it is.

-- 
  Daniel Burrows

"I think that the surest sign that there is intelligent
 life out there is that none of it has tried to contact us."

  -- _Calvin and Hobbes_, Bill Watterson
Index: callbacks.c
===================================================================
RCS file: /cvs/gnome/control-center/control-center/callbacks.c,v
retrieving revision 1.7
diff -c -r1.7 callbacks.c
*** callbacks.c	1998/11/21 22:38:47	1.7
--- callbacks.c	1998/12/13 23:12:07
***************
*** 13,18 ****
--- 13,19 ----
  extern GtkWidget *notebook;
  extern GtkWidget *create_exit_dialog();
  extern GList *capplet_list;
+ extern CORBA_Environment ev;
  
  /* this is meant to be called with a foreach to make a list of all modified nodes. */
  void
***************
*** 85,88 ****
--- 86,129 ----
                  exit_dialog = NULL;
                  launch_capplet (data);
          }
+ }
+ 
+ void create_zaplist(node_data *data,GList **list)
+ 
+ {
+ 	*list=g_list_prepend(*list,data);
+ }
+ 
+ void execute_ok(node_data *data)
+ 
+ {
+ 	GNOME_capplet_ok(data->capplet,data->id,&ev);
+ 	close_capplet(data->socket,data);
+ }
+ 
+ void execute_cancel(node_data *data)
+ 
+ {
+ 	GNOME_capplet_cancel(data->capplet,data->id,&ev);
+ 	close_capplet(data->socket,data);
+ }
+ 
+ void ok_callback(GtkWidget *widget,gpointer data)
+ {
+ 	GList *zap_list=NULL;
+ 	g_list_foreach(capplet_list,create_zaplist,&zap_list);
+ 	g_list_foreach(zap_list,execute_ok,0);
+ 	gtk_widget_destroy(main_window);
+ 	control_center_corba_gtk_main_quit();
+ 	return;
+ }
+ 
+ void cancel_callback(GtkWidget *widget,gpointer data)
+ {
+ 	GList *zap_list=NULL;
+ 	g_list_foreach(capplet_list,create_zaplist,&zap_list);
+ 	g_list_foreach(zap_list,execute_cancel,0);
+ 	gtk_widget_destroy(main_window);
+ 	control_center_corba_gtk_main_quit();
+ 	return;
  }
Index: callbacks.h
===================================================================
RCS file: /cvs/gnome/control-center/control-center/callbacks.h,v
retrieving revision 1.4
diff -c -r1.4 callbacks.h
*** callbacks.h	1998/10/08 21:14:34	1.4
--- callbacks.h	1998/12/13 23:12:07
***************
*** 20,25 ****
--- 20,30 ----
  void help_callback(GtkWidget *widget, gpointer data);
  void about_callback(GtkWidget *widget, gpointer data);
  
+ /* button callbacks */
+ 
+ void ok_callback(GtkWidget *widget,gpointer data);
+ void cancel_callback(GtkWidget *widget,gpointer data);
+ 
  #ifdef __cplusplus
  }
  #endif /* __cplusplus */
Index: capplet-manager.c
===================================================================
RCS file: /cvs/gnome/control-center/control-center/capplet-manager.c,v
retrieving revision 1.16
diff -c -r1.16 capplet-manager.c
*** capplet-manager.c	1998/12/01 21:00:10	1.16
--- capplet-manager.c	1998/12/13 23:12:07
***************
*** 29,36 ****
  /* prototypes */
  void try_button_callback(GtkWidget *widget, gpointer data);
  void revert_button_callback(GtkWidget *widget, gpointer data);
! void ok_button_callback(GtkWidget *widget, gpointer data);
! void cancel_button_callback(GtkWidget *widget, gpointer data);
  void help_button_callback(GtkWidget *widget, gpointer data);
  void close_capplet (GtkWidget *widget, gpointer data);
  static void exec_capplet (node_data *data);
--- 29,36 ----
  /* prototypes */
  void try_button_callback(GtkWidget *widget, gpointer data);
  void revert_button_callback(GtkWidget *widget, gpointer data);
! //void ok_button_callback(GtkWidget *widget, gpointer data);
! //void cancel_button_callback(GtkWidget *widget, gpointer data);
  void help_button_callback(GtkWidget *widget, gpointer data);
  void close_capplet (GtkWidget *widget, gpointer data);
  static void exec_capplet (node_data *data);
***************
*** 112,118 ****
          if ((data->id == -1) && (data->gde->exec_length)) {
                  if (notebook == NULL) {
                          notebook = gtk_notebook_new();
!                         gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), TRUE);
                          gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
                          gtk_widget_ref (splash_screen);
                          gtk_container_remove (GTK_CONTAINER (container), splash_screen);
--- 112,118 ----
          if ((data->id == -1) && (data->gde->exec_length)) {
                  if (notebook == NULL) {
                          notebook = gtk_notebook_new();
!                         gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
                          gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
                          gtk_widget_ref (splash_screen);
                          gtk_container_remove (GTK_CONTAINER (container), splash_screen);
***************
*** 140,153 ****
                  gtk_container_add (GTK_CONTAINER (bbox), data->revert_button);
                  gtk_signal_connect (GTK_OBJECT (data->revert_button), "clicked", GTK_SIGNAL_FUNC (revert_button_callback), data);
  
!                 data->ok_button = gtk_button_new_with_label ("OK");
                  gtk_widget_set_sensitive (data->ok_button, FALSE);
                  gtk_container_add (GTK_CONTAINER (bbox), data->ok_button);
                  gtk_signal_connect (GTK_OBJECT (data->ok_button), "clicked", GTK_SIGNAL_FUNC (ok_button_callback), data);
  
                  data->cancel_button = gtk_button_new_with_label ("Cancel");
                  gtk_container_add (GTK_CONTAINER (bbox), data->cancel_button);
!                 gtk_signal_connect (GTK_OBJECT (data->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_button_callback), data);
                  data->help_button = gtk_button_new_with_label ("Help");
                  gtk_container_add (GTK_CONTAINER (bbox), data->help_button);
                  gtk_signal_connect (GTK_OBJECT (data->help_button), "clicked", GTK_SIGNAL_FUNC (help_button_callback), data);
--- 140,153 ----
                  gtk_container_add (GTK_CONTAINER (bbox), data->revert_button);
                  gtk_signal_connect (GTK_OBJECT (data->revert_button), "clicked", GTK_SIGNAL_FUNC (revert_button_callback), data);
  
! /*                data->ok_button = gtk_button_new_with_label ("OK");
                  gtk_widget_set_sensitive (data->ok_button, FALSE);
                  gtk_container_add (GTK_CONTAINER (bbox), data->ok_button);
                  gtk_signal_connect (GTK_OBJECT (data->ok_button), "clicked", GTK_SIGNAL_FUNC (ok_button_callback), data);
  
                  data->cancel_button = gtk_button_new_with_label ("Cancel");
                  gtk_container_add (GTK_CONTAINER (bbox), data->cancel_button);
!                 gtk_signal_connect (GTK_OBJECT (data->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_button_callback), data); */
                  data->help_button = gtk_button_new_with_label ("Help");
                  gtk_container_add (GTK_CONTAINER (bbox), data->help_button);
                  gtk_signal_connect (GTK_OBJECT (data->help_button), "clicked", GTK_SIGNAL_FUNC (help_button_callback), data);
Index: capplet-manager.h
===================================================================
RCS file: /cvs/gnome/control-center/control-center/capplet-manager.h,v
retrieving revision 1.2
diff -c -r1.2 capplet-manager.h
*** capplet-manager.h	1998/10/08 21:14:35	1.2
--- capplet-manager.h	1998/12/13 23:12:07
***************
*** 14,19 ****
--- 14,20 ----
  #endif /* __cplusplus */
  
  void launch_capplet (node_data *data);
+ void close_capplet(GtkWidget *widget,gpointer data);
  node_data *find_node_by_id (gint id);
  #ifdef __cplusplus
  }
Index: corba-glue.c
===================================================================
RCS file: /cvs/gnome/control-center/control-center/corba-glue.c,v
retrieving revision 1.12
diff -c -r1.12 corba-glue.c
*** corba-glue.c	1998/12/11 02:07:05	1.12
--- corba-glue.c	1998/12/13 23:12:07
***************
*** 154,160 ****
          gtk_widget_set_sensitive (nd->try_button, TRUE);
          if (undoable)
                  gtk_widget_set_sensitive (nd->revert_button, TRUE);
-         gtk_widget_set_sensitive (nd->ok_button, TRUE);
  
          style = gtk_widget_get_style (nd->label);
          
--- 154,159 ----
Index: main.c
===================================================================
RCS file: /cvs/gnome/control-center/control-center/main.c,v
retrieving revision 1.14
diff -c -r1.14 main.c
*** main.c	1998/12/11 02:07:07	1.14
--- main.c	1998/12/13 23:12:07
***************
*** 125,130 ****
--- 125,133 ----
          GtkWidget *tree;
          GdkPixmap *temp_splash;
          GtkWidget *sw;
+ 	GtkWidget *bbox;
+ 	GtkWidget *ok_button;
+ 	GtkWidget *cancel_button;
          
          /* create the app */
          retval = gnome_app_new ("control-center", "Control Center");
***************
*** 148,163 ****
          /*gdk_imlib_load_file_to_pixmap ("splash.png", &temp_splash, NULL);*/
          gtk_widget_set_usize (splash_screen, 300, 275);
          status_bar = gtk_statusbar_new();
  
          /* we put it all together... */
          gtk_container_add (GTK_CONTAINER (sw), tree);
          gtk_paned_add1 (GTK_PANED (hpane), sw);
          gtk_paned_add2 (GTK_PANED (hpane), container); 
          gtk_container_add (GTK_CONTAINER (container), splash_screen);
          gtk_box_pack_end (GTK_BOX (vbox), status_bar, FALSE, FALSE, 0);
          gtk_box_pack_end (GTK_BOX (vbox), hpane, TRUE, TRUE, 0);
          gnome_app_set_contents(GNOME_APP(retval), vbox);
!         
          /* and make everyting visible */
          gtk_widget_show_all (retval);
          /*gdk_window_set_back_pixmap (splash_screen->window, temp_splash, FALSE); */
--- 151,182 ----
          /*gdk_imlib_load_file_to_pixmap ("splash.png", &temp_splash, NULL);*/
          gtk_widget_set_usize (splash_screen, 300, 275);
          status_bar = gtk_statusbar_new();
+ 	
+ 	bbox=gtk_hbutton_box_new();
+ 	gtk_button_box_set_layout(GTK_BUTTON_BOX (bbox),GTK_BUTTONBOX_SPREAD);
+ 	gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox),5);
+ 	gtk_button_box_set_child_size(GTK_BUTTON_BOX(bbox),5,-1);
+ 	gtk_container_set_border_width(GTK_CONTAINER(bbox),5);
+ 	ok_button=gnome_stock_button(GNOME_STOCK_BUTTON_OK);
+ 	cancel_button=gnome_stock_button(GNOME_STOCK_BUTTON_CANCEL);
  
+ 	gtk_signal_connect(GTK_OBJECT(ok_button),"clicked",GTK_SIGNAL_FUNC(ok_callback),0);
+ 	gtk_signal_connect(GTK_OBJECT(cancel_button),"clicked",GTK_SIGNAL_FUNC(cancel_callback),0);
+ 
          /* we put it all together... */
          gtk_container_add (GTK_CONTAINER (sw), tree);
          gtk_paned_add1 (GTK_PANED (hpane), sw);
          gtk_paned_add2 (GTK_PANED (hpane), container); 
          gtk_container_add (GTK_CONTAINER (container), splash_screen);
+ 	
+ 	gtk_container_add(GTK_CONTAINER(bbox),ok_button);
+ 	gtk_container_add(GTK_CONTAINER(bbox),cancel_button);
+ 
          gtk_box_pack_end (GTK_BOX (vbox), status_bar, FALSE, FALSE, 0);
+ 	gtk_box_pack_end(GTK_BOX(vbox),bbox,TRUE,FALSE,0);
          gtk_box_pack_end (GTK_BOX (vbox), hpane, TRUE, TRUE, 0);
          gnome_app_set_contents(GNOME_APP(retval), vbox);
! 	
          /* and make everyting visible */
          gtk_widget_show_all (retval);
          /*gdk_window_set_back_pixmap (splash_screen->window, temp_splash, FALSE); */
Index: tree.h
===================================================================
RCS file: /cvs/gnome/control-center/control-center/tree.h,v
retrieving revision 1.6
diff -c -r1.6 tree.h
*** tree.h	1998/10/08 21:14:38	1.6
--- tree.h	1998/12/13 23:12:07
***************
*** 33,40 ****
          gboolean modified;
          GtkWidget *try_button;
          GtkWidget *revert_button;
-         GtkWidget *ok_button;
-         GtkWidget *cancel_button;
          GtkWidget *help_button;
  };
  
--- 33,38 ----

PGP signature



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