gerstensaft-0.3/0000755000076500001440000000000010536056136012600 5ustar joeyusersgerstensaft-0.3/man/0000755000076500001440000000000010536056136013353 5ustar joeyusersgerstensaft-0.3/man/Makefile0000644000076500001440000000205410536050716015012 0ustar joeyusers# Makefile - Frontend for SAFT for X11 # Copyright (c) 1999,2001,6 Joey Schulze # # This file is part of the Gerstensaft package. # # 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, USA. prefix = /usr/local all: install: test -d $(prefix)/share/man/man1 || install -d -g root -o root -m 755 $(prefix)/share/man/man1 install -g root -o root -m 644 beer.1 $(prefix)/share/man/man1 clean: gerstensaft-0.3/man/beer.10000644000076500001440000000421010536052531014342 0ustar joeyusers.\" Copyright (c) 1999,2006 Joey Schulze .\" .\" 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, USA. .\" .TH BEER 1 "7 December 2006" "0.3" "Gerstensaft" .SH NAME beer \- Graphical frontend to SAFT .SH SYNOPSIS .B beer .RI [ " gtk-options " ] .RI [ " \-v " | " \-h " ] .RI [ " \-m " | " \-r " | " \-s " ] .SH DESCRIPTION Gerstensaft is an easy to use graphical frontend to the SAFT protocol, i.e. .BR sendfile (1), .BR sendmsg (1) and .BR receive (1). It features sending messages, files and directories, adding comments, and provides a history of recipients. Since .BR sendfile (1), .BR sendmsg (1) and .BR receive (1) are called for real operations you'll need to have these programs installed as well. .SH OPTIONS .TP .B \-h Display help and exit. .TP .B \-m Run in message mode. .TP .B \-r Run in receive mode. .TP .B \-s Run in send mode. .TP .B \-v Display version and exit. .SH NAMING Gerstensaft is German and means barley juice translated word by word. So in short it's nothing less than simply beer, hence the name of the binary. Although beer is Bier. .SH AUTHOR Gerstensaft has been developed by Joey Schulze . It uses the GIMP Toolkit (Gtk) to draw its user interface. .SH FILES .TP .I ~/.gerstensaft/history Contains the stored history list of recipients. .TP .I ~/.gerstensaft/config Contains additional configuration .SH SEE ALSO .BR sendfile (1), .BR sendmsg (1), .BR receive (1), .br .RB "Homepage: <" http://www.infodrom.org/projects/gerstensaft/ >. gerstensaft-0.3/CHANGES0000644000076500001440000000345210536055671013602 0ustar joeyusersVersion 0.3 . Fixed problem with double clicks and regular files. Thanks to Tim Gerla . Fixed segmentation fault when hitting `..' too often . Some beautification for the directory listing . Added Swedish translation by Daniel Nylander . Applied patch by Andreas Jochens to fix invalid lvalue in increment . Adjusted web addresses and stuff . Beginning of port to Gtk 2 by Holger Levsen . Widen the window by 100 pixel . Added mnemonics to menu items . Use stock buttons where possible . Sorting of files to send by Johannes Beigel . New receive module . New message module . Support for adding a comment along the files . Adjust the sensitivity of several buttons automatically according to user's actions . Exchanged the position of Send and Clear buttons since the Clear button clearly belongs to the list below . Added LFS support . Added Preferences dialog . New Vietnamese translation by Clytie Siddall . Updated Swedish translation by Daniel Nylander . New Romanian translation by Eddy Petrior -- Thu Dec 7 19:21:27 CET 2006 Joey Schulze Version 0.2 . Fixed problem with .gerstensaft/history . Removed debug output at program termination . Added notice about the need of most recent sendfile package . Added some braces to make the compiler happy . Documented problem with double click and selection . Corrected paths to pixmap files . Added exception code if the pixmap was not available . Added Todo::Gnomification . Added code to taint filenames for saft/shell -- Thu Jul 1 13:57:11 CEST 1999: Martin Schulze Version 0.1 . Initial release. . Rewrite of `tkfaxspool' with GTK -- Sun Oct 18 23:31:29 CEST 1998: Martin Schulze gerstensaft-0.3/COPYING0000644000076500001440000004312706655457645013663 0ustar joeyusers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. gerstensaft-0.3/Makefile0000644000076500001440000000401010536050675014235 0ustar joeyusers# Makefile - Frontend for SAFT for X11 # Copyright (c) 1998,9,2006 Joey Schulze # # This file is part of the Gerstensaft package. # # 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, USA. prefix = /usr/local # You might need to adjust the PIXMAP_WM variables if these pixmaps go # into a different directory than the general pixmap dir, in order to # make them public for window managers. # #DEBUG=1 PIXMAP_DIR=$(prefix)/share/gerstensaft PIXMAP_WM_DIR=$(PIXMAP_DIR) LOCALE_DIR=$(prefix)/share/locale # If you want to have Large File Support, set this # CONFIG_LFS=1 config_h=src/config.h all: echo "/* Do not edit, edit Makefile instead. */" > $(config_h) -test -n "$(DEBUG)" && echo "#define DEBUG" >> $(config_h) echo "#define PIXMAP_DIR \"$(PIXMAP_DIR)\"" >> $(config_h) echo "#define PIXMAP_WM_DIR \"$(PIXMAP_WM_DIR)\"" >> $(config_h) echo "#define LOCALE_DIR \"$(LOCALE_DIR)\"" >> $(config_h) cd src && $(MAKE) CONFIG_LFS=$(CONFIG_LFS) prefix=$(prefix) cd po && $(MAKE) # Support i18n pot: cd po && $(MAKE) pot # Continue with the mandatory targets clean: cd src && $(MAKE) clean cd po && $(MAKE) clean rm -f $(config_h) install: cd src && $(MAKE) prefix=$(prefix) install cd pixmaps && $(MAKE) PIXMAP_DIR=$(PIXMAP_DIR) PIXMAP_WM_DIR=$(PIXMAP_WM_DIR) install cd man && $(MAKE) prefix=$(prefix) install cd po && $(MAKE) LOCALE_DIR=$(LOCALE_DIR) install gerstensaft-0.3/readme0000644000076500001440000000412210536056062013755 0ustar joeyusersGerstensaft - Graphical frontend to SAFT Gerstensaft is an easy to use graphical oriented frontend for sendfile(1). It features sending files and directories and provides a history for addresses. Thus you'll need the sendfile program installed as well: ftp://ftp.infodrom.north.de/pub/unix/network/sendfile/ Gerstensaft is German and means barley juice translated word by word, short beer, although beer is Bier. Copyright (c) 1999-2006 Joey Schulze This package is released under the terms of the GNU General Public Licence version 2 or higher. Files Gerstensaft uses ~/.gerstensaft/history to store the address history. ~/.gerstensaft/config will be used in further releases to cover its configuration. Caveat If you want to send files or directories that contain spaces you'll need the most recent Debian version of the sendfile package. The upstream source doesn't support this. Framstag has received the patches from me. Please find proper source and binary files at http://packages.debian.org/sendfile Project's Website http://www.infodrom.org/projects/gerstensaft/ Credits Andreas Fuchs For several good pointers and ideas with my upcoming Gtk knowledge and for adding support for Gtk 1.1. Bjorn Lindgren For some good ideas through his own program xwhois. Brian Masney For some good ideas through his own program gftp and the pixmaps used by the file selection boxes. Holger Levsen For starting the port to Gtk 2. Johannes Beigel For sorting the file/directory display. Thomas Khler For improved err. corrected Makefiles. Patrick Feldhusen For digitized beer bottle. Translations Clytie Siddall Vietnamese Daniel Nylander Swedish Eddy Petrisor Romanian Joey Schulze German gerstensaft-0.3/pixmaps/0000755000076500001440000000000010536056136014261 5ustar joeyusersgerstensaft-0.3/pixmaps/Makefile0000644000076500001440000000271010536050636015720 0ustar joeyusers# Makefile - Frontend for SAFT for X11 # Copyright (c) 1999,2006 Joey Schulze # # This file is part of the Gerstensaft package. # # 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, USA. prefix = /usr/local PIXMAP_DIR=$(prefix)/share/gerstensaft PIXMAP_WM_DIR=$(PIXMAP_DIR) # Add pixmaps to $(FILES) and $(DESTFILES) FILES=dir.xpm doc.xpm linkdir.xpm linkfile.xpm updir.xpm gerstensaft.xpm FILES_WM=beer.xpm beer-mini.xpm ifeq ($(shell whoami),root) install=install -o root -g root else install=install endif clean: install: install_dirs install_files install_dirs: test -d $(PIXMAP_DIR) || $(install) -d -m 755 $(PIXMAP_DIR) test -d $(PIXMAP_WM_DIR) || $(install) -d -m 755 $(PIXMAP_WM_DIR) install_files: $(install) -m 644 $(FILES) $(PIXMAP_DIR) $(install) -m 644 $(FILES_WM) $(PIXMAP_WM_DIR) gerstensaft-0.3/pixmaps/beer-mini.xpm0000644000076500001440000000147106667541764016701 0ustar joeyusers/* XPM */ static char *flasche_18_20[] = { /* width height num_colors chars_per_pixel */ " 18 20 15 1", /* colors */ " s None c None", ". c #2b3b37", "# c #355d40", "a c #2e495b", "b c #3d6465", "c c #57685c", "d c #88796b", "e c #8f9091", "f c #aca09b", "g c #bcaba3", "h c #c6c3bf", "i c #c7c9cb", "j c #d9d7d4", "k c #e8ece9", "l c #f4f7f5", /* pixels */ "lhkl ", "gbel ", "jehhl ", " khfhl ", " jihhk ", " liieagk ", " ke#a#be ", " fbb##bg ", " j#ccfeci ", " lcbgfgfei ", " hbfhhheej ", " feghhgfdk ", " ffhhheecl ", " lffhgfdbe ", " leegediee ", " kcbeiebag", " jdfhba#f", " ieab.e ", " lfa#f ", " lgi " }; gerstensaft-0.3/pixmaps/beer.xpm0000644000076500001440000000552406667541764015752 0ustar joeyusers/* XPM */ static char *flasche_46_50[] = { /* width height num_colors chars_per_pixel */ " 46 50 16 1", /* colors */ " s None c None", ". c #2b3b37", "# c #355d40", "a c #2e495b", "b c #3d6465", "c c #57685c", "d c #88796b", "e c #8f9091", "f c #aca09b", "g c #bcaba3", "h c #c6c3bf", "i c #c7c9cb", "j c #d9d7d4", "k c #e8ece9", "l c #f4f7f5", "m c #fffbf7", /* pixels */ " kkm ", " igegl ", " jfcbbfl ", "kgcc##ckl ", "ke#cchfek ", "lf#bjghhgk ", " leehhihfhj ", " lhfiihhhfk ", " llhhhefifikl ", " khgeehiffkl ", " lkhihihihfjl ", " lihhihhhifil ", " lihhiiihfeci ", " lfhijihbbbbfjl ", " khhiibbbabbcehkl ", " lhgibbbb.#ababcfk ", " jfebbb#a#a.##bbek ", " lib##a##b#c.#.#bel ", " lebb#bcab##a##bcfl ", " icc#cc#cc#cc.#ccf ", " ke##ccccb#cddcaachl ", " leb.#ccbcfihhgge#ci ", " mfc#cccchhffdfdffebj ", " hc#.bcfjffffgfedgecj ", " jeb#a#igdgghhhgfeeeck ", " hdb#.jffhjhhhhheeeecl ", " fcb#gffhhhhghhffdfbel ", " lgbbfefhhghhghgfeegbe ", " lfcefdjhjhgihhhgefdcfl ", " lecgfghhihhhhhhedgabhl ", " lkeefdhhihgghghffgcaci ", " jdffdjhjihhhhfdgdabci ", " lieffdhhiihhhefgeaaadj ", " hdhdgghhihfffhbcaadck ", " gdgfffggfdfgfacaefecl ", " lgdffdgffdhhcccghffec ", " lebfgfghjgdadgihgebbe ", " lfbcdegeccdiihhibaace ", " kebaaacdeihhhfbaaaacf ", " kecaaaeiiihfbacac.#bi", " mjebachijihabaca#.aaj", " midcgfhihbbcacaca.fm", " mhcfeffbccbaac..fm ", " lhbheaaecca...em ", " lfbaaaacc...f ", " lfba.#c...g ", " mkecb..c.jm ", " keba.cjm ", " ljecdkmm ", " kjlmm " }; gerstensaft-0.3/pixmaps/dir.xpm0000644000076500001440000000064006655457645015606 0ustar joeyusers/* XPM */ static char *dir_xpm[] = { "16 14 6 1", " c None", "# c #000000", "- c #ffffff", "* c gray50", "h c gray85", "j c yellow", " **** ", " *hjhj* ", " *hjhjhj******* ", "*-------------* ", "*-jhjhjhjhjhjh*#", "*-hjhjhjhjhjhj*#", "*-jhjhjhjhjhjh*#", "*-hjhjhjhjhjhj*#", "*-jhjhjhjhjhjh*#", "*-hjhjhjhjhjhj*#", "*-jhjhjhjhjhjh*#", "*-hjhjhjhjhjhj*#", "***************#", " ###############" }; gerstensaft-0.3/pixmaps/doc.xpm0000644000076500001440000000060606655457645015577 0ustar joeyusers/* XPM */ static char *doc_xpm[] = { "16 14 4 1", " c None", "# c #000000", "- c lightblue", "* c gray50", "*********** ", "*---------** ", "*---------* * ", "*---------**** ", "*-------------* ", "*-------------*#", "*-------------*#", "*-------------*#", "*-------------*#", "*-------------*#", "*-------------*#", "*-------------*#", "***************#", " ###############" }; gerstensaft-0.3/pixmaps/gerstensaft.xpm0000644000076500001440000003026006667541764017355 0ustar joeyusers/* XPM */ static char *flasche_53_199[] = { /* width height num_colors chars_per_pixel */ " 53 199 64 1", /* colors */ " s None c None", ". c #21392d", "# c #243d43", "a c #3d4a2f", "b c #3c4544", "c c #265c3d", "d c #336243", "e c #42573e", "f c #3d6d40", "g c #234259", "h c #2d565f", "i c #46504c", "j c #43545d", "k c #346753", "l c #43734e", "m c #33676b", "n c #446a6a", "o c #555b46", "p c #4f7951", "q c #53696c", "r c #50786f", "s c #63755a", "t c #637a76", "u c #787e6c", "v c #9e7e63", "w c #6b8687", "x c #86948b", "y c #958e85", "z c #93a194", "A c #a88b83", "B c #a89d8e", "C c #a2ac9e", "D c #a4b3ab", "E c #b89e85", "F c #b9b0a2", "G c #adb9b1", "H c #b8bdae", "I c #b3c2b9", "J c #b9c5b8", "K c #c3c3b7", "L c #c1ceb5", "M c #bacbc3", "N c #c0cfc5", "O c #c6d2c1", "P c #c6cece", "Q c #ccd2c1", "R c #c6dbcb", "S c #ced6c6", "T c #d5dac7", "U c #cfded4", "V c #d6e7d6", "W c #dee1d0", "X c #d6ebde", "Y c #dee7d6", "Z c #deebda", "0 c #deefe2", "1 c #e9f3e4", "2 c #efffe7", "3 c #eff7ef", "4 c #efffef", "5 c #f3fff3", "6 c #f7fff7", "7 c #fffff7", "8 c #f7ffff", /* pixels */ " 6 6 6 6 ", " 66411010100156 ", " 50UOOSSLLJLJJRX36 ", " 4UJJJLROHLJHGGGGR1 ", " 4UHGJJIOLHGOGGJICIR38 ", " 5ULLGLGCHHxCICDJIGIIU6 ", " 1OOMCCxsuuforkwxxDGGN4 ", " 6ZODupkaaaaaa.afdctuxG1 ", " 6XzpccccsssspfffccknqC0 ", " ZzfffffpxppppppflnrwG1 ", " 0DxpfllpuppfpfppfcrzM18 ", " 0Hwfdlppwppplflld.nxIX6 ", " 0CpcdfppppfffflffcktCX6 ", " 0zlccdkc#.c##cccd##ixU8 ", " 0wcca..dfrnmkkca....uU6 ", " 0ucdpuxFJLJIGCzxrnmbtR6 ", " 1xpwCJOUVVURRRMGDCzrxS6 ", " 4GzHLSRVZVVTRRNMIIICCZ6 ", " 6UHLOORRTSOLJJGGGIJHL18 ", " 6VMJHDDGGDCCzzzxzzGJN2 ", " 6UGzzzzGHGFDDCzzxxxCM57 ", " 6OzxCDIRWSSNJMJGCCzzI5 ", " 5LCGHMSVVVUSROMJIGDDN4 ", " 4MHJLLSUWUTRSNNJJGHGO5 ", " 4OIJMOSTVWUSPONJIHGHR4 ", " 4NKJKNSUYWUSSNNMJHHIL1 ", " 4NJJKOSVUSORNNNJJHGIL0 ", " 4OJJKNTULGDJRONJJIGIM18 ", " 4NJJKORQGzzINNOMHGIIJ18 ", " 4NJJJNKJDBCHHJNNJIGIJ18 ", " 4NIJMJHGFCFCGGNMJGIGJZ6 ", " 4MJJJJGCBCBCCGJMJIGHJU6 ", " 1NJJJHHByFCBzGJJJIHIIU6 ", " 0JJJLJKBvCFCFLOMJIGIIU6 ", " 6ZMJJMSSFuAEBHSPLIIGIIU6 ", " 8ZJJIJOPFABAyFNJIGGGGIU6 ", " 6XJGGHNKCFFyyyKKJGDCGHU5 ", " 6YIDGIQLFCBAyFKOOKHDHIR6 ", " 6UGIJJRSJKFFHOQPOJIGGIU6 ", " 5RJJJNQUTWRSTUSNNMJIGIR5 ", " 5SIJMKSSVYWVUSRNOJJIIGN4 ", " 5RJMKOSUTWTUSRNONMJIGIM2 ", " 5SJJMOOSUTVLJNJMMJIGIIM2 ", " 4SJHJJOOQSTLJLIIIIDGDGK38 ", " 0MGGGHKOQTTOSSJMJIGCCCJ18 ", " ZGDHHJSSUYUTSSRPOKJGFGHV ", " ZGGHJORUWTVNKMNKJMJIGGIV8 ", " 6ZLHJLJNOOOUKGHIJIGMIIIIR6 ", " 6UJJLJJJOSSWUQNJMIIJJIGIR5 ", " 5SJJJMMOSUUUTUSNNNMJIIIIN36 ", " 3NJJJLPSUUWVURRRNNNMJIGHM16 ", " ZMJJJOOSUWUVTUSRONNJJHIHJ0 ", " 6VJJJLMOPUVYUUTRSRONJJIHHJ18 ", " 4SIHJMKRSUVYVUUSRSPMMJIHIJZ6 ", " 60NJJJLOOQTUVWRSONNNLMHHGIJU6 ", " 5UJJJIIJMLOMNJMHGGGGFDCDDGIU5 ", " 4SJHGDDDGIMMMMJJJGGGGDDzCzDJ38 ", " 4OHCCCCHMPUWVUUUUORRMMIGDCCDZ ", " 4ODCGFMORUTROMJNJGIMIIIIGHGGU6 ", " 3LDHJHDCCzzwwrwrrjrtrwttwzDGL36 ", " 4NGDzuijjhmmmmgggggggggg#gtzDR6 ", " 4MCue..bbhhrwnmhhjggggg##.#nwJ5 ", " 1Iudc#biionrrrljoikjkjibbbhhtD3 ", " 6ZDufoiiikknlrlljljknmkhbdikqrz0 ", " 4RCtlqlidjkknpnlkkknjmhdbbhjrtxU6 ", " 1LztpljkbdkklnlkkkkkmkihcdinrtxM6 ", " 6ZGzurnlkdidikknkjkkjkdddbdklqtwG36 ", " 6WCxsrljkdbkdjknjkjkdidhbdibdqqwzV8 ", " 2OztrpnlkidbhbhkkidbhdbcbiikjqrtxI3 ", " 6VHxstrplkkdbcheidibcbbbbcijonnqwwDZ ", " 61NCxtrppljfjcgcdkdbdbcbc#bjonnnqtuxN6 ", " 4SIzwupllokidbdbkdkdidbbbcbbkinqnttxD07 ", " 60JCxutpllieebdidkkkkdidbhbhbdbkjnqtuxN6 ", " 2RGxtrsplodeeidikkikjkkididhdgbdhknqtwC1 ", " 4UIztrqqoleeeiijljjkjdikikidhdbgcbjkkrtxR6 ", " 6ZMCwrrrniidbeijjjnjjliidikikiicbgcjknlttD2 ", " 4UGxttrlkjdbeikonnjnoljljkjkiijbhb#ciknruxU6 ", " 6VLzutppldedidilqqtqeklkjkmkjjkihdbc#cinrrwD18 ", " 2PGxutpledbcekilpsuslopknmjkjkjkdbcbabdkknrwS6 ", " 6VJzxsrplecaceilipsssspllkmmjkkkdidbaaabkjnqtCX7 ", " 1SGyupplidbebekepptuppplknjkkkdiddieeacaiknktuG4 ", " 5VJCusprlkbbeiiolqrsppppkdnknkdkdeediebacbklqswzS6 ", " 1SJzusplkc#diiiiksttsrsrljlildldediidbcbcedipquwG06 ", " 0OHxssplkcbdiildjuwspsrqnljpkdkededjihdcbciklnrwzP3 ", " ZMCuspplicbcedjlpuupppslikqrpkldkeikhebc#cbkkhrtxG0 ", " 0JCwtrlkdbcbidllpssposppikrrrrlifkidbddbdbcjnnrnwGX ", " 0Hzurrlki#bcikjprpssspppnpqllplieidieiedbcbhkmntwDX7", " 1HztrrljdbbdikqnruppprknrrpnploloeieeeeeecbdkknrwzZ8", " 0GxurpnjbcbdiknrtrspprlnprqrlllefoeeeeeedaccdllquzV6", " 0DxussjlbgdbdikttuprprrnrrrrnlllkeloeeeeecaddlnruxU ", " 1Cxusqljd#bhccktwstpooooooibepsllkokieeeecacklnstxU7", " 0DxtslqkbcgchdnwwrloosvssuoiadmmnkljoiedebgdknlruxU7", " 0CwurnnkhbcbdcpspktuECHHGGGCzwrkcdikjliidc#hjnnrtxV6", " 0Cxtrnnkbcbdi#hfuCLQTTWUUUTSNJDztnk#ilidbbcijnnrwxV6", " ZDxrrrlkbbebc.kzLYZZWWTTUTSTSSSNHzul#kjidbbkjlnruxU ", " ZCxtrpnpebd##jCSZ0ZUTTWTTTSSSSRSOOGxn#ekebciknpquxV6", " 0Dxsrplnde..qCSZYVVWTTQKKKKKKOOQQSOIzrcbdbbkijstuzU ", " ZGxtrrlkdb.iCPUWVWSKHFByBCBBFFHKOOSNMCj.cbcikinswxW6", " 0Gxwrrnlb.auMQTWSKBEvvvvCFBAAAAFFKOSOMzj.bbdilqsuzU7", " 0Gxwrrnn#.uDKSTKFBEvvvvvEHEAEAvBAFHOPOJxbcadjlituxV ", " 0Gxwrrkk#oCJPQHAvEEFEvEvEFAEBEBAvvBHKNNDt..kiljswxU ", " 0GxrrrkdbxGKKFBAvEEFEAvvBByBAAEvvvABHMNJz#.bkjqquxV ", " 0GxrrrcbtzKKFyEEEvEEEAECFCBBAEEvvFEvyHKNGt##qjqqtzU7", " ZDxrspjqzHJHBAAFEAAEBKLQKOKKFBBAAFAvvCHMJzbbjlkrtxV6", " 0GxsrpeuGKGBABEEFEFKQTTQONQOOKFBAAEABBBHJCsiljkrtxU7", " 0DxupejyJHBAAFAABFQTSSROPOONOPOHBABFEAyCKHxqalppuxV6", " ZDxupdtCKHyvyEBAFTTSQNOSRSPOKONQJBBAAvvBHKDq.eppszV7", " ZDxtrowKKCFAAAAFTSSPOOSRSRSONONNOHByvvABBHHwddlpuxU ", " ZDxtqqyOHABBAvBQTPSSOOSPURPSOONNPNGAyBBAyFJCncnstxU7", " 0GxrjtDOFyvAAAHTSSPSPOOSRSRSPSONNOKCvBByvCHDtanrtxU6", " ZDzthwHKFAAvACQTPSSSONMOPOSSSPNNNPSHyEAvuBHHxgkqtxR ", " ZGxtjxJJBBBBAKQSQSSORNKMKOPOOONKNKNKFAABBAGHzjqstxU6", " ZGxqjzNHyBAvBQQOQQQQNMJJMMKMOKMKJJJKHAAEAvCKCqqquxU ", " ZDxrjzPHyBvvFKKOONONOKIJKMKJOOKMJJJKKBAAvvCKGwqqtxU ", " ZDxtjCPGACAAFQOKONSNKMHIKJJKNQNMNMMMNCAvvABIIxjmwxU ", " ZGxsqDPFvAvAKQOOSSRQNKJJIKIKKOONNLMKOFBABABDKzmhtxU ", " 0FxuuHQBvAvvQQOSPUPSOOKJHHIKMKONONNMNKBBBByFJCnhtxU ", " 0DysuHKFABvEQOQSRRURQOKJIIKJJJNPNNNNNNCyCByCKDqdtxU8", " 0DxuuHKBBAyFSQSSUSPSSPNJHJMKIIKNKOKNKIzyAyvzJGq#qxU8", " ZGuuyHHByyABLPRSRSOSSOKJIJKMIHJMKMKJGDByEyvzGGqjtwU7", " ZDxtxHHCyAvvDOSPSSRSSONKIJKJIHIKMJMIFCyBEAyyIIqjtxS ", " ZFxsyJKByBvuHPSSSSTPSQOKKJJKHIKMKMKJGDBzCBuzGIjjtyU8", " ZDuuyJKCABABKSSSSSSSOQOKNKJIKJKMJKKJHHCyAAyxGInhsxR ", " ZDuuyLLByEvESPRSRSOPOOONKNKJMKNKMJKIGFCAEyuxDIqhtwT8", " ZDysyLKCyAvESRSPSSOSOOOKOMKNKNNJJKMGDzxBEAyxGIrdrxR7", " ZDxuyLQByBvAOPSUSROSPOMJNKJNQNKIIJJIDzxABAuxGIrkrxR6", " VDusyOKCABABQSPSSSPSRMJJKMKJOOKIIKJGGDBBEAuyCMqdrwT8", " ZDuuxOOBvAvALSSSQSSSNJJJMKJMKOKJHIJHCzyBEByyDIqdqxR ", " ZDusyJKBvAvvCOSPQSTPOJIIKMJKOOOKJKHGFzyyFByyDItjtwR ", " 0HuuyHKBABvvDKSSOSSQKKJHJKIKNQKOKJJKJHzyyyvuDJtmqwS8", " 0DusyHHByByBLNQSRSSOOKKJHGKJKNONOKMMOOByvvsvGIqhtwU6", " ZDyuyHHyvvyFOKOSQSOSQOMJHIJKJJNKNNKNKNCyEAvyJGnmtwS8", " ZDuuyGKCBBABLQQOSPSQSONJIJJMIIKMNMKNLKByBByzKGnhrwU6", " ZFyquHKCBByAKQQPSQQSSSKJIKMKIIJNMOMKNKBvvvuBNDn#qxU8", " ZDyquGKFyAAAHQKQSPQSSQNKIIKJJHIKNKMKOHyvvvvCKDngtxP8", " ZDxtqDPFyAABFKKNSSRSSQOKJKJKGHKNKMHNOBBBBAyFIDjjtxS8", " 0CxqjDNHyAFAAPKOOSPSOQOKKJJIKJKNKJJNKAvBAvzGIzbbtxS ", " ZGxqgzPHyBBAAHQKOOSOQNQNKNKJJMKNMKMQHAvvvuBJHxjitxP7", " XDxtmxMIBBAEBBLQKQQPQOOONOMKNNNKJJPKBABBvvCJGuhktxS8", " ZDxtmxIMCAAEEvHQQKQPOPOONONNNNKIMKPFyyABBzFJzqdjtwU7", " ZDxthwGMFyBEAvBKSQONOQPOOOONKNJINPHBAAAAvCHHxbjqrwS8", " 0DxtmqCMHBAvAAEBKTSNKOSKOKOKMJKNQKByBBAAvFJGu.jttuP ", " 0DxthjxIKFyvAEBEBKSQPOQMKMKMKJOQHAABBEAABGKzq.jqtwT ", " 0DxtjjtDKGBAAFFEAFHQQQSNKNONOQKHAAAAEAvAHKGubbnqtxP ", " 0GxuqjqxIHFyvAFBBBBFHKQQQQQKKKBAAEAAAvvCKJCq.jqrrwU6", " 0GxutqitGJHBAAEFFEABBBFFFHFFBBAABFEAvvBKOHxi#jnqrwU ", " 0DxtqqbizGKHFAvEFAAEEAAAAAByAEAvAEEAvBINKDobiijqqwS ", " 0GxtqrjbjzKKHFABEAAFFEvvAAABBFBvvEAABJPKJxb.iijqsuU8", " ZGxtrrng.uDKKQHFAAAEEEvvEEAEAEFvvvBCKNQNDq.#kkokquU6", " ZDxtrnmk##yGNQSQHBBvvEvvEAEEvvEAyBKNPOPGt##kjknjqwT8", " ZCxtrpnnb.izKPTWUQHEBAvvAAAAyABCHNOPQNMx#ghhhjnnrwU6", " ZDyusnlikb#jDQUUWWWQKFFBBBFCFHKQQPNSNGwj#jjhjmnrrwP ", " ZDxurpjjij##qDPYYVUUTTTQQQKQQPSPRPSNDwg#jjbhhjnqrwR8", " ZGxtsnljihjggqCPVZYVWTTTTTTTQSSRPNDzrggjiebbhjnjqwU7", " 0DxusqjkihibghqxDNUWWWTTTTTSSSNMDxrhgijliidbbjnjrxP8", " 0GxtsnijihhjnhmquwzCHKKKLKJJGDxwsjhhjjljeibbkinnqwS8", " 0GxtrqjjijihnnqsrmmqquuwwwwtrnmhkojqjonedbdbihjqttR7", " ZDxurjjiibhimnrttrrnjoooaoeb#hmmmnjqnjjjihbhijnnqwS8", " 0DxtrljdidbkhnrrtttstsssoininnqnqjqjqjnjikbhijjnjtR ", " ZDxtrnnibhdiknrrttrqqrqrqnnnnnnqnqqnqnjjjjiijjqqqwP8", " ZDxwrnnjdidkknnrtspooosoosoooeoeobbbbbbiaiebiijqtwP ", " ZGxtsnnkghghggmnqssoooooooooeeoooooobbib....#bhqqwP7", " ZGyusoaa...gmqwwzxzyxyzyyxzzxxzyzyzxxzxwtqqoqrnqtwS ", " ZFxsessuusuxzCGMNPOPOPOMKMKIJMJJJJMMIIIIGCzxCCwpquP7", " ZDxsbxHGBzBCHMSYYZYYVWTTSSSQOQSOOQNPOKMKJGCCDHxeeuU6", " ZDxrnzMHCCCFGKUY0ZYVWUUSSPSSPOOONOOONKMMJDCzGHxoowS6", " ZDxrbzMHCzCDHMSUWVUUTSSRPOMPNNKMKMKMJMJIIGCCDHxfpwS ", " 0GxnhzMGCCCDGKNSUTUSSRPSRNMMMNMINNMIIIIIIDCzGHxfltR7", " 0GxrhzIGDBCFGKQTWWTUTUSPPNNKNNKNNNKMMIMIIGzCDHxfdtP6", " ZDxwgzMHCzCCHJQTWWWSTUSSNKKNKKJMKNKJKJJHGCCzGHxsltR8", " ZDxthzMGzyzCGJNTUTUSTUPOKMKMKMKMKMKMJJIIGCCzDHypowS6", " ZDxrjxMGCzzDGMPUVVWUWSSPONONNNPONNNNMMKMGGCCDHyeewS6", " ZDxrhzIGDzCDGNSUZZYYVUUUPORPRRPRPPPPNPMMMGCzDHzletN8", " ZDxqjxMHDCCCHOSVVYVUTUSSNMMMMMMMMJMJMJIIGGzzCFzskrR6", " 0HxtjzGDzxxzDGKOQKKJHGHDCCCCCzCCCzzCzzzzxxqtuxtiktP6", " ZDxtjwxwtjhnqwwxxwwtttwnmqqqosojniooooob....#bgjqtR ", " VDxqnqjj##ggggmmmmmmmmmmgghhghhggggg#ghgjgggghjnqtP7", " ZCxrqjebbbbbhgnnnprrpmnmnhmjjkjkjkjjjnjnjibhjmnnqwP ", " VDxtkniiiebiijnnrrspsljnnjjnjijkjkkkjjjjbd#bdjmhqwP7", " VDxtljliebacbdilrtrppqsnnnjjljiikikikjjkbbcbbhjhqwP7", " VCxrlknkbcbbceknstuspprlnoljjidiidiiiikihbcbdijjquP7", " VCxrrlnkbb#bbiepuzussrlllljlikiidiikikiidbb#bkijqwO8", " VCxrrnlkbcbdbdisyzusprpqlllikiiiikijdjkjjd#bcbkjqtN8", " VCxtrlkkbcbbbilsuuupspslnklkljokokkijdikiebcadikqtP8", " VzxrrnkidbcbdipssspllljpkkkkjljliljkkiieidacbdjjqtM8", " VCwtrnhibabeb.susprpqlklidikikjkjklkfifioebcbdjkqtM8", " VCxtrmmhbacedcptprlrrllidbbiikjknmnlkoieeea.cdkjjrN ", " VCwtrmmic.aadfptplnlllldbbbdjjknmnkjiioeeecacekilnM7", " VCxrrnmdb#acellplkklklkbdbgbhjmkmknjkiiiee.cbdikqqN6", " VCxtrnkjbc.edddkbbeikie#abb#ihjkjhjkikjkebc#ejjiqtM8", " VCxtrnnibbb#bdbdb.abeebaaaabbidjdjkjkjkih##bhdjnqtM8", " 0Dxtrniib#b#bhike.aaaba#a#a.beeidikiikidb#gchjjnmtP8", " 4Izurljibb#bbkqqebc#ac#a#a#a#acbbdbbbiiicb#bhihjnwP8", " 6SCusqkjbb#b#jjlb#bc#a##b######a####bbdbb#bcihjmqxX ", " ZGyuqjjdbbbb#abb#a#aa#a###c##c#a#a#cbbbbbba##cnxM58", " 4Qzuujhg###b..b.b....a#a#a..#......#....a.aeouDV48 ", " 2SJCxtrqnjoeoiaa.bb###ac.djihbbikhnwxxxxzDRU048 ", " 660URPRMOKKLHDFGKOIGCDDDIMIIRNRMMR34355468 ", " 67876 6767666 686666667868868687 " }; gerstensaft-0.3/pixmaps/linkdir.xpm0000644000076500001440000000066206655457645016470 0ustar joeyusers/* XPM */ static char *linkdir_xpm[] = { "16 14 7 1", " c None", "# c #000000", "- c #ffffff", "* c gray50", "h c gray85", "i c purple", "j c yellow", " **** ", " *hjhj* ", " *hjhjhj******* ", "*-------------* ", "*-hjh*hjhjhjhj*#", "*-jh#*jhjhjhjh*#", "*-h#i********j*#", "*-#iiiiiiiiiih*#", "*-h#ii#######j*#", "*-jh#ijhjhjhjh*#", "*-hjh#hjhjhjhj*#", "*-jhjhjhjhjhjh*#", "***************#", " ###############" }; gerstensaft-0.3/pixmaps/linkfile.xpm0000644000076500001440000000063106655457645016625 0ustar joeyusers/* XPM */ static char *linkfile_xpm[] = { "16 14 5 1", " c None", "# c #000000", "- c lightblue", "* c gray50", "h c purple", "*********** ", "*---------** ", "*---------* * ", "*----*----**** ", "*---#*--------* ", "*--#h********-*#", "*-#hhhhhhhhhh-*#", "*--#hh#######-*#", "*---#h--------*#", "*----#--------*#", "*-------------*#", "*-------------*#", "***************#", " ###############" }; gerstensaft-0.3/pixmaps/updir.xpm0000644000076500001440000000061206655457645016152 0ustar joeyusers/* XPM */ static char *dotdot_xpm[] = { "16 14 4 1", " c None", "# c purple", "* c #000000", "- c blue", " ", " ", " # ", " ### ", " ##### ", "####### ", " ### ", " ### ", " ### ", " ###### ### ## ", " ######*###*##*", " ****** *** **", " ", " " }; gerstensaft-0.3/po/0000755000076500001440000000000010536056136013216 5ustar joeyusersgerstensaft-0.3/po/Makefile0000644000076500001440000000316110536050607014654 0ustar joeyusers# Makefile - Frontend for SAFT for X11 # Copyright (c) 1998,9,2007 Joey Schulze # # This file is part of the Gerstensaft package. # # 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, USA. prefix = /usr/local LOCALE_DIR=$(prefix)/share/locale basename=gerstensaft POFILES=$(shell echo *.po) MOFILES=$(POFILES:%.po=%.mo) POXFILES=$(POFILES:%.po=%.pox) LANGUAGES=$(POFILES:%.po=%) ifeq ($(shell whoami),root) install=install -o root -g root else install=install endif .SUFFIXES: .po .mo .pox .po.mo: msgfmt --statistics -o $@ $< .po.pox: msgmerge -o $@ $< gerstensaft.pot all: $(MOFILES) pot: xgettext --keyword=_ --force-po -o gerstensaft.pot ../src/*.c install: all for lang in $(LANGUAGES); do \ test -d $(LOCALE_DIR)/$$lang/LC_MESSAGES || $(install) -d -g root -o root -m 755 $(LOCALE_DIR)/$$lang/LC_MESSAGES; \ $(install) -g root -o root -m 644 $$lang.mo $(LOCALE_DIR)/$$lang/LC_MESSAGES/$(basename).mo; \ done clean: rm -f $(MOFILES) $(POXFILES) gerstensaft-0.3/po/de.po0000644000076500001440000002015310534335220014137 0ustar joeyusers# Copyright (c) 1999,2006 Joey Schulze , # This file is distributed under the same license as the PACKAGE package. # Joey Schulze , 2006 # msgid "" msgstr "" "Project-Id-Version: Gerstensaft 0.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-12-02 18:38+0100\n" "PO-Revision-Date: 2006-12-02 18:39+0100\n" "Last-Translator: Joey Schulze \n" "Language-Team: German Translation Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/beer.c:221 #, c-format msgid "Usage: %s" msgstr "Aufruf: %s" #: ../src/beer.c:222 msgid "display help and exit" msgstr "Hilfe anzeigen und beenden" #: ../src/beer.c:223 msgid "run in message mode" msgstr "Im Nachrichten-Modus starten" #: ../src/beer.c:224 msgid "run in receive mode" msgstr "Im Empfangsmodus starten" #: ../src/beer.c:225 msgid "run in send mode" msgstr "Im Sende-Modus starten" #: ../src/beer.c:226 msgid "display version and exit" msgstr "Version anzeigen und beenden" #: ../src/main.c:409 ../src/main.c:412 #, c-format msgid "From: %s" msgstr "Von: %s" #: ../src/main.c:569 ../src/main.c:570 ../src/send.c:204 msgid "Filename" msgstr "Dateiname" #: ../src/main.c:569 ../src/main.c:570 ../src/send.c:204 msgid "Size" msgstr "Größe" #: ../src/main.c:570 msgid "Date" msgstr "Datum" #: ../src/main.c:582 msgid "Gerstensaft" msgstr "Gerstensaft" #: ../src/main.c:600 msgid "_File" msgstr "_Datei" #: ../src/main.c:606 msgid "_Clear History" msgstr "_Historie löschen" #: ../src/main.c:612 msgid "_Preferences..." msgstr "_Einstellungen..." #: ../src/main.c:620 msgid "_Quit" msgstr "_Beenden" #: ../src/main.c:629 msgid "_Mode" msgstr "_Modus" #: ../src/main.c:634 msgid "_Send" msgstr "_Senden" #: ../src/main.c:640 msgid "_Receive" msgstr "_Empfangen" #: ../src/main.c:646 msgid "_Message" msgstr "_Nachricht" #: ../src/main.c:655 msgid "_Help" msgstr "_Hilfe" #: ../src/main.c:661 msgid "_Todo" msgstr "_Zu tun" #: ../src/main.c:667 msgid "_About" msgstr "_Über" #: ../src/main.c:744 msgid " _Select all " msgstr " _Alle " #: ../src/main.c:748 ../src/send.c:351 msgid "Select all files" msgstr "Markiert alle Dateien" #: ../src/main.c:752 msgid " _Unselect all " msgstr " _Keine " #: ../src/main.c:756 ../src/send.c:359 msgid "Unselected all files" msgstr "Löscht alle Markierungen" #: ../src/main.c:764 msgid "Add selected files to sendlist" msgstr "Ausgewählte Dateien zur Liste hinzufügen" #: ../src/main.c:768 msgid " Send " msgstr " Senden " #: ../src/main.c:773 msgid "Send recorded files to recipient" msgstr "Verschickt die gesammelten Dateien zum Empfänger" #: ../src/main.c:782 msgid "Clear list of selected files" msgstr "Löscht die Liste zu sendender Dateien" #: ../src/main.c:891 msgid "Receive" msgstr "Empfangen" #: ../src/main.c:896 msgid "Receive all selected files and archives" msgstr "Empfangen aller ausgewählten Dateien und Archive" #: ../src/main.c:905 msgid "Refresh receive queue listing" msgstr "Aktualisieren der Anzeige der Empfangswarteschlange" #: ../src/main.c:922 ../src/send.c:252 msgid "Recipient" msgstr "Empfänger" #: ../src/main.c:936 ../src/send.c:264 msgid "Enter recipient's address" msgstr "Adresse des Empfängers eingeben" #: ../src/main.c:945 msgid "Message" msgstr "Nachricht" #: ../src/main.c:957 msgid "Type your message here" msgstr "Geben Sie hier ihre Nachrict ein" #: ../src/main.c:974 msgid "Send" msgstr "Senden" #: ../src/main.c:979 msgid "Send the message to the recipient" msgstr "Verschickt die Nachricht zum Empfänger" #: ../src/msgbox.c:48 msgid "About Gerstensaft" msgstr "Über Gerstensaft" #: ../src/msgbox.c:85 msgid " Graphical frontend to SAFT " msgstr " Grafisches Frontend für SAFT " #: ../src/msgbox.c:120 msgid "Gerstensaft Todo" msgstr "Gerstensaft-Aufgabenliste" #: ../src/msgbox.c:146 msgid " Things to do for Gerstensaft " msgstr " Noch zu tun für Gerstensaft " #: ../src/msgbox.c:150 msgid " Select/Unselect via pattern " msgstr " Auswählen nach Dateimuster " #: ../src/msgbox.c:154 msgid " Gnomification / Support for drag and drop " msgstr " Gnomifikation / Unterstützung für Drag & Drop " #: ../src/options.c:131 msgid "Preferences" msgstr "Einstellungen" #: ../src/options.c:144 msgid "Send Options" msgstr "Sende-Optionen" #: ../src/options.c:154 msgid "_Show Dot Files" msgstr "_Punktdateien anzeigen" #: ../src/options.c:157 msgid "Display files and directories starting with a dot" msgstr "Anzeigen von Dateien und Verzeichnissen, die mit einem Punkt beginnen" #: ../src/options.c:160 msgid "Close Send _Window" msgstr "Sende-_Dialog schließen" #: ../src/options.c:163 msgid "Close the send window after successful transmission" msgstr "Schließen des Sende-Dialogs nach erfolgreicher Übertragung" #: ../src/options.c:166 msgid "Receive Options" msgstr "Empfangsoptionen" #: ../src/options.c:176 msgid "_Keep Files" msgstr "_Dateien behalten" #: ../src/options.c:179 msgid "Keep files in the receive queue after receiving" msgstr "Behalten der Dateien in der Empfangswarteschlange nach Empfang" #: ../src/options.c:182 msgid "Protocol Options" msgstr "Protokolleinstellungen" #: ../src/options.c:192 msgid "_Automatic" msgstr "_Automatisch" #: ../src/options.c:196 msgid "Let sendfile and sendmsg decide which version of IP to use" msgstr "" "sendfile und sendmsg entscheiden selbst, welche Version von IP sie verwenden" #: ../src/options.c:199 msgid "Always IPv_4" msgstr "Immer IPv_4" #: ../src/options.c:203 msgid "Lock sendfile and sendmsg to IP version 4" msgstr "sendfile und sendmsg auf IP Version 4 festlegen" #: ../src/options.c:206 msgid "Always IPv_6" msgstr "Immer IPv_6" #: ../src/options.c:209 msgid "Lock sendfile and sendmsg to IP version 6" msgstr "sendfile und sendmsg auf IP Version 6 festlegen" #: ../src/options.c:226 msgid "Cancel previously made settings and return to main program" msgstr "Einstellungen ignorieren und zum Hauptprogramm zurückkehren" #: ../src/options.c:234 msgid "Accept settings and return to main program" msgstr "Einstellungen übernehmen und zum Hauptprogramm zurückkehren" #: ../src/receive.c:245 #, c-format msgid "" "A file named '%s' already exists. Do you want to replace it with the file " "you are receiving?" msgstr "" "Eine Datei mit dem Namen '%s' existiert bereits. Möchten Sie diesemit der " "Datei ersetzen, die sie empfangen?" #: ../src/receive.c:248 msgid "File exists" msgstr "Datei schon vorhanden" #: ../src/receive.c:269 ../src/saft.c:139 ../src/send.c:437 #, c-format msgid "%s terminated with exit code %d." msgstr "%s mit Fehlercode %d beendet." #: ../src/receive.c:271 ../src/saft.c:91 ../src/saft.c:98 ../src/saft.c:141 #: ../src/send.c:448 msgid "Error condition" msgstr "Fehlerbedingung" #: ../src/saft.c:90 #, c-format msgid "'%s' lacks full path" msgstr "'%s' enthält keinen vollständigen Pfad" #: ../src/saft.c:97 #, c-format msgid "Can't change directory to '%s'" msgstr "Kann nicht in das Verzeichnis '%s' wechseln" #: ../src/send.c:232 msgid "Send Files" msgstr "Dateien Senden" #: ../src/send.c:268 msgid "Comment" msgstr "Kommentar" #: ../src/send.c:275 msgid "Enter optional comment" msgstr "Optionalen Kommentar eingeben" #: ../src/send.c:347 msgid " Select all " msgstr " Alle " #: ../src/send.c:355 msgid " Unselect all " msgstr " Keine " #: ../src/send.c:363 msgid " _Send " msgstr " _Senden " #: ../src/send.c:368 msgid "Send selected files to recipient" msgstr "Verschickt die ausgewählten Dateien zum Empfänger" #: ../src/send.c:376 msgid "Clear list of files" msgstr "Löscht die Liste der Dateien" #: ../src/send.c:384 msgid "Return to main program" msgstr "Zum Hauptprogramm zurückkehren" #: ../src/send.c:442 msgid "Maybe the recipient is not available at the moment." msgstr "Eventuell ist der Empfänger im Moment nicht erreichbar." #: ../src/send.c:468 msgid "Message information" msgstr "Nachrichteninformationen" #: ../src/send.c:469 msgid "" "Your message is longer than the SAFT limit for single messages and will be " "transmitted in several chunks therefore." msgstr "" "Ihre Nachricht ist länger als das Limit von SAFT für einzelne Nachrichten " "und wird daher in mehreren Brocken übertragen." gerstensaft-0.3/po/gerstensaft.pot0000644000076500001440000001372010534335102016261 0ustar joeyusers# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-12-02 18:38+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/beer.c:221 #, c-format msgid "Usage: %s" msgstr "" #: ../src/beer.c:222 msgid "display help and exit" msgstr "" #: ../src/beer.c:223 msgid "run in message mode" msgstr "" #: ../src/beer.c:224 msgid "run in receive mode" msgstr "" #: ../src/beer.c:225 msgid "run in send mode" msgstr "" #: ../src/beer.c:226 msgid "display version and exit" msgstr "" #: ../src/main.c:409 ../src/main.c:412 #, c-format msgid "From: %s" msgstr "" #: ../src/main.c:569 ../src/main.c:570 ../src/send.c:204 msgid "Filename" msgstr "" #: ../src/main.c:569 ../src/main.c:570 ../src/send.c:204 msgid "Size" msgstr "" #: ../src/main.c:570 msgid "Date" msgstr "" #: ../src/main.c:582 msgid "Gerstensaft" msgstr "" #: ../src/main.c:600 msgid "_File" msgstr "" #: ../src/main.c:606 msgid "_Clear History" msgstr "" #: ../src/main.c:612 msgid "_Preferences..." msgstr "" #: ../src/main.c:620 msgid "_Quit" msgstr "" #: ../src/main.c:629 msgid "_Mode" msgstr "" #: ../src/main.c:634 msgid "_Send" msgstr "" #: ../src/main.c:640 msgid "_Receive" msgstr "" #: ../src/main.c:646 msgid "_Message" msgstr "" #: ../src/main.c:655 msgid "_Help" msgstr "" #: ../src/main.c:661 msgid "_Todo" msgstr "" #: ../src/main.c:667 msgid "_About" msgstr "" #: ../src/main.c:744 msgid " _Select all " msgstr "" #: ../src/main.c:748 ../src/send.c:351 msgid "Select all files" msgstr "" #: ../src/main.c:752 msgid " _Unselect all " msgstr "" #: ../src/main.c:756 ../src/send.c:359 msgid "Unselected all files" msgstr "" #: ../src/main.c:764 msgid "Add selected files to sendlist" msgstr "" #: ../src/main.c:768 msgid " Send " msgstr "" #: ../src/main.c:773 msgid "Send recorded files to recipient" msgstr "" #: ../src/main.c:782 msgid "Clear list of selected files" msgstr "" #: ../src/main.c:891 msgid "Receive" msgstr "" #: ../src/main.c:896 msgid "Receive all selected files and archives" msgstr "" #: ../src/main.c:905 msgid "Refresh receive queue listing" msgstr "" #: ../src/main.c:922 ../src/send.c:252 msgid "Recipient" msgstr "" #: ../src/main.c:936 ../src/send.c:264 msgid "Enter recipient's address" msgstr "" #: ../src/main.c:945 msgid "Message" msgstr "" #: ../src/main.c:957 msgid "Type your message here" msgstr "" #: ../src/main.c:974 msgid "Send" msgstr "" #: ../src/main.c:979 msgid "Send the message to the recipient" msgstr "" #: ../src/msgbox.c:48 msgid "About Gerstensaft" msgstr "" #: ../src/msgbox.c:85 msgid " Graphical frontend to SAFT " msgstr "" #: ../src/msgbox.c:120 msgid "Gerstensaft Todo" msgstr "" #: ../src/msgbox.c:146 msgid " Things to do for Gerstensaft " msgstr "" #: ../src/msgbox.c:150 msgid " Select/Unselect via pattern " msgstr "" #: ../src/msgbox.c:154 msgid " Gnomification / Support for drag and drop " msgstr "" #: ../src/options.c:131 msgid "Preferences" msgstr "" #: ../src/options.c:144 msgid "Send Options" msgstr "" #: ../src/options.c:154 msgid "_Show Dot Files" msgstr "" #: ../src/options.c:157 msgid "Display files and directories starting with a dot" msgstr "" #: ../src/options.c:160 msgid "Close Send _Window" msgstr "" #: ../src/options.c:163 msgid "Close the send window after successful transmission" msgstr "" #: ../src/options.c:166 msgid "Receive Options" msgstr "" #: ../src/options.c:176 msgid "_Keep Files" msgstr "" #: ../src/options.c:179 msgid "Keep files in the receive queue after receiving" msgstr "" #: ../src/options.c:182 msgid "Protocol Options" msgstr "" #: ../src/options.c:192 msgid "_Automatic" msgstr "" #: ../src/options.c:196 msgid "Let sendfile and sendmsg decide which version of IP to use" msgstr "" #: ../src/options.c:199 msgid "Always IPv_4" msgstr "" #: ../src/options.c:203 msgid "Lock sendfile and sendmsg to IP version 4" msgstr "" #: ../src/options.c:206 msgid "Always IPv_6" msgstr "" #: ../src/options.c:209 msgid "Lock sendfile and sendmsg to IP version 6" msgstr "" #: ../src/options.c:226 msgid "Cancel previously made settings and return to main program" msgstr "" #: ../src/options.c:234 msgid "Accept settings and return to main program" msgstr "" #: ../src/receive.c:245 #, c-format msgid "" "A file named '%s' already exists. Do you want to replace it with the file " "you are receiving?" msgstr "" #: ../src/receive.c:248 msgid "File exists" msgstr "" #: ../src/receive.c:269 ../src/saft.c:139 ../src/send.c:437 #, c-format msgid "%s terminated with exit code %d." msgstr "" #: ../src/receive.c:271 ../src/saft.c:91 ../src/saft.c:98 ../src/saft.c:141 #: ../src/send.c:448 msgid "Error condition" msgstr "" #: ../src/saft.c:90 #, c-format msgid "'%s' lacks full path" msgstr "" #: ../src/saft.c:97 #, c-format msgid "Can't change directory to '%s'" msgstr "" #: ../src/send.c:232 msgid "Send Files" msgstr "" #: ../src/send.c:268 msgid "Comment" msgstr "" #: ../src/send.c:275 msgid "Enter optional comment" msgstr "" #: ../src/send.c:347 msgid " Select all " msgstr "" #: ../src/send.c:355 msgid " Unselect all " msgstr "" #: ../src/send.c:363 msgid " _Send " msgstr "" #: ../src/send.c:368 msgid "Send selected files to recipient" msgstr "" #: ../src/send.c:376 msgid "Clear list of files" msgstr "" #: ../src/send.c:384 msgid "Return to main program" msgstr "" #: ../src/send.c:442 msgid "Maybe the recipient is not available at the moment." msgstr "" #: ../src/send.c:468 msgid "Message information" msgstr "" #: ../src/send.c:469 msgid "" "Your message is longer than the SAFT limit for single messages and will be " "transmitted in several chunks therefore." msgstr "" gerstensaft-0.3/po/readme0000644000076500001440000000233110536052743014375 0ustar joeyusersTranslations ------------ If you want to translate the used strings into a language that is currently not supported, please go ahead. Following please find a small receipe. . Pick the gerstensaft.pot file and rename it into lang.po (e.g. es.po for espanol). . Edit the main header to refer to you and your work. . Translate all strings given by the `msgid' keyword. Please be very careful about spaces and newlines since they're important for the output later. Please also take care about punctuation characters. . To test your translation run `make lang.mo' which will create the appropriate lang.mo file (e.g. es.mo in the above example) and copy the resulting file into the system location (probably /usr/share/locales/$lang/LC_MESSAGES/gerstensaft.mo) . If you're happy with the translation, send it to me and I'll include it if the language isn't supported yet. If you occur that the translation into a certain language is out of date please contact the former translator and/or go ahead and update the language file. In order to receive a current language file please issue `make lang.pox' which will create the new file as lang.pox. Joey Schulze gerstensaft-0.3/po/ro.po0000644000076500001440000002104210536055530014172 0ustar joeyusers# Romanian translations for PACKAGE package # Traducerea în limba română pentru pachetul PACKAGE. # Copyright (C) 2006 THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Eddy Petrisor , 2006. # Eddy Petrișor , 2006. msgid "" msgstr "" "Project-Id-Version: ro\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-12-02 18:38+0100\n" "PO-Revision-Date: 2006-12-04 09:04+0200\n" "Last-Translator: Eddy Petrișor \n" "Language-Team: Romanian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3;plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1))\n" "X-Generator: KBabel 1.11.4\n" #: ../src/beer.c:221 #, c-format msgid "Usage: %s" msgstr "Utilizare: %s" #: ../src/beer.c:222 msgid "display help and exit" msgstr "afișează ajutorul și iese" #: ../src/beer.c:223 msgid "run in message mode" msgstr "rulează în mod mesaj" #: ../src/beer.c:224 msgid "run in receive mode" msgstr "rulează în mod recepție" #: ../src/beer.c:225 msgid "run in send mode" msgstr "rulează în mod transmisie" #: ../src/beer.c:226 msgid "display version and exit" msgstr "afișează versiunea și iese" #: ../src/main.c:409 ../src/main.c:412 #, c-format msgid "From: %s" msgstr "De la: %s" #: ../src/main.c:569 ../src/main.c:570 ../src/send.c:204 msgid "Filename" msgstr "Nume de fișier" #: ../src/main.c:569 ../src/main.c:570 ../src/send.c:204 msgid "Size" msgstr "Dimensiune" #: ../src/main.c:570 msgid "Date" msgstr "Data" #: ../src/main.c:582 msgid "Gerstensaft" msgstr "Gerstensaft" #: ../src/main.c:600 msgid "_File" msgstr "_Fișier" #: ../src/main.c:606 msgid "_Clear History" msgstr "Șterge istoria" #: ../src/main.c:612 msgid "_Preferences..." msgstr "_Preferințe..." #: ../src/main.c:620 msgid "_Quit" msgstr "Ieșire" #: ../src/main.c:629 msgid "_Mode" msgstr "_Mod" #: ../src/main.c:634 msgid "_Send" msgstr "Trimite" #: ../src/main.c:640 msgid "_Receive" msgstr "_Recepție" #: ../src/main.c:646 msgid "_Message" msgstr "_Mesaj" #: ../src/main.c:655 msgid "_Help" msgstr "Ajutor" #: ../src/main.c:661 msgid "_Todo" msgstr "De făcut" #: ../src/main.c:667 msgid "_About" msgstr "Despre" #: ../src/main.c:744 msgid " _Select all " msgstr " _Selectează tot " #: ../src/main.c:748 ../src/send.c:351 msgid "Select all files" msgstr "Selectează toate fișierele" #: ../src/main.c:752 msgid " _Unselect all " msgstr "Deselectează tot" #: ../src/main.c:756 ../src/send.c:359 msgid "Unselected all files" msgstr "Deselectează toate fișierele" #: ../src/main.c:764 msgid "Add selected files to sendlist" msgstr "Adaugă fișierele selectate la lista de trimitere" #: ../src/main.c:768 msgid " Send " msgstr " Trimite " #: ../src/main.c:773 msgid "Send recorded files to recipient" msgstr "Trimite fișierele înregistrate la destinatar" #: ../src/main.c:782 msgid "Clear list of selected files" msgstr "Șterge lista de fișiere selectate" #: ../src/main.c:891 msgid "Receive" msgstr "Recepționează" #: ../src/main.c:896 msgid "Receive all selected files and archives" msgstr "Recepționează toate fișierele și arhivele selectate" #: ../src/main.c:905 msgid "Refresh receive queue listing" msgstr "Reîmprospatează afișarea cozii de recepție" #: ../src/main.c:922 ../src/send.c:252 msgid "Recipient" msgstr "Destinatar" #: ../src/main.c:936 ../src/send.c:264 msgid "Enter recipient's address" msgstr "Introduceți adresa destinatarului" #: ../src/main.c:945 msgid "Message" msgstr "Mesaj" #: ../src/main.c:957 msgid "Type your message here" msgstr "Scrieți mesajul dumneavoastră aici" #: ../src/main.c:974 msgid "Send" msgstr "Trimite" #: ../src/main.c:979 msgid "Send the message to the recipient" msgstr "Trimite mesajul la destinatar" #: ../src/msgbox.c:48 msgid "About Gerstensaft" msgstr "Despre Gerstensaft" #: ../src/msgbox.c:85 msgid " Graphical frontend to SAFT " msgstr " Interfață grafică pentru SAFT " #: ../src/msgbox.c:120 msgid "Gerstensaft Todo" msgstr "De făcut la Gerstensaft" #: ../src/msgbox.c:146 msgid " Things to do for Gerstensaft " msgstr " Lucrurile de făcut pentru Gerstensaft " #: ../src/msgbox.c:150 msgid " Select/Unselect via pattern " msgstr " Selectează/deselectează prin șabloane " #: ../src/msgbox.c:154 msgid " Gnomification / Support for drag and drop " msgstr " Gnomificare / Suport pentru „drag and drop” " #: ../src/options.c:131 msgid "Preferences" msgstr "Preferințe" #: ../src/options.c:144 msgid "Send Options" msgstr "Opțiuni de transmisie" #: ../src/options.c:154 msgid "_Show Dot Files" msgstr "Afișează fișierele a_scunse" #: ../src/options.c:157 msgid "Display files and directories starting with a dot" msgstr "Afișează fișierele și directoarele care încep cu un punct" #: ../src/options.c:160 msgid "Close Send _Window" msgstr "Închide fereastra de transmisie" #: ../src/options.c:163 msgid "Close the send window after successful transmission" msgstr "Închide fereastra de transmisie după o transmisie reușită" #: ../src/options.c:166 msgid "Receive Options" msgstr "Opțiuni de recepție" #: ../src/options.c:176 msgid "_Keep Files" msgstr "Păstrează fișierele" #: ../src/options.c:179 msgid "Keep files in the receive queue after receiving" msgstr "Păstrează fișierele în coada de recepție după recepție" #: ../src/options.c:182 msgid "Protocol Options" msgstr "Opținuni de protocol" #: ../src/options.c:192 msgid "_Automatic" msgstr "_Automat" #: ../src/options.c:196 msgid "Let sendfile and sendmsg decide which version of IP to use" msgstr "Lasă decizia versiunii IP pe seama sendfile și sendmsg" #: ../src/options.c:199 msgid "Always IPv_4" msgstr "Întotdeauna IPv_4" #: ../src/options.c:203 msgid "Lock sendfile and sendmsg to IP version 4" msgstr "Forțează sendfile și sendmsg să folosească IP versiunea 4" #: ../src/options.c:206 msgid "Always IPv_6" msgstr "Întotdeauna IPv_6" #: ../src/options.c:209 msgid "Lock sendfile and sendmsg to IP version 6" msgstr "Forțează sendfile și sendmsg să folosească IP versiunea 6" #: ../src/options.c:226 msgid "Cancel previously made settings and return to main program" msgstr "Anulează configurațiile făcute anterior și întoarce-te la programul principal" #: ../src/options.c:234 msgid "Accept settings and return to main program" msgstr "Acceptă configurațiile și întoarce-te la programul principal" #: ../src/receive.c:245 #, c-format msgid "" "A file named '%s' already exists. Do you want to replace it with the file " "you are receiving?" msgstr "Există deja un fișier cu numele „%s”. Doriți să-l înlocuiți cu fișierul pe care-l recepționați?" #: ../src/receive.c:248 msgid "File exists" msgstr "Fișierul există" #: ../src/receive.c:269 ../src/saft.c:139 ../src/send.c:437 #, c-format msgid "%s terminated with exit code %d." msgstr "%s s-a terminat cu codul de ieșire %d." #: ../src/receive.c:271 ../src/saft.c:91 ../src/saft.c:98 ../src/saft.c:141 #: ../src/send.c:448 msgid "Error condition" msgstr "Condiție de eroare" #: ../src/saft.c:90 #, c-format msgid "'%s' lacks full path" msgstr "„%s” nu are cale completă" #: ../src/saft.c:97 #, c-format msgid "Can't change directory to '%s'" msgstr "Nu se poate intra în directorul „%s”" #: ../src/send.c:232 msgid "Send Files" msgstr "Trimite fișiere" #: ../src/send.c:268 msgid "Comment" msgstr "Comentariu" #: ../src/send.c:275 msgid "Enter optional comment" msgstr "Introduceți un comentariu opțional" #: ../src/send.c:347 msgid " Select all " msgstr " Selectează tot " #: ../src/send.c:355 msgid " Unselect all " msgstr " Deselectează tot " #: ../src/send.c:363 msgid " _Send " msgstr " Trimite " #: ../src/send.c:368 msgid "Send selected files to recipient" msgstr "Trimite fișierele selectate la destinatar" #: ../src/send.c:376 msgid "Clear list of files" msgstr "Șterge lista de fișiere" #: ../src/send.c:384 msgid "Return to main program" msgstr "Întoarcere la meniul principal" #: ../src/send.c:442 msgid "Maybe the recipient is not available at the moment." msgstr "Poate destinatarul nu este momentan disponibil." #: ../src/send.c:468 # XXX: nu sunt sigur msgid "Message information" msgstr "Informaţie despre mesaj" #: ../src/send.c:469 msgid "" "Your message is longer than the SAFT limit for single messages and will be " "transmitted in several chunks therefore." msgstr "Mesajul dumneavoastră este mai lung decât limita lui SAFT pentru mesaje singulare și, de aceea, va fi trimis în câteva bucăți." gerstensaft-0.3/po/sv.po0000644000076500001440000001757310535071334014217 0ustar joeyusers# Swedish translation for gerstensaft. # Copyright (C) 2006 Free Software Foundation, Inc. # Daniel Nylander , 2006. # msgid "" msgstr "" "Project-Id-Version: gerstensaft\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-12-02 13:53+0100\n" "PO-Revision-Date: 2006-12-03 16:33+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/beer.c:221 #, c-format msgid "Usage: %s" msgstr "Användning: %s" #: ../src/beer.c:222 msgid "display help and exit" msgstr "visa hjälp och avsluta" #: ../src/beer.c:223 msgid "run in message mode" msgstr "kör i meddelandeläge" #: ../src/beer.c:224 msgid "run in receive mode" msgstr "kör i mottagningsläge" #: ../src/beer.c:225 msgid "run in send mode" msgstr "kör i sändläge" #: ../src/beer.c:226 msgid "display version and exit" msgstr "visa version och avsluta" #: ../src/main.c:409 #: ../src/main.c:412 #, c-format msgid "From: %s" msgstr "Från: %s" #: ../src/main.c:569 #: ../src/main.c:570 #: ../src/send.c:204 msgid "Filename" msgstr "Filnamn" #: ../src/main.c:569 #: ../src/main.c:570 #: ../src/send.c:204 msgid "Size" msgstr "Storlek" #: ../src/main.c:570 msgid "Date" msgstr "Datum" #: ../src/main.c:582 msgid "Gerstensaft" msgstr "Gerstensaft" #: ../src/main.c:600 msgid "_File" msgstr "_Arkiv" #: ../src/main.c:606 msgid "_Clear History" msgstr "_Töm historik" #: ../src/main.c:612 msgid "_Preferences..." msgstr "_Inställningar..." #: ../src/main.c:620 msgid "_Quit" msgstr "_Avsluta" #: ../src/main.c:629 msgid "_Mode" msgstr "_Läge" #: ../src/main.c:634 msgid "_Send" msgstr "_Skicka" #: ../src/main.c:640 msgid "_Receive" msgstr "_Ta emot" #: ../src/main.c:646 msgid "_Message" msgstr "_Meddelande" #: ../src/main.c:655 msgid "_Help" msgstr "_Hjälp" #: ../src/main.c:661 msgid "_Todo" msgstr "Att _göra" #: ../src/main.c:667 msgid "_About" msgstr "_Om" #: ../src/main.c:744 msgid " _Select all " msgstr " _Markera allt" #: ../src/main.c:748 #: ../src/send.c:351 msgid "Select all files" msgstr "Markera alla filerna" #: ../src/main.c:752 msgid " _Unselect all " msgstr " _Avmarkera allt" #: ../src/main.c:756 #: ../src/send.c:359 msgid "Unselected all files" msgstr "Avmarkera alla filerna" #: ../src/main.c:764 msgid "Add selected files to sendlist" msgstr "Lägg till markerade filer till sändlista" #: ../src/main.c:768 msgid " Send " msgstr " Skicka " #: ../src/main.c:773 msgid "Send recorded files to recipient" msgstr "Skicka inspelade filer till mottagare" #: ../src/main.c:782 msgid "Clear list of selected files" msgstr "Rensa lista av markerade filer" #: ../src/main.c:891 msgid "Receive" msgstr "Ta emot" #: ../src/main.c:896 msgid "Receive all selected files and archives" msgstr "Ta emot alla markerade filer och arkiv" #: ../src/main.c:905 msgid "Refresh receive queue listing" msgstr "Uppdatera mottagningskön" #: ../src/main.c:922 #: ../src/send.c:252 msgid "Recipient" msgstr "Mottagare" #: ../src/main.c:936 #: ../src/send.c:264 msgid "Enter recipient's address" msgstr "Ange mottagarens adress" #: ../src/main.c:945 msgid "Message" msgstr "Meddelande" #: ../src/main.c:957 msgid "Type your message here" msgstr "Skriv ditt meddelande här" #: ../src/main.c:974 msgid "Send" msgstr "Skicka" #: ../src/main.c:979 msgid "Send the message to the recipient" msgstr "Skicka meddelandet till mottagaren" #: ../src/msgbox.c:48 msgid "About Gerstensaft" msgstr "Om Gerstensaft" #: ../src/msgbox.c:85 msgid " Graphical frontend to SAFT " msgstr " Grafiskt gränssnitt för SAFT " #: ../src/msgbox.c:120 msgid "Gerstensaft Todo" msgstr "Att göra för Gerstensaft" #: ../src/msgbox.c:146 msgid " Things to do for Gerstensaft " msgstr " Saker att göra för Gerstensaft " #: ../src/msgbox.c:150 msgid " Select/Unselect via pattern " msgstr " Markera/Avmarkera via mönster " #: ../src/msgbox.c:154 msgid " Gnomification / Support for drag and drop " msgstr " Gnomifiering / Stöd för dra och släpp " #: ../src/options.c:131 msgid "Preferences" msgstr "Inställningar" #: ../src/options.c:144 msgid "Send Options" msgstr "Sändalternativ" #: ../src/options.c:154 msgid "_Show Dot Files" msgstr "_Visa punktfiler" #: ../src/options.c:157 msgid "Display files and directories starting with a dot" msgstr "Visa filer och kataloger som börjar med en punkt" #: ../src/options.c:160 msgid "Close Send _Window" msgstr "Stäng sänd_fönstret" #: ../src/options.c:163 msgid "Close the send window after successful transmission" msgstr "Stäng sändfönstret efter lyckad överföring" #: ../src/options.c:166 msgid "Receive Options" msgstr "Mottagningsalternativ" #: ../src/options.c:176 msgid "_Keep Files" msgstr "_Behåll filer" #: ../src/options.c:179 msgid "Keep files in the receive queue after receiving" msgstr "Behåll filerna i mottagningskön efter mottagning" #: ../src/options.c:182 msgid "Protocol Options" msgstr "Protokollalternativ" #: ../src/options.c:192 msgid "_Automatic" msgstr "_Automatisk" #: ../src/options.c:196 msgid "Let sendfile and sendmsg decide which version of IP to use" msgstr "Låt sendfile och sendmsg bestämma vilken version av IP som används" #: ../src/options.c:199 msgid "Always IPv_4" msgstr "Alltid IPv_4" #: ../src/options.c:203 msgid "Lock sendfile and sendmsg to IP version 4" msgstr "Lås sendfile och sendmsg till IP version 4" #: ../src/options.c:206 msgid "Always IPv_6" msgstr "Alltid IPv_6" #: ../src/options.c:209 msgid "Lock sendfile and sendmsg to IP version 6" msgstr "Lås sendfile och sendmsg till IP version 6" #: ../src/options.c:226 msgid "Cancel previously made settings and return to main program" msgstr "Avbryt tidigare gjorda inställningar och återgå till huvudprogrammet" #: ../src/options.c:234 msgid "Accept settings and return to main program" msgstr "Acceptera inställningarna och återgå till huvudprogrammet" #: ../src/receive.c:245 #, c-format msgid "A file named '%s' already exists. Do you want to replace it with the file you are receiving?" msgstr "En fil med namnet \"%s\" finns redan. Vill du ersätta den med filen som du tar emot?" #: ../src/receive.c:248 msgid "File exists" msgstr "Filen finns redan" #: ../src/receive.c:269 #: ../src/saft.c:139 #: ../src/send.c:437 #, c-format msgid "%s terminated with exit code %d." msgstr "%s avslutades med felkod %d." #: ../src/receive.c:271 #: ../src/saft.c:91 #: ../src/saft.c:98 #: ../src/saft.c:141 #: ../src/send.c:448 msgid "Error condition" msgstr "Feltillstånd" #: ../src/saft.c:90 #, c-format msgid "'%s' lacks full path" msgstr "\"%s\" saknar fullständig sökväg" #: ../src/saft.c:97 #, c-format msgid "Can't change directory to '%s'" msgstr "Kan inte byta katalog till \"%s\"" #: ../src/send.c:232 msgid "Send Files" msgstr "Skicka filer" #: ../src/send.c:268 msgid "Comment" msgstr "Kommentar" #: ../src/send.c:275 msgid "Enter optional comment" msgstr "Ange valfri kommentar" #: ../src/send.c:347 msgid " Select all " msgstr " Markera allt " #: ../src/send.c:355 msgid " Unselect all " msgstr " Avmarkera allt " #: ../src/send.c:363 msgid " _Send " msgstr " _Skicka" #: ../src/send.c:368 msgid "Send selected files to recipient" msgstr "Skicka markerade filer till mottagaren" #: ../src/send.c:376 msgid "Clear list of files" msgstr "Töm fillista" #: ../src/send.c:384 msgid "Return to main program" msgstr "Gå tillbaka till huvudprogrammet" #: ../src/send.c:442 msgid "Maybe the recipient is not available at the moment." msgstr "Kanske är mottagaren inte tillgänglig just nu." #: ../src/send.c:468 msgid "Message information" msgstr "Meddelandeinformation" #: ../src/send.c:469 msgid "Your message is longer than the SAFT limit for single messages and will be transmitted in several chunks therefore." msgstr "Ditt meddelande är längre än begränsningen i SAFT för enstaka meddelanden och kommer därför att skickas i flera delar." gerstensaft-0.3/po/vi.po0000644000076500001440000002065610535071204014175 0ustar joeyusers# Vietnamese translation for Gerstensaft. # Copyright © 2006 Free Software Foundation, Inc. # Clytie Siddall , 2006. # msgid "" "" msgstr "" "Project-Id-Version: gerstensaft\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-12-02 18:38+0100\n" "PO-Revision-Date: 2006-12-04 22:17+1030\n" "Last-Translator: Clytie Siddall \n" "Language-Team: Vietnamese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Mac PO Editor 1.0a10" #: ../src/beer.c:221 #, c-format msgid "Usage: %s" msgstr "Cách sử dụng: %s" #: ../src/beer.c:222 msgid "display help and exit" msgstr "hiển thị trợ giúp rồi thoát" #: ../src/beer.c:223 msgid "run in message mode" msgstr "chạy trong chế độ thư" #: ../src/beer.c:224 msgid "run in receive mode" msgstr "chạy trong chế độ nhận" #: ../src/beer.c:225 msgid "run in send mode" msgstr "chạy trong chế độ gửi" #: ../src/beer.c:226 msgid "display version and exit" msgstr "hiển thị phiên bản rồi thoát" #: ../src/main.c:409 #: ../src/main.c:412 #, c-format msgid "From: %s" msgstr "Từ : %s" #: ../src/main.c:569 #: ../src/main.c:570 #: ../src/send.c:204 msgid "Filename" msgstr "Tên tập tin" #: ../src/main.c:569 #: ../src/main.c:570 #: ../src/send.c:204 msgid "Size" msgstr "Cỡ" #: ../src/main.c:570 msgid "Date" msgstr "Ngày" #: ../src/main.c:582 msgid "Gerstensaft" msgstr "Gerstensaft" #: ../src/main.c:600 msgid "_File" msgstr "_Tập tin" #: ../src/main.c:606 msgid "_Clear History" msgstr "_Xoá lược sử" #: ../src/main.c:612 msgid "_Preferences..." msgstr "Tù_y thích..." #: ../src/main.c:620 msgid "_Quit" msgstr "T_hoát" #: ../src/main.c:629 msgid "_Mode" msgstr "_Chế độ" #: ../src/main.c:634 msgid "_Send" msgstr "_Gửi" #: ../src/main.c:640 msgid "_Receive" msgstr "_Nhận" #: ../src/main.c:646 msgid "_Message" msgstr "_Thư" #: ../src/main.c:655 msgid "_Help" msgstr "Trợ g_iúp" #: ../src/main.c:661 msgid "_Todo" msgstr "Cần _làm" #: ../src/main.c:667 msgid "_About" msgstr "_Giới thiệu" #: ../src/main.c:744 msgid " _Select all " msgstr " Chọn _hết " #: ../src/main.c:748 #: ../src/send.c:351 msgid "Select all files" msgstr "Chọn tất cả các tập tin" #: ../src/main.c:752 msgid " _Unselect all " msgstr " Hủ_y chọn hết " #: ../src/main.c:756 #: ../src/send.c:359 msgid "Unselected all files" msgstr "Thôi chọn tất cả các tập tin" #: ../src/main.c:764 msgid "Add selected files to sendlist" msgstr "Thêm các tập tin đã chọn vào danh sách gửi" #: ../src/main.c:768 msgid " Send " msgstr " Gửi " #: ../src/main.c:773 msgid "Send recorded files to recipient" msgstr "Gửi các tập tin đã ghi lưu cho người nhận" #: ../src/main.c:782 msgid "Clear list of selected files" msgstr "Xoá danh sách các tập tin đã chọn" #: ../src/main.c:891 msgid "Receive" msgstr "Nhận" #: ../src/main.c:896 msgid "Receive all selected files and archives" msgstr "Nhận tất cả các tập tin và kho lưu đã chọn" #: ../src/main.c:905 msgid "Refresh receive queue listing" msgstr "Cập nhật danh sách hàng đợi" #: ../src/main.c:922 #: ../src/send.c:252 msgid "Recipient" msgstr "Người nhận" #: ../src/main.c:936 #: ../src/send.c:264 msgid "Enter recipient's address" msgstr "Gõ địa chỉ của người nhận" #: ../src/main.c:945 msgid "Message" msgstr "Thư" #: ../src/main.c:957 msgid "Type your message here" msgstr "Gõ thư vào đây" #: ../src/main.c:974 msgid "Send" msgstr "Gửi" #: ../src/main.c:979 msgid "Send the message to the recipient" msgstr "Gửi thư cho người nhận" #: ../src/msgbox.c:48 msgid "About Gerstensaft" msgstr "Giới thiệu về Gerstensaft" #: ../src/msgbox.c:85 msgid " Graphical frontend to SAFT " msgstr " Giao diện đồ họa của SAFT " #: ../src/msgbox.c:120 msgid "Gerstensaft Todo" msgstr "Cần Làm Gerstensaft" #: ../src/msgbox.c:146 msgid " Things to do for Gerstensaft " msgstr " Các việc cần làm đối với Gerstensaft " #: ../src/msgbox.c:150 msgid " Select/Unselect via pattern " msgstr " Chọn/hủy chọn theo mẫu " #: ../src/msgbox.c:154 msgid " Gnomification / Support for drag and drop " msgstr " Hỗ trợ khả năng kéo và thả " #: ../src/options.c:131 msgid "Preferences" msgstr "Tùy thích" #: ../src/options.c:144 msgid "Send Options" msgstr "Tùy chọn gửi" #: ../src/options.c:154 msgid "_Show Dot Files" msgstr "_Hiện tập tin chấm" #: ../src/options.c:157 msgid "Display files and directories starting with a dot" msgstr "Hiển thị các tập tin và thư mục có tên bắt đầu với dấu chấm" #: ../src/options.c:160 msgid "Close Send _Window" msgstr "Đóng cửa _sổ gửi" #: ../src/options.c:163 msgid "Close the send window after successful transmission" msgstr "Đóng cửa sổ gửi sau khi truyền được" #: ../src/options.c:166 msgid "Receive Options" msgstr "Tùy chọn nhận" #: ../src/options.c:176 msgid "_Keep Files" msgstr "_Giữ tập tin" #: ../src/options.c:179 msgid "Keep files in the receive queue after receiving" msgstr "Giữ các tập tin trong hàng đợi nhận sau khi nhận" #: ../src/options.c:182 msgid "Protocol Options" msgstr "Tùy chọn giao thức" #: ../src/options.c:192 msgid "_Automatic" msgstr "_Tự động" #: ../src/options.c:196 msgid "Let sendfile and sendmsg decide which version of IP to use" msgstr "Cho phép sendfile và sendmsg quyết định phiên bản IP nào cần dùng" #: ../src/options.c:199 msgid "Always IPv_4" msgstr "Luôn luôn IPv_4" #: ../src/options.c:203 msgid "Lock sendfile and sendmsg to IP version 4" msgstr "Khoá sendfile và sendmsg tới IP phiên bản 4" #: ../src/options.c:206 msgid "Always IPv_6" msgstr "Luôn luôn IPv_6" #: ../src/options.c:209 msgid "Lock sendfile and sendmsg to IP version 6" msgstr "Khoá sendfile và sendmsg tới IP phiên bản 6" #: ../src/options.c:226 msgid "Cancel previously made settings and return to main program" msgstr " Hủy thiết lập đã được tạo và trở về chương trình chính" #: ../src/options.c:234 msgid "Accept settings and return to main program" msgstr " Chấp nhận thiết lập và trở về chương trình chính" #: ../src/receive.c:245 #, c-format msgid "" "A file named '%s' already exists. Do you want to replace it with the file " "you are receiving?" msgstr "" "Tập tin tên « %s » đã có. Bạn có muốn thay thế nó bằng tập tin đang nhận không?" #: ../src/receive.c:248 msgid "File exists" msgstr "Tập tin đã có" #: ../src/receive.c:269 #: ../src/saft.c:139 #: ../src/send.c:437 #, c-format msgid "%s terminated with exit code %d." msgstr "%s đã kết thúc với mã thoát %d." #: ../src/receive.c:271 #: ../src/saft.c:91 #: ../src/saft.c:98 #: ../src/saft.c:141 #: ../src/send.c:448 msgid "Error condition" msgstr "Điều kiện lỗi." #: ../src/saft.c:90 #, c-format msgid "'%s' lacks full path" msgstr "« %s » thiếu đường dẫn đầy đủ" #: ../src/saft.c:97 #, c-format msgid "Can't change directory to '%s'" msgstr "Không thể thay đổi thư mục thành « %s »" #: ../src/send.c:232 msgid "Send Files" msgstr "Gửi tập tin" #: ../src/send.c:268 msgid "Comment" msgstr "Ghi chú" #: ../src/send.c:275 msgid "Enter optional comment" msgstr "Gõ chú thích tùy chọn" #: ../src/send.c:347 msgid " Select all " msgstr " Chọn hết " #: ../src/send.c:355 msgid " Unselect all " msgstr " Hủy chọn hết " #: ../src/send.c:363 msgid " _Send " msgstr " _Gửi " #: ../src/send.c:368 msgid "Send selected files to recipient" msgstr "Gửi các tập tin đã chọn cho người nhận" #: ../src/send.c:376 msgid "Clear list of files" msgstr "Xoá sạch danh sách tập tin" #: ../src/send.c:384 msgid "Return to main program" msgstr "Trở về chương trình chính" #: ../src/send.c:442 msgid "Maybe the recipient is not available at the moment." msgstr "Có lẽ người nhận không sẵn sàng vào lúc này." #: ../src/send.c:468 msgid "Message information" msgstr "Thông tin thư" #: ../src/send.c:469 msgid "" "Your message is longer than the SAFT limit for single messages and will be " "transmitted in several chunks therefore." msgstr "" "Bạn đã viết một lá thư dài hơn sự hạn chế SAFT cho mỗi thư nên nó sẽ được truyền theo vài phần riêng." gerstensaft-0.3/src/0000755000076500001440000000000010536056136013367 5ustar joeyusersgerstensaft-0.3/src/Makefile0000644000076500001440000000302610533342241015020 0ustar joeyusers# Makefile - Frontend for SAFT for X11 # Copyright (c) 1999,2006 Joey Schulze # # This file is part of the Gerstensaft package. # # 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, USA. prefix = /usr/local CC = gcc CFLAGS=-g -Wall \ -DG_DISABLE_DEPRECATED \ -DGDK_DISABLE_DEPRECATED \ -DGDK_PIXBUF_DISABLE_DEPRECATED GTK_CFLAGS=$(shell pkg-config gtk+-2.0 --cflags) GTK_LDFLAGS=$(shell pkg-config gtk+-2.0 --libs) CFLAGS+=$(GTK_CFLAGS) LDFLAGS+=$(GTK_LDFLAGS) ifneq ($(CONFIG_LFS),) CFLAGS+=$(shell getconf LFS_CFLAGS) endif OBJS=beer.o msgbox.o main.o io.o send.o saft.o gutils.o receive.o options.o ifeq ($(shell whoami),root) install=install -o root -g root else install=install endif beer: $(OBJS) install: beer test -d $(prefix)/bin || $(install) -d -g root -o root -m 755 $(prefix)/bin $(install) -s -m 755 beer $(prefix)/bin clean: rm -f $(OBJS) core beer gerstensaft-0.3/src/beer.c0000644000076500001440000001566410534254125014460 0ustar joeyusers/* beer.c - Frontend for SAFT for X11 Copyright (c) 1999,2001,6 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include "main.h" #include "nls.h" #include "config.h" #include "beer.h" #include "io.h" char progname[] = "Gerstensaft"; char version[] = "0.3"; struct s_conf config = { NULL, 1 }; int beer_exitcode = EXIT_OK; extern int errno; static struct option long_options[] = { {"help", no_argument, 0, 'h'}, {0, 0, 0, 0} }; void read_config () { char *fname; char buf[300]; char *cp, *xp; FILE *f; int remainder; config.addrs = NULL; config.keep = TRUE; config.closewindow = FALSE; config.protocol = PROTOCOL_AUTO; config.dotfiles = FALSE; if (asprintf (&fname, "%s/.gerstensaft/history", getenv("HOME")) == -1) return; if ((f = fopen (fname, "r")) != NULL) { for (cp = fgets(buf, sizeof(buf)-1, f); cp != NULL; cp = fgets(buf, sizeof(buf)-1, f) ) { remainder = !(buf[strlen(buf)-1] == '\n'); if (!remainder) buf[strlen(buf)-1] = '\0'; if (strlen(buf) && !strncasecmp(buf, "Recipient", 9) && isspace(buf[9])) { for (cp=buf+10; *cp && isspace(*cp); cp++); xp = (char *)malloc (strlen(cp)+1); sprintf (xp, cp); config.addrs = g_list_insert_sorted (config.addrs, xp, (GCompareFunc)strcmp); } /* throw away superflous stuff */ if (remainder) { for (cp = fgets(buf, sizeof(buf)-1, f); cp != NULL && buf[strlen(buf)-1] != '\n'; cp = fgets(buf, sizeof(buf)-1, f) ); } } fclose (f); } free (fname); if (asprintf (&fname, "%s/.gerstensaft/config", getenv("HOME")) == -1) return; if ((f = fopen (fname, "r")) != NULL) { for (cp = fgets(buf, sizeof(buf)-1, f); cp != NULL; cp = fgets(buf, sizeof(buf)-1, f) ) { remainder = !(buf[strlen(buf)-1] == '\n'); if (!remainder) buf[strlen(buf)-1] = '\0'; if (strlen(buf)) { if (!strncasecmp(buf, "KeepFiles", 9) && isspace(buf[9])) { for (cp=buf+10; *cp && isspace(*cp); cp++); if (!strncasecmp(cp, "false", 5)) config.keep = FALSE; } else if (!strncasecmp(buf, "DotFiles", 8) && isspace(buf[8])) { for (cp=buf+9; *cp && isspace(*cp); cp++); if (!strncasecmp(cp, "true", 4)) config.closewindow = TRUE; } else if (!strncasecmp(buf, "CloseWindow", 11) && isspace(buf[11])) { for (cp=buf+12; *cp && isspace(*cp); cp++); if (!strncasecmp(cp, "true", 4)) config.dotfiles = TRUE; } else if (!strncasecmp(buf, "Protocol", 8) && isspace(buf[8])) { for (cp=buf+9; *cp && isspace(*cp); cp++); if (!strncasecmp(cp, "ipv4", 4)) config.protocol = PROTOCOL_IPV4; else if (!strncasecmp(cp, "ipv6", 4)) config.protocol = PROTOCOL_IPV6; } } /* throw away superflous stuff */ if (remainder) { for (cp = fgets(buf, sizeof(buf)-1, f); cp != NULL && buf[strlen(buf)-1] != '\n'; cp = fgets(buf, sizeof(buf)-1, f) ); } } fclose (f); } free (fname); } void write_config() { char *fname; int i; FILE *f; if (!getenv("HOME")) return; if (asprintf (&fname, "%s/.gerstensaft", getenv("HOME")) == -1) return; if (!is_dir (fname, NULL)) mkdir (fname, 0700); free (fname); if (asprintf (&fname, "%s/.gerstensaft/history", getenv("HOME")) == -1) return; if (!g_list_length (config.addrs)) { unlink (fname); return; } if ((f=fopen (fname,"w")) != NULL) { for (i=0;idata); fclose (f); } free (fname); if (asprintf (&fname, "%s/.gerstensaft/config", getenv("HOME")) == -1) return; if ((f=fopen (fname,"w")) != NULL) { fprintf (f, "KeepFiles %s\n", config.keep?"true":"false"); fprintf (f, "CloseWindow %s\n", config.closewindow?"true":"false"); fprintf (f, "DotFiles %s\n", config.dotfiles?"true":"false"); switch (config.protocol) { case PROTOCOL_AUTO: fprintf (f, "Protocol auto\n"); break; case PROTOCOL_IPV4: fprintf (f, "Protocol ipv4\n"); break; case PROTOCOL_IPV6: fprintf (f, "Protocol ipv6\n"); break; } fclose (f); } free (fname); } void clear_history () { GList *elem; while (g_list_length (config.addrs)) { elem = g_list_nth (config.addrs, 0); free (elem->data); config.addrs = g_list_remove_link (config.addrs, elem); g_list_free (elem); } g_list_free (config.addrs); config.addrs = NULL; } void clear_config () { clear_history(); } void usage() { printf ("%s %s\n\n", progname, version); printf (_("Usage: %s"), "beer [-hv] [-srm]\n\n"); printf (" -h %s\n", _("display help and exit")); printf (" -m %s\n", _("run in message mode")); printf (" -r %s\n", _("run in receive mode")); printf (" -s %s\n", _("run in send mode")); printf (" -v %s\n", _("display version and exit")); } int main (int argc, char *argv[]) { int c; int longindex; unsigned short int startmode = MOD_SEND; bindtextdomain ("gerstensaft", LOCALE_DIR); textdomain ("gerstensaft"); /* Pass arguments to GTK * --display * --debug-level * --no-xshm * --sync * --show-events * --no-show-events * --name * --class */ gtk_init (&argc, &argv); optind = 0; while ( (c = getopt_long(argc, argv, "hmrsv", long_options, &longindex)) != -1 ) { switch (c) { case 'h': usage(); exit (beer_exitcode); case 'm': startmode = MOD_MESSAGE; break; case 'r': startmode = MOD_RECEIVE; break; case 's': startmode = MOD_SEND; break; case 'v': printf ("%s %s\n", progname, version); exit (beer_exitcode); } /* switch */ } /* while */ read_config (); main_window (startmode); gtk_main(); #ifdef DEBUG for (longindex=0;longindexdata); } #endif write_config(); clear_config(); #ifdef DEBUG printf ("return %d\n", beer_exitcode); #endif return beer_exitcode; } gerstensaft-0.3/src/beer.h0000644000076500001440000000270310534250627014456 0ustar joeyusers/* beer.h - Frontend for SAFT for X11 Copyright (c) 1999,2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #ifndef __BEER_H__ #define __BEER_H__ #include #include /* Contains the name of the program and version */ extern char progname[]; extern char version[]; #define PROTOCOL_AUTO 1 #define PROTOCOL_IPV4 2 #define PROTOCOL_IPV6 3 struct s_conf { GList *addrs; uint8_t keep; uint8_t closewindow; uint8_t protocol; uint8_t dotfiles; }; extern struct s_conf config; void clear_history (); /* Contains the exit code set somewhere within the program */ extern int beer_exitcode; #define EXIT_OK 0 #define EXIT_CANCEL 1 #define EXIT_DELETE 2 #endif /* __BEER_H__ */ gerstensaft-0.3/src/gutils.c0000644000076500001440000000504610533340512015036 0ustar joeyusers/* gutils.c - Gtk/Glib utilitis Copyright (c) 2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #include "gutils.h" #include #include #include #include #include int clist_contains (GtkCList *clist, int column, char *needle) { GList *row; char *tmp; if (! GTK_IS_CLIST(clist)) return 0; for (row = GTK_CLIST(clist)->row_list; row; row = row->next) { gtk_clist_get_text(GTK_CLIST(clist), (int)row->data, column, &tmp); if (!strcmp(tmp, needle)) return 1; } return 0; } int filebox_append (GtkCList *filebox, char *fullname) { char *fname; char asize[10]; char *dummy = ""; char *clp[3] = {dummy, fullname, asize}; struct stat st; GdkColor background; GdkColormap *colormap; int i; for (i=0; i < GTK_CLIST(filebox)->rows; i++) { gtk_clist_get_text (GTK_CLIST(filebox), i, 1, &fname); if (!strcmp (fname, fullname)) return 0; } /* Obviously the file wasn't found, so it needs to be added */ if (stat (fullname, &st)) return 0; #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 snprintf (asize, sizeof (asize), "%lld", (st.st_size+1023)/1024); #else snprintf (asize, sizeof (asize), "%ld", (st.st_size+1023)/1024); #endif gtk_clist_append (GTK_CLIST(filebox), clp); background.red = background.green = background.blue = ~0; colormap = gdk_colormap_get_system(); gdk_color_alloc (colormap, &background); gtk_clist_set_background (GTK_CLIST(filebox), GTK_CLIST(filebox)->rows-1, &background); if (S_ISDIR(st.st_mode)) gtk_clist_set_pixmap (GTK_CLIST(filebox), GTK_CLIST(filebox)->rows-1, 0, dir_pixmap, dir_mask); else gtk_clist_set_pixmap (GTK_CLIST(filebox), GTK_CLIST(filebox)->rows-1, 0, doc_pixmap, doc_mask); return 1; } gerstensaft-0.3/src/gutils.h0000644000076500001440000000261310532261034015040 0ustar joeyusers/* gutils.h - Gtk/Glib utilitis Copyright (c) 2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #ifndef __GUTILS_H__ #define __GUTILS_H__ #include extern GdkPixmap *dir_pixmap, *linkdir_pixmap, *linkfile_pixmap, *updir_pixmap, *doc_pixmap; extern GdkBitmap *dir_mask, *linkdir_mask, *linkfile_mask, *updir_mask, *doc_mask; /* Check if the clist has needle in column */ int clist_contains (GtkCList *clist, int column, char *needle); /* Possibly add a name to the list */ int filebox_append (GtkCList *filebox, char *fullname); #endif /* __GUTILS_H__ */ gerstensaft-0.3/src/io.c0000644000076500001440000001424010534036365014143 0ustar joeyusers/* io.c - I/O routines Copyright (c) 1999,2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #include "beer.h" #include "io.h" #include #include #include #include #include #include #include struct s_file *get_dir (const char *dir) { struct stat st; struct s_file *files, *fp; DIR *dirfd; struct dirent *entry; char *fname; files = NULL; if ((fname = (char *)malloc(strlen(dir)+256)) == NULL) return NULL; if (!stat (dir, &st)) { if (S_ISDIR (st.st_mode)) { if ((dirfd = opendir (dir)) != NULL) { while ((entry = readdir (dirfd)) != NULL) { if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) continue; if (!(config.dotfiles) && (entry->d_name[0] == '.')) continue; if ((fp = (struct s_file *)malloc(sizeof(struct s_file))) != NULL) { fp->next = NULL; if ((fp->name = (char *)malloc(strlen(entry->d_name)+1)) != NULL) strcpy (fp->name, entry->d_name); snprintf (fname, strlen(dir)+256, "%s/%s", dir, entry->d_name); if (!lstat (fname, &st)) fp->size = st.st_size; else fp->size = 0; if (S_ISLNK (st.st_mode)) { if (!stat (fname, &st)) { if (S_ISDIR (st.st_mode)) fp->type = FILE_LINKDIR; else fp->type = FILE_LINK; } else fp->type = FILE_LINKDIR; } else { if (S_ISDIR (st.st_mode)) fp->type = FILE_DIRECTORY; else fp->type = FILE_REGULAR; } if (files == 0) files = fp; else { struct s_file *tmp, *pred; pred = 0; tmp = files; while (tmp != 0) if (strcmp (fp->name, tmp->name) < 0) break; else { pred = tmp; tmp = tmp->next; } if (pred) { pred->next = fp; fp->next = tmp; } else { fp->next = tmp; files = fp; } } } } closedir (dirfd); } else return NULL; } else return NULL; } else return NULL; if ((fp = (struct s_file *)malloc(sizeof(struct s_file))) != NULL) { fp->next = files; files = fp; if ((fp->name = (char *)malloc(3)) != NULL) strcpy (fp->name, ".."); fp->size = 0; fp->type = FILE_UPDIR; } return files; } void free_dir (struct s_file *files) { struct s_file *fp; for (fp=files; fp; fp=fp->next) { if (fp->name) free (fp->name); free (fp); } } char *check_and_adjust_dir (const char *dir) { char *cp; int i; if (!dir || !strlen(dir)) return NULL; /* Remove trailing '/' */ for (i=strlen(dir)-1; i>0 && dir[i]=='/'; i--); if ((cp = (char *)malloc (i+2)) == NULL) return NULL; strncpy (cp, dir, i+1); *(cp+i+1) = '\0'; return cp; } int list_contains_file (char **list, int length, const char *dir, const char *file) { char *fname; int i; if (!dir || !file) return 0; if ((fname = (char *)malloc (strlen (dir) + strlen (file) +2)) == NULL) return 0; sprintf (fname, "%s/%s", dir, file); for (i=0; i * which he put in the public domain. * * Returns the amount of space a directory (with or without its subdirs) * occupies. */ unsigned long int getdirsize (const char *dirname) { unsigned long int size; DIR *d; struct dirent *dent; struct stat sbuf; char newdir[NAME_MAX]; if (dirname == NULL || !strlen (dirname) || !(d = opendir ((dirname)))) return 0; size = 0; while ((dent = readdir (d)) != NULL) { snprintf (newdir, sizeof(newdir), "%s/%s", dirname, dent->d_name); lstat (newdir, &sbuf); if (sbuf.st_mode & S_IFREG) size += sbuf.st_size; else if (S_ISDIR (sbuf.st_mode) && strcmp (dent->d_name, ".") && strcmp (dent->d_name, "..")) size += getdirsize (newdir); } return (size); } unsigned long int get_filesize (const char *name) { struct stat st; if (!name) return 0; if (!stat (name, &st)) { if (S_ISDIR (st.st_mode)) { return getdirsize (name); } else return (st.st_size); } return 0; } char *escape_quotes (char *text) { char *stext; char *cp, *xp; int count; for (cp=text,count=0; *cp; cp++) if (*cp == '\'') count++; if ((stext = (char *)malloc(strlen(text) + count*3 + 1)) == NULL) return NULL; memset (stext, 0, strlen(text) + count*3 + 1); for (cp=text,xp=stext; *cp; cp++) if (*cp == '\'') { *(xp++) = '\''; *(xp++) = '\\'; *(xp++) = '\''; *(xp++) = '\''; } else *(xp++) = *cp; return stext; } gerstensaft-0.3/src/io.h0000644000076500001440000000277410533340457014160 0ustar joeyusers/* io.h - I/O routines Copyright (c) 1999,2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #ifndef __IO_H__ #define __IO_H__ #include struct s_file { char *name; off_t size; int type; struct s_file *next; }; typedef enum { FILE_REGULAR, FILE_DIRECTORY, FILE_LINK, FILE_LINKDIR, FILE_UPDIR } io_filetype; struct s_file *get_dir (const char *dir); void free_dir (struct s_file *files); char *check_and_adjust_dir (const char *dir); int list_contains_file (char **list, int length, const char *dir, const char *file); int exists (const char *dir, const char *file); int is_dir (const char *dir, const char *file); unsigned long int get_filesize (const char *name); char *escape_quotes (char *text); #endif /* __IO_H__ */ gerstensaft-0.3/src/main.c0000644000076500001440000011253410534274021014456 0ustar joeyusers/* main.c - Provide the main window and related routines Copyright (c) 1999,2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #define _GNU_SOURCE #include #include #include #include #include #include "msgbox.h" #include "main.h" #include "io.h" #include "beer.h" #include "send.h" #include "nls.h" #include "gutils.h" #include "config.h" #include "receive.h" #include "options.h" #include GdkPixmap *dir_pixmap = NULL, *linkdir_pixmap = NULL, *linkfile_pixmap = NULL, *updir_pixmap = NULL, *doc_pixmap = NULL; GdkBitmap *dir_mask = NULL, *linkdir_mask = NULL, *linkfile_mask = NULL, *updir_mask = NULL, *doc_mask = NULL; gint main_delete(GtkWidget *widget, GdkEvent *event, gpointer data) { return (FALSE); } void main_destroy (GtkWidget *widget, gpointer data) { if (((struct s_main_data *) data) != NULL) { if (((struct s_main_data *) data)->dir != NULL) free (((struct s_main_data *) data)->dir); free (((struct s_main_data *) data)); } gtk_main_quit (); } void menu_mode_send (GtkWidget *widget, gpointer data) { if (((struct s_main_data *) data)->mode != MOD_SEND) { if (((struct s_main_data *) data)->mode == MOD_RECEIVE) gtk_widget_hide (((struct s_main_data *) data)->container_receive); else gtk_widget_hide (((struct s_main_data *) data)->container_message); gtk_widget_show (((struct s_main_data *) data)->container_send); gtk_widget_set_sensitive (GTK_WIDGET(((struct s_main_data *) data)->modeitem[((struct s_main_data *) data)->mode]), TRUE); ((struct s_main_data *) data)->mode = MOD_SEND; gtk_widget_set_sensitive (GTK_WIDGET(((struct s_main_data *) data)->modeitem[((struct s_main_data *) data)->mode]), FALSE); } } void menu_mode_receive (GtkWidget *widget, gpointer data) { if (((struct s_main_data *) data)->mode != MOD_RECEIVE) { parse_receive ((struct s_main_data *)data); if (((struct s_main_data *) data)->mode == MOD_SEND) gtk_widget_hide (((struct s_main_data *) data)->container_send); else gtk_widget_hide (((struct s_main_data *) data)->container_message); gtk_widget_show (((struct s_main_data *) data)->container_receive); gtk_widget_set_sensitive (GTK_WIDGET(((struct s_main_data *) data)->modeitem[((struct s_main_data *) data)->mode]), TRUE); ((struct s_main_data *) data)->mode = MOD_RECEIVE; gtk_widget_set_sensitive (GTK_WIDGET(((struct s_main_data *) data)->modeitem[((struct s_main_data *) data)->mode]), FALSE); } } void menu_mode_message (GtkWidget *widget, gpointer data) { if (((struct s_main_data *) data)->mode != MOD_MESSAGE) { if (((struct s_main_data *) data)->mode == MOD_SEND) gtk_widget_hide (((struct s_main_data *) data)->container_send); else gtk_widget_hide (((struct s_main_data *) data)->container_receive); gtk_widget_show (((struct s_main_data *) data)->container_message); gtk_widget_set_sensitive (GTK_WIDGET(((struct s_main_data *) data)->modeitem[((struct s_main_data *) data)->mode]), TRUE); ((struct s_main_data *) data)->mode = MOD_MESSAGE; gtk_widget_set_sensitive (GTK_WIDGET(((struct s_main_data *) data)->modeitem[((struct s_main_data *) data)->mode]), FALSE); } } void message_addr_change (GtkWidget *widget, gpointer data) { GtkTextBuffer *buffer; if (strlen(gtk_entry_get_text (GTK_ENTRY(widget))) > 0) { if (!((struct s_main_data *) data)->addrok) { buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(((struct s_main_data *) data)->msginput)); if (gtk_text_buffer_get_char_count(buffer) > 0) { ((struct s_main_data *) data)->addrok = 1; gtk_widget_set_sensitive (((struct s_main_data *) data)->msgsend, TRUE); } } } else { if (((struct s_main_data *) data)->addrok) { ((struct s_main_data *) data)->addrok = 0; gtk_widget_set_sensitive (((struct s_main_data *) data)->msgsend, FALSE); } } } void message_input_change (GObject *object, gpointer data) { if (((struct s_main_data *) data)->addrok) { if (gtk_text_buffer_get_char_count(GTK_TEXT_BUFFER(object)) == 0) { ((struct s_main_data *) data)->addrok = 0; gtk_widget_set_sensitive (((struct s_main_data *) data)->msgsend, FALSE); } } else { if (gtk_text_buffer_get_char_count(GTK_TEXT_BUFFER(object)) > 0 && strlen(gtk_entry_get_text (GTK_ENTRY(GTK_COMBO(((struct s_main_data *) data)->addrinput)->entry))) > 0) { ((struct s_main_data *) data)->addrok = 1; gtk_widget_set_sensitive (((struct s_main_data *) data)->msgsend, TRUE); } } } void menu_clear_history (GtkWidget *widget, gpointer data) { clear_history(); } void load_pixmap (const char *name, GtkWidget *parent, GdkPixmap **pixmap, GdkBitmap **mask) { char fname[1024]; GtkStyle *style; snprintf (fname, sizeof(fname), "%s/%s", PIXMAP_DIR, name); style = gtk_widget_get_style (parent); *pixmap = gdk_pixmap_create_from_xpm (parent->window, mask, &style->bg[GTK_STATE_NORMAL], fname); } void read_directory (struct s_main_data *wdata, const char *dir) { struct s_file *files, *fp; char *name, size[10]; char **clp; gint pos; GdkColor background; GdkColormap *colormap; #ifdef DEBUG printf ("read_directory(%s)\n", dir); #endif if ((clp = (char **)malloc(sizeof(char *)*3)) == NULL) return; clp[0] = NULL; /* Copy the new directory into local variable */ if (wdata->dir) free (wdata->dir); wdata->dir = check_and_adjust_dir (dir); if ((files = get_dir (wdata->dir)) != NULL) { gtk_clist_freeze (GTK_CLIST(wdata->listbox)); gtk_clist_clear (GTK_CLIST(wdata->listbox)); for (fp = files; fp; fp=fp->next) { if ((name = (char *)malloc(strlen(fp->name)+1)) == NULL) continue; memcpy (name, fp->name, strlen(fp->name)+1); clp[1] = name; #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 snprintf (size, sizeof (size), "%lld", (fp->size+1023)/1024); #else snprintf (size, sizeof (size), "%ld", (fp->size+1023)/1024); #endif if ((name = strdup(size)) == NULL) continue; clp[2] = name; pos = gtk_clist_append (GTK_CLIST(wdata->listbox), clp); background.red = background.green = background.blue = ~0; colormap = gdk_colormap_get_system(); gdk_color_alloc (colormap, &background); gtk_clist_set_background (GTK_CLIST(wdata->listbox), pos, &background); switch (fp->type) { case FILE_REGULAR: gtk_clist_set_pixmap (GTK_CLIST(wdata->listbox), pos, 0, doc_pixmap, doc_mask); break; case FILE_DIRECTORY: gtk_clist_set_pixmap (GTK_CLIST(wdata->listbox), pos, 0, dir_pixmap, dir_mask); break; case FILE_LINK: gtk_clist_set_pixmap (GTK_CLIST(wdata->listbox), pos, 0, linkfile_pixmap, linkfile_mask); break; case FILE_LINKDIR: gtk_clist_set_pixmap (GTK_CLIST(wdata->listbox), pos, 0, linkdir_pixmap, linkdir_mask); break; case FILE_UPDIR: gtk_clist_set_pixmap (GTK_CLIST(wdata->listbox), pos, 0, updir_pixmap, updir_mask); break; } } gtk_clist_set_column_width (GTK_CLIST(wdata->listbox), 2, gtk_clist_optimal_column_width (GTK_CLIST(wdata->listbox), 2)); gtk_clist_thaw (GTK_CLIST(wdata->listbox)); } /* Now adjust the input field */ gtk_entry_set_text (GTK_ENTRY(wdata->dirinput), wdata->dir); /* Deactivate the Add button since there's nothing selected */ gtk_widget_set_sensitive (wdata->addbutton, FALSE); gtk_widget_set_sensitive (wdata->unselectbutton, FALSE); } void dirinput_change (GtkWidget *widget, gpointer data) { #ifdef DEBUG printf ("dirinput_change()\n"); printf (" Old value: %s\n", ((struct s_main_data *)data)->dir); printf (" New value: %s\n", gtk_entry_get_text (GTK_ENTRY(widget))); #endif read_directory ((struct s_main_data *)data, gtk_entry_get_text (GTK_ENTRY(widget))); } gint main_row_button (GtkWidget *widget, GdkEventButton *event, gpointer data) { gint row, col; gchar *file; char *fname, *cp; #ifdef DEBUG printf ("main_row_button(%d)\n", event->type); #endif if (event) { gtk_clist_get_selection_info (GTK_CLIST (widget), event->x, event->y, &row, &col); if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) { gtk_clist_get_text(GTK_CLIST(((struct s_main_data *) data)->listbox), row, 1, &file); if (!strcmp(file, "..")) { if ((fname = (char *)malloc (strlen (((struct s_main_data *) data)->dir) +1)) == NULL) return FALSE; strcpy (fname, ((struct s_main_data *) data)->dir); if ((cp = strrchr (fname, '/')) != NULL) { *cp = '\0'; if (fname[0] == '\0') { fname[0] = '/'; fname[1] = '\0'; } read_directory ((struct s_main_data *)data, fname); free (fname); } } else { if ((fname = (char *)malloc (strlen (((struct s_main_data *) data)->dir) + strlen (file) +2)) == NULL) return FALSE; if (strlen (((struct s_main_data *) data)->dir) == 1) sprintf (fname, "/%s", file); else sprintf (fname, "%s/%s", ((struct s_main_data *) data)->dir, file); if (is_dir (fname, NULL)) { read_directory ((struct s_main_data *)data, fname); free (fname); } else { gtk_clist_freeze (GTK_CLIST(((struct s_main_data *) data)->listbox)); gtk_clist_unselect_row (GTK_CLIST(((struct s_main_data *) data)->listbox), row, col); gtk_clist_thaw (GTK_CLIST(((struct s_main_data *) data)->listbox)); if (!filebox_append (GTK_CLIST(((struct s_main_data *) data)->filebox), fname)) free (fname); gtk_widget_set_sensitive (((struct s_main_data *) data)->sendbutton, TRUE); gtk_widget_set_sensitive (((struct s_main_data *) data)->clearbutton, TRUE); } return TRUE; } /* could be used for a context menu } else if (event->button == 3) { */ } } return FALSE; } void main_button_select_all (GtkWidget *widget, gpointer data) { int i; gtk_clist_freeze (GTK_CLIST(((struct s_main_data *) data)->listbox)); for (i=1; i < GTK_CLIST(((struct s_main_data *) data)->listbox)->rows; i++) { gtk_clist_select_row (GTK_CLIST(((struct s_main_data *) data)->listbox), i, 0); } gtk_clist_thaw (GTK_CLIST(((struct s_main_data *) data)->listbox)); gtk_widget_set_sensitive (((struct s_main_data *) data)->selectbutton, FALSE); } void main_button_unselect_all (GtkWidget *widget, gpointer data) { int i; gtk_clist_freeze (GTK_CLIST(((struct s_main_data *) data)->listbox)); for (i=0; i < GTK_CLIST(((struct s_main_data *) data)->listbox)->rows; i++) { gtk_clist_unselect_row (GTK_CLIST(((struct s_main_data *) data)->listbox), i, 0); } gtk_clist_thaw (GTK_CLIST(((struct s_main_data *) data)->listbox)); gtk_widget_set_sensitive (((struct s_main_data *) data)->addbutton, FALSE); gtk_widget_set_sensitive (((struct s_main_data *) data)->unselectbutton, FALSE); } void button_add (GtkWidget *widget, gpointer data) { gchar *fname; char *fullname; GList *selection; #ifdef DEBUG printf ("button_add()\n"); #endif for (selection = GTK_CLIST(((struct s_main_data *) data)->listbox)->selection; selection; selection = selection->next) { gtk_clist_get_text (GTK_CLIST(((struct s_main_data *) data)->listbox), (int)selection->data, 1, &fname); if (!strcmp(fname, "..")) continue; if ((fullname = (char *)malloc (strlen(fname) + strlen(((struct s_main_data *) data)->dir) + 2)) == NULL) return; if (strlen (((struct s_main_data *) data)->dir) > 1) sprintf (fullname, "%s/%s", ((struct s_main_data *) data)->dir, fname); else sprintf (fullname, "/%s", fname); if (!filebox_append (GTK_CLIST(((struct s_main_data *) data)->filebox), fullname)) free (fullname); gtk_widget_set_sensitive (((struct s_main_data *) data)->sendbutton, TRUE); } main_button_unselect_all (widget, data); gtk_widget_set_sensitive (((struct s_main_data *) data)->clearbutton, TRUE); } void main_clear (gpointer data) { gtk_clist_clear (GTK_CLIST(((struct s_main_data *) data)->filebox)); gtk_widget_set_sensitive (((struct s_main_data *) data)->clearbutton, FALSE); gtk_widget_set_sensitive (((struct s_main_data *) data)->sendbutton, FALSE); } void button_clear (GtkWidget *widget, gpointer data) { gtk_clist_clear (GTK_CLIST(((struct s_main_data *) data)->filebox)); main_clear (data); } void button_send (GtkWidget *widget, gpointer data) { if (GTK_CLIST(((struct s_main_data *) data)->filebox)->rows > 0) send_dialog (data); } gint receiver_row_select (GtkWidget *widget, gint row_select, gint column, GdkEventButton * event, gpointer data) { gchar *sender; gchar *comment = NULL; char *s; gtk_clist_get_text (GTK_CLIST(((struct s_main_data *)data)->receiver), row_select, 5, &sender); gtk_clist_get_text (GTK_CLIST(((struct s_main_data *)data)->receiver), row_select, 6, &comment); if ((s = (char *)malloc(strlen(sender) + strlen(_("From: %s")))) == NULL) return FALSE; sprintf (s, _("From: %s"), sender); gtk_label_set_text (GTK_LABEL(((struct s_main_data *) data)->rinfo), s); if (comment) gtk_label_set_text (GTK_LABEL(((struct s_main_data *) data)->rcomment), strdup(comment)); else gtk_label_set_text (GTK_LABEL(((struct s_main_data *) data)->rcomment), NULL); return FALSE; } gint main_row_select (GtkWidget *widget, gint row_select, gint column, GdkEventButton * event, gpointer data) { GList *selection; if (row_select > 0) { gtk_widget_set_sensitive (((struct s_main_data *) data)->addbutton, TRUE); gtk_widget_set_sensitive (((struct s_main_data *) data)->unselectbutton, TRUE); } else if ((selection = GTK_CLIST(((struct s_main_data *) data)->listbox)->selection) && !selection->next) { gtk_widget_set_sensitive (((struct s_main_data *) data)->addbutton, FALSE); gtk_widget_set_sensitive (((struct s_main_data *) data)->unselectbutton, FALSE); } return FALSE; } gint main_row_unselect (GtkWidget *widget, gint row_select, gint column, GdkEventButton * event, gpointer data) { if (row_select > 0) gtk_widget_set_sensitive (((struct s_main_data *) data)->selectbutton, TRUE); return FALSE; } gint receiver_row_button (GtkWidget *widget, GdkEventButton *event, gpointer data) { gint row, col; /* gchar *nr; gchar *fname; gchar *dir; */ if (event) { gtk_clist_get_selection_info (GTK_CLIST (widget), event->x, event->y, &row, &col); if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) { /* * Sorry, but but when activating this code, gtk_run_dialog() will * freeze the entire X and you can only operate the window with the * keyboard, not quite promising. This doesn't happen when being * called from the "Receive" button, though. * dir = gtk_entry_get_text (GTK_ENTRY(((struct s_main_data *) data)->rdirinput)); gtk_clist_get_text(GTK_CLIST(widget), row, 4, &nr); gtk_clist_get_text(GTK_CLIST(widget), row, 1, &fname); if (receive_file (nr, dir, fname)) gtk_clist_remove (GTK_CLIST(((struct s_main_data *)data)->receiver), row); else gtk_clist_unselect_row (GTK_CLIST(widget), row, 0); */ return TRUE; /* could be used for a context menu } else if (event->button == 3) { */ } } return FALSE; } void button_receive (GtkWidget *widget, gpointer data) { GList *selection; gchar *nr; gchar *fname; const gchar *dir; dir = gtk_entry_get_text (GTK_ENTRY(((struct s_main_data *) data)->rdirinput)); gtk_clist_freeze (GTK_CLIST(((struct s_main_data *) data)->receiver)); while ((selection = GTK_CLIST(((struct s_main_data *) data)->receiver)->selection)) { gtk_clist_get_text (GTK_CLIST(((struct s_main_data *) data)->receiver), (int)selection->data, 4, &nr); gtk_clist_get_text (GTK_CLIST(((struct s_main_data *) data)->receiver), (int)selection->data, 1, &fname); if (receive_file (nr, dir, fname)) gtk_clist_remove (GTK_CLIST(((struct s_main_data *)data)->receiver), (int)selection->data); else gtk_clist_unselect_row (GTK_CLIST(((struct s_main_data *)data)->receiver), (int)selection->data, 0); } gtk_clist_thaw (GTK_CLIST(((struct s_main_data *) data)->receiver)); } void button_refresh (GtkWidget *widget, gpointer data) { parse_receive ((struct s_main_data *)data); gtk_label_set_text (GTK_LABEL(((struct s_main_data *) data)->rinfo), NULL); gtk_label_set_text (GTK_LABEL(((struct s_main_data *) data)->rcomment), NULL); } void button_msgsend (GtkWidget *widget, gpointer data) { GtkTextBuffer *buffer; GtkTextIter start_iter, end_iter; const gchar *addr; gchar *text; if (!((struct s_main_data *) data)->addrok) return; addr = gtk_entry_get_text (GTK_ENTRY(GTK_COMBO(((struct s_main_data *) data)->addrinput)->entry)); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(((struct s_main_data *) data)->msginput)); gtk_text_buffer_get_start_iter (buffer, &start_iter); gtk_text_buffer_get_end_iter (buffer, &end_iter); text = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE); if (sendmessage (addr, text)) gtk_text_buffer_set_text (buffer, "", 0); send_history_add (addr, GTK_COMBO(((struct s_main_data *) data)->addrinput)); } /* * FIXME: Prevent the Size field from being size-increased if the dialog gets resized */ /** * main_window: * * Opens the main window with menu etc. * * return values: nothing +------+-------+-------+ | File | ..... | Help | +------+-------+-------+ | Open | | Index | | | | | | Quit | | About | +------+ +-------+ */ void main_window(unsigned short int startmode) { GtkWidget *window; GtkWidget *mainbox, *hbox, *vbox; GtkWidget *menubar, *menu, *menuitem; GtkWidget *frame; GtkWidget *button; GtkWidget *label; #if GTK_MAJOR_VERSION >= 1 && GTK_MINOR_VERSION >= 1 GtkWidget *scrollwin; #endif GtkTooltips *tooltips; GtkTextBuffer *buffer; GtkAccelGroup* accelgroup; char *titles[3] = {"", _("Filename"), _("Size")}; char *rtitles[7] = {"", _("Filename"), _("Date"), _("Size"), "", "", ""}; char cwd[255]; char *cp; struct s_main_data *wdata; if ((wdata = (struct s_main_data *) malloc (sizeof(struct s_main_data))) == NULL) return; memset (wdata, 0, sizeof (struct s_main_data)); wdata->mode = startmode; /* Create a new dialog box */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), _("Gerstensaft")); gtk_widget_set_usize (GTK_WIDGET (window), 450, 350); accelgroup = gtk_accel_group_new(); gtk_window_add_accel_group (GTK_WINDOW (window), accelgroup); /* Connect the appropriate signal handlers */ g_signal_connect (G_OBJECT (window), "delete_event", G_CALLBACK (main_delete), NULL); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (main_destroy), (gpointer) wdata); mainbox = gtk_vbox_new(FALSE, 0); gtk_container_add (GTK_CONTAINER (window), mainbox); menubar = gtk_menu_bar_new(); gtk_box_pack_start (GTK_BOX(mainbox), menubar, FALSE, FALSE, 2); menu = gtk_menu_new(); menuitem = gtk_menu_item_new_with_mnemonic(_("_File")); gtk_menu_item_set_submenu( GTK_MENU_ITEM(menuitem), menu ); gtk_menu_bar_append( GTK_MENU_BAR (menubar), menuitem ); gtk_widget_show(menuitem); /* Should be moved into the Options menu */ menuitem = gtk_menu_item_new_with_mnemonic(_("_Clear History")); g_signal_connect (G_OBJECT (menuitem), "activate", G_CALLBACK (menu_clear_history), NULL); gtk_menu_append( GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); menuitem = gtk_menu_item_new_with_mnemonic(_("_Preferences...")); g_signal_connect (G_OBJECT (menuitem), "activate", G_CALLBACK (options_dialog), NULL); gtk_menu_append (GTK_MENU(menu), menuitem); gtk_widget_show (menuitem); gtk_widget_add_accelerator ( GTK_WIDGET (menuitem), "activate", accelgroup, GDK_P, GDK_MOD1_MASK, GTK_ACCEL_VISIBLE); menuitem = gtk_menu_item_new_with_mnemonic(_("_Quit")); g_signal_connect (G_OBJECT (menuitem), "activate", G_CALLBACK (main_destroy), (gpointer) wdata); gtk_menu_append( GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); gtk_widget_add_accelerator ( GTK_WIDGET (menuitem), "activate", accelgroup, GDK_Q, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); menu = gtk_menu_new(); menuitem = gtk_menu_item_new_with_mnemonic(_("_Mode")); gtk_menu_item_set_submenu( GTK_MENU_ITEM(menuitem), menu ); gtk_menu_bar_append( GTK_MENU_BAR (menubar), menuitem ); gtk_widget_show(menuitem); wdata->modeitem[MOD_SEND] = gtk_menu_item_new_with_mnemonic(_("_Send")); g_signal_connect (G_OBJECT (wdata->modeitem[MOD_SEND]), "activate", G_CALLBACK (menu_mode_send), (gpointer) wdata); gtk_menu_append( GTK_MENU(menu), wdata->modeitem[MOD_SEND]); gtk_widget_show(wdata->modeitem[MOD_SEND]); wdata->modeitem[MOD_RECEIVE] = gtk_menu_item_new_with_mnemonic(_("_Receive")); g_signal_connect (G_OBJECT (wdata->modeitem[MOD_RECEIVE]), "activate", G_CALLBACK (menu_mode_receive), (gpointer) wdata); gtk_menu_append( GTK_MENU(menu), wdata->modeitem[MOD_RECEIVE]); gtk_widget_show(wdata->modeitem[MOD_RECEIVE]); wdata->modeitem[MOD_MESSAGE] = gtk_menu_item_new_with_mnemonic(_("_Message")); g_signal_connect (G_OBJECT (wdata->modeitem[MOD_MESSAGE]), "activate", G_CALLBACK (menu_mode_message), (gpointer) wdata); gtk_menu_append( GTK_MENU(menu), wdata->modeitem[MOD_MESSAGE]); gtk_widget_show(wdata->modeitem[MOD_MESSAGE]); gtk_widget_set_sensitive (GTK_WIDGET(wdata->modeitem[wdata->mode]), FALSE); menu = gtk_menu_new(); menuitem = gtk_menu_item_new_with_mnemonic(_("_Help")); gtk_menu_item_set_submenu( GTK_MENU_ITEM(menuitem), menu ); gtk_menu_item_right_justify( GTK_MENU_ITEM(menuitem) ); gtk_menu_bar_append( GTK_MENU_BAR (menubar), menuitem ); gtk_widget_show(menuitem); menuitem = gtk_menu_item_new_with_mnemonic(_("_Todo")); g_signal_connect (G_OBJECT (menuitem), "activate", G_CALLBACK (msgbox_todo), NULL); gtk_menu_append( GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); menuitem = gtk_menu_item_new_with_mnemonic(_("_About")); g_signal_connect (G_OBJECT (menuitem), "activate", G_CALLBACK (msgbox_about), NULL); gtk_menu_append( GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); gtk_widget_show(menubar); /* Vertical box containing the send container */ wdata->container_send = gtk_vbox_new(FALSE, 0); /* Horizontal box containing Clist on the left and buttons on the right */ hbox = gtk_hbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER(wdata->container_send), hbox); /* Listbox containing files to select */ frame = gtk_frame_new (NULL); gtk_container_border_width (GTK_CONTAINER(frame), 5); gtk_container_add (GTK_CONTAINER(hbox), frame); vbox = gtk_vbox_new (FALSE, 0); gtk_container_border_width (GTK_CONTAINER(vbox), 5); gtk_container_add (GTK_CONTAINER(frame), vbox); /* Input field for directory, will be updated automatically */ wdata->dirinput = gtk_entry_new_with_max_length (60); g_signal_connect (G_OBJECT (wdata->dirinput), "activate", G_CALLBACK (dirinput_change), (gpointer) wdata); gtk_box_pack_start (GTK_BOX(vbox), wdata->dirinput, FALSE, FALSE, FALSE); gtk_widget_show (wdata->dirinput); wdata->listbox = gtk_clist_new_with_titles (3, titles); gtk_widget_set_usize (GTK_WIDGET (wdata->listbox), 100, 100); gtk_clist_column_titles_passive (GTK_CLIST(wdata->listbox)); gtk_clist_set_selection_mode (GTK_CLIST(wdata->listbox), GTK_SELECTION_MULTIPLE); gtk_clist_set_column_width (GTK_CLIST(wdata->listbox), 0, 16); gtk_clist_set_column_justification (GTK_CLIST(wdata->listbox), 0, GTK_JUSTIFY_CENTER); gtk_clist_set_column_width (GTK_CLIST(wdata->listbox), 1, 210); gtk_clist_set_column_justification (GTK_CLIST(wdata->listbox), 1, GTK_JUSTIFY_LEFT); gtk_clist_set_column_width (GTK_CLIST(wdata->listbox), 2, 30); gtk_clist_set_column_justification (GTK_CLIST(wdata->listbox), 2, GTK_JUSTIFY_RIGHT); g_signal_connect (G_OBJECT (wdata->listbox), "button_press_event", G_CALLBACK (main_row_button), (gpointer) wdata); g_signal_connect (G_OBJECT (wdata->listbox), "select_row", G_CALLBACK (main_row_select), (gpointer) wdata); g_signal_connect (G_OBJECT (wdata->listbox), "unselect_row", G_CALLBACK (main_row_unselect), (gpointer) wdata); #if GTK_MAJOR_VERSION >= 1 && GTK_MINOR_VERSION >= 1 scrollwin = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX(vbox), scrollwin, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER(scrollwin), wdata->listbox); gtk_widget_show (scrollwin); #else gtk_box_pack_start (GTK_BOX(vbox) , wdata->listbox, TRUE, TRUE, 0); #endif gtk_widget_show (window); load_pixmap ("updir.xpm", window, &updir_pixmap, &updir_mask); load_pixmap ("dir.xpm", window, &dir_pixmap, &dir_mask); load_pixmap ("doc.xpm", window, &doc_pixmap, &doc_mask); load_pixmap ("linkdir.xpm", window, &linkdir_pixmap, &linkdir_mask); load_pixmap ("linkfile.xpm", window, &linkfile_pixmap, &linkfile_mask); gtk_widget_show (wdata->listbox); gtk_widget_show (frame); gtk_widget_show (vbox); /* listbox */ /* Vertical box containing buttons */ vbox = gtk_vbox_new (FALSE, 0); gtk_container_border_width (GTK_CONTAINER(vbox), 5); gtk_box_pack_start (GTK_BOX(hbox) , vbox, FALSE, TRUE, 0); wdata->selectbutton = gtk_button_new_with_mnemonic (_(" _Select all ")); g_signal_connect (G_OBJECT (wdata->selectbutton), "clicked", G_CALLBACK (main_button_select_all), (gpointer) wdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, wdata->selectbutton, _("Select all files"), NULL); gtk_box_pack_start (GTK_BOX(vbox), wdata->selectbutton, TRUE, FALSE, 0); gtk_widget_show (wdata->selectbutton); wdata->unselectbutton = gtk_button_new_with_mnemonic (_(" _Unselect all ")); g_signal_connect (G_OBJECT (wdata->unselectbutton), "clicked", G_CALLBACK (main_button_unselect_all), (gpointer) wdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, wdata->unselectbutton, _("Unselected all files"), NULL); gtk_box_pack_start (GTK_BOX(vbox), wdata->unselectbutton, TRUE, FALSE, 0); gtk_widget_show (wdata->unselectbutton); wdata->addbutton = gtk_button_new_from_stock ("gtk-add"); g_signal_connect (G_OBJECT (wdata->addbutton), "clicked", G_CALLBACK (button_add), (gpointer) wdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, wdata->addbutton, _("Add selected files to sendlist"), NULL); gtk_box_pack_start (GTK_BOX(vbox), wdata->addbutton, TRUE, FALSE, 0); gtk_widget_show (wdata->addbutton); wdata->sendbutton = gtk_button_new_with_label (_(" Send ")); gtk_widget_set_sensitive (wdata->sendbutton, FALSE); g_signal_connect (G_OBJECT (wdata->sendbutton), "clicked", G_CALLBACK (button_send), (gpointer) wdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, wdata->sendbutton, _("Send recorded files to recipient"), NULL); gtk_box_pack_start (GTK_BOX(vbox), wdata->sendbutton, TRUE, FALSE, 0); gtk_widget_show (wdata->sendbutton); wdata->clearbutton = gtk_button_new_from_stock ("gtk-clear"); gtk_widget_set_sensitive (wdata->clearbutton, FALSE); g_signal_connect (G_OBJECT (wdata->clearbutton), "clicked", G_CALLBACK (button_clear), (gpointer) wdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, wdata->clearbutton, _("Clear list of selected files"), NULL); gtk_box_pack_start (GTK_BOX(vbox), wdata->clearbutton, TRUE, FALSE, 0); gtk_widget_show (wdata->clearbutton); gtk_widget_show (vbox); gtk_widget_show (hbox); /* Add another box so we get some space between object and border */ hbox = gtk_hbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER(wdata->container_send), hbox); gtk_container_border_width (GTK_CONTAINER(hbox), 5); /* This should be an additional box containing all selected files */ wdata->filebox = gtk_clist_new_with_titles (3, titles); gtk_clist_column_titles_passive (GTK_CLIST(wdata->filebox)); gtk_clist_set_selection_mode (GTK_CLIST(wdata->filebox), GTK_SELECTION_SINGLE); gtk_clist_set_column_width (GTK_CLIST(wdata->filebox), 0, 16); gtk_clist_set_column_justification (GTK_CLIST(wdata->filebox), 0, GTK_JUSTIFY_CENTER); gtk_clist_set_column_width (GTK_CLIST(wdata->filebox), 1, 340); gtk_clist_set_column_justification (GTK_CLIST(wdata->filebox), 1, GTK_JUSTIFY_LEFT); gtk_clist_set_column_width (GTK_CLIST(wdata->filebox), 2, 30); gtk_clist_set_column_justification (GTK_CLIST(wdata->filebox), 2, GTK_JUSTIFY_RIGHT); #if GTK_MAJOR_VERSION >= 1 && GTK_MINOR_VERSION >= 1 scrollwin = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX(hbox), scrollwin, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER(scrollwin), wdata->filebox); gtk_widget_show (scrollwin); #else gtk_box_pack_start (GTK_BOX(hbox) , wdata->filebox, TRUE, TRUE, 0); #endif gtk_widget_show (wdata->filebox); gtk_widget_show (hbox); /* Vertical box containing the receive container */ wdata->container_receive = gtk_vbox_new(FALSE, 0); /* Input field for directory */ wdata->rdirinput = gtk_entry_new_with_max_length (60); gtk_box_pack_start (GTK_BOX(wdata->container_receive), wdata->rdirinput, FALSE, FALSE, FALSE); gtk_widget_show (wdata->rdirinput); if ((cp = get_current_dir_name())) gtk_entry_set_text (GTK_ENTRY(wdata->rdirinput), cp); wdata->receiver = gtk_clist_new_with_titles (7, rtitles); gtk_clist_column_titles_passive (GTK_CLIST(wdata->receiver)); gtk_clist_set_selection_mode (GTK_CLIST(wdata->receiver), GTK_SELECTION_MULTIPLE); gtk_clist_set_column_width (GTK_CLIST(wdata->receiver), 0, 16); gtk_clist_set_column_justification (GTK_CLIST(wdata->receiver), 0, GTK_JUSTIFY_CENTER); gtk_clist_set_column_width (GTK_CLIST(wdata->receiver), 1, 230); gtk_clist_set_column_justification (GTK_CLIST(wdata->receiver), 1, GTK_JUSTIFY_LEFT); gtk_clist_set_column_width (GTK_CLIST(wdata->receiver), 2, 90); gtk_clist_set_column_justification (GTK_CLIST(wdata->receiver), 1, GTK_JUSTIFY_LEFT); gtk_clist_set_column_width (GTK_CLIST(wdata->receiver), 3, 30); gtk_clist_set_column_justification (GTK_CLIST(wdata->receiver), 3, GTK_JUSTIFY_RIGHT); gtk_clist_set_column_visibility (GTK_CLIST(wdata->receiver), 4, FALSE); gtk_clist_set_column_visibility (GTK_CLIST(wdata->receiver), 5, FALSE); gtk_clist_set_column_visibility (GTK_CLIST(wdata->receiver), 6, FALSE); g_signal_connect (G_OBJECT (wdata->receiver), "select_row", G_CALLBACK (receiver_row_select), (gpointer) wdata); g_signal_connect (G_OBJECT (wdata->receiver), "button_press_event", G_CALLBACK (receiver_row_button), (gpointer) wdata); #if GTK_MAJOR_VERSION >= 1 && GTK_MINOR_VERSION >= 1 scrollwin = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX(wdata->container_receive), scrollwin, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER(scrollwin), wdata->receiver); gtk_widget_show (scrollwin); #else gtk_box_pack_start (GTK_BOX(wdata->container_receive), clist, TRUE, TRUE, 0); #endif gtk_widget_show (wdata->receiver); /* Frame containing aditional information about files */ frame = gtk_frame_new (NULL); gtk_container_border_width (GTK_CONTAINER(frame), 2); gtk_widget_show (frame); gtk_box_pack_start (GTK_BOX(wdata->container_receive), frame, FALSE, TRUE, 0); vbox = gtk_vbox_new(FALSE, 0); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER(frame), vbox); hbox = gtk_hbox_new(FALSE, 5); gtk_widget_show (hbox); gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0); wdata->rinfo = gtk_label_new (NULL); gtk_widget_show (wdata->rinfo); gtk_box_pack_start (GTK_BOX(hbox), wdata->rinfo, FALSE, FALSE, 3); hbox = gtk_hbox_new(FALSE, 5); gtk_widget_show (hbox); gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0); wdata->rcomment = gtk_label_new (NULL); gtk_widget_show (wdata->rcomment); gtk_box_pack_start (GTK_BOX(hbox), wdata->rcomment, FALSE, FALSE, 3); hbox = gtk_hbox_new(FALSE, 5); gtk_widget_show (hbox); gtk_box_set_homogeneous (GTK_BOX(hbox), FALSE); gtk_box_pack_end (GTK_BOX (wdata->container_receive), hbox, FALSE, FALSE, 5); button = gtk_button_new_with_label (_("Receive")); gtk_widget_set_sensitive (button, TRUE); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (button_receive), (gpointer) wdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, button, _("Receive all selected files and archives"), NULL); gtk_box_pack_start (GTK_BOX(hbox), button, TRUE, FALSE, 3); gtk_widget_show (button); button = gtk_button_new_from_stock ("gtk-refresh"); gtk_widget_set_sensitive (button, TRUE); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (button_refresh), (gpointer) wdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, button, _("Refresh receive queue listing"), NULL); gtk_box_pack_start (GTK_BOX(hbox), button, TRUE, FALSE, 3); gtk_widget_show (button); /* Vertical box containing the message container */ wdata->container_message = gtk_vbox_new(FALSE, 0); frame = gtk_frame_new (NULL); gtk_container_border_width (GTK_CONTAINER(frame), 5); gtk_container_add (GTK_CONTAINER(wdata->container_message), frame); gtk_widget_show (frame); vbox = gtk_vbox_new (FALSE, 0); gtk_container_border_width (GTK_CONTAINER(vbox), 5); gtk_container_add (GTK_CONTAINER(frame), vbox); gtk_widget_show (vbox); label = gtk_label_new (_("Recipient")); gtk_misc_set_alignment (GTK_MISC(label), 0, 0); gtk_box_pack_start (GTK_BOX(vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); wdata->addrok = 0; wdata->addrinput = gtk_combo_new(); if (config.addrs) gtk_combo_set_popdown_strings (GTK_COMBO(wdata->addrinput), config.addrs); gtk_entry_set_text (GTK_ENTRY(GTK_COMBO(wdata->addrinput)->entry), ""); g_signal_connect (G_OBJECT (GTK_COMBO(wdata->addrinput)->entry), "changed", G_CALLBACK (message_addr_change), (gpointer) wdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, GTK_COMBO(wdata->addrinput)->entry, _("Enter recipient's address"), NULL); gtk_box_pack_start (GTK_BOX(vbox), GTK_WIDGET(wdata->addrinput), FALSE, FALSE, 0); gtk_widget_show (wdata->addrinput); label = gtk_label_new (""); gtk_misc_set_alignment (GTK_MISC(label), 0, 0); gtk_box_pack_start (GTK_BOX(vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); label = gtk_label_new (_("Message")); gtk_misc_set_alignment (GTK_MISC(label), 0, 0); gtk_box_pack_start (GTK_BOX(vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); wdata->msginput = gtk_text_view_new(); gtk_widget_show (wdata->msginput); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(wdata->msginput)); g_signal_connect (G_OBJECT (buffer), "changed", G_CALLBACK (message_input_change), (gpointer) wdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, wdata->msginput, _("Type your message here"), NULL); #if GTK_MAJOR_VERSION >= 1 && GTK_MINOR_VERSION >= 1 scrollwin = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX(vbox), scrollwin, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER(scrollwin), wdata->msginput); gtk_widget_show (scrollwin); #else gtk_box_pack_start (GTK_BOX(vbox), wdata->msginput, TRUE, TRUE, 5); #endif hbox = gtk_hbox_new(FALSE, 5); gtk_widget_show (hbox); gtk_box_set_homogeneous (GTK_BOX(hbox), FALSE); gtk_box_pack_end (GTK_BOX(wdata->container_message), hbox, FALSE, FALSE, 5); wdata->msgsend = gtk_button_new_with_label (_("Send")); gtk_widget_set_sensitive (wdata->msgsend, FALSE); g_signal_connect (G_OBJECT (wdata->msgsend), "clicked", G_CALLBACK (button_msgsend), (gpointer) wdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, wdata->msgsend, _("Send the message to the recipient"), NULL); gtk_box_pack_start (GTK_BOX(hbox), wdata->msgsend, TRUE, FALSE, 3); gtk_widget_show (wdata->msgsend); /* -------------------------------------------------- */ switch (startmode) { case MOD_SEND: if (getcwd (cwd, sizeof(cwd))) read_directory (wdata, cwd); gtk_widget_show (wdata->container_send); break; case MOD_RECEIVE: parse_receive (wdata); gtk_widget_show (wdata->container_receive); break; case MOD_MESSAGE: gtk_widget_show (wdata->container_message); break; } gtk_container_add (GTK_CONTAINER (mainbox), wdata->container_send); gtk_container_add (GTK_CONTAINER (mainbox), wdata->container_receive); gtk_container_add (GTK_CONTAINER (mainbox), wdata->container_message); gtk_widget_show (mainbox); } gerstensaft-0.3/src/main.h0000644000076500001440000000354310532607637014475 0ustar joeyusers/* main.h - Provide the main window and related routines Copyright (c) 1999,2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #ifndef __MAIN_H__ #define __MAIN_H__ #include #define MOD_SEND 0 #define MOD_RECEIVE 1 #define MOD_MESSAGE 2 struct s_main_data { char *dir; /* Current directory */ unsigned short int mode; GtkWidget *modeitem[3]; /* Mode: Send */ GtkWidget *listbox; GtkWidget *dirinput; GtkWidget *filebox; GtkWidget *sendbutton; GtkWidget *clearbutton; GtkWidget *addbutton; GtkWidget *selectbutton; GtkWidget *unselectbutton; /* Mode: Receive */ GtkWidget *receiver; GtkWidget *rdirinput; GtkWidget *rinfo; GtkWidget *rcomment; /* Mode: Message */ GtkWidget *addrinput; GtkWidget *msgsend; GtkWidget *msginput; unsigned short int addrok; /* Mode Containers */ GtkWidget *container_send; GtkWidget *container_receive; GtkWidget *container_message; }; void main_window(unsigned short int startmode); extern GdkPixmap *dir_pixmap, *doc_pixmap; extern GdkBitmap *dir_mask, *doc_mask; void main_clear (gpointer data); #endif /* __MAIN_H__ */ gerstensaft-0.3/src/msgbox.c0000644000076500001440000001771310534322353015036 0ustar joeyusers/* msgbox.c - Provide some simple message boxes Copyright (c) 1998,9,2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #include #include #include #include "msgbox.h" #include "config.h" #include "nls.h" #include "beer.h" gint msgbox_delete(GtkWidget *widget, GdkEvent *event, gpointer data) { return FALSE; } void msgbox_about(GtkWidget *widget, gpointer data) { GtkWidget *dialog; GtkWidget *hbox, *vbox; GtkWidget *label; GtkWidget *button; char buf[1024]; GdkPixmap *beer_pixmap; GdkBitmap *beer_mask; GtkStyle *style; dialog = gtk_dialog_new(); gtk_window_set_title (GTK_WINDOW (dialog), _("About Gerstensaft")); g_signal_connect (G_OBJECT (dialog), "delete_event", G_CALLBACK (msgbox_delete), (gpointer) dialog); g_signal_connect_swapped (G_OBJECT (dialog), "destroy", G_CALLBACK (gtk_widget_destroy), (gpointer) dialog); /* Horizontal box with pix on the left, text on the right */ hbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, TRUE, TRUE, 5); gtk_widget_show (hbox); gtk_widget_show (dialog); snprintf (buf, sizeof(buf), "%s/%s", PIXMAP_DIR, "gerstensaft.xpm"); style = gtk_widget_get_style (dialog); beer_pixmap = gdk_pixmap_create_from_xpm (dialog->window, &beer_mask, &style->bg[GTK_STATE_NORMAL], buf); if (beer_pixmap != NULL) { label = gtk_pixmap_new (beer_pixmap, beer_mask); gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); } vbox = gtk_vbox_new (FALSE, 0); gtk_container_border_width (GTK_CONTAINER(vbox), 5); gtk_box_pack_start (GTK_BOX(hbox), vbox, FALSE, FALSE, 0); label = gtk_label_new (" "); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); gtk_widget_show (label); label = gtk_label_new (" "); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); gtk_widget_show (label); snprintf(buf, sizeof(buf), "Gerstensaft %s", version); label = gtk_label_new (buf); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); gtk_widget_show (label); label = gtk_label_new (_(" Graphical frontend to SAFT ")); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); gtk_widget_show (label); label = gtk_label_new (" Joey Schulze "); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); gtk_widget_show (label); label = gtk_label_new ("http://www.infodrom.org/projects/gerstensaft/"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); gtk_widget_show (label); gtk_widget_show (vbox); button = gtk_button_new_from_stock ("gtk-close"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_destroy), (gpointer) dialog); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->action_area), button, TRUE, FALSE, 0); gtk_widget_show (button); gtk_widget_grab_default (button); } void msgbox_todo (GtkWidget *widget, gpointer data) { GtkWidget *dialog; GtkWidget *box; GtkWidget *label; GtkWidget *button; char buf[1024]; GdkPixmap *beer_pixmap; GdkBitmap *beer_mask; GtkStyle *style; dialog = gtk_dialog_new(); gtk_window_set_title (GTK_WINDOW (dialog), _("Gerstensaft Todo")); g_signal_connect (G_OBJECT (dialog), "delete_event", G_CALLBACK (msgbox_delete), (gpointer) dialog); g_signal_connect (G_OBJECT (dialog), "destroy", G_CALLBACK (gtk_widget_destroy), NULL); box = gtk_vbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), box, TRUE, TRUE, 5); gtk_widget_show (box); gtk_widget_show (dialog); snprintf(buf, sizeof(buf), "Gerstensaft %s", version); label = gtk_label_new (buf); gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 5); gtk_widget_show (label); snprintf (buf, sizeof(buf), "%s/%s", PIXMAP_WM_DIR, "beer.xpm"); style = gtk_widget_get_style (dialog); beer_pixmap = gdk_pixmap_create_from_xpm (dialog->window, &beer_mask, &style->bg[GTK_STATE_NORMAL], buf); if (beer_pixmap != NULL) { label = gtk_pixmap_new (beer_pixmap, beer_mask); gtk_box_pack_start (GTK_BOX(box), label, FALSE, FALSE, 0); gtk_widget_show (label); } label = gtk_label_new (_(" Things to do for Gerstensaft ")); gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 5); gtk_widget_show (label); label = gtk_label_new (_(" Select/Unselect via pattern ")); gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 5); gtk_widget_show (label); label = gtk_label_new (_(" Gnomification / Support for drag and drop ")); gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 5); gtk_widget_show (label); button = gtk_button_new_from_stock ("gtk-close"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_destroy), (gpointer) dialog); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->action_area), button, TRUE, FALSE, 0); gtk_widget_show (button); gtk_widget_grab_default (button); } void msgbox (const char *title, const char *text) { GtkWidget *dialog; GtkWidget *box; GtkWidget *label; GtkWidget *button; if (!title || !strlen(title) || !text || !strlen(text)) return; dialog = gtk_dialog_new(); gtk_grab_add (dialog); gtk_window_set_title(GTK_WINDOW (dialog), title); gtk_widget_set_usize (GTK_WIDGET (dialog), 400, 130); g_signal_connect (G_OBJECT (dialog), "delete_event", G_CALLBACK (msgbox_delete), (gpointer) dialog); g_signal_connect (G_OBJECT (dialog), "destroy", G_CALLBACK (gtk_widget_destroy), NULL); box = gtk_vbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), box, TRUE, TRUE, 5); gtk_widget_show (box); label = gtk_label_new (text); gtk_label_set_line_wrap (GTK_LABEL(label), TRUE); gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 5); gtk_widget_show (label); button = gtk_button_new_from_stock ("gtk-close"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_destroy), (gpointer) dialog); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->action_area), button, TRUE, FALSE, 0); gtk_widget_show (button); gtk_widget_grab_default (button); gtk_widget_show (dialog); } /* * Will return one of * * GTK_RESPONSE_DELETE_EVENT (-4) * GTK_RESPONSE_OK (-5) * GTK_RESPONSE_CANCEL (-6) */ gint okbox (const char *title, const char *text) { GtkWidget *dialog; GtkWidget *label; gint response; if (!title || !strlen(title) || !text || !strlen(text)) return FALSE; dialog = gtk_dialog_new_with_buttons(title, NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_OK, GTK_RESPONSE_OK, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL); gtk_widget_set_usize (GTK_WIDGET (dialog), 400, 130); label = gtk_label_new (text); gtk_label_set_line_wrap (GTK_LABEL(label), TRUE); gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), label, FALSE, FALSE, 5); gtk_widget_show (GTK_WIDGET(label)); response = gtk_dialog_run (GTK_DIALOG(dialog)); #ifdef DEBUG printf ("okbox response: %d\n", response); #endif gtk_widget_destroy (GTK_WIDGET(dialog)); return response; } gerstensaft-0.3/src/msgbox.h0000644000076500001440000000224710532261035015034 0ustar joeyusers/* msgbox.h - Provide some simple message boxes Copyright (c) 1998,9,2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #ifndef __MSGBOX_H__ #define __MSGBOX_H__ #include void msgbox_about (GtkWidget *widget, gpointer data); void msgbox_todo (GtkWidget *widget, gpointer data); void msgbox (const char *title, const char *text); gint okbox (const char *title, const char *text); #endif /* __MSGBOX_H__ */ gerstensaft-0.3/src/nls.h0000644000076500001440000000200210532261035014316 0ustar joeyusers/* nls.h - Frontend for SAFT for X11 Copyright (c) 1999 Joey Schulze This file is part of the `beer' package. 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, USA. */ #ifndef __NLS_H__ #define __NLS_H__ /* Enable NLS */ #include #define _(String) gettext(String) #define N_(String) (String) #endif /* __NLS_H__ */ gerstensaft-0.3/src/options.c0000644000076500001440000002151110534250647015227 0ustar joeyusers/* options.c - Options dialog Copyright (c) 2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #include #include #include #include "beer.h" #include "nls.h" struct s_options_data { GtkWidget *dialog; GtkWidget *send_dotfiles; GtkWidget *send_closewindow; GtkWidget *rec_keepfiles; GtkWidget *proto_auto; GtkWidget *proto_ipv4; GtkWidget *proto_ipv6; }; void preferences_init (struct s_options_data *data) { if (config.dotfiles) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->send_dotfiles), TRUE); else gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->send_dotfiles), FALSE); if (config.closewindow) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->send_closewindow), TRUE); else gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->send_closewindow), FALSE); if (config.keep) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->rec_keepfiles), TRUE); else gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->rec_keepfiles), FALSE); switch (config.protocol) { case PROTOCOL_AUTO: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->proto_auto), TRUE); break; case PROTOCOL_IPV4: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->proto_ipv4), TRUE); break; case PROTOCOL_IPV6: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->proto_ipv6), TRUE); break; } } void preferences_accept (struct s_options_data *data) { if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->rec_keepfiles))) config.keep = TRUE; else config.keep = FALSE; if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->send_dotfiles))) config.dotfiles = TRUE; else config.dotfiles = FALSE; if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->send_closewindow))) config.closewindow = TRUE; else config.closewindow = FALSE; if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->proto_auto))) config.protocol = PROTOCOL_AUTO; else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->proto_ipv4))) config.protocol = PROTOCOL_IPV4; else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->proto_ipv6))) config.protocol = PROTOCOL_IPV6; } gint callback_options_delete (GtkWidget *widget, GdkEvent *event, gpointer data) { return FALSE; } void callback_options_destroy (GtkWidget *widget, gpointer data) { if (((struct s_options_data *) data) != NULL) free (((struct s_options_data *) data)); } void callback_options_ok (GtkButton *button, gpointer data) { preferences_accept ((struct s_options_data *) data); gtk_signal_emit_by_name (GTK_OBJECT (((struct s_options_data *) data)->dialog), "destroy"); } void options_dialog (GtkWidget *widget, gpointer dummy) { GtkWidget *mainbox; GtkWidget *frame; GtkWidget *hbox; GtkWidget *vbox; GtkWidget *button; GtkTooltips *tooltips; GSList *protogroup; struct s_options_data *data; if ((data = (struct s_options_data *) malloc (sizeof(struct s_options_data))) == NULL) { perror ("malloc"); return; } memset (data, 0, sizeof (struct s_options_data)); /* Create a new dialog box */ data->dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_grab_add (data->dialog); gtk_window_set_title (GTK_WINDOW (data->dialog), _("Preferences")); gtk_window_set_resizable (GTK_WINDOW (data->dialog), FALSE); /* Connect the appropriate signal handlers */ g_signal_connect (G_OBJECT (data->dialog), "delete_event", G_CALLBACK (callback_options_delete), (gpointer) data); g_signal_connect (G_OBJECT (data->dialog), "destroy", G_CALLBACK (callback_options_destroy), (gpointer) data); mainbox = gtk_vbox_new (FALSE, 0); gtk_widget_show (mainbox); gtk_container_add (GTK_CONTAINER (data->dialog), mainbox); frame = gtk_frame_new (_("Send Options")); gtk_widget_show (frame); gtk_container_set_border_width (GTK_CONTAINER (frame), 5); gtk_container_add (GTK_CONTAINER (mainbox), frame); vbox = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_container_add (GTK_CONTAINER (frame), vbox); data->send_dotfiles = gtk_check_button_new_with_mnemonic (_("_Show Dot Files")); gtk_widget_show (data->send_dotfiles); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, data->send_dotfiles, _("Display files and directories starting with a dot"), NULL); gtk_container_add (GTK_CONTAINER (vbox), data->send_dotfiles); data->send_closewindow = gtk_check_button_new_with_mnemonic (_("Close Send _Window")); gtk_widget_show (data->send_closewindow); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, data->send_closewindow, _("Close the send window after successful transmission"), NULL); gtk_container_add (GTK_CONTAINER (vbox), data->send_closewindow); frame = gtk_frame_new (_("Receive Options")); gtk_widget_show (frame); gtk_container_set_border_width (GTK_CONTAINER (frame), 5); gtk_container_add (GTK_CONTAINER (mainbox), frame); hbox = gtk_hbox_new (FALSE, 0); gtk_widget_show (hbox); gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); gtk_container_add (GTK_CONTAINER (frame), hbox); data->rec_keepfiles = gtk_check_button_new_with_mnemonic (_("_Keep Files")); gtk_widget_show (data->rec_keepfiles); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, data->rec_keepfiles, _("Keep files in the receive queue after receiving"), NULL); gtk_container_add (GTK_CONTAINER (hbox), data->rec_keepfiles); frame = gtk_frame_new (_("Protocol Options")); gtk_widget_show (frame); gtk_container_set_border_width (GTK_CONTAINER (frame), 5); gtk_container_add (GTK_CONTAINER (mainbox), frame); vbox = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); gtk_container_add (GTK_CONTAINER (frame), vbox); data->proto_auto = gtk_radio_button_new_with_mnemonic (NULL, _("_Automatic")); gtk_widget_show (data->proto_auto); gtk_container_add (GTK_CONTAINER (vbox), data->proto_auto); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, data->proto_auto, _("Let sendfile and sendmsg decide which version of IP to use"), NULL); protogroup = gtk_radio_button_get_group (GTK_RADIO_BUTTON (data->proto_auto)); data->proto_ipv4 = gtk_radio_button_new_with_mnemonic (protogroup, _("Always IPv_4")); gtk_widget_show (data->proto_ipv4); gtk_container_add (GTK_CONTAINER (vbox), data->proto_ipv4); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, data->proto_ipv4, _("Lock sendfile and sendmsg to IP version 4"), NULL); protogroup = gtk_radio_button_get_group (GTK_RADIO_BUTTON (data->proto_auto)); data->proto_ipv6 = gtk_radio_button_new_with_mnemonic (protogroup, _("Always IPv_6")); gtk_widget_show (data->proto_ipv6); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, data->proto_ipv6, _("Lock sendfile and sendmsg to IP version 6"), NULL); gtk_container_add (GTK_CONTAINER (vbox), data->proto_ipv6); preferences_init (data); /* horizontal box containing the buttons */ hbox = gtk_hbox_new (FALSE, 0); gtk_container_border_width (GTK_CONTAINER(hbox), 5); gtk_box_pack_end (GTK_BOX(mainbox), hbox, TRUE, TRUE, 0); gtk_box_set_homogeneous (GTK_BOX(hbox), TRUE); gtk_box_set_spacing (GTK_BOX(hbox), 5); gtk_widget_show (hbox); button = gtk_button_new_from_stock ("gtk-cancel"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_destroy), (gpointer) data->dialog); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, button, _("Cancel previously made settings and return to main program"), NULL); gtk_container_add (GTK_CONTAINER(hbox), button); gtk_widget_show (button); button = gtk_button_new_from_stock ("gtk-ok"); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (callback_options_ok), (gpointer) data); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, button, _("Accept settings and return to main program"), NULL); gtk_container_add (GTK_CONTAINER(hbox), button); gtk_widget_show (button); gtk_widget_show (data->dialog); } gerstensaft-0.3/src/options.h0000644000076500001440000000176610533272564015247 0ustar joeyusers/* options.h - Options dialog Copyright (c) 2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #ifndef __OPTIONS_H__ #define __OPTIONS_H__ #include void options_dialog (GtkWidget *widget, gpointer data); #endif /* __OPTIONS_H__ */ gerstensaft-0.3/src/receive.c0000644000076500001440000001633010533777553015172 0ustar joeyusers/* receive.c - Provide everything for receiving files Copyright (c) 2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #define _GNU_SOURCE #include "main.h" #include "receive.h" #include "msgbox.h" #include "beer.h" #include "nls.h" #include "io.h" #include #include #include #include #include #include #include struct rfile { char *nr; char *date; char *size; char *name; char *flags; }; /* 27) 1999-12-13 17:49:08 43 kB martin.jpg (archive) */ struct rfile *split_line (char *line, struct rfile *rf) { char *cp, *xp; memset (rf, 0, sizeof(struct rfile)); for (cp=line; *cp && isspace(*cp); cp++); /* 27) */ if ((xp = strchr(cp, ')')) == NULL) return NULL; if ((rf->nr = (char *)malloc(xp-cp+1)) == NULL) return NULL; memset (rf->nr, 0, xp-cp+1); strncpy (rf->nr, cp, xp-cp); /* 1999-12-13 17:49:08 */ cp = xp+2; if ((rf->date = (char *)malloc(20)) == NULL) return NULL; memset (rf->date, 0, 20); strncpy (rf->date, cp, 19); /* 43 kB */ cp += 20; for (; *cp && isspace(*cp); cp++); for (xp=cp; *xp && isdigit(*xp); xp++); if ((rf->size = (char *)malloc(xp-cp+1)) == NULL) return NULL; memset (rf->size, 0, xp-cp+1); strncpy (rf->size, cp, xp-cp); for (cp=xp; *cp && isspace(*cp); cp++); if (*cp == 'k' && *(cp+1) == 'B') cp += 2; /* martin.jpg (archive) */ for (; *cp && isspace(*cp); cp++); if ((xp = strrchr(cp, '(')) != NULL) { if ((rf->flags = (char *)malloc(strlen(xp))) == NULL) return NULL; memset (rf->flags, 0, strlen(xp)); strncpy (rf->flags, xp, strlen(xp)-1); *(xp--) = '\0'; if (isspace(*xp)) *xp = '\0'; } if ((rf->name = (char *)malloc(strlen(cp)+1)) == NULL) return NULL; memset (rf->name, 0, strlen(cp)+1); strncpy (rf->name, cp, strlen(cp)); return rf; } void parse_receive (void *data) { FILE *rec; char line[100]; char *cp; char *input; char *sender = NULL; struct rfile *jewels = NULL; char **clp; gint pos; GdkColor background; GdkColormap *colormap; if ((rec = popen ("receive -l 2> /dev/null", "r")) == NULL) return; memset (line, 0, sizeof(line)); if ((clp = (char **)malloc(sizeof(char *)*7)) == NULL) { perror ("malloc"); return; } clp[0] = NULL; gtk_clist_freeze (GTK_CLIST(((struct s_main_data *)data)->receiver)); gtk_clist_clear (GTK_CLIST(((struct s_main_data *)data)->receiver)); while (line[0] == '\0' && (cp = fgets(line, sizeof(line), rec))) { if (line[0] == '\n') line[0] = '\0'; else if (line[0] == '-') { while (line[strlen(line)-1] != '\n' && (cp = fgets(line, sizeof(line), rec))); line[0] = '\0'; } else if (!strncmp(line, "Files in spool directory", 24)) line[0] = '\0'; if (line[0] == '\0') continue; if (line[strlen(line)-1] == '\n') { line[strlen(line)-1] = '\0'; input = line; } else { if ((input = (char *)malloc(strlen(line)+1)) == NULL) { perror ("malloc"); return; } memset (input, 0, strlen(line)+1); strcpy (input, line); while (line[strlen(line)-1] != '\n' && (cp = fgets(line, sizeof(line), rec))) { if ((input = (char *)realloc(input, strlen(cp)+strlen(line)+1)) == NULL) { perror ("malloc"); free (input); return; } strcat (input, line); } input[strlen(input)-1] = '\0'; } if (!strncasecmp (input, "From ", 5)) { if (sender) free (sender); if ((sender = (char *)malloc(strlen(input)-5+1)) == NULL) { perror ("malloc"); if (strlen(input) >= sizeof(line)) free (input); return; } strcpy (sender, input+5); #ifdef DEBUG printf ("new sender: %s\n", sender); #endif } else if (!strncmp(input, " \"", 6)) { if (input[strlen(input)-1] == '"') { cp = NULL; gtk_clist_get_text (GTK_CLIST(((struct s_main_data *)data)->receiver), pos, 6, &cp); if (!cp) if ((cp = (char *)malloc(strlen(input)-6)) != NULL) { snprintf (cp, strlen(input)-6, input+6); gtk_clist_set_text (GTK_CLIST(((struct s_main_data *)data)->receiver), pos, 6, cp); } } } else { if (!jewels) if ((jewels = (struct rfile *)malloc(sizeof(struct rfile))) == NULL) { perror ("malloc"); if (strlen(input) >= sizeof(line)) free (input); } if ((jewels = split_line (input, jewels)) != NULL) { clp[1] = jewels->name; if ((cp = (char *)malloc(11)) == NULL) { perror ("malloc"); if (strlen(input) >= sizeof(line)) free (input); } strncpy(cp, jewels->date, 10); *(cp+10) = '\0'; clp[2] = cp; clp[3] = jewels->size; clp[4] = jewels->nr; clp[5] = strdup (sender); clp[6] = NULL; pos = gtk_clist_append (GTK_CLIST(((struct s_main_data *)data)->receiver), clp); background.red = background.green = background.blue = ~0; colormap = gdk_colormap_get_system(); gdk_color_alloc (colormap, &background); gtk_clist_set_background (GTK_CLIST(((struct s_main_data *)data)->receiver), pos, &background); if (jewels->flags && strstr(jewels->flags, "archive")) gtk_clist_set_pixmap (GTK_CLIST(((struct s_main_data *)data)->receiver), pos, 0, dir_pixmap, dir_mask); else gtk_clist_set_pixmap (GTK_CLIST(((struct s_main_data *)data)->receiver), pos, 0, doc_pixmap, doc_mask); free (jewels->date); if (jewels->flags) free (jewels->flags); } } if (strlen(input) >= sizeof(line)) free (input); line[0] = '\0'; } gtk_clist_thaw (GTK_CLIST(((struct s_main_data *)data)->receiver)); if (jewels) free (jewels); pclose (rec); } int receive_file (char *nr, const char *dir, char *fname) { char *cmd; char *msg; int ret; #ifdef DEBUG printf ("receive_file (%s, %s, %s)\n", nr, dir, fname); #endif if (chdir(dir)) return 0; if (exists (dir, fname)) { if (asprintf (&msg, _("A file named '%s' already exists. " "Do you want to replace it with the file you are receiving?"), fname) != -1) { if (okbox(_("File exists"), msg) != GTK_RESPONSE_OK) { free (msg); return 0; } else free (msg); } } if (asprintf (&cmd, "receive -q%s -n %s 2> /dev/null", (config.keep?" -k":""), nr) == -1) return 0; #ifdef DEBUG printf ("%s\n", cmd); #endif ret = system (cmd); if (ret == -1) { perror ("system"); free (cmd); return 0; } else if (WEXITSTATUS(ret)) { if (asprintf (&msg, _("%s terminated with exit code %d."), "receive", WEXITSTATUS(ret)) != -1) { msgbox (_("Error condition"), msg); free (msg); } free (cmd); return 0; } free (cmd); return 1; } gerstensaft-0.3/src/receive.h0000644000076500001440000000203510533344545015163 0ustar joeyusers/* receive.h - Provide everything for receiving files Copyright (c) 2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #ifndef __RECEIVE_H__ #define __RECEIVE_H__ void parse_receive (void *data); int receive_file (char *nr, const char *dir, char *fname); #endif /* __RECEIVE_H__ */ gerstensaft-0.3/src/saft.c0000644000076500001440000000726610534047743014505 0ustar joeyusers/* saft.c - SAFT interface Copyright (c) 1999,2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #define _GNU_SOURCE #include #include #include #include "config.h" #include "msgbox.h" #include "io.h" #include "nls.h" #include "beer.h" #include "saft.h" #include #include char *saft_taint_fname (char *fname) { char *res = NULL; char *p, *q; if (!fname) return NULL; if ((res = (char *)malloc((strlen(fname)*2)+1)) != NULL) { for (p=fname,q=res;*p;p++,q++) { if (strchr(" |\'\"`", *p)) *(q++)='\\'; *q=*p; } *q='\0'; } return res; } int saft_send (const char *addr, char **files, const char *comment) { char **cp; char *cmd; char *lastdir; char errmsg[1024]; char *taint_fname; char *taint_comment = NULL; char *msg; char protocol[4]; int ret; if (!addr || !strlen(addr)) return 0; if (comment && strlen(comment)) taint_comment = escape_quotes((char *)comment); if (config.protocol == PROTOCOL_AUTO) protocol[0] = '\0'; else if (config.protocol == PROTOCOL_IPV4) strcpy (protocol, " -4"); else if (config.protocol == PROTOCOL_IPV6) strcpy (protocol, " -6"); /* * Since comments can be only added to single files or archives, * don't group arguments. */ for (cp=files; *cp; (char **)cp++) { if ((lastdir = strrchr (*cp, '/')) == NULL){ snprintf (errmsg, sizeof(errmsg), _("'%s' lacks full path"), *cp); msgbox (_("Error condition"), errmsg); continue; } *lastdir = '\0'; if (chdir (*cp) != 0) { snprintf (errmsg, sizeof(errmsg), _("Can't change directory to '%s'"), *cp); msgbox (_("Error condition"), errmsg); *(lastdir++) = '/'; continue; } *(lastdir++) = '/'; taint_fname = saft_taint_fname((char *)lastdir); if (is_dir (lastdir, NULL)) { if (taint_comment) { if (asprintf (&cmd, "sendfile -Q%s -a=%s -c '%s' %s %s 2> /dev/null", protocol, taint_fname, taint_comment, taint_fname, addr) == -1) return 0; } else { if (asprintf (&cmd, "sendfile -Q%s -a=%s %s %s 2> /dev/null", protocol, taint_fname, taint_fname, addr) == -1) return 0; } } else { if (taint_comment) { if (asprintf (&cmd, "sendfile -Q%s -c '%s' %s %s 2> /dev/null", protocol, taint_comment, taint_fname, addr) == -1) return 0; } else { if (asprintf (&cmd, "sendfile -Q%s %s %s 2> /dev/null", protocol, taint_fname, addr) == -1) return 0; } } free (taint_fname); #ifdef DEBUG printf ("%s\n", cmd); #endif ret = system (cmd); if (ret == -1) { perror ("system"); free (cmd); return 0; } else if (WEXITSTATUS(ret)) { if (asprintf (&msg, _("%s terminated with exit code %d."), "sendfile", WEXITSTATUS(ret)) != -1) { msgbox (_("Error condition"), msg); free (msg); } free (cmd); return 0; } free (cmd); } return 1; } gerstensaft-0.3/src/saft.h0000644000076500001440000000174610534047743014507 0ustar joeyusers/* saft.h - SAFT interface Copyright (c) 1999,2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #ifndef __SAFT_H__ #define __SAFT_H__ int saft_send (const char *addr, char **files, const char *comment); #endif /* __SAFT_H__ */ gerstensaft-0.3/src/send.c0000644000076500001440000004015510534335030014460 0ustar joeyusers/* send.c - Provide the send dialog and related routines Copyright (c) 1999,2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include "main.h" #include "beer.h" #include "send.h" #include "msgbox.h" #include "saft.h" #include "nls.h" #include "io.h" #include "config.h" #define SENDMSG_MAXLEN 4090 /* max length of various strings - 6 chars safety */ #define SENDMSG_DELTA 200 /* search for newline delta chars before limit */ gint send_delete(GtkWidget *widget, GdkEvent *event, gpointer data) { #ifdef DEBUG printf ("send_delete()\n"); #endif return (FALSE); } void send_destroy (GtkWidget *widget, gpointer data) { #ifdef DEBUG printf ("send_destroy()\n"); #endif if (((struct s_send_data *) data) != NULL) free (((struct s_send_data *) data)); } void send_addr_change (GtkWidget *widget, gpointer data) { /* De/-activate the Send button only if needed */ if (strlen(gtk_entry_get_text (GTK_ENTRY(widget))) > 0) { if (!((struct s_send_data *) data)->addrok) { if (GTK_CLIST(((struct s_send_data *) data)->listbox)->selection) gtk_widget_set_sensitive (((struct s_send_data *) data)->sendbutton, TRUE); ((struct s_send_data *) data)->addrok = 1; } } else { if (((struct s_send_data *) data)->addrok) { gtk_widget_set_sensitive (((struct s_send_data *) data)->sendbutton, FALSE); ((struct s_send_data *) data)->addrok = 0; } } } void send_row_select (GtkCList *clist, gint row, gint column, GdkEventButton *event, gpointer data) { #ifdef DEBUG printf ("send_row_select()\n"); #endif if (strlen(gtk_entry_get_text (GTK_ENTRY(((struct s_send_data *) data)->addrinput->entry))) > 0) gtk_widget_set_sensitive (((struct s_send_data *) data)->sendbutton, TRUE); } void send_button_select_all (GtkWidget *widget, gpointer data) { int i; gtk_clist_freeze (GTK_CLIST(((struct s_send_data *) data)->listbox)); for (i=0; i < GTK_CLIST(((struct s_send_data *) data)->listbox)->rows; i++) gtk_clist_select_row (GTK_CLIST(((struct s_send_data *) data)->listbox), i, 0); gtk_clist_thaw (GTK_CLIST(((struct s_send_data *) data)->listbox)); if (((struct s_send_data *) data)->addrok == 1) gtk_widget_set_sensitive (((struct s_send_data *) data)->sendbutton, TRUE); } void send_button_unselect_all (GtkWidget *widget, gpointer data) { int i; gtk_clist_freeze (GTK_CLIST(((struct s_send_data *) data)->listbox)); for (i=0; i < GTK_CLIST(((struct s_send_data *) data)->listbox)->rows; i++) gtk_clist_unselect_row (GTK_CLIST(((struct s_send_data *) data)->listbox), i, 0); gtk_clist_thaw (GTK_CLIST(((struct s_send_data *) data)->listbox)); gtk_widget_set_sensitive (((struct s_send_data *) data)->sendbutton, FALSE); } void send_button_clear (GtkWidget *widget, gpointer data) { gtk_clist_clear (GTK_CLIST(((struct s_send_data *) data)->listbox)); gtk_widget_set_sensitive (((struct s_send_data *) data)->sendbutton, FALSE); gtk_entry_set_text (GTK_ENTRY(((struct s_send_data *) data)->addrinput->entry), ""); main_clear (((struct s_send_data *) data)->wdata); gtk_widget_set_sensitive (((struct s_send_data *) data)->clearbutton, FALSE); } gint send_history_add (const gchar *addr, GtkCombo *combo) { int i, n; gchar *xp; /* Find out if the address is already listed in the history */ for (i=0,n=0;idata)) { n++; break; } } /* Add address to history if it isn't in already */ if (!n && (xp = (char *)malloc (strlen(addr)+1)) != NULL) { sprintf (xp, addr); config.addrs = g_list_insert_sorted (config.addrs, xp, (GCompareFunc)strcmp); gtk_combo_set_popdown_strings (combo, config.addrs); gtk_entry_set_text (GTK_ENTRY(combo->entry), xp); } return (n == 0); } void send_button_send (GtkWidget *widget, gpointer data) { int i, n; gchar *fname; const gchar *addr; const gchar *comment; char **files; GList *selection; addr = gtk_entry_get_text (GTK_ENTRY(((struct s_send_data *) data)->addrinput->entry)); comment = gtk_entry_get_text (GTK_ENTRY(((struct s_send_data *) data)->comment)); if (send_history_add (addr, ((struct s_send_data *) data)->addrinput)) { gtk_combo_set_popdown_strings (GTK_COMBO(((struct s_send_data *) data)->wdata->addrinput), config.addrs); gtk_entry_set_text (GTK_ENTRY(GTK_COMBO((((struct s_send_data *) data)->wdata)->addrinput)->entry), ""); } for (selection = GTK_CLIST(((struct s_send_data *) data)->listbox)->selection, n=0; selection; selection = selection->next) n++; if (n>0 && (files = (char **)malloc ((n+1)*sizeof (char *))) != NULL) { memset (files, 0, (n+1)*sizeof (char *)); for (selection = GTK_CLIST(((struct s_send_data *) data)->listbox)->selection, i=0; selection; selection = selection->next) { gtk_clist_get_text (GTK_CLIST(((struct s_send_data *) data)->listbox), (int)selection->data, 1, &fname); files[i++] = fname; } if (saft_send (addr, files, comment)) { send_button_unselect_all (widget, data); gtk_entry_set_text (GTK_ENTRY(((struct s_send_data *) data)->comment), ""); free (files); if (config.closewindow) gtk_signal_emit_by_name (GTK_OBJECT (((struct s_send_data *) data)->dialog), "destroy"); } else free (files); } } void send_dialog (gpointer data) { GtkWidget *mainbox, *hbox, *vbox; GtkWidget *frame; GtkWidget *label; GtkWidget *button; #if GTK_MAJOR_VERSION >= 1 && GTK_MINOR_VERSION >= 1 GtkWidget *scrollwin; #endif GtkTooltips *tooltips; char *titles[3] = {"", _("Filename"), _("Size")}; struct stat st; char *name, asize[10]; char **clp; GdkColor background; GdkColormap *colormap; int i; char *cp; struct s_send_data *sdata; if ((sdata = (struct s_send_data *) malloc (sizeof(struct s_send_data))) == NULL) { perror ("malloc"); return; } memset (sdata, 0, sizeof (struct s_send_data)); if ((clp = (char **)malloc(sizeof(char *)*3)) == NULL) { perror ("malloc"); free (sdata); return; } clp[0] = NULL; sdata->wdata = data; /* Create a new dialog box */ sdata->dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_grab_add (sdata->dialog); gtk_window_set_title (GTK_WINDOW (sdata->dialog), _("Send Files")); gtk_widget_set_usize (GTK_WIDGET (sdata->dialog), 450, 270); /* Connect the appropriate signal handlers */ g_signal_connect (G_OBJECT (sdata->dialog), "delete_event", G_CALLBACK (send_delete), (gpointer) sdata); g_signal_connect (G_OBJECT (sdata->dialog), "destroy", G_CALLBACK (send_destroy), (gpointer) sdata); mainbox = gtk_vbox_new(FALSE, 0); gtk_container_add (GTK_CONTAINER (sdata->dialog), mainbox); frame = gtk_frame_new (NULL); gtk_container_border_width (GTK_CONTAINER(frame), 5); gtk_container_add (GTK_CONTAINER(mainbox), frame); vbox = gtk_vbox_new (FALSE, 0); gtk_container_border_width (GTK_CONTAINER(vbox), 5); gtk_container_add (GTK_CONTAINER(frame), vbox); label = gtk_label_new (_("Recipient")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_box_pack_start (GTK_BOX(vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); sdata->addrinput = GTK_COMBO(gtk_combo_new()); if (config.addrs) gtk_combo_set_popdown_strings (sdata->addrinput, config.addrs); gtk_entry_set_text (GTK_ENTRY(sdata->addrinput->entry), ""); g_signal_connect (G_OBJECT (sdata->addrinput->entry), "changed", G_CALLBACK (send_addr_change), (gpointer) sdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, sdata->addrinput->entry, _("Enter recipient's address"), NULL); gtk_box_pack_start (GTK_BOX(vbox), GTK_WIDGET(sdata->addrinput), FALSE, FALSE, FALSE); gtk_widget_show (GTK_WIDGET(sdata->addrinput)); label = gtk_label_new (_("Comment")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0); gtk_box_pack_start (GTK_BOX(vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); sdata->comment = gtk_entry_new(); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, sdata->comment, _("Enter optional comment"), NULL); gtk_box_pack_start (GTK_BOX(vbox), GTK_WIDGET(sdata->comment), FALSE, FALSE, FALSE); gtk_widget_show (GTK_WIDGET(sdata->comment)); sdata->listbox = gtk_clist_new_with_titles (3, titles); gtk_clist_column_titles_passive (GTK_CLIST(sdata->listbox)); gtk_clist_set_selection_mode (GTK_CLIST(sdata->listbox), GTK_SELECTION_MULTIPLE); gtk_clist_set_column_width (GTK_CLIST(sdata->listbox), 0, 16); gtk_clist_set_column_justification (GTK_CLIST(sdata->listbox), 0, GTK_JUSTIFY_CENTER); gtk_clist_set_column_width (GTK_CLIST(sdata->listbox), 1, 340); gtk_clist_set_column_justification (GTK_CLIST(sdata->listbox), 1, GTK_JUSTIFY_LEFT); gtk_clist_set_column_width (GTK_CLIST(sdata->listbox), 2, 30); gtk_clist_set_column_justification (GTK_CLIST(sdata->listbox), 2, GTK_JUSTIFY_RIGHT); g_signal_connect(G_OBJECT (sdata->listbox), "select_row", G_CALLBACK (send_row_select), (gpointer) sdata); #if GTK_MAJOR_VERSION >= 1 && GTK_MINOR_VERSION >= 1 scrollwin = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX(vbox), scrollwin, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER(scrollwin), sdata->listbox); gtk_widget_show (scrollwin); #else gtk_box_pack_start (GTK_BOX(vbox) , sdata->listbox, TRUE, TRUE, 0); #endif for (i=0; i < GTK_CLIST(((struct s_main_data *) data)->filebox)->rows; i++) { gtk_clist_get_text(GTK_CLIST(((struct s_main_data *) data)->filebox), i, 1, &name); if ((cp = (char *)malloc (strlen(name)+1)) == NULL) continue; memcpy (cp, name, strlen(name)+1); clp[1] = cp; if (stat (name, &st)) continue; #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 snprintf (asize, sizeof (asize), "%lld", (st.st_size+1023)/1024); #else snprintf (asize, sizeof (asize), "%ld", (st.st_size+1023)/1024); #endif if ((cp = (char *)malloc (strlen(asize)+1)) == NULL) continue; memcpy (cp, asize, strlen(asize)+1); clp[2] = cp; gtk_clist_append (GTK_CLIST(sdata->listbox), clp); background.red = background.green = background.blue = ~0; colormap = gdk_colormap_get_system(); gdk_color_alloc (colormap, &background); gtk_clist_set_background (GTK_CLIST(sdata->listbox), GTK_CLIST(sdata->listbox)->rows-1, &background); if (S_ISDIR(st.st_mode)) gtk_clist_set_pixmap (GTK_CLIST(sdata->listbox), GTK_CLIST(sdata->listbox)->rows-1, 0, dir_pixmap, dir_mask); else gtk_clist_set_pixmap (GTK_CLIST(sdata->listbox), GTK_CLIST(sdata->listbox)->rows-1, 0, doc_pixmap, doc_mask); gtk_clist_select_row (GTK_CLIST(sdata->listbox), GTK_CLIST(sdata->listbox)->rows-1, 0); } gtk_clist_set_column_width (GTK_CLIST(sdata->listbox), 2, gtk_clist_optimal_column_width (GTK_CLIST(sdata->listbox), 2)); gtk_widget_show (sdata->listbox); gtk_widget_show (vbox); /* horizontal box containing the buttons */ hbox = gtk_hbox_new (FALSE, 0); gtk_container_border_width (GTK_CONTAINER(hbox), 5); gtk_box_pack_start (GTK_BOX(mainbox), hbox, FALSE, TRUE, 0); button = gtk_button_new_with_label (_(" Select all ")); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (send_button_select_all), (gpointer) sdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, button, _("Select all files"), NULL); gtk_box_pack_start (GTK_BOX(hbox), button, TRUE, FALSE, 0); gtk_widget_show (button); button = gtk_button_new_with_label (_(" Unselect all ")); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (send_button_unselect_all), (gpointer) sdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, button, _("Unselected all files"), NULL); gtk_box_pack_start (GTK_BOX(hbox), button, TRUE, FALSE, 0); gtk_widget_show (button); sdata->sendbutton = gtk_button_new_with_mnemonic (_(" _Send ")); gtk_widget_set_sensitive (sdata->sendbutton, FALSE); g_signal_connect (G_OBJECT (sdata->sendbutton), "clicked", G_CALLBACK (send_button_send), (gpointer) sdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, sdata->sendbutton, _("Send selected files to recipient"), NULL); gtk_box_pack_start (GTK_BOX(hbox), sdata->sendbutton, TRUE, FALSE, 0); gtk_widget_show (sdata->sendbutton); sdata->clearbutton = gtk_button_new_from_stock ("gtk-clear"); g_signal_connect (G_OBJECT (sdata->clearbutton), "clicked", G_CALLBACK (send_button_clear), (gpointer) sdata); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, sdata->clearbutton, _("Clear list of files"), NULL); gtk_box_pack_start (GTK_BOX(hbox), sdata->clearbutton, TRUE, FALSE, 0); gtk_widget_show (sdata->clearbutton); button = gtk_button_new_from_stock ("gtk-close"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_destroy), (gpointer) sdata->dialog); tooltips = gtk_tooltips_new(); gtk_tooltips_set_tip (tooltips, button, _("Return to main program"), NULL); gtk_box_pack_start (GTK_BOX(hbox), button, TRUE, FALSE, 0); gtk_widget_show (button); gtk_widget_show (hbox); gtk_widget_show (frame); gtk_widget_show (mainbox); gtk_widget_show (sdata->dialog); } int sendmsg (const char *addr, char *text) { char *cmd; char *msg; char *stext; char *cp; int ret; char protocol[4]; if ((stext = escape_quotes(text)) == NULL) return 0; for (cp=text,ret=0; *cp; cp++) if (*cp == '\n') { ret++; break; } if (config.protocol == PROTOCOL_AUTO) protocol[0] = '\0'; else if (config.protocol == PROTOCOL_IPV4) strcpy (protocol, " -4"); else if (config.protocol == PROTOCOL_IPV6) strcpy (protocol, " -6"); if (asprintf (&cmd, "sendmsg -q -m%s%s -s '%s%s' %s 2> /dev/null", (ret?" -l":""), protocol, stext, (ret?"\n":""), addr) == -1) { free (stext); return 0; } free (stext); #ifdef DEBUG printf ("%s\n", cmd); #endif ret = system (cmd); if (ret == -1) { perror ("system"); free (cmd); return 0; } else if (WEXITSTATUS(ret)) { if (asprintf (&msg, _("%s terminated with exit code %d."), "sendmsg", WEXITSTATUS(ret)) != -1) { if (WEXITSTATUS(ret) == 1) { cp = msg; if (asprintf (&msg, "%s %s", cp, _("Maybe the recipient is not available at the moment.")) != -1) free (cp); else msg = cp; } msgbox (_("Error condition"), msg); free (msg); } free (cmd); return 0; } free (cmd); return 1; } int sendmessage (const char *addr, char *text) { int ret = 1; char *sp; char *pivot; char pv = '\0'; if (strlen(text) > SENDMSG_MAXLEN) msgbox (_("Message information"), _("Your message is longer than the SAFT limit for single messages and will be transmitted in several chunks therefore.")); sp = text; while (*sp) { if (strlen(sp) > SENDMSG_MAXLEN) { for (pivot = sp+SENDMSG_MAXLEN-1; (sp+SENDMSG_MAXLEN-1 - pivot) < SENDMSG_DELTA && *pivot != '\n'; pivot--); /* No newline found, use maximum length then */ if (*pivot != '\n') pivot = sp+SENDMSG_MAXLEN-1; pv = *pivot; *pivot = '\0'; } else pv = '\0'; ret &= sendmsg (addr, sp); sp += (strlen(sp)); if (pv) { if (pv == '\n') sp++; else *pivot = pv; } } return ret; } gerstensaft-0.3/src/send.h0000644000076500001440000000256410534250703014472 0ustar joeyusers/* send.h - Provide the send dialog and related routines Copyright (c) 1999,2006 Joey Schulze This file is part of the Gerstensaft package. 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, USA. */ #ifndef __SEND_H__ #define __SEND_H__ #include #include "main.h" struct s_send_data { int addrok; GtkWidget *dialog; GtkWidget *listbox; GtkCombo *addrinput; GtkWidget *comment; GtkWidget *sendbutton; GtkWidget *clearbutton; struct s_main_data *wdata; }; void send_dialog (gpointer data); gint send_history_add (const gchar *addr, GtkCombo *combo); int sendmsg (const char *addr, char *text); int sendmessage (const char *addr, char *text); #endif /* __SEND_H__ */