[gq-commit] gq/src COPYING.h,1.6,1.7 Makefile.am,1.24,1.25 browse.c,1.67,1.68 common.h,1.21,1.22 dt_
Status: Beta
Brought to you by:
sur5r
From: <sta...@us...> - 2003-09-30 17:20:34
|
Update of /cvsroot/gqclient/gq/src In directory sc8-pr-cvs1:/tmp/cvs-serv11957/src Modified Files: COPYING.h Makefile.am browse.c common.h dt_jpeg.c dt_text.c dt_text.h dtutil.c dtutil.h filter.c input.c input.h mainwin.c mainwin.h prefs.c search.c util.c util.h Log Message: * Fixed many small bugs wrt gtk2, cleanups * Ported the dt_text to gtk2 and GtkTextView * Added keyboard mnemonics in a-great-many-places. Needs to be fixed so that for gtk 1.2 those underlines do not show up * Fixed the Filter Window * Almost fixed the License Window (but not quite) * Changed COPYING.h and introduced COPYING.c (autogenerated). COPYING.c gets built from the top-level COPYING file. Index: COPYING.h =================================================================== RCS file: /cvsroot/gqclient/gq/src/COPYING.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** COPYING.h 29 Sep 2003 19:24:14 -0000 1.6 --- COPYING.h 30 Sep 2003 17:20:25 -0000 1.7 *************** *** 1,350 **** ! char *license = "\n\ ! GQ -- a GTK-based LDAP client\n\ ! Copyright (C) 1998-2003 Bert Vermeulen\n\ ! Parts: Copyright (C) 2002-2003 Peter Stamfest and Bert Vermeulen\n\ ! \n\ ! This program is released under the Gnu General Public License with\n\ ! the additional exemption that compiling, linking, and/or using\n\ ! OpenSSL is allowed.\n\ ! \n\ ! GNU GENERAL PUBLIC LICENSE\n\ ! Version 2, June 1991\n\ ! \n\ ! Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n\ ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\ ! Everyone is permitted to copy and distribute verbatim copies\n\ ! of this license document, but changing it is not allowed.\n\ ! \n\ ! Preamble\n\ ! \n\ ! The licenses for most software are designed to take away your\n\ ! freedom to share and change it. By contrast, the GNU General Public\n\ ! License is intended to guarantee your freedom to share and change free\n\ ! software--to make sure the software is free for all its users. This\n\ ! General Public License applies to most of the Free Software\n\ ! Foundation's software and to any other program whose authors commit to\n\ ! using it. (Some other Free Software Foundation software is covered by\n\ ! the GNU Library General Public License instead.) You can apply it to\n\ ! your programs, too.\n\ ! \n\ ! When we speak of free software, we are referring to freedom, not\n\ ! price. Our General Public Licenses are designed to make sure that you\n\ ! have the freedom to distribute copies of free software (and charge for\n\ ! this service if you wish), that you receive source code or can get it\n\ ! if you want it, that you can change the software or use pieces of it\n\ ! in new free programs; and that you know you can do these things.\n\ ! \n\ ! To protect your rights, we need to make restrictions that forbid\n\ ! anyone to deny you these rights or to ask you to surrender the rights.\n\ ! These restrictions translate to certain responsibilities for you if you\n\ ! distribute copies of the software, or if you modify it.\n\ ! \n\ ! For example, if you distribute copies of such a program, whether\n\ ! gratis or for a fee, you must give the recipients all the rights that\n\ ! you have. You must make sure that they, too, receive or can get the\n\ ! source code. And you must show them these terms so they know their\n\ ! rights.\n\ ! \n\ ! We protect your rights with two steps: (1) copyright the software, and\n\ ! (2) offer you this license which gives you legal permission to copy,\n\ ! distribute and/or modify the software.\n\ ! \n\ ! Also, for each author's protection and ours, we want to make certain\n\ ! that everyone understands that there is no warranty for this free\n\ ! software. If the software is modified by someone else and passed on, we\n\ ! want its recipients to know that what they have is not the original, so\n\ ! that any problems introduced by others will not reflect on the original\n\ ! authors' reputations.\n\ ! \n\ ! Finally, any free program is threatened constantly by software\n\ ! patents. We wish to avoid the danger that redistributors of a free\n\ ! program will individually obtain patent licenses, in effect making the\n\ ! program proprietary. To prevent this, we have made it clear that any\n\ ! patent must be licensed for everyone's free use or not licensed at all.\n\ ! \n\ ! The precise terms and conditions for copying, distribution and\n\ ! modification follow.\n\ ! \n\ ! GNU GENERAL PUBLIC LICENSE\n\ ! TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\ ! \n\ ! 0. This License applies to any program or other work which contains\n\ ! a notice placed by the copyright holder saying it may be distributed\n\ ! under the terms of this General Public License. The \"Program\", below,\n\ ! refers to any such program or work, and a \"work based on the Program\"\n\ ! means either the Program or any derivative work under copyright law:\n\ ! that is to say, a work containing the Program or a portion of it,\n\ ! either verbatim or with modifications and/or translated into another\n\ ! language. (Hereinafter, translation is included without limitation in\n\ ! the term \"modification\".) Each licensee is addressed as \"you\".\n\ ! \n\ ! Activities other than copying, distribution and modification are not\n\ ! covered by this License; they are outside its scope. The act of\n\ ! running the Program is not restricted, and the output from the Program\n\ ! is covered only if its contents constitute a work based on the\n\ ! Program (independent of having been made by running the Program).\n\ ! Whether that is true depends on what the Program does.\n\ ! \n\ ! 1. You may copy and distribute verbatim copies of the Program's\n\ ! source code as you receive it, in any medium, provided that you\n\ ! conspicuously and appropriately publish on each copy an appropriate\n\ ! copyright notice and disclaimer of warranty; keep intact all the\n\ ! notices that refer to this License and to the absence of any warranty;\n\ ! and give any other recipients of the Program a copy of this License\n\ ! along with the Program.\n\ ! \n\ ! You may charge a fee for the physical act of transferring a copy, and\n\ ! you may at your option offer warranty protection in exchange for a fee.\n\ ! \n\ ! 2. You may modify your copy or copies of the Program or any portion\n\ ! of it, thus forming a work based on the Program, and copy and\n\ ! distribute such modifications or work under the terms of Section 1\n\ ! above, provided that you also meet all of these conditions:\n\ ! \n\ ! a) You must cause the modified files to carry prominent notices\n\ ! stating that you changed the files and the date of any change.\n\ ! \n\ ! b) You must cause any work that you distribute or publish, that in\n\ ! whole or in part contains or is derived from the Program or any\n\ ! part thereof, to be licensed as a whole at no charge to all third\n\ ! parties under the terms of this License.\n\ ! \n\ ! c) If the modified program normally reads commands interactively\n\ ! when run, you must cause it, when started running for such\n\ ! interactive use in the most ordinary way, to print or display an\n\ ! announcement including an appropriate copyright notice and a\n\ ! notice that there is no warranty (or else, saying that you provide\n\ ! a warranty) and that users may redistribute the program under\n\ ! these conditions, and telling the user how to view a copy of this\n\ ! License. (Exception: if the Program itself is interactive but\n\ ! does not normally print such an announcement, your work based on\n\ ! the Program is not required to print an announcement.)\n\ ! \n\ ! These requirements apply to the modified work as a whole. If\n\ ! identifiable sections of that work are not derived from the Program,\n\ ! and can be reasonably considered independent and separate works in\n\ ! themselves, then this License, and its terms, do not apply to those\n\ ! sections when you distribute them as separate works. But when you\n\ ! distribute the same sections as part of a whole which is a work based\n\ ! on the Program, the distribution of the whole must be on the terms of\n\ ! this License, whose permissions for other licensees extend to the\n\ ! entire whole, and thus to each and every part regardless of who wrote it.\n\ ! \n\ ! Thus, it is not the intent of this section to claim rights or contest\n\ ! your rights to work written entirely by you; rather, the intent is to\n\ ! exercise the right to control the distribution of derivative or\n\ ! collective works based on the Program.\n\ ! \n\ ! In addition, mere aggregation of another work not based on the Program\n\ ! with the Program (or with a work based on the Program) on a volume of\n\ ! a storage or distribution medium does not bring the other work under\n\ ! the scope of this License.\n\ ! \n\ ! 3. You may copy and distribute the Program (or a work based on it,\n\ ! under Section 2) in object code or executable form under the terms of\n\ ! Sections 1 and 2 above provided that you also do one of the following:\n\ ! \n\ ! a) Accompany it with the complete corresponding machine-readable\n\ ! source code, which must be distributed under the terms of Sections\n\ ! 1 and 2 above on a medium customarily used for software interchange; or,\n\ ! \n\ ! b) Accompany it with a written offer, valid for at least three\n\ ! years, to give any third party, for a charge no more than your\n\ ! cost of physically performing source distribution, a complete\n\ ! machine-readable copy of the corresponding source code, to be\n\ ! distributed under the terms of Sections 1 and 2 above on a medium\n\ ! customarily used for software interchange; or,\n\ ! \n\ ! c) Accompany it with the information you received as to the offer\n\ ! to distribute corresponding source code. (This alternative is\n\ ! allowed only for noncommercial distribution and only if you\n\ ! received the program in object code or executable form with such\n\ ! an offer, in accord with Subsection b above.)\n\ ! \n\ ! The source code for a work means the preferred form of the work for\n\ ! making modifications to it. For an executable work, complete source\n\ ! code means all the source code for all modules it contains, plus any\n\ ! associated interface definition files, plus the scripts used to\n\ ! control compilation and installation of the executable. However, as a\n\ ! special exception, the source code distributed need not include\n\ ! anything that is normally distributed (in either source or binary\n\ ! form) with the major components (compiler, kernel, and so on) of the\n\ ! operating system on which the executable runs, unless that component\n\ ! itself accompanies the executable.\n\ ! \n\ ! If distribution of executable or object code is made by offering\n\ ! access to copy from a designated place, then offering equivalent\n\ ! access to copy the source code from the same place counts as\n\ ! distribution of the source code, even though third parties are not\n\ ! compelled to copy the source along with the object code.\n\ ! \n\ ! 4. You may not copy, modify, sublicense, or distribute the Program\n\ ! except as expressly provided under this License. Any attempt\n\ ! otherwise to copy, modify, sublicense or distribute the Program is\n\ ! void, and will automatically terminate your rights under this License.\n\ ! However, parties who have received copies, or rights, from you under\n\ ! this License will not have their licenses terminated so long as such\n\ ! parties remain in full compliance.\n\ ! \n\ ! 5. You are not required to accept this License, since you have not\n\ ! signed it. However, nothing else grants you permission to modify or\n\ ! distribute the Program or its derivative works. These actions are\n\ ! prohibited by law if you do not accept this License. Therefore, by\n\ ! modifying or distributing the Program (or any work based on the\n\ ! Program), you indicate your acceptance of this License to do so, and\n\ ! all its terms and conditions for copying, distributing or modifying\n\ ! the Program or works based on it.\n\ ! \n\ ! 6. Each time you redistribute the Program (or any work based on the\n\ ! Program), the recipient automatically receives a license from the\n\ ! original licensor to copy, distribute or modify the Program subject to\n\ ! these terms and conditions. You may not impose any further\n\ ! restrictions on the recipients' exercise of the rights granted herein.\n\ ! You are not responsible for enforcing compliance by third parties to\n\ ! this License.\n\ ! \n\ ! 7. If, as a consequence of a court judgment or allegation of patent\n\ ! infringement or for any other reason (not limited to patent issues),\n\ ! conditions are imposed on you (whether by court order, agreement or\n\ ! otherwise) that contradict the conditions of this License, they do not\n\ ! excuse you from the conditions of this License. If you cannot\n\ ! distribute so as to satisfy simultaneously your obligations under this\n\ ! License and any other pertinent obligations, then as a consequence you\n\ ! may not distribute the Program at all. For example, if a patent\n\ ! license would not permit royalty-free redistribution of the Program by\n\ ! all those who receive copies directly or indirectly through you, then\n\ ! the only way you could satisfy both it and this License would be to\n\ ! refrain entirely from distribution of the Program.\n\ ! \n\ ! If any portion of this section is held invalid or unenforceable under\n\ ! any particular circumstance, the balance of the section is intended to\n\ ! apply and the section as a whole is intended to apply in other\n\ ! circumstances.\n\ ! \n\ ! It is not the purpose of this section to induce you to infringe any\n\ ! patents or other property right claims or to contest validity of any\n\ ! such claims; this section has the sole purpose of protecting the\n\ ! integrity of the free software distribution system, which is\n\ ! implemented by public license practices. Many people have made\n\ ! generous contributions to the wide range of software distributed\n\ ! through that system in reliance on consistent application of that\n\ ! system; it is up to the author/donor to decide if he or she is willing\n\ ! to distribute software through any other system and a licensee cannot\n\ ! impose that choice.\n\ ! \n\ ! This section is intended to make thoroughly clear what is believed to\n\ ! be a consequence of the rest of this License.\n\ ! \n\ ! 8. If the distribution and/or use of the Program is restricted in\n\ ! certain countries either by patents or by copyrighted interfaces, the\n\ ! original copyright holder who places the Program under this License\n\ ! may add an explicit geographical distribution limitation excluding\n\ ! those countries, so that distribution is permitted only in or among\n\ ! countries not thus excluded. In such case, this License incorporates\n\ ! the limitation as if written in the body of this License.\n\ ! \n\ ! 9. The Free Software Foundation may publish revised and/or new versions\n\ ! of the General Public License from time to time. Such new versions will\n\ ! be similar in spirit to the present version, but may differ in detail to\n\ ! address new problems or concerns.\n\ ! \n\ ! Each version is given a distinguishing version number. If the Program\n\ ! specifies a version number of this License which applies to it and \"any\n\ ! later version\", you have the option of following the terms and conditions\n\ ! either of that version or of any later version published by the Free\n\ ! Software Foundation. If the Program does not specify a version number of\n\ ! this License, you may choose any version ever published by the Free Software\n\ ! Foundation.\n\ ! \n\ ! 10. If you wish to incorporate parts of the Program into other free\n\ ! programs whose distribution conditions are different, write to the author\n\ ! to ask for permission. For software which is copyrighted by the Free\n\ ! Software Foundation, write to the Free Software Foundation; we sometimes\n\ ! make exceptions for this. Our decision will be guided by the two goals\n\ ! of preserving the free status of all derivatives of our free software and\n\ ! of promoting the sharing and reuse of software generally.\n\ ! \n\ ! NO WARRANTY\n\ ! \n\ ! 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n\ ! FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n\ ! OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n\ ! PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n\ ! OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n\ ! MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n\ ! TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n\ ! PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n\ ! REPAIR OR CORRECTION.\n\ ! \n\ ! 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n\ ! WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n\ ! REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n\ ! INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n\ ! OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n\ ! TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n\ ! YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n\ ! PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n\ ! POSSIBILITY OF SUCH DAMAGES.\n\ ! \n\ ! END OF TERMS AND CONDITIONS\n\ ! \n\ ! How to Apply These Terms to Your New Programs\n\ ! \n\ ! If you develop a new program, and you want it to be of the greatest\n\ ! possible use to the public, the best way to achieve this is to make it\n\ ! free software which everyone can redistribute and change under these terms.\n\ ! \n\ ! To do so, attach the following notices to the program. It is safest\n\ ! to attach them to the start of each source file to most effectively\n\ ! convey the exclusion of warranty; and each file should have at least\n\ ! the \"copyright\" line and a pointer to where the full notice is found.\n\ ! \n\ ! <one line to give the program's name and a brief idea of what it does.>\n\ ! Copyright (C) 19yy <name of author>\n\ ! \n\ ! This program is free software; you can redistribute it and/or modify\n\ ! it under the terms of the GNU General Public License as published by\n\ ! the Free Software Foundation; either version 2 of the License, or\n\ ! (at your option) any later version.\n\ ! \n\ ! This program is distributed in the hope that it will be useful,\n\ ! but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ ! GNU General Public License for more details.\n\ ! \n\ ! You should have received a copy of the GNU General Public License\n\ ! along with this program; if not, write to the Free Software\n\ ! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\ ! \n\ ! \n\ ! Also add information on how to contact you by electronic and paper mail.\n\ ! \n\ ! If the program is interactive, make it output a short notice like this\n\ ! when it starts in an interactive mode:\n\ ! \n\ ! Gnomovision version 69, Copyright (C) 19yy name of author\n\ ! Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n\ ! This is free software, and you are welcome to redistribute it\n\ ! under certain conditions; type `show c' for details.\n\ ! \n\ ! The hypothetical commands `show w' and `show c' should show the appropriate\n\ ! parts of the General Public License. Of course, the commands you use may\n\ ! be called something other than `show w' and `show c'; they could even be\n\ ! mouse-clicks or menu items--whatever suits your program.\n\ ! \n\ ! You should also get your employer (if you work as a programmer) or your\n\ ! school, if any, to sign a \"copyright disclaimer\" for the program, if\n\ ! necessary. Here is a sample; alter the names:\n\ ! \n\ ! Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n\ ! `Gnomovision' (which makes passes at compilers) written by James Hacker.\n\ ! \n\ ! <signature of Ty Coon>, 1 April 1989\n\ ! Ty Coon, President of Vice\n\ ! \n\ ! This General Public License does not permit incorporating your program into\n\ ! proprietary programs. If your program is a subroutine library, you may\n\ ! consider it more useful to permit linking proprietary applications with the\n\ ! library. If this is what you want to do, use the GNU Library General\n\ ! Public License instead of this License.\n\ ! "; --- 1,32 ---- ! /* ! GQ -- a GTK-based LDAP client ! Copyright (C) 1998-2003 Bert Vermeulen ! Copyright (C) 2002-2003 by Peter Stamfest ! ! This program is released under the Gnu General Public License with ! the additional exemption that compiling, linking, and/or using ! OpenSSL is allowed. ! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /* $Id$ */ ! ! #ifndef DT_COPYING_H_INCLUDED ! #define DT_COPYING_H_INCLUDED ! ! extern const char *license; ! ! #endif /* DT_COPYING_H_INCLUDED */ Index: Makefile.am =================================================================== RCS file: /cvsroot/gqclient/gq/src/Makefile.am,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Makefile.am 29 Sep 2003 19:24:15 -0000 1.24 --- Makefile.am 30 Sep 2003 17:20:25 -0000 1.25 *************** *** 42,45 **** --- 42,47 ---- i18n.c + gq_LDADD = COPYING.o + noinst_HEADERS = \ mainwin.h \ *************** *** 100,102 **** test-clean: ! rm -f TEST-*.c TEST-*.o \ No newline at end of file --- 102,109 ---- test-clean: ! rm -f TEST-*.c TEST-*.o ! ! COPYING.c: $(top_srcdir)/COPYING ! ( echo "const char *license =" ; \ ! sed -e 's/\(["\\]\)/\\\1/g' -e 's/^/ "/' -e 's/$$/\\n"/' < $< ;\ ! echo ";" ) > $@ Index: browse.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/browse.c,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** browse.c 29 Sep 2003 19:24:15 -0000 1.67 --- browse.c 30 Sep 2003 17:20:25 -0000 1.68 *************** *** 1017,1022 **** --- 1017,1027 ---- /* avoid recursive calls to this handler - this causes crashes!!! */ if (gtk_object_get_data(GTK_OBJECT(ctree), "in-tree_row_selected")) { + #if GTK_MAJOR >= 2 g_signal_stop_emission_by_name(GTK_OBJECT(ctree), "tree-select-row"); + #else + gtk_signal_emit_stop_by_name(GTK_OBJECT(ctree), + "tree-select-row"); + #endif return; } *************** *** 1219,1223 **** GTK_POLICY_AUTOMATIC); gtk_widget_show(pane1_scrwin); ! gtk_widget_set_usize(pane1_scrwin, 300, -1); gtk_paned_set_position(GTK_PANED(mainpane), 300); gtk_paned_add1(GTK_PANED(mainpane), pane1_scrwin); --- 1224,1230 ---- GTK_POLICY_AUTOMATIC); gtk_widget_show(pane1_scrwin); ! #if GTK_MAJOR < 2 ! gtk_widget_set_usize(pane1_scrwin, 300, -1); /* FIXME: needed in gtk 1.2? */ ! #endif gtk_paned_set_position(GTK_PANED(mainpane), 300); gtk_paned_add1(GTK_PANED(mainpane), pane1_scrwin); Index: common.h =================================================================== RCS file: /cvsroot/gqclient/gq/src/common.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** common.h 28 Sep 2003 23:39:18 -0000 1.21 --- common.h 30 Sep 2003 17:20:25 -0000 1.22 *************** *** 56,60 **** #define LDIF_V1 1 - struct server_schema { GList *oc; --- 56,59 ---- Index: dt_jpeg.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/dt_jpeg.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dt_jpeg.c 29 Sep 2003 19:24:16 -0000 1.9 --- dt_jpeg.c 30 Sep 2003 17:20:25 -0000 1.10 *************** *** 131,140 **** GdkBitmap *mask; - GdkPixbufLoader* loader; GByteArray *copy; ! GError *error = NULL; - loader = gdk_pixbuf_loader_new(); #if GTK_MAJOR >= 2 gdk_pixbuf_loader_write(loader, data->data, data->len, &error); /* FIXME - error handling */ if (!error) gdk_pixbuf_loader_close(loader, &error); --- 131,140 ---- GdkBitmap *mask; GByteArray *copy; ! GdkPixbufLoader* loader = gdk_pixbuf_loader_new(); #if GTK_MAJOR >= 2 + GError *error = NULL; + gdk_pixbuf_loader_write(loader, data->data, data->len, &error); /* FIXME - error handling */ if (!error) gdk_pixbuf_loader_close(loader, &error); Index: dt_text.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/dt_text.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dt_text.c 29 Sep 2003 19:24:16 -0000 1.9 --- dt_text.c 30 Sep 2003 17:20:25 -0000 1.10 *************** *** 51,60 **** --- 51,71 ---- #include "dt_text.h" + #if GTK_MAJOR >= 2 + static GByteArray *dt_text_get_data(struct formfill *form, GtkWidget *widget); + static void dt_text_set_data(struct formfill *form, GByteArray *data, + GtkWidget *widget); + #endif + static dt_text_handler dt_text_handler_vtab = { { "Multi-line Text", TRUE, dt_text_get_widget, + #if GTK_MAJOR >= 2 + dt_text_get_data, + dt_text_set_data, + #else dt_entry_get_data, /* reuse method from dt_entry */ dt_entry_set_data, + #endif bervalLDAPMod /* reuse method from dt_entry */ }, *************** *** 74,109 **** #if GTK_MAJOR >= 2 ! inputbox = gtk_entry_new(); ! gtk_entry_set_editable(GTK_ENTRY(inputbox), TRUE); ! #warning "GTK2 support does not allow for multiline text right now" #else inputbox = gtk_text_new(NULL, NULL); gtk_text_set_editable(GTK_TEXT(inputbox), TRUE); - #endif - dt_entry_set_data(form, data, inputbox); return inputbox; } ! #if 0 ! void dt_text_set_data(struct formfill *form, GByteArray *data, ! GtkWidget *widget) { ! gtk_text_freeze(GTK_TEXT(widget)); ! gtk_text_set_point(GTK_TEXT(widget), 0); ! gtk_text_forward_delete(GTK_TEXT(widget), ! gtk_text_get_length(GTK_TEXT(widget))); ! if(data) { ! GByteArray *encoded = DT_TEXT(form->dt_handler)->encode(data->data, data->len); ! ! gtk_text_set_point(GTK_TEXT(widget), 0); ! gtk_text_insert(GTK_TEXT(widget), NULL, NULL, NULL, ! encoded->data, -1); ! ! g_byte_array_free(encoded, TRUE); ! } ! gtk_text_thaw(GTK_TEXT(widget)); } #endif --- 85,146 ---- #if GTK_MAJOR >= 2 ! GtkWidget *scrolled; ! ! inputbox = gtk_text_view_new(); ! gtk_widget_show(inputbox); ! ! scrolled = gtk_scrolled_window_new(NULL, NULL); ! gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), ! GTK_POLICY_AUTOMATIC, ! GTK_POLICY_AUTOMATIC); ! gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), ! GTK_SHADOW_IN); ! gtk_container_add(GTK_CONTAINER(scrolled), inputbox); ! gtk_widget_show(scrolled); ! ! dt_text_set_data(form, data, scrolled); ! ! return scrolled; #else inputbox = gtk_text_new(NULL, NULL); gtk_text_set_editable(GTK_TEXT(inputbox), TRUE); dt_entry_set_data(form, data, inputbox); return inputbox; + #endif } ! ! #if GTK_MAJOR >= 2 ! ! static GByteArray *dt_text_get_data(struct formfill *form, GtkWidget *widget) { ! GtkWidget *text = gtk_bin_get_child(GTK_BIN(widget)); ! GtkTextBuffer *b = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)); ! GtkTextIter s, e; ! gchar *c; ! GByteArray *a = NULL; ! ! gtk_text_buffer_get_start_iter(b, &s); ! gtk_text_buffer_get_end_iter(b, &e); ! c = gtk_text_buffer_get_text(b, &s, &e, TRUE); ! ! if (!c) return NULL; ! ! a = g_byte_array_new(); ! g_byte_array_append(a, c, strlen(c)); ! g_free(c); ! ! return a; ! } ! ! static void dt_text_set_data(struct formfill *form, GByteArray *data, ! GtkWidget *widget) ! { ! GtkWidget *text = gtk_bin_get_child(GTK_BIN(widget)); ! GtkTextBuffer *b = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)); ! gtk_text_buffer_set_text(b, (gchar*) data->data, data->len); } + #endif Index: dt_text.h =================================================================== RCS file: /cvsroot/gqclient/gq/src/dt_text.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dt_text.h 28 Sep 2003 03:26:25 -0000 1.5 --- dt_text.h 30 Sep 2003 17:20:25 -0000 1.6 *************** *** 41,46 **** GtkSignalFunc *activatefunc, gpointer funcdata); - void dt_text_set_data(struct formfill *form, GByteArray *data, - GtkWidget *widget); #endif --- 41,44 ---- Index: dtutil.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/dtutil.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dtutil.c 13 Jul 2002 09:13:34 -0000 1.3 --- dtutil.c 30 Sep 2003 17:20:25 -0000 1.4 *************** *** 34,41 **** #include "dtutil.h" ! void editable_changed_cb(GtkEditable *editable, gpointer user_data) { ! gtk_object_set_data(GTK_OBJECT(editable), "editable_changed_flag", GINT_TO_POINTER(1)); } --- 34,41 ---- #include "dtutil.h" ! void editable_changed_cb(GtkWidget *object, gpointer user_data) { ! gtk_object_set_data(GTK_OBJECT(object), "editable_changed_flag", GINT_TO_POINTER(1)); } Index: dtutil.h =================================================================== RCS file: /cvsroot/gqclient/gq/src/dtutil.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dtutil.h 12 Jul 2002 20:18:59 -0000 1.1 --- dtutil.h 30 Sep 2003 17:20:25 -0000 1.2 *************** *** 33,37 **** #include "config.h" ! void editable_changed_cb(GtkEditable *editable, gpointer user_data); void editable_set_text(GtkEditable *entry, GByteArray *data, GByteArray* (*encode)(const char *val, int len), --- 33,37 ---- #include "config.h" ! void editable_changed_cb(GtkWidget *object, gpointer user_data); void editable_set_text(GtkEditable *entry, GByteArray *data, GByteArray* (*encode)(const char *val, int len), Index: filter.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/filter.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** filter.c 29 Sep 2003 19:24:16 -0000 1.16 --- filter.c 30 Sep 2003 17:20:25 -0000 1.17 *************** *** 48,51 **** --- 48,52 ---- #include "debug.h" #include "i18n.h" + #include "input.h" *************** *** 178,182 **** window = gtk_dialog_new(); ! gtk_container_border_width(GTK_CONTAINER(window), 12); gtk_window_set_title(GTK_WINDOW(window), _("Filter name")); gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE); --- 179,183 ---- window = gtk_dialog_new(); ! gtk_container_border_width(GTK_CONTAINER(window), CONTAINER_BORDER_WIDTH); gtk_window_set_title(GTK_WINDOW(window), _("Filter name")); gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE); *************** *** 194,198 **** gtk_widget_show(vbox1); ! label = gtk_label_new(_("Filter name")); gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_widget_show(label); --- 195,199 ---- gtk_widget_show(vbox1); ! label = gq_label_new(_("Filter _name")); gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_widget_show(label); *************** *** 208,214 **** /* Save server and base DN */ ! button = gtk_check_button_new_with_label(_("Remember server and base DN")); gtk_object_set_data(GTK_OBJECT(filternamebox), "saveserver", button); GTK_WIDGET_UNSET_FLAGS(GTK_CHECK_BUTTON(button), GTK_CAN_FOCUS); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(vbox1), button, FALSE, TRUE, 10); --- 209,217 ---- /* Save server and base DN */ ! button = gq_check_button_new_with_label(_("Remember server and base DN")); gtk_object_set_data(GTK_OBJECT(filternamebox), "saveserver", button); + #ifdef OLD_FOCUS_HANDLING GTK_WIDGET_UNSET_FLAGS(GTK_CHECK_BUTTON(button), GTK_CAN_FOCUS); + #endif gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(vbox1), button, FALSE, TRUE, 10); *************** *** 288,292 **** window = gtk_window_new(GTK_WINDOW_TOPLEVEL); ! gtk_container_border_width(GTK_CONTAINER(window), 12); gtk_window_set_title(GTK_WINDOW(window), _("Filters")); gtk_window_set_default_size(GTK_WINDOW(window), 670, 350); --- 291,295 ---- window = gtk_window_new(GTK_WINDOW_TOPLEVEL); ! gtk_container_border_width(GTK_CONTAINER(window), CONTAINER_BORDER_WIDTH); gtk_window_set_title(GTK_WINDOW(window), _("Filters")); gtk_window_set_default_size(GTK_WINDOW(window), 670, 350); *************** *** 312,328 **** gtk_box_pack_start(GTK_BOX(hbox0), hbox1, FALSE, FALSE, 0); ! new_button = gtk_button_new_with_label(_("New")); GTK_WIDGET_UNSET_FLAGS(new_button, GTK_CAN_DEFAULT); GTK_WIDGET_UNSET_FLAGS(new_button, GTK_CAN_FOCUS); gtk_widget_show(new_button); gtk_box_pack_start(GTK_BOX(hbox1), new_button, FALSE, FALSE, 0); ! delete_button = gtk_button_new_with_label(_("Delete")); GTK_WIDGET_UNSET_FLAGS(delete_button, GTK_CAN_DEFAULT); GTK_WIDGET_UNSET_FLAGS(delete_button, GTK_CAN_FOCUS); gtk_widget_show(delete_button); gtk_box_pack_start(GTK_BOX(hbox1), delete_button, FALSE, FALSE, 5); ! copy_button = gtk_button_new_with_label(_("Copy")); GTK_WIDGET_UNSET_FLAGS(copy_button, GTK_CAN_DEFAULT); GTK_WIDGET_UNSET_FLAGS(copy_button, GTK_CAN_FOCUS); --- 315,335 ---- gtk_box_pack_start(GTK_BOX(hbox0), hbox1, FALSE, FALSE, 0); ! new_button = gq_button_new_with_label(_("_New")); GTK_WIDGET_UNSET_FLAGS(new_button, GTK_CAN_DEFAULT); + #ifdef OLD_FOCUS_HANDLING GTK_WIDGET_UNSET_FLAGS(new_button, GTK_CAN_FOCUS); + #endif gtk_widget_show(new_button); gtk_box_pack_start(GTK_BOX(hbox1), new_button, FALSE, FALSE, 0); ! delete_button = gq_button_new_with_label(_("_Delete")); GTK_WIDGET_UNSET_FLAGS(delete_button, GTK_CAN_DEFAULT); + #ifdef OLD_FOCUS_HANDLING GTK_WIDGET_UNSET_FLAGS(delete_button, GTK_CAN_FOCUS); + #endif gtk_widget_show(delete_button); gtk_box_pack_start(GTK_BOX(hbox1), delete_button, FALSE, FALSE, 5); ! copy_button = gq_button_new_with_label(_("_Copy")); GTK_WIDGET_UNSET_FLAGS(copy_button, GTK_CAN_DEFAULT); GTK_WIDGET_UNSET_FLAGS(copy_button, GTK_CAN_FOCUS); *************** *** 503,506 **** --- 510,516 ---- void edit_filter(GtkCList *filter_clist, int is_new_filter, int row, struct gq_filter *filter) { + #if GTK_MAJOR >= 2 + GtkWidget *scrolled; + #endif GtkWidget *window, *vbox1, *hbox1, *hbox2, *label, *entry; GtkWidget *table1, *indent, *editbox, *save, *cancel; *************** *** 514,518 **** gtk_object_set_data(GTK_OBJECT(window), "filter_row", GINT_TO_POINTER(row)); ! gtk_container_border_width(GTK_CONTAINER(window), 12); gtk_window_set_title(GTK_WINDOW(window), _("Edit filter")); --- 524,528 ---- gtk_object_set_data(GTK_OBJECT(window), "filter_row", GINT_TO_POINTER(row)); ! gtk_container_border_width(GTK_CONTAINER(window), CONTAINER_BORDER_WIDTH); gtk_window_set_title(GTK_WINDOW(window), _("Edit filter")); *************** *** 537,541 **** /* Filter name */ ! label = gtk_label_new(_("Filter name")); gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_widget_show(label); --- 547,551 ---- /* Filter name */ ! label = gq_label_new(_("Filter _name")); gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_widget_show(label); *************** *** 551,556 **** GTK_EXPAND | GTK_FILL, 0, 0, 0); /* Server */ ! label = gtk_label_new(_("Server")); gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_widget_show(label); --- 561,570 ---- GTK_EXPAND | GTK_FILL, 0, 0, 0); + #if GTK_MAJOR >= 2 + gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); + #endif + /* Server */ ! label = gq_label_new(_("_Server")); gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_widget_show(label); *************** *** 566,571 **** GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); /* Base DN */ ! label = gtk_label_new(_("Base DN")); gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_widget_show(label); --- 580,589 ---- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + #if GTK_MAJOR >= 2 + gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); + #endif + /* Base DN */ ! label = gq_label_new(_("_Base DN")); gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_widget_show(label); *************** *** 585,601 **** gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 0); ! indent = gtk_toggle_button_new_with_label(_(" Indent ")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(indent), TRUE); GTK_WIDGET_UNSET_FLAGS(indent, GTK_CAN_FOCUS); gtk_widget_show(indent); gtk_box_pack_start(GTK_BOX(hbox1), indent, FALSE, FALSE, 0); #if GTK_MAJOR >= 2 editbox = gtk_text_view_new(); gtk_object_set_data(GTK_OBJECT(window), "editbox", editbox); gtk_text_view_set_editable(GTK_TEXT_VIEW(editbox), TRUE); ! gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(editbox), GTK_WRAP_NONE); ! ! GTK_WIDGET_SET_FLAGS(editbox, GTK_CAN_FOCUS); /* populate editbox */ --- 603,632 ---- gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 0); ! indent = gq_toggle_button_new_with_label(_("_Indent")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(indent), TRUE); + #ifdef OLD_FOCUS_HANDLING GTK_WIDGET_UNSET_FLAGS(indent, GTK_CAN_FOCUS); + #endif gtk_widget_show(indent); gtk_box_pack_start(GTK_BOX(hbox1), indent, FALSE, FALSE, 0); #if GTK_MAJOR >= 2 + gtk_label_set_mnemonic_widget(GTK_LABEL(label), entry); + #endif + + #if GTK_MAJOR >= 2 + scrolled = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled), + GTK_SHADOW_IN); + editbox = gtk_text_view_new(); + gtk_container_add(GTK_CONTAINER(scrolled), editbox); + gtk_object_set_data(GTK_OBJECT(window), "editbox", editbox); gtk_text_view_set_editable(GTK_TEXT_VIEW(editbox), TRUE); ! gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(editbox), GTK_WRAP_CHAR); /* populate editbox */ *************** *** 609,615 **** } ! /* gtk_text_set_point(GTK_TEXT(editbox), 0); */ /* FIXME */ #else editbox = gtk_text_new(NULL, NULL); gtk_object_set_data(GTK_OBJECT(window), "editbox", editbox); gtk_text_set_editable(GTK_TEXT(editbox), TRUE); --- 640,649 ---- } ! gtk_box_pack_start(GTK_BOX(vbox1), scrolled, TRUE, TRUE, 3); ! gtk_widget_show(editbox); ! gtk_widget_show(scrolled); #else editbox = gtk_text_new(NULL, NULL); + gtk_object_set_data(GTK_OBJECT(window), "editbox", editbox); gtk_text_set_editable(GTK_TEXT(editbox), TRUE); *************** *** 617,624 **** gtk_text_set_line_wrap(GTK_TEXT(editbox), FALSE); GTK_WIDGET_SET_FLAGS(editbox, GTK_CAN_FOCUS); - gtk_box_pack_start(GTK_BOX(vbox1), editbox, TRUE, TRUE, 3); - - gtk_signal_connect(GTK_OBJECT(indent), "toggled", - GTK_SIGNAL_FUNC(indent_toggled), (gpointer) editbox); /* populate editbox */ --- 651,654 ---- *************** *** 634,646 **** } gtk_text_set_point(GTK_TEXT(editbox), 0); #endif ! gtk_widget_show(editbox); hbox2 = gtk_hbutton_box_new(); /* box_new(FALSE, 0); */ gtk_widget_show(hbox2); ! gtk_box_pack_start(GTK_BOX(vbox1), hbox2, TRUE, TRUE, 10); ! save = gtk_button_new_with_label(_("Save")); gtk_signal_connect_object(GTK_OBJECT(save), "clicked", GTK_SIGNAL_FUNC(save_filter), GTK_OBJECT(window)); --- 664,681 ---- } gtk_text_set_point(GTK_TEXT(editbox), 0); + gtk_widget_show(editbox); + + gtk_box_pack_start(GTK_BOX(vbox1), editbox, TRUE, TRUE, 3); #endif ! gtk_signal_connect(GTK_OBJECT(indent), "toggled", ! GTK_SIGNAL_FUNC(indent_toggled), (gpointer) editbox); ! hbox2 = gtk_hbutton_box_new(); /* box_new(FALSE, 0); */ gtk_widget_show(hbox2); ! gtk_box_pack_start(GTK_BOX(vbox1), hbox2, FALSE, FALSE, 0); ! save = gq_button_new_with_label(_("_Save")); gtk_signal_connect_object(GTK_OBJECT(save), "clicked", GTK_SIGNAL_FUNC(save_filter), GTK_OBJECT(window)); *************** *** 709,713 **** --- 744,760 ---- text = gtk_object_get_data(GTK_OBJECT(window), "editbox"); + + #if GTK_MAJOR >= 2 + { + GtkTextBuffer *b = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text)); + GtkTextIter s, e; + + gtk_text_buffer_get_start_iter(b, &s); + gtk_text_buffer_get_end_iter(b, &e); + filtertext = gtk_text_buffer_get_text(b, &s, &e, TRUE); + } + #else filtertext = gtk_editable_get_chars(GTK_EDITABLE(text), 0, -1); + #endif filter_clist = gtk_object_get_data(GTK_OBJECT(window), "filter_clist"); *************** *** 909,913 **** unsigned char c, *unindented; ! unindented = malloc(strlen(indented) + 1); unindented[0] = '\0'; f = s = 0; --- 956,960 ---- unsigned char c, *unindented; ! unindented = g_malloc(strlen(indented) + 1); unindented[0] = '\0'; f = s = 0; *************** *** 952,993 **** void indent_toggled(GtkToggleButton *indent, gpointer editbox) { ! char *indented, *unindented; ! ! if(gtk_toggle_button_get_active(indent)) { ! /* indent */ ! unindented = gtk_editable_get_chars(GTK_EDITABLE(editbox), 0, -1); ! if(!unindented) ! return; ! indented = indent_filter(unindented); ! g_free(unindented); #if GTK_MAJOR >= 2 ! gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(editbox)), ! indented, strlen(indented)); /* FIXME: UTF-8 ?? */ #else ! gtk_text_set_point(GTK_TEXT(editbox), 0); ! gtk_text_forward_delete(GTK_TEXT(editbox), gtk_text_get_length(GTK_TEXT(editbox))); ! gtk_text_insert(GTK_TEXT(editbox), FILTER_EDIT_FONT, NULL, NULL, indented, -1); #endif ! g_free(indented); ! } ! else { /* unindent */ ! indented = gtk_editable_get_chars(GTK_EDITABLE(editbox), 0, -1); ! if(!indented) ! return; ! unindented = unindent_filter(indented); ! g_free(indented); #if GTK_MAJOR >= 2 ! gtk_text_buffer_set_text(gtk_text_view_get_buffer(GTK_TEXT_VIEW(editbox)), ! unindented, strlen(unindented)); /* FIXME: UTF-8 ?? */ #else ! gtk_text_set_point(GTK_TEXT(editbox), 0); ! gtk_text_forward_delete(GTK_TEXT(editbox), gtk_text_get_length(GTK_TEXT(editbox))); ! gtk_text_insert(GTK_TEXT(editbox), FILTER_EDIT_FONT, NULL, NULL, unindented, -1); #endif ! g_free(unindented); ! } } --- 999,1034 ---- void indent_toggled(GtkToggleButton *indent, gpointer editbox) { ! char *current, *newtext; #if GTK_MAJOR >= 2 ! GtkTextBuffer *b = gtk_text_view_get_buffer(GTK_TEXT_VIEW(editbox)); ! GtkTextIter s, e; ! ! gtk_text_buffer_get_start_iter(b, &s); ! gtk_text_buffer_get_end_iter(b, &e); ! current = gtk_text_buffer_get_text(b, &s, &e, TRUE); #else ! current = gtk_editable_get_chars(GTK_EDITABLE(editbox), 0, -1); #endif ! ! if(!current) return; ! ! if(gtk_toggle_button_get_active(indent)) { ! /* indent */ ! newtext = indent_filter(current); ! } else { /* unindent */ ! newtext = unindent_filter(current); ! } #if GTK_MAJOR >= 2 ! gtk_text_buffer_set_text(b, newtext, strlen(newtext)); /* FIXME: UTF-8 ?? */ #else ! gtk_text_set_point(GTK_TEXT(editbox), 0); ! gtk_text_forward_delete(GTK_TEXT(editbox), gtk_text_get_length(GTK_TEXT(editbox))); ! gtk_text_insert(GTK_TEXT(editbox), FILTER_EDIT_FONT, NULL, NULL, newtext, -1); #endif ! g_free(newtext); ! g_free(current); } Index: input.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/input.c,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** input.c 29 Sep 2003 19:24:16 -0000 1.56 --- input.c 30 Sep 2003 17:20:25 -0000 1.57 *************** *** 64,67 **** --- 64,70 ---- static void create_new_attr(GtkButton *button, struct inputform *iform); + static void change_displaytype(GtkWidget *button, + struct inputform *iform, + int wanted_dt); *************** *** 92,95 **** --- 95,108 ---- } + static void linebutton_clicked(GtkWidget *button, struct inputform *iform) + { + change_displaytype(button, iform, DISPLAYTYPE_ENTRY); + } + + static void textareabutton_clicked(GtkWidget *button, struct inputform *iform) + { + change_displaytype(button, iform, DISPLAYTYPE_TEXT); + } + void create_form_content(struct inputform *iform) *************** *** 114,118 **** /* line button */ linebutton = gtk_button_new(); - gtk_object_set_data(GTK_OBJECT(linebutton), "transform", "make entry"); GTK_WIDGET_UNSET_FLAGS(linebutton, GTK_CAN_FOCUS); icon = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(iform->target_vbox)->window, --- 127,130 ---- *************** *** 134,138 **** gtk_box_pack_start(GTK_BOX(hbox1), linebutton, FALSE, FALSE, 5); gtk_signal_connect(GTK_OBJECT(linebutton), "clicked", ! GTK_SIGNAL_FUNC(change_displaytype), (gpointer) iform); --- 146,150 ---- gtk_box_pack_start(GTK_BOX(hbox1), linebutton, FALSE, FALSE, 5); gtk_signal_connect(GTK_OBJECT(linebutton), "clicked", ! GTK_SIGNAL_FUNC(linebutton_clicked), (gpointer) iform); *************** *** 146,150 **** /* textarea button */ textareabutton = gtk_button_new(); - gtk_object_set_data(GTK_OBJECT(textareabutton), "transform", "make text"); GTK_WIDGET_UNSET_FLAGS(textareabutton, GTK_CAN_FOCUS); icon = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(iform->target_vbox)->window, --- 158,161 ---- *************** *** 161,165 **** gtk_box_pack_start(GTK_BOX(hbox1), textareabutton, FALSE, FALSE, 0); gtk_signal_connect(GTK_OBJECT(textareabutton), "clicked", ! GTK_SIGNAL_FUNC(change_displaytype), (gpointer) iform); --- 172,176 ---- gtk_box_pack_start(GTK_BOX(hbox1), textareabutton, FALSE, FALSE, 0); gtk_signal_connect(GTK_OBJECT(textareabutton), "clicked", ! GTK_SIGNAL_FUNC(textareabutton_clicked), (gpointer) iform); *************** *** 173,177 **** newattrbutton = gtk_button_new(); - gtk_object_set_data(GTK_OBJECT(newattrbutton), "transform", "make text"); GTK_WIDGET_UNSET_FLAGS(newattrbutton, GTK_CAN_FOCUS); icon = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(iform->target_vbox)->window, --- 184,187 ---- *************** *** 201,206 **** /* hide empty attributes button */ hideattrbutton = gtk_toggle_button_new(); - - gtk_object_set_data(GTK_OBJECT(hideattrbutton), "transform", "make text"); GTK_WIDGET_UNSET_FLAGS(hideattrbutton, GTK_CAN_FOCUS); icon = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(iform->target_vbox)->window, --- 211,214 ---- *************** *** 258,262 **** if(iform->edit) { ! button = gtk_button_new_with_label(_("Apply")); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0); --- 266,270 ---- if(iform->edit) { ! button = gq_button_new_with_label(_("_Apply")); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0); *************** *** 268,272 **** gtk_widget_grab_default(button); ! button = gtk_button_new_with_label(_("Add as new")); gtk_widget_set_sensitive(button, FALSE); gtk_widget_show(button); --- 276,280 ---- gtk_widget_grab_default(button); ! button = gq_button_new_with_label(_("Add as _new")); gtk_widget_set_sensitive(button, FALSE); gtk_widget_show(button); *************** *** 278,282 **** iform->add_as_new_button = button; ! button = gtk_button_new_with_label(_("Refresh")); /* gtk_widget_set_sensitive(button, FALSE); */ /* GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); */ --- 286,290 ---- iform->add_as_new_button = button; ! button = gq_button_new_with_label(_("_Refresh")); /* gtk_widget_set_sensitive(button, FALSE); */ /* GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); */ *************** *** 1702,1705 **** --- 1710,1720 ---- } + static void check_focus(GtkWidget *w, GtkWidget **focus) + { + if (GTK_WIDGET_HAS_FOCUS(w)) { + *focus = w; + } + } + GtkWidget *find_focusbox(GList *formlist) *************** *** 1720,1723 **** --- 1735,1747 ---- return GTK_WIDGET(widgets->data); } + + /* check children as well */ + if (GTK_IS_CONTAINER(GTK_WIDGET(widgets->data))) { + GtkWidget *focus = NULL; + gtk_container_foreach(GTK_CONTAINER(GTK_WIDGET(widgets->data)), + (GtkCallback) check_focus, + &focus); + if (focus) return widgets->data; + } } } *************** *** 1731,1743 **** * callback for entry or textbox buttons */ ! void change_displaytype(GtkWidget *button, struct inputform *iform) { GtkWidget *focusbox; ! struct formfill *ff, *focusform; ! char *transformtype; update_formlist(iform); focusbox = find_focusbox(iform->formlist); if(focusbox == NULL) /* nothing focused */ --- 1755,1768 ---- * callback for entry or textbox buttons */ ! static void change_displaytype(GtkWidget *button, struct inputform *iform, int wanted_dt) { GtkWidget *focusbox; ! struct formfill *ff, *focusform = NULL; ! assert(wanted_dt == DISPLAYTYPE_ENTRY || wanted_dt == DISPLAYTYPE_TEXT); update_formlist(iform); focusbox = find_focusbox(iform->formlist); + if(focusbox == NULL) /* nothing focused */ *************** *** 1745,1755 **** focusform = (struct formfill *) gtk_object_get_data(GTK_OBJECT(focusbox), ! "formfill"); if(focusform == NULL) /* field can't be resized anyway */ return; - iform->focusform = focusform; ! transformtype = gtk_object_get_data(GTK_OBJECT(button), "transform"); ff = (struct formfill *) gtk_object_get_data(GTK_OBJECT(focusbox), --- 1770,1780 ---- focusform = (struct formfill *) gtk_object_get_data(GTK_OBJECT(focusbox), ! "formfill"); ! if(focusform == NULL) /* field can't be resized anyway */ return; ! iform->focusform = focusform; ff = (struct formfill *) gtk_object_get_data(GTK_OBJECT(focusbox), *************** *** 1758,1772 **** return; ! if(!strcmp(transformtype, "make entry")) { ! if(GTK_IS_ENTRY(focusbox)) ! return; ff->displaytype = DISPLAYTYPE_ENTRY; ff->dt_handler = get_dt_handler(ff->displaytype); ! } else if(!strcmp(transformtype, "make text")) { ! #if GTK_MAJOR < 2 ! if(GTK_IS_TEXT(focusbox)) ! return; ! #endif ff->displaytype = DISPLAYTYPE_TEXT; --- 1783,1795 ---- return; ! if (wanted_dt == DISPLAYTYPE_ENTRY) { ! /* if(GTK_IS_ENTRY(focusbox)) */ ! /* return; */ ff->displaytype = DISPLAYTYPE_ENTRY; ff->dt_handler = get_dt_handler(ff->displaytype); ! } else if(wanted_dt == DISPLAYTYPE_TEXT) { ! /* if(GTK_IS_TEXT(focusbox)) */ ! /* return; */ ff->displaytype = DISPLAYTYPE_TEXT; *************** *** 1776,1781 **** /* redraw */ clear_table(iform); - build_inputform(iform); } --- 1799,1806 ---- /* redraw */ clear_table(iform); + gtk_widget_hide(iform->table); + build_inputform(iform); + gtk_widget_show(iform->table); } Index: input.h =================================================================== RCS file: /cvsroot/gqclient/gq/src/input.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** input.h 29 Sep 2003 19:24:17 -0000 1.12 --- input.h 30 Sep 2003 17:20:25 -0000 1.13 *************** *** 78,82 **** GtkWidget *gq_new_arrowbutton(struct inputform *iform); GtkWidget *find_focusbox(GList *formlist); - void change_displaytype(GtkWidget *button, struct inputform *form); void set_hide_empty_attributes(int hidden, struct inputform *form); --- 78,81 ---- Index: mainwin.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/mainwin.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** mainwin.c 29 Sep 2003 19:24:17 -0000 1.32 --- mainwin.c 30 Sep 2003 17:20:25 -0000 1.33 *************** *** 122,126 **** } - void cleanup(void) { --- 122,125 ---- *************** *** 128,131 **** --- 127,162 ---- } + static gboolean ctrl_b_hack(GtkWidget *widget, GdkEventKey *event, gpointer obj) + { + if(event && event->type == GDK_KEY_PRESS && + event->state & GDK_CONTROL_MASK && event->keyval == GDK_b) { + gtk_signal_emit_by_name(GTK_OBJECT(obj), "activate"); + gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event"); + return(TRUE); + } + + #if GTK_MAJOR >= 2 + return(FALSE); + #else + return(TRUE); /* may be a bug to return TRUE unconditionally in gtk 1.2 */ + #endif + } + + + static gboolean ctrl_w_hack(GtkWidget *widget, GdkEventKey *event, gpointer obj) + { + if(event && event->type == GDK_KEY_PRESS && + event->state & GDK_CONTROL_MASK && event->keyval == GDK_w) { + gtk_signal_emit_by_name(GTK_OBJECT(obj), "activate"); + gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event"); + return(TRUE); + } + + #if GTK_MAJOR >= 2 + return(FALSE); + #else + return(TRUE); /* may be a bug to return TRUE unconditionally in gtk 1.2 */ + #endif + } void create_mainwin(void) *************** *** 181,185 **** /* File menu */ ! File = gtk_menu_item_new_with_label(_("File")); gtk_widget_show(File); gtk_container_add(GTK_CONTAINER(menubar), File); --- 212,216 ---- /* File menu */ ! File = gq_menu_item_new_with_label(_("_File")); gtk_widget_show(File); gtk_container_add(GTK_CONTAINER(menubar), File); *************** *** 189,193 **** /* File | New */ ! New = gtk_menu_item_new_with_label(_("New tab")); gtk_widget_show(New); gtk_container_add(GTK_CONTAINER(menuFile), New); --- 220,224 ---- /* File | New */ ! New = gq_menu_item_new_with_label(_("_New tab")); gtk_widget_show(New); gtk_container_add(GTK_CONTAINER(menuFile), New); *************** *** 196,200 **** /* File | New | Search */ ! Search = gtk_menu_item_new_with_label(_("Search")); gtk_widget_show(Search); gtk_menu_append(GTK_MENU(submenu), Search); --- 227,231 ---- /* File | New | Search */ ! Search = gq_menu_item_new_with_label(_("_Search")); gtk_widget_show(Search); gtk_menu_append(GTK_MENU(submenu), Search); *************** *** 206,210 **** /* File | New | Browse */ ! Browse = gtk_menu_item_new_with_label(_("Browse")); gtk_widget_show(Browse); gtk_menu_append(GTK_MENU(submenu), Browse); --- 237,241 ---- /* File | New | Browse */ ! Browse = gq_menu_item_new_with_label(_("_Browse")); gtk_widget_show(Browse); gtk_menu_append(GTK_MENU(submenu), Browse); *************** *** 221,225 **** /* File | New | Schema */ ! Schema = gtk_menu_item_new_with_label(_("Schema")); gtk_widget_show(Schema); gtk_menu_append(GTK_MENU(submenu), Schema); --- 252,256 ---- /* File | New | Schema */ ! Schema = gq_menu_item_new_with_label(_("S_chema")); gtk_widget_show(Schema); gtk_menu_append(GTK_MENU(submenu), Schema); *************** *** 235,239 **** /* File | Preferences */ ! menuitem = gtk_menu_item_new_with_label(_("Preferences")); gtk_widget_show(menuitem); gtk_container_add(GTK_CONTAINER(menuFile), menuitem); --- 266,270 ---- /* File | Preferences */ ! menuitem = gq_menu_item_new_with_label(_("_Preferences")); gtk_widget_show(menuitem); gtk_container_add(GTK_CONTAINER(menuFile), menuitem); *************** *** 245,249 **** /* File | Close */ ! Close = gtk_menu_item_new_with_label(_("Close tab")); gtk_widget_show(Close); gtk_container_add(GTK_CONTAINER(menuFile), Close); --- 276,280 ---- /* File | Close */ ! Close = gq_menu_item_new_with_label(_("_Close tab")); gtk_widget_show(Close); gtk_container_add(GTK_CONTAINER(menuFile), Close); *************** *** 258,262 **** /* File | Quit */ ! Quit = gtk_menu_item_new_with_label(_("Quit")); gtk_widget_show(Quit); gtk_container_add(GTK_CONTAINER(menuFile), Quit); --- 289,293 ---- /* File | Quit */ ! Quit = gq_menu_item_new_with_label(_("_Quit")); gtk_widget_show(Quit); gtk_container_add(GTK_CONTAINER(menuFile), Quit); *************** *** 269,273 **** /* Filters menu */ ! Filters = gtk_menu_item_new_with_label(_("Filters")); gtk_widget_show(Filters); gtk_container_add(GTK_CONTAINER(menubar), Filters); --- 300,304 ---- /* Filters menu */ ! Filters = gq_menu_item_new_with_label(_("F_ilters")); gtk_widget_show(Filters); gtk_container_add(GTK_CONTAINER(menubar), Filters); *************** *** 278,282 **** /* Filters | New */ ! New = gtk_menu_item_new_with_label(_("New filter")); gtk_widget_show(New); gtk_container_add(GTK_CONTAINER(menuFilters), New); --- 309,313 ---- /* Filters | New */ ! New = gq_menu_item_new_with_label(_("_New filter")); ... [truncated message content] |