From: Jacob V. <jv...@do...> - 2002-12-22 05:31:47
|
I know this sounds like a realy stupid question, but im a newbie.... What is the diff command to apply this patch Thanks Jacob Visser On Sun, 2002-12-22 at 15:24, cmr wrote: > The attached patch, against current CVS, implements an option to not > create the away message box. Myself and others find this box annoying > and it really serves no purpose (when away message queuing is turned > off). I also think it's bad UI. > > Even though I despise the box, I did make it an option in Away > preferences. Since the away message queue is dependent on the away box, > its option is correctly grayed-out and disabled when the away message > box is not displayed. > > I tested this with various combinations of all the other options. > Everything seems to work perfectly. > > Please apply. > > Chris Rivera > > > ---- > > diff -ur gaim-cvs/src/away.c gaim/src/away.c > --- gaim-cvs/src/away.c 2002-12-18 00:41:37.000000000 -0500 > +++ gaim/src/away.c 2002-12-21 21:38:08.000000000 -0500 > @@ -178,8 +174,14 @@ > > if (!a) > return; > - > - if (!imaway) { > + > + if (imaway) { > + destroy_im_away(); > + do_away_message(w, a); > + return; > + } > + > + if (away_options & OPT_AWAY_CREATE_BOX) { > GAIM_DIALOG(imaway); > gtk_window_set_role(GTK_WINDOW(imaway), "imaway"); > if (strlen(a->name)) > @@ -224,8 +226,6 @@ > gtk_container_add(GTK_CONTAINER(clistqueuesw), clistqueue); > gtk_signal_connect(GTK_OBJECT(clistqueue), "select_row", GTK_SIGNAL_FUNC(dequeue_by_buddy), NULL); > > - > - > if (away_options & OPT_AWAY_QUEUE) { > gtk_widget_show(clistqueuesw); > gtk_widget_show(clistqueue); > @@ -235,18 +235,12 @@ > gtk_box_pack_start(GTK_BOX(vbox), back, FALSE, FALSE, 0); > gtk_signal_connect(GTK_OBJECT(back), "clicked", GTK_SIGNAL_FUNC(do_im_back), imaway); > gtk_window_set_focus(GTK_WINDOW(imaway), back); > - > - awaymessage = a; > + gtk_widget_show(imaway); > > #ifdef _WIN32 > /* Register window widget with wgaim systray module */ > wgaim_created_backwin(imaway); > #endif > - > - } else { > - destroy_im_away(); > - do_away_message(w, a); > - return; > } > > /* New away message... Clear out the old sent_aways */ > @@ -256,7 +250,7 @@ > g_free(qar); > } > > - gtk_widget_show(imaway); > + awaymessage = a; > buf2 = g_malloc(strlen(awaymessage->message) * 4 + 1); > strncpy_withhtml(buf2, awaymessage->message, strlen(awaymessage->message) * 4 + 1); > serv_set_away_all(buf2); > @@ -349,6 +343,12 @@ > > remmenu = gtk_menu_new(); > > + menuitem = gtk_menu_item_new_with_label(_("Set Back")); > + gtk_menu_append(GTK_MENU(awaymenu), menuitem); > + gtk_widget_show(menuitem); > + gtk_signal_connect(GTK_OBJECT(menuitem), "activate", GTK_SIGNAL_FUNC(do_im_back), > + imaway); > + > menuitem = gtk_menu_item_new_with_label(_("New Away Message")); > gtk_menu_append(GTK_MENU(awaymenu), menuitem); > gtk_widget_show(menuitem); > diff -ur gaim-cvs/src/gaim.h gaim/src/gaim.h > --- gaim-cvs/src/gaim.h 2002-12-20 00:52:03.000000000 -0500 > +++ gaim/src/gaim.h 2002-12-20 02:51:10.000000000 -0500 > @@ -344,6 +344,7 @@ > #define OPT_AWAY_IDLE_RESP 0x00000040 > #define OPT_AWAY_QUEUE_UNREAD 0x00000080 > #define OPT_AWAY_DELAY_IN_USE 0x00000100 > +#define OPT_AWAY_CREATE_BOX 0x00000200 > > extern guint away_resend; > extern int report_idle; > diff -ur gaim-cvs/src/prefs.c gaim/src/prefs.c > --- gaim-cvs/src/prefs.c 2002-12-20 00:52:03.000000000 -0500 > +++ gaim/src/prefs.c 2002-12-21 22:07:40.000000000 -0500 > @@ -50,6 +50,7 @@ > GtkWidget *prefs_away_menu = NULL; > GtkWidget *preftree = NULL; > GtkWidget *fontseld = NULL; > +GtkWidget *queue_toggle = NULL; > > GtkListStore *prefs_away_store = NULL; > > @@ -727,10 +728,14 @@ > sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); > > vbox = make_frame (ret, _("Away")); > + gaim_button(_("_Create away message box"), &away_options, OPT_AWAY_CREATE_BOX, vbox); > gaim_button(_("_Sending messages removes away status"), &away_options, OPT_AWAY_BACK_ON_IM, vbox); > - gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); > + queue_toggle = gaim_button(_("_Queue new messages when away"), &away_options, OPT_AWAY_QUEUE, vbox); > gaim_button(_("_Ignore new conversations when away"), &away_options, OPT_AWAY_DISCARD, vbox); > > + if(!(away_options & OPT_AWAY_CREATE_BOX)) > + gtk_widget_set_sensitive(queue_toggle, FALSE); > + > vbox = make_frame (ret, _("Auto-response")); > hbox = gtk_hbox_new(FALSE, 0); > gtk_container_add(GTK_CONTAINER(vbox), hbox); > @@ -1722,12 +1727,23 @@ > update_font_buttons(); > } > > +static void toggle_away_box() > +{ > + if (away_options & OPT_AWAY_CREATE_BOX) > + gtk_widget_set_sensitive(queue_toggle, TRUE); > + else > + gtk_widget_set_sensitive(queue_toggle, FALSE); > +} > + > static void set_away_option(GtkWidget *w, int option) > { > away_options ^= option; > > if (option == OPT_AWAY_QUEUE) > toggle_away_queue(); > + > + if (option == OPT_AWAY_CREATE_BOX) > + toggle_away_box(); > } > > GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) |