moserial r2 - in trunk: . data data/glade data/icons data/icons/48x48 data/icons/48x48/apps doc doc/C doc/C/figures m4 po src



Author: mjc
Date: Fri Mar  6 18:32:35 2009
New Revision: 2
URL: http://svn.gnome.org/viewvc/moserial?rev=2&view=rev

Log:
Initial commit. Copied from SourceForge svn repo.


Added:
   trunk/AUTHORS
   trunk/COPYING
   trunk/ChangeLog
   trunk/MAINTAINERS
   trunk/Makefile.am
   trunk/NEWS
   trunk/README
   trunk/autogen.sh   (contents, props changed)
   trunk/configure.ac
   trunk/data/
   trunk/data/Makefile.am
   trunk/data/glade/
   trunk/data/glade/Makefile.am
   trunk/data/glade/moserial.glade
   trunk/data/glade/moserial.ui
   trunk/data/icons/
   trunk/data/icons/48x48/
   trunk/data/icons/48x48/Makefile.am
   trunk/data/icons/48x48/apps/
   trunk/data/icons/48x48/apps/Makefile.am
   trunk/data/icons/48x48/apps/moserial.png   (contents, props changed)
   trunk/data/icons/Makefile.am
   trunk/data/moserial.desktop.in
   trunk/doc/
   trunk/doc/C/
   trunk/doc/C/figures/
   trunk/doc/C/figures/authorizations.png   (contents, props changed)
   trunk/doc/C/figures/connect.png   (contents, props changed)
   trunk/doc/C/figures/disconnect.png   (contents, props changed)
   trunk/doc/C/figures/main-toolbar.png   (contents, props changed)
   trunk/doc/C/figures/outgoing.png   (contents, props changed)
   trunk/doc/C/figures/port-setup.png   (contents, props changed)
   trunk/doc/C/figures/preferences.png   (contents, props changed)
   trunk/doc/C/figures/receive-file-dialog.png   (contents, props changed)
   trunk/doc/C/figures/receive-file.png   (contents, props changed)
   trunk/doc/C/figures/receive-progress.png   (contents, props changed)
   trunk/doc/C/figures/received-tabs.png   (contents, props changed)
   trunk/doc/C/figures/record-dialog.png   (contents, props changed)
   trunk/doc/C/figures/record.png   (contents, props changed)
   trunk/doc/C/figures/send-file-dialog.png   (contents, props changed)
   trunk/doc/C/figures/send-file.png   (contents, props changed)
   trunk/doc/C/figures/send-progress.png   (contents, props changed)
   trunk/doc/C/figures/sent-tabs.png   (contents, props changed)
   trunk/doc/C/figures/statusbar.png   (contents, props changed)
   trunk/doc/C/figures/stop-recording.png   (contents, props changed)
   trunk/doc/C/legal.xml
   trunk/doc/C/moserial.xml
   trunk/doc/ChangeLog
   trunk/doc/Makefile.am
   trunk/doc/moserial.omf.in
   trunk/gnome-doc-utils.make
   trunk/m4/
   trunk/omf.make
   trunk/po/
   trunk/po/ChangeLog
   trunk/po/LINGUAS
   trunk/po/Makefile.in.in
   trunk/po/POTFILES.in
   trunk/po/POTFILES.skip
   trunk/src/
   trunk/src/AutoScroll.vala
   trunk/src/Config.vapi
   trunk/src/DefaultPaths.vala
   trunk/src/HexTextBuffer.vala
   trunk/src/InputParser.vala
   trunk/src/Main.vala
   trunk/src/MainWindow.vala
   trunk/src/MoUtils.vala
   trunk/src/Preferences.vala
   trunk/src/PreferencesDialog.vala
   trunk/src/Profile.vala
   trunk/src/ReceiveChooserDialog.vala
   trunk/src/ReceiveProgressDialog.vala
   trunk/src/RecordDialog.vala
   trunk/src/Rzwrapper.vala
   trunk/src/SendChooserDialog.vala
   trunk/src/SendProgressDialog.vala
   trunk/src/SerialConnection.vala
   trunk/src/SerialStreamRecorder.vala
   trunk/src/Settings.vala
   trunk/src/SettingsDialog.vala
   trunk/src/Szwrapper.vala
   trunk/src/XmodemFilenameDialog.vala
   trunk/src/posix.vapi
   trunk/xmldocs.make

Added: trunk/AUTHORS
==============================================================================
--- (empty file)
+++ trunk/AUTHORS	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,2 @@
+Michael J. Chudobiak <mjc svn gnome org>
+Marlodavampire (rentacoder.com)

Added: trunk/COPYING
==============================================================================
--- (empty file)
+++ trunk/COPYING	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  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
+them 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 prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  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.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey 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;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If 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 convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU 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 that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  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.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+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.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     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
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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 3 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, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program 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, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU 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 Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.

Added: trunk/MAINTAINERS
==============================================================================
--- (empty file)
+++ trunk/MAINTAINERS	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,3 @@
+Michael J. Chudobiak
+E-mail: mjc svn gnome org
+Userid: mjc

Added: trunk/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/Makefile.am	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,84 @@
+NULL = 
+
+AUTOMAKE_OPTIONS = subdir-objects
+
+SUBDIRS = \
+	data \
+	doc \
+	po \
+	$(NULL)
+
+gladedir = $(datadir)/moserial/glade
+INCLUDES = -DMOSERIAL_GLADEDIR=\""$(gladedir)"\"
+
+AM_CPPFLAGS = \
+	$(MOSERIAL_CFLAGS) \
+	-include $(CONFIG_HEADER) \
+	$(NULL)
+
+BUILT_SOURCES = src/moserial.vala.stamp
+
+bin_PROGRAMS = moserial
+
+moserial_VALASOURCES = \
+	src/MainWindow.vala \
+	src/Main.vala \
+	src/SettingsDialog.vala \
+	src/Settings.vala \
+	src/SendProgressDialog.vala \
+	src/ReceiveChooserDialog.vala \
+	src/ReceiveProgressDialog.vala \
+	src/RecordDialog.vala \
+	src/PreferencesDialog.vala \
+	src/SerialConnection.vala \
+	src/HexTextBuffer.vala \
+	src/SerialStreamRecorder.vala \
+	src/InputParser.vala \
+	src/Rzwrapper.vala \
+	src/XmodemFilenameDialog.vala \
+	src/SendChooserDialog.vala \
+	src/Szwrapper.vala \
+	src/AutoScroll.vala \
+	src/Preferences.vala \
+	src/Profile.vala \
+	src/DefaultPaths.vala \
+	src/MoUtils.vala \
+	$(NULL)
+
+moserial_SOURCES = \
+	$(moserial_VALASOURCES:.vala=.c) \
+	$(moserial_VALASOURCES:.vala=.h) \
+	$(NULL)
+
+src/moserial.vala.stamp: $(moserial_VALASOURCES)
+	$(VALAC) -C --pkg gtk+-2.0 --pkg gdk-2.0 --pkg Config --pkg posix --pkg gconf-2.0 --vapidir src/ --basedir $(top_srcdir) $^
+	touch $@
+
+moserial_LDADD = \
+	$(MOSERIAL_LIBS) \
+	$(NULL)
+
+distcleancheck_listfiles = find . -type f -print | grep -v 'omf\.out'
+
+distuninstallcheck_listfiles = find . -type f -print | grep -v '^\./var/scrollkeeper' | grep -v 'omf' | grep -v 'figures'
+
+EXTRA_DIST = \
+	intltool-extract.in \
+	intltool-update.in \
+	intltool-merge.in \
+	$(moserial_VALASOURCES) \
+	src/moserial.vala.stamp \
+        omf.make                \
+        xmldocs.make            \
+        gnome-doc-utils.make	\
+	$(NULL)
+
+DISTCLEANFILES = \
+	intltool-extract \
+	intltool-update \
+	intltool-merge \
+	po/.intltool-merge-cache \
+        gnome-doc-utils.make	\
+	$(NULL)
+
+DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper

Added: trunk/NEWS
==============================================================================

Added: trunk/README
==============================================================================

Added: trunk/autogen.sh
==============================================================================
--- (empty file)
+++ trunk/autogen.sh	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+PKG_NAME="moserial"
+
+. gnome-autogen.sh

Added: trunk/configure.ac
==============================================================================
--- (empty file)
+++ trunk/configure.ac	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,50 @@
+AC_INIT([moserial], [1.0.4], [mjc svn gnome org], [moserial])
+AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADERS(config.h)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+
+AC_PATH_PROG(VALAC, valac, valac)
+AC_SUBST(VALAC)
+
+AC_CONFIG_MACRO_DIR([m4])
+GNOME_DOC_INIT
+
+AH_TEMPLATE([GETTEXT_PACKAGE], [Package name for gettext])
+GETTEXT_PACKAGE=moserial
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
+AC_SUBST(GETTEXT_PACKAGE)
+AM_GLIB_GNU_GETTEXT
+IT_PROG_INTLTOOL([0.35.0])
+
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+AC_SUBST(LDFLAGS)
+
+GLIB_REQUIRED=2.12.0
+GTK_REQUIRED=2.10.0
+
+PKG_CHECK_MODULES(MOSERIAL, glib-2.0 >= $GLIB_REQUIRED
+			    gobject-2.0 >= $GLIB_REQUIRED
+			    gtk+-2.0 >= $GTK_REQUIRED
+			    gconf-2.0
+                            gio-2.0)
+AC_SUBST(MOSERIAL_CFLAGS)
+AC_SUBST(MOSERIAL_LIBS)
+
+AC_CONFIG_FILES([
+	Makefile
+	po/Makefile.in
+	data/Makefile
+	data/glade/Makefile
+	data/icons/Makefile
+	data/icons/48x48/Makefile
+	data/icons/48x48/apps/Makefile
+	doc/Makefile])
+
+AC_OUTPUT

Added: trunk/data/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/data/Makefile.am	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,14 @@
+SUBDIRS = glade icons
+
+ INTLTOOL_DESKTOP_RULE@
+
+desktopdir = $(datadir)/applications
+desktop_in_files=moserial.desktop.in
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) 
+
+EXTRA_DIST = 			\
+	$(desktop_in_files)	\
+	$(desktop_DATA)		
+
+DISTCLEANFILES =                \
+	$(desktop_DATA)

Added: trunk/data/glade/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/data/glade/Makefile.am	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,8 @@
+glade_DATA = moserial.ui
+
+gladedir = $(datadir)/moserial/glade
+
+EXTRA_DIST = moserial.ui moserial.glade
+
+moserial.ui: moserial.glade
+	gtk-builder-convert moserial.glade moserial.ui

Added: trunk/data/glade/moserial.glade
==============================================================================
--- (empty file)
+++ trunk/data/glade/moserial.glade	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,1745 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.5 on Fri Mar  6 09:30:42 2009 -->
+<glade-interface>
+  <widget class="GtkWindow" id="window">
+    <property name="title" translatable="yes">moserial</property>
+    <property name="default_width">640</property>
+    <property name="default_height">477</property>
+    <property name="icon_name">moserial</property>
+    <child>
+      <widget class="GtkVBox" id="vbox1">
+        <property name="visible">True</property>
+        <child>
+          <widget class="GtkMenuBar" id="menubar1">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkMenuItem" id="menuitem1">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">_File</property>
+                <property name="use_underline">True</property>
+                <child>
+                  <widget class="GtkMenu" id="menu1">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="menubar_open_settings">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">_Open Settings</property>
+                        <property name="use_underline">True</property>
+                        <child internal-child="image">
+                          <widget class="GtkImage" id="menu-item-image1">
+                            <property name="visible">True</property>
+                            <property name="stock">gtk-open</property>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkSeparatorMenuItem" id="menuitem5">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">menuitem5</property>
+                        <property name="use_underline">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="menubar_save_settings">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">_Save Settings</property>
+                        <property name="use_underline">True</property>
+                        <child internal-child="image">
+                          <widget class="GtkImage" id="menu-item-image2">
+                            <property name="visible">True</property>
+                            <property name="stock">gtk-save</property>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="menubar_save_settings_as">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">Save Settings _As</property>
+                        <property name="use_underline">True</property>
+                        <child internal-child="image">
+                          <widget class="GtkImage" id="menu-item-image3">
+                            <property name="visible">True</property>
+                            <property name="stock">gtk-save-as</property>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
+                        <property name="visible">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="menubar_quit">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">gtk-quit</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkMenuItem" id="menubar_edit">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">_Edit</property>
+                <property name="use_underline">True</property>
+                <child>
+                  <widget class="GtkMenu" id="menu2">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="menubar_cut">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">gtk-cut</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="menubar_copy">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">gtk-copy</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="menubar_paste">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">gtk-paste</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkSeparatorMenuItem" id="menuitem3">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">menuitem3</property>
+                        <property name="use_underline">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="menubar_clear">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">gtk-clear</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkMenuItem" id="menuitem4">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">_Help</property>
+                <property name="use_underline">True</property>
+                <child>
+                  <widget class="GtkMenu" id="menu3">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="menubar_about">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">gtk-about</property>
+                        <property name="use_underline">True</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkImageMenuItem" id="menubar_contents">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">_Contents</property>
+                        <property name="use_underline">True</property>
+                        <accelerator key="F1" modifiers="" signal="activate"/>
+                        <child internal-child="image">
+                          <widget class="GtkImage" id="menu-item-image4">
+                            <property name="stock">gtk-help</property>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkToolbar" id="toolbar">
+            <property name="visible">True</property>
+            <property name="border_width">4</property>
+            <child>
+              <widget class="GtkToggleToolButton" id="toolbar_connect">
+                <property name="visible">True</property>
+                <property name="tooltip" translatable="yes">You must connect to your port before you can send or receive data. Disconnecting and reconnecting will clear the textboxes and reset the TX / RX counters.</property>
+                <property name="label" translatable="yes">Connect</property>
+                <property name="stock_id">gtk-connect</property>
+              </widget>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkSeparatorToolItem" id="toolbutton3">
+                <property name="visible">True</property>
+              </widget>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkToggleToolButton" id="toolbar_logging">
+                <property name="visible">True</property>
+                <property name="tooltip" translatable="yes">Use this to record (or "log") your communications to a file. You can log the received data, the sent data, or both. This can also be used to receive files sent by a remote device without the use of error correction protocols (a straight binary dump).</property>
+                <property name="label" translatable="yes">Record</property>
+                <property name="stock_id">gtk-media-record</property>
+              </widget>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkToolButton" id="toolbar_send">
+                <property name="visible">True</property>
+                <property name="tooltip" translatable="yes">Use this to send a file to a remote computer, with or without error correction protocols.</property>
+                <property name="label" translatable="yes">Send File</property>
+                <property name="stock_id">gtk-go-up</property>
+              </widget>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkToolButton" id="toolbar_receive">
+                <property name="visible">True</property>
+                <property name="tooltip" translatable="yes">Use this to receive a file from a remote computer, using an error correction protocol. For straight binary dumps without error correction, use Record instead.</property>
+                <property name="label" translatable="yes">Receive File</property>
+                <property name="stock_id">gtk-save-as</property>
+              </widget>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkSeparatorToolItem" id="toolbutton1">
+                <property name="visible">True</property>
+              </widget>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkToolButton" id="toolbar_settings">
+                <property name="visible">True</property>
+                <property name="tooltip" translatable="yes">Use this to configure your serial port parameters.</property>
+                <property name="label" translatable="yes">Port Setup</property>
+                <property name="stock_id">gtk-properties</property>
+              </widget>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkToolButton" id="toolbar_preferences">
+                <property name="visible">True</property>
+                <property name="tooltip" translatable="yes">Use this to set font sizes and other related settings.</property>
+                <property name="label" translatable="yes">Preferences</property>
+                <property name="stock_id">gtk-preferences</property>
+              </widget>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkSeparatorToolItem" id="separatortoolitem1">
+                <property name="visible">True</property>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkToolButton" id="toolbar_help">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Help</property>
+                <property name="stock_id">gtk-help</property>
+              </widget>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkVPaned" id="vpaned">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="position">50</property>
+            <property name="position_set">True</property>
+            <child>
+              <widget class="GtkNotebook" id="incoming_notebook">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="border_width">4</property>
+                <child>
+                  <widget class="GtkScrolledWindow" id="incoming_ascii_scrolledwindow">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                    <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                    <child>
+                      <widget class="GtkTextView" id="incoming_ascii_textview">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip_text">This is the data received by the serial port. Depending on the configuration of the remote device, your outgoing data may also be echoed here. moserial attempts to identify echoed text, and highlight it in blue.</property>
+                        <property name="border_width">1</property>
+                        <property name="editable">False</property>
+                        <property name="wrap_mode">GTK_WRAP_WORD_CHAR</property>
+                        <property name="left_margin">2</property>
+                        <property name="right_margin">2</property>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label12">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Received ASCII</property>
+                  </widget>
+                  <packing>
+                    <property name="type">tab</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkScrolledWindow" id="incoming_hex_scrolledwindow">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                    <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                    <child>
+                      <widget class="GtkTextView" id="incoming_hex_textview">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip_text">This is the data received by the serial port. Depending on the configuration of the remote device, your outgoing data may also be echoed here.</property>
+                        <property name="border_width">1</property>
+                        <property name="editable">False</property>
+                        <property name="left_margin">2</property>
+                        <property name="right_margin">2</property>
+                      </widget>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label15">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Received HEX</property>
+                  </widget>
+                  <packing>
+                    <property name="type">tab</property>
+                    <property name="position">1</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="resize">True</property>
+                <property name="shrink">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkNotebook" id="outgoing_notebook">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="border_width">4</property>
+                <child>
+                  <widget class="GtkScrolledWindow" id="outgoing_ascii_scrolledwindow">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                    <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                    <child>
+                      <widget class="GtkTextView" id="outgoing_ascii_textview">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip_text">This is the history, or log, of your outgoing data. New outgoing data is entered below.</property>
+                        <property name="border_width">1</property>
+                        <property name="editable">False</property>
+                        <property name="wrap_mode">GTK_WRAP_WORD_CHAR</property>
+                        <property name="left_margin">2</property>
+                        <property name="right_margin">2</property>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label13">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Sent ASCII</property>
+                  </widget>
+                  <packing>
+                    <property name="type">tab</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkScrolledWindow" id="outgoing_hex_scrolledwindow">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                    <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                    <child>
+                      <widget class="GtkTextView" id="outgoing_hex_textview">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip_text">This is the history, or log, of your outgoing data. New outgoing data is entered below.</property>
+                        <property name="border_width">1</property>
+                        <property name="editable">False</property>
+                        <property name="left_margin">2</property>
+                        <property name="right_margin">2</property>
+                      </widget>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label16">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Sent HEX</property>
+                  </widget>
+                  <packing>
+                    <property name="type">tab</property>
+                    <property name="position">1</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="resize">True</property>
+                <property name="shrink">True</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkVBox" id="vbox4">
+            <property name="visible">True</property>
+            <property name="border_width">4</property>
+            <child>
+              <widget class="GtkLabel" id="label14">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">&lt;i&gt;Outgoing&lt;/i&gt;</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkHBox" id="hbox2">
+                <property name="visible">True</property>
+                <child>
+                  <widget class="GtkEntry" id="entry">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="has_focus">True</property>
+                    <property name="has_tooltip">True</property>
+                    <property name="tooltip_markup">Enter your new outgoing data here. Data is transmitted on a character-by-character basis.</property>
+                    <property name="tooltip" translatable="yes">Enter the data that you wish to transmit here. Press Enter or Send when you are ready to send it.</property>
+                  </widget>
+                </child>
+                <child>
+                  <widget class="GtkButton" id="send">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="tooltip" translatable="yes">Click this to transmit the data entered in the Outgoing text box. Clicking "enter" in that box will do the same thing.</property>
+                    <property name="label" translatable="yes">Send</property>
+                    <property name="response_id">0</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkComboBox" id="input_mode">
+                    <property name="visible">True</property>
+                    <property name="tooltip" translatable="yes">This determines whether the data entered in the Outgoing text box should be interpreted as normal ASCII text, or as hexadecimal codes. If this is set to HEX, the entered data should consist of only 0-9 and A-F characters.</property>
+                    <property name="items" translatable="yes">ASCII
+HEX</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkComboBox" id="termination_mode">
+                    <property name="visible">True</property>
+                    <property name="tooltip" translatable="yes">This selects the termination sequence that is appended to the Outgoing data in the ASCII mode when you click Send.</property>
+                    <property name="items" translatable="yes">CR+LF end
+CR end
+LF end
+TAB end
+No end</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkHBox" id="hbox5">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkStatusbar" id="statusbar">
+                <property name="visible">True</property>
+                <property name="border_width">4</property>
+                <property name="spacing">2</property>
+                <property name="has_resize_grip">False</property>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkStatusbar" id="bytecountbar">
+                <property name="visible">True</property>
+                <property name="border_width">4</property>
+                <property name="spacing">2</property>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">4</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkDialog" id="settings_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Port Setup</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox3">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkVBox" id="vbox11">
+            <property name="visible">True</property>
+            <property name="spacing">6</property>
+            <child>
+              <widget class="GtkLabel" id="label24">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;Port Settings&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkTable" id="table1">
+                <property name="visible">True</property>
+                <property name="n_rows">8</property>
+                <property name="n_columns">2</property>
+                <child>
+                  <widget class="GtkCheckButton" id="settings_local_echo">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="tooltip" translatable="yes">Normally disabled</property>
+                    <property name="label" translatable="yes">Echo received data</property>
+                    <property name="response_id">0</property>
+                    <property name="draw_indicator">True</property>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">7</property>
+                    <property name="bottom_attach">8</property>
+                    <property name="x_padding">2</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label26">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Local Echo</property>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">7</property>
+                    <property name="bottom_attach">8</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Device</property>
+                  </widget>
+                  <packing>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label2">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Baud Rate</property>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label3">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Data Bits</property>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label4">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Stop Bits</property>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">3</property>
+                    <property name="bottom_attach">4</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label5">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Parity</property>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">4</property>
+                    <property name="bottom_attach">5</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label7">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Handshake</property>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">5</property>
+                    <property name="bottom_attach">6</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label8">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Access Mode</property>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">6</property>
+                    <property name="bottom_attach">7</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkComboBoxEntry" id="settings_device">
+                    <property name="visible">True</property>
+                    <property name="items" translatable="yes">/dev/ttyS0
+/dev/ttyS1
+/dev/ttyS2
+/dev/ttyS3
+/dev/ttyUSB0
+/dev/ttyUSB1
+/dev/ttyUSB2
+/dev/ttyUSB3</property>
+                    <child internal-child="entry">
+                      <widget class="GtkEntry" id="comboboxentry-entry1">
+                      </widget>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkComboBox" id="settings_baud_rate">
+                    <property name="visible">True</property>
+                    <property name="items" translatable="yes">300
+600
+1200
+2400
+4800
+9600
+19200
+38400
+57600
+115200
+230400
+460800
+576000
+927600</property>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkComboBox" id="settings_data_bits">
+                    <property name="visible">True</property>
+                    <property name="items" translatable="yes">5
+6
+7
+8</property>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkComboBox" id="settings_stop_bits">
+                    <property name="visible">True</property>
+                    <property name="items" translatable="yes">1
+2</property>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">3</property>
+                    <property name="bottom_attach">4</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkComboBox" id="settings_parity">
+                    <property name="visible">True</property>
+                    <property name="items" translatable="yes">None
+Odd
+Even
+Mark
+Space</property>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">4</property>
+                    <property name="bottom_attach">5</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkHBox" id="hbox3">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="settings_hardware_handshake">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">Hardware</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="padding">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="settings_software_handshake">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">Software</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="padding">2</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">5</property>
+                    <property name="bottom_attach">6</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkComboBox" id="settings_open_for">
+                    <property name="visible">True</property>
+                    <property name="items" translatable="yes">Read and Write
+Read Only
+Write Only</property>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">6</property>
+                    <property name="bottom_attach">7</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area3">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="settings_apply_button">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-apply</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkButton" id="settings_discard_button">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-discard</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkDialog" id="send_progress_dialog">
+    <property name="width_request">640</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Send File Progress</property>
+    <property name="modal">True</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox4">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkVBox" id="vbox3">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkLabel" id="send_statusbox">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkProgressBar" id="send_progressbar">
+                <property name="visible">True</property>
+                <property name="fraction">0.5</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area4">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="send_progress_cancel">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-cancel</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkDialog" id="receive_progress_dialog">
+    <property name="width_request">640</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Receive File Progress</property>
+    <property name="modal">True</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox6">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkVBox" id="vbox2">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkLabel" id="receive_statusbox">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkProgressBar" id="receive_progressbar">
+                <property name="visible">True</property>
+                <property name="activity_mode">True</property>
+                <property name="fraction">0.5</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area6">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="receive_progress_cancel">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-cancel</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkWindow" id="window1">
+    <child>
+      <widget class="GtkTable" id="table3">
+        <property name="visible">True</property>
+        <property name="n_rows">6</property>
+        <property name="n_columns">6</property>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="disconnect_label">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Disconnect</property>
+          </widget>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="connect_label">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Connect</property>
+          </widget>
+          <packing>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="record_label">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Record</property>
+          </widget>
+          <packing>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="stop_recording_label">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Stop Recording</property>
+          </widget>
+          <packing>
+            <property name="top_attach">3</property>
+            <property name="bottom_attach">4</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkFileChooserDialog" id="record_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Record Incoming and/or Outgoing Data</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <property name="action">GTK_FILE_CHOOSER_ACTION_SAVE</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox9">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkHBox" id="hbox1">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkLabel" id="label11">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Stream to record</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkComboBox" id="record_stream">
+                <property name="visible">True</property>
+                <property name="items" translatable="yes">Incoming
+Outgoing
+Incoming and Outgoing</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area9">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkFileChooserDialog" id="receive_chooser_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Select Folder for Received Files</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <property name="local_only">False</property>
+    <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox10">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkHBox" id="hbox4">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkLabel" id="label6">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Error Correction Protocol</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">5</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkComboBox" id="receive_chooser_protocol">
+                <property name="visible">True</property>
+                <property name="tooltip" translatable="yes">Select the error correction protocol to use. If you wish to receive a straight binary file without using error correction protocols, use the Record button instead.</property>
+                <property name="items" translatable="yes">Xmodem
+Ymodem
+Zmodem</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area10">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkDialog" id="xmodem_filename_dialog">
+    <property name="border_width">5</property>
+    <property name="modal">True</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox11">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkHBox" id="hbox6">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkLabel" id="label17">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Filename required for XMODEM</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkEntry" id="xmodem_filename">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area11">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="button1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-ok</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">-3</property>
+              </widget>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkFileChooserDialog" id="send_chooser_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Select File to Send</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <property name="local_only">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox13">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkHBox" id="hbox7">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkLabel" id="label18">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Error Correction Protocol</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">5</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkComboBox" id="send_chooser_protocol">
+                <property name="visible">True</property>
+                <property name="tooltip" translatable="yes">Select the error correction protocol to use.</property>
+                <property name="items" translatable="yes">Xmodem
+Ymodem
+Zmodem
+None (straight binary)</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area13">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkDialog" id="preferences_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Preferences</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox16">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkVBox" id="vbox5">
+            <property name="visible">True</property>
+            <property name="spacing">18</property>
+            <child>
+              <widget class="GtkVBox" id="vbox6">
+                <property name="visible">True</property>
+                <property name="spacing">6</property>
+                <child>
+                  <widget class="GtkLabel" id="label9">
+                    <property name="visible">True</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Font&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox7">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="preferences_use_system_font">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">_Use the system fixed width font</property>
+                        <property name="use_underline">True</property>
+                        <property name="response_id">0</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="hbox10">
+                        <property name="visible">True</property>
+                        <property name="spacing">12</property>
+                        <child>
+                          <widget class="GtkLabel" id="label19">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">Display Font</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkFontButton" id="preferences_font_button">
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="response_id">0</property>
+                          </widget>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="hbox9">
+                        <property name="visible">True</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <widget class="GtkLabel" id="label20">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">Font Colour</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkColorButton" id="preferences_font_color_button">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="response_id">0</property>
+                            <property name="color">#000000000000</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label21">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">Background Color</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkColorButton" id="preferences_background_color_button">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="response_id">0</property>
+                            <property name="color">#000000000000</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label22">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">Highlight Color</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">4</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkColorButton" id="preferences_highlight_color_button">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="response_id">0</property>
+                            <property name="color">#000000000000</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">5</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkVBox" id="vbox8">
+                <property name="visible">True</property>
+                <property name="spacing">6</property>
+                <child>
+                  <widget class="GtkLabel" id="label10">
+                    <property name="visible">True</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Recording&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox9">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="preferences_record_launch">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="tooltip" translatable="yes">If this option is enabled, a recorded file will be opened immediately after it is saved, using the default application for the file type. The default application is defined by the desktop environment.</property>
+                        <property name="label" translatable="yes">_Launch recorded files</property>
+                        <property name="use_underline">True</property>
+                        <property name="response_id">0</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkHBox" id="hbox8">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="preferences_record_enable_timeout">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="tooltip" translatable="yes">If this option is enabled, recording will be automatically stopped after an adjustable period of inactivity after receiving some data. That is, moserial will wait indefinitely to record the first data byte before activating the inactivity timer.</property>
+                        <property name="label" translatable="yes">Enable timeout after</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkSpinButton" id="preferences_record_timeout">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="adjustment">60 5 5000 1 10 0</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="padding">2</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label23">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">seconds</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area16">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="preferences_apply">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-apply</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkButton" id="preferences_discard">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-discard</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>

Added: trunk/data/glade/moserial.ui
==============================================================================
--- (empty file)
+++ trunk/data/glade/moserial.ui	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,1968 @@
+<?xml version="1.0"?>
+<!--Generated with glade3 3.4.5 on Fri Mar  6 09:30:42 2009 -->
+<interface>
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="upper">5000</property>
+    <property name="lower">5</property>
+    <property name="page_increment">10</property>
+    <property name="step_increment">1</property>
+    <property name="page_size">0</property>
+    <property name="value">60</property>
+  </object>
+  <object class="GtkListStore" id="model1">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">ASCII</col>
+      </row>
+      <row>
+        <col id="0">HEX</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model10">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">Xmodem</col>
+      </row>
+      <row>
+        <col id="0">Ymodem</col>
+      </row>
+      <row>
+        <col id="0">Zmodem</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model11">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">Xmodem</col>
+      </row>
+      <row>
+        <col id="0">Ymodem</col>
+      </row>
+      <row>
+        <col id="0">Zmodem</col>
+      </row>
+      <row>
+        <col id="0">None (straight binary)</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model2">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">CR+LF end</col>
+      </row>
+      <row>
+        <col id="0">CR end</col>
+      </row>
+      <row>
+        <col id="0">LF end</col>
+      </row>
+      <row>
+        <col id="0">TAB end</col>
+      </row>
+      <row>
+        <col id="0">No end</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model3">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">/dev/ttyS0</col>
+      </row>
+      <row>
+        <col id="0">/dev/ttyS1</col>
+      </row>
+      <row>
+        <col id="0">/dev/ttyS2</col>
+      </row>
+      <row>
+        <col id="0">/dev/ttyS3</col>
+      </row>
+      <row>
+        <col id="0">/dev/ttyUSB0</col>
+      </row>
+      <row>
+        <col id="0">/dev/ttyUSB1</col>
+      </row>
+      <row>
+        <col id="0">/dev/ttyUSB2</col>
+      </row>
+      <row>
+        <col id="0">/dev/ttyUSB3</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model4">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">300</col>
+      </row>
+      <row>
+        <col id="0">600</col>
+      </row>
+      <row>
+        <col id="0">1200</col>
+      </row>
+      <row>
+        <col id="0">2400</col>
+      </row>
+      <row>
+        <col id="0">4800</col>
+      </row>
+      <row>
+        <col id="0">9600</col>
+      </row>
+      <row>
+        <col id="0">19200</col>
+      </row>
+      <row>
+        <col id="0">38400</col>
+      </row>
+      <row>
+        <col id="0">57600</col>
+      </row>
+      <row>
+        <col id="0">115200</col>
+      </row>
+      <row>
+        <col id="0">230400</col>
+      </row>
+      <row>
+        <col id="0">460800</col>
+      </row>
+      <row>
+        <col id="0">576000</col>
+      </row>
+      <row>
+        <col id="0">927600</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model5">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">5</col>
+      </row>
+      <row>
+        <col id="0">6</col>
+      </row>
+      <row>
+        <col id="0">7</col>
+      </row>
+      <row>
+        <col id="0">8</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model6">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">1</col>
+      </row>
+      <row>
+        <col id="0">2</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model7">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">None</col>
+      </row>
+      <row>
+        <col id="0">Odd</col>
+      </row>
+      <row>
+        <col id="0">Even</col>
+      </row>
+      <row>
+        <col id="0">Mark</col>
+      </row>
+      <row>
+        <col id="0">Space</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model8">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">Read and Write</col>
+      </row>
+      <row>
+        <col id="0">Read Only</col>
+      </row>
+      <row>
+        <col id="0">Write Only</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model9">
+    <columns>
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">Incoming</col>
+      </row>
+      <row>
+        <col id="0">Outgoing</col>
+      </row>
+      <row>
+        <col id="0">Incoming and Outgoing</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkUIManager" id="uimanager1">
+    <child>
+      <object class="GtkActionGroup" id="actiongroup1">
+        <child>
+          <object class="GtkAction" id="menuitem1">
+            <property name="name">menuitem1</property>
+            <property name="label" translatable="yes">_File</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menubar_open_settings">
+            <property name="stock_id">gtk-open</property>
+            <property name="name">menubar_open_settings</property>
+            <property name="label" translatable="yes">_Open Settings</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menubar_save_settings">
+            <property name="stock_id">gtk-save</property>
+            <property name="name">menubar_save_settings</property>
+            <property name="label" translatable="yes">_Save Settings</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menubar_save_settings_as">
+            <property name="stock_id">gtk-save-as</property>
+            <property name="name">menubar_save_settings_as</property>
+            <property name="label" translatable="yes">Save Settings _As</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menubar_quit">
+            <property name="stock_id" translatable="yes">gtk-quit</property>
+            <property name="name">menubar_quit</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menubar_edit">
+            <property name="name">menubar_edit</property>
+            <property name="label" translatable="yes">_Edit</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menubar_cut">
+            <property name="stock_id" translatable="yes">gtk-cut</property>
+            <property name="name">menubar_cut</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menubar_copy">
+            <property name="stock_id" translatable="yes">gtk-copy</property>
+            <property name="name">menubar_copy</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menubar_paste">
+            <property name="stock_id" translatable="yes">gtk-paste</property>
+            <property name="name">menubar_paste</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menubar_clear">
+            <property name="stock_id" translatable="yes">gtk-clear</property>
+            <property name="name">menubar_clear</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menuitem4">
+            <property name="name">menuitem4</property>
+            <property name="label" translatable="yes">_Help</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menubar_about">
+            <property name="stock_id" translatable="yes">gtk-about</property>
+            <property name="name">menubar_about</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menubar_contents">
+            <property name="stock_id">gtk-help</property>
+            <property name="name">menubar_contents</property>
+            <property name="label" translatable="yes">_Contents</property>
+          </object>
+          <accelerator key="F1" modifiers=""/>
+        </child>
+      </object>
+    </child>
+    <ui>
+      <menubar name="menubar1">
+        <menu action="menuitem1">
+          <menuitem action="menubar_open_settings"/>
+          <separator/>
+          <menuitem action="menubar_save_settings"/>
+          <menuitem action="menubar_save_settings_as"/>
+          <separator/>
+          <menuitem action="menubar_quit"/>
+        </menu>
+        <menu action="menubar_edit">
+          <menuitem action="menubar_cut"/>
+          <menuitem action="menubar_copy"/>
+          <menuitem action="menubar_paste"/>
+          <separator/>
+          <menuitem action="menubar_clear"/>
+        </menu>
+        <menu action="menuitem4">
+          <menuitem action="menubar_about"/>
+          <menuitem action="menubar_contents"/>
+        </menu>
+      </menubar>
+    </ui>
+  </object>
+  <object class="GtkWindow" id="window">
+    <property name="title" translatable="yes">moserial</property>
+    <property name="default_width">640</property>
+    <property name="default_height">477</property>
+    <property name="icon_name">moserial</property>
+    <child>
+      <object class="GtkVBox" id="vbox1">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkMenuBar" constructor="uimanager1" id="menubar1">
+            <property name="visible">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkToolbar" id="toolbar">
+            <property name="visible">True</property>
+            <property name="border_width">4</property>
+            <child>
+              <object class="GtkToggleToolButton" id="toolbar_connect">
+                <property name="visible">True</property>
+                <property name="tooltip-text" translatable="yes">You must connect to your port before you can send or receive data. Disconnecting and reconnecting will clear the textboxes and reset the TX / RX counters.</property>
+                <property name="label" translatable="yes">Connect</property>
+                <property name="stock_id">gtk-connect</property>
+              </object>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSeparatorToolItem" id="toolbutton3">
+                <property name="visible">True</property>
+              </object>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToggleToolButton" id="toolbar_logging">
+                <property name="visible">True</property>
+                <property name="tooltip-text" translatable="yes">Use this to record (or "log") your communications to a file. You can log the received data, the sent data, or both. This can also be used to receive files sent by a remote device without the use of error correction protocols (a straight binary dump).</property>
+                <property name="label" translatable="yes">Record</property>
+                <property name="stock_id">gtk-media-record</property>
+              </object>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="toolbar_send">
+                <property name="visible">True</property>
+                <property name="tooltip-text" translatable="yes">Use this to send a file to a remote computer, with or without error correction protocols.</property>
+                <property name="label" translatable="yes">Send File</property>
+                <property name="stock_id">gtk-go-up</property>
+              </object>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="toolbar_receive">
+                <property name="visible">True</property>
+                <property name="tooltip-text" translatable="yes">Use this to receive a file from a remote computer, using an error correction protocol. For straight binary dumps without error correction, use Record instead.</property>
+                <property name="label" translatable="yes">Receive File</property>
+                <property name="stock_id">gtk-save-as</property>
+              </object>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSeparatorToolItem" id="toolbutton1">
+                <property name="visible">True</property>
+              </object>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="toolbar_settings">
+                <property name="visible">True</property>
+                <property name="tooltip-text" translatable="yes">Use this to configure your serial port parameters.</property>
+                <property name="label" translatable="yes">Port Setup</property>
+                <property name="stock_id">gtk-properties</property>
+              </object>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="toolbar_preferences">
+                <property name="visible">True</property>
+                <property name="tooltip-text" translatable="yes">Use this to set font sizes and other related settings.</property>
+                <property name="label" translatable="yes">Preferences</property>
+                <property name="stock_id">gtk-preferences</property>
+              </object>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSeparatorToolItem" id="separatortoolitem1">
+                <property name="visible">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="toolbar_help">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Help</property>
+                <property name="stock_id">gtk-help</property>
+              </object>
+              <packing>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkVPaned" id="vpaned">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="position">50</property>
+            <property name="position_set">True</property>
+            <child>
+              <object class="GtkNotebook" id="incoming_notebook">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="border_width">4</property>
+                <child>
+                  <object class="GtkScrolledWindow" id="incoming_ascii_scrolledwindow">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                    <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                    <child>
+                      <object class="GtkTextView" id="incoming_ascii_textview">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip_text">This is the data received by the serial port. Depending on the configuration of the remote device, your outgoing data may also be echoed here. moserial attempts to identify echoed text, and highlight it in blue.</property>
+                        <property name="border_width">1</property>
+                        <property name="editable">False</property>
+                        <property name="wrap_mode">GTK_WRAP_WORD_CHAR</property>
+                        <property name="left_margin">2</property>
+                        <property name="right_margin">2</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel" id="label12">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Received ASCII</property>
+                  </object>
+                  <packing>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkScrolledWindow" id="incoming_hex_scrolledwindow">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                    <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                    <child>
+                      <object class="GtkTextView" id="incoming_hex_textview">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip_text">This is the data received by the serial port. Depending on the configuration of the remote device, your outgoing data may also be echoed here.</property>
+                        <property name="border_width">1</property>
+                        <property name="editable">False</property>
+                        <property name="left_margin">2</property>
+                        <property name="right_margin">2</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel" id="label15">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Received HEX</property>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="resize">True</property>
+                <property name="shrink">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkNotebook" id="outgoing_notebook">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="border_width">4</property>
+                <child>
+                  <object class="GtkScrolledWindow" id="outgoing_ascii_scrolledwindow">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                    <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                    <child>
+                      <object class="GtkTextView" id="outgoing_ascii_textview">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip_text">This is the history, or log, of your outgoing data. New outgoing data is entered below.</property>
+                        <property name="border_width">1</property>
+                        <property name="editable">False</property>
+                        <property name="wrap_mode">GTK_WRAP_WORD_CHAR</property>
+                        <property name="left_margin">2</property>
+                        <property name="right_margin">2</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel" id="label13">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Sent ASCII</property>
+                  </object>
+                  <packing>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkScrolledWindow" id="outgoing_hex_scrolledwindow">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                    <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+                    <child>
+                      <object class="GtkTextView" id="outgoing_hex_textview">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip_text">This is the history, or log, of your outgoing data. New outgoing data is entered below.</property>
+                        <property name="border_width">1</property>
+                        <property name="editable">False</property>
+                        <property name="left_margin">2</property>
+                        <property name="right_margin">2</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel" id="label16">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Sent HEX</property>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="resize">True</property>
+                <property name="shrink">True</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkVBox" id="vbox4">
+            <property name="visible">True</property>
+            <property name="border_width">4</property>
+            <child>
+              <object class="GtkLabel" id="label14">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">&lt;i&gt;Outgoing&lt;/i&gt;</property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="hbox2">
+                <property name="visible">True</property>
+                <child>
+                  <object class="GtkEntry" id="entry">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="has_focus">True</property>
+                    <property name="has_tooltip">True</property>
+                    <property name="tooltip_markup">Enter your new outgoing data here. Data is transmitted on a character-by-character basis.</property>
+                    <property name="tooltip-text" translatable="yes">Enter the data that you wish to transmit here. Press Enter or Send when you are ready to send it.</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkButton" id="send">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="tooltip-text" translatable="yes">Click this to transmit the data entered in the Outgoing text box. Clicking "enter" in that box will do the same thing.</property>
+                    <property name="label" translatable="yes">Send</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="input_mode">
+                    <property name="visible">True</property>
+                    <property name="tooltip-text" translatable="yes">This determines whether the data entered in the Outgoing text box should be interpreted as normal ASCII text, or as hexadecimal codes. If this is set to HEX, the entered data should consist of only 0-9 and A-F characters.</property>
+                    <property name="model">model1</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="renderer1"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="termination_mode">
+                    <property name="visible">True</property>
+                    <property name="tooltip-text" translatable="yes">This selects the termination sequence that is appended to the Outgoing data in the ASCII mode when you click Send.</property>
+                    <property name="model">model2</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="renderer2"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="hbox5">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkStatusbar" id="statusbar">
+                <property name="visible">True</property>
+                <property name="border_width">4</property>
+                <property name="spacing">2</property>
+                <property name="has_resize_grip">False</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkStatusbar" id="bytecountbar">
+                <property name="visible">True</property>
+                <property name="border_width">4</property>
+                <property name="spacing">2</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">4</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkDialog" id="settings_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Port Setup</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox3">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkVBox" id="vbox11">
+            <property name="visible">True</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="label24">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;Port Settings&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkTable" id="table1">
+                <property name="visible">True</property>
+                <property name="n_rows">8</property>
+                <property name="n_columns">2</property>
+                <child>
+                  <object class="GtkCheckButton" id="settings_local_echo">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="tooltip-text" translatable="yes">Normally disabled</property>
+                    <property name="label" translatable="yes">Echo received data</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">7</property>
+                    <property name="bottom_attach">8</property>
+                    <property name="x_padding">2</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label26">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Local Echo</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">7</property>
+                    <property name="bottom_attach">8</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Device</property>
+                  </object>
+                  <packing>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label2">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Baud Rate</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label3">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Data Bits</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label4">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Stop Bits</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">3</property>
+                    <property name="bottom_attach">4</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label5">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Parity</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">4</property>
+                    <property name="bottom_attach">5</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label7">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Handshake</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">5</property>
+                    <property name="bottom_attach">6</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label8">
+                    <property name="visible">True</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">Access Mode</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">6</property>
+                    <property name="bottom_attach">7</property>
+                    <property name="x_padding">4</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBoxEntry" id="settings_device">
+                    <property name="visible">True</property>
+                    <child internal-child="entry">
+                      <object class="GtkEntry" id="comboboxentry-entry1">
+                      </object>
+                    </child>
+                    <property name="model">model3</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="renderer3"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="settings_baud_rate">
+                    <property name="visible">True</property>
+                    <property name="model">model4</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="renderer4"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="settings_data_bits">
+                    <property name="visible">True</property>
+                    <property name="model">model5</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="renderer5"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="settings_stop_bits">
+                    <property name="visible">True</property>
+                    <property name="model">model6</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="renderer6"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">3</property>
+                    <property name="bottom_attach">4</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="settings_parity">
+                    <property name="visible">True</property>
+                    <property name="model">model7</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="renderer7"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">4</property>
+                    <property name="bottom_attach">5</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkHBox" id="hbox3">
+                    <property name="visible">True</property>
+                    <child>
+                      <object class="GtkCheckButton" id="settings_hardware_handshake">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">Hardware</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="padding">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="settings_software_handshake">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">Software</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="padding">2</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">5</property>
+                    <property name="bottom_attach">6</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="settings_open_for">
+                    <property name="visible">True</property>
+                    <property name="model">model8</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="renderer8"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">6</property>
+                    <property name="bottom_attach">7</property>
+                    <property name="y_options">GTK_EXPAND</property>
+                    <property name="y_padding">2</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area3">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <object class="GtkButton" id="settings_apply_button">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-apply</property>
+                <property name="use_stock">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkButton" id="settings_discard_button">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-discard</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">settings_local_echo</action-widget>
+      <action-widget response="0">settings_hardware_handshake</action-widget>
+      <action-widget response="0">settings_software_handshake</action-widget>
+      <action-widget response="0">settings_apply_button</action-widget>
+      <action-widget response="0">settings_discard_button</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="send_progress_dialog">
+    <property name="width_request">640</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Send File Progress</property>
+    <property name="modal">True</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox4">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkVBox" id="vbox3">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkLabel" id="send_statusbox">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkProgressBar" id="send_progressbar">
+                <property name="visible">True</property>
+                <property name="fraction">0.5</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area4">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <object class="GtkButton" id="send_progress_cancel">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-cancel</property>
+                <property name="use_stock">True</property>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">send_progress_cancel</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkDialog" id="receive_progress_dialog">
+    <property name="width_request">640</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Receive File Progress</property>
+    <property name="modal">True</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox6">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkVBox" id="vbox2">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkLabel" id="receive_statusbox">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkProgressBar" id="receive_progressbar">
+                <property name="visible">True</property>
+                <property name="activity_mode">True</property>
+                <property name="fraction">0.5</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area6">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <object class="GtkButton" id="receive_progress_cancel">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-cancel</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">receive_progress_cancel</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkWindow" id="window1">
+    <child>
+      <object class="GtkTable" id="table3">
+        <property name="visible">True</property>
+        <property name="n_rows">6</property>
+        <property name="n_columns">6</property>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <object class="GtkLabel" id="disconnect_label">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Disconnect</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="connect_label">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Connect</property>
+          </object>
+          <packing>
+            <property name="top_attach">1</property>
+            <property name="bottom_attach">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="record_label">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Record</property>
+          </object>
+          <packing>
+            <property name="top_attach">2</property>
+            <property name="bottom_attach">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="stop_recording_label">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Stop Recording</property>
+          </object>
+          <packing>
+            <property name="top_attach">3</property>
+            <property name="bottom_attach">4</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkFileChooserDialog" id="record_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Record Incoming and/or Outgoing Data</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <property name="action">GTK_FILE_CHOOSER_ACTION_SAVE</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox9">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkHBox" id="hbox1">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkLabel" id="label11">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Stream to record</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="record_stream">
+                <property name="visible">True</property>
+                <property name="model">model9</property>
+                <child>
+                  <object class="GtkCellRendererText" id="renderer9"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area9">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkFileChooserDialog" id="receive_chooser_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Select Folder for Received Files</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <property name="local_only">False</property>
+    <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox10">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkHBox" id="hbox4">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkLabel" id="label6">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Error Correction Protocol</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="receive_chooser_protocol">
+                <property name="visible">True</property>
+                <property name="tooltip-text" translatable="yes">Select the error correction protocol to use. If you wish to receive a straight binary file without using error correction protocols, use the Record button instead.</property>
+                <property name="model">model10</property>
+                <child>
+                  <object class="GtkCellRendererText" id="renderer10"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area10">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkDialog" id="xmodem_filename_dialog">
+    <property name="border_width">5</property>
+    <property name="modal">True</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox11">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkHBox" id="hbox6">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkLabel" id="label17">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Filename required for XMODEM</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkEntry" id="xmodem_filename">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area11">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <object class="GtkButton" id="button1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-ok</property>
+                <property name="use_stock">True</property>
+              </object>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-3">button1</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkFileChooserDialog" id="send_chooser_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Select File to Send</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <property name="local_only">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox13">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkHBox" id="hbox7">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkLabel" id="label18">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Error Correction Protocol</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="padding">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="send_chooser_protocol">
+                <property name="visible">True</property>
+                <property name="tooltip-text" translatable="yes">Select the error correction protocol to use.</property>
+                <property name="model">model11</property>
+                <child>
+                  <object class="GtkCellRendererText" id="renderer11"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area13">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkDialog" id="preferences_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Preferences</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox16">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkVBox" id="vbox5">
+            <property name="visible">True</property>
+            <property name="spacing">18</property>
+            <child>
+              <object class="GtkVBox" id="vbox6">
+                <property name="visible">True</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkLabel" id="label9">
+                    <property name="visible">True</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Font&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkVBox" id="vbox7">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkCheckButton" id="preferences_use_system_font">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="label" translatable="yes">_Use the system fixed width font</property>
+                        <property name="use_underline">True</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHBox" id="hbox10">
+                        <property name="visible">True</property>
+                        <property name="spacing">12</property>
+                        <child>
+                          <object class="GtkLabel" id="label19">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">Display Font</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkFontButton" id="preferences_font_button">
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                          </object>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHBox" id="hbox9">
+                        <property name="visible">True</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkLabel" id="label20">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">Font Colour</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkColorButton" id="preferences_font_color_button">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="color">#000000000000</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label21">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">Background Color</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkColorButton" id="preferences_background_color_button">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="color">#000000000000</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="label22">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">Highlight Color</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">4</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkColorButton" id="preferences_highlight_color_button">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="color">#000000000000</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">5</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkVBox" id="vbox8">
+                <property name="visible">True</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkLabel" id="label10">
+                    <property name="visible">True</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Recording&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkVBox" id="vbox9">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkCheckButton" id="preferences_record_launch">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="tooltip-text" translatable="yes">If this option is enabled, a recorded file will be opened immediately after it is saved, using the default application for the file type. The default application is defined by the desktop environment.</property>
+                        <property name="label" translatable="yes">_Launch recorded files</property>
+                        <property name="use_underline">True</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkHBox" id="hbox8">
+                    <property name="visible">True</property>
+                    <child>
+                      <object class="GtkCheckButton" id="preferences_record_enable_timeout">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="tooltip-text" translatable="yes">If this option is enabled, recording will be automatically stopped after an adjustable period of inactivity after receiving some data. That is, moserial will wait indefinitely to record the first data byte before activating the inactivity timer.</property>
+                        <property name="label" translatable="yes">Enable timeout after</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkSpinButton" id="preferences_record_timeout">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="adjustment">adjustment1</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="padding">2</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label23">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">seconds</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area16">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <object class="GtkButton" id="preferences_apply">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-apply</property>
+                <property name="use_stock">True</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkButton" id="preferences_discard">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-discard</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">preferences_use_system_font</action-widget>
+      <action-widget response="0">preferences_font_button</action-widget>
+      <action-widget response="0">preferences_font_color_button</action-widget>
+      <action-widget response="0">preferences_background_color_button</action-widget>
+      <action-widget response="0">preferences_highlight_color_button</action-widget>
+      <action-widget response="0">preferences_record_launch</action-widget>
+      <action-widget response="0">preferences_record_enable_timeout</action-widget>
+      <action-widget response="0">preferences_apply</action-widget>
+      <action-widget response="0">preferences_discard</action-widget>
+    </action-widgets>
+  </object>
+</interface>

Added: trunk/data/icons/48x48/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/data/icons/48x48/Makefile.am	Fri Mar  6 18:32:35 2009
@@ -0,0 +1 @@
+SUBDIRS = apps

Added: trunk/data/icons/48x48/apps/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/data/icons/48x48/apps/Makefile.am	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,9 @@
+themedir = $(datadir)/icons/hicolor
+size = 48x48
+context = apps
+
+iconsdir = $(themedir)/$(size)/$(context)
+
+icons_DATA = moserial.png
+
+EXTRA_DIST = $(icons_DATA)

Added: trunk/data/icons/48x48/apps/moserial.png
==============================================================================
Binary file. No diff available.

Added: trunk/data/icons/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/data/icons/Makefile.am	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,14 @@
+SUBDIRS = 48x48
+
+gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
+
+install-data-hook: update-icon-cache
+uninstall-hook: update-icon-cache
+update-icon-cache:
+	@-if test -z "$(DESTDIR)"; then \
+		echo "Updating Gtk icon cache."; \
+		$(gtk_update_icon_cache); \
+	else \
+		echo "*** Icon cache not updated.  After (un)install, run this:"; \
+		echo "***   $(gtk_update_icon_cache)"; \
+	fi

Added: trunk/data/moserial.desktop.in
==============================================================================
--- (empty file)
+++ trunk/data/moserial.desktop.in	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,11 @@
+[Desktop Entry]
+_Name=moserial Terminal
+_GenericName=Serial Terminal
+_Comment=A serial terminal optimized for logging and file capture
+Categories=GTK;Utility;FileTransfer;TerminalEmulator
+Exec=moserial %U
+Icon=moserial
+MimeType=
+StartupNotify=true
+Terminal=false
+Type=Application

Added: trunk/doc/C/figures/authorizations.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/connect.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/disconnect.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/main-toolbar.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/outgoing.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/port-setup.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/preferences.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/receive-file-dialog.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/receive-file.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/receive-progress.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/received-tabs.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/record-dialog.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/record.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/send-file-dialog.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/send-file.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/send-progress.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/sent-tabs.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/statusbar.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/figures/stop-recording.png
==============================================================================
Binary file. No diff available.

Added: trunk/doc/C/legal.xml
==============================================================================
--- (empty file)
+++ trunk/doc/C/legal.xml	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,76 @@
+   <legalnotice id="legalnotice">
+         <para>
+           Permission is granted to copy, distribute and/or modify this
+           document under the terms of the GNU Free Documentation
+           License (GFDL), Version 1.1 or any later version published
+           by the Free Software Foundation with no Invariant Sections,
+           no Front-Cover Texts, and no Back-Cover Texts.  You can find
+           a copy of the GFDL at this <ulink type="help"
+           url="ghelp:fdl">link</ulink> or in the file COPYING-DOCS
+           distributed with this manual.
+          </para>
+          <para> This manual is part of a collection of GNOME manuals
+           distributed under the GFDL.  If you want to distribute this
+           manual separately from the collection, you can do so by
+           adding a copy of the license to the manual, as described in
+           section 6 of the license.
+         </para>
+ 
+         <para>
+           Many of the names used by companies to distinguish their
+           products and services are claimed as trademarks. Where those
+           names appear in any GNOME documentation, and the members of
+           the GNOME Documentation Project are made aware of those
+           trademarks, then the names are in capital letters or initial
+           capital letters.
+         </para>
+ 
+         <para>
+           DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED
+           UNDER  THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE
+           WITH THE FURTHER UNDERSTANDING THAT:
+ 
+           <orderedlist>
+                 <listitem>
+                   <para>DOCUMENT IS PROVIDED ON AN "AS IS" BASIS,
+                     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
+                     IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
+                     THAT THE DOCUMENT OR MODIFIED VERSION OF THE
+                     DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR
+                     A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
+                     RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE
+                     OF THE DOCUMENT OR MODIFIED VERSION OF THE
+                     DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR
+                     MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT,
+                     YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY
+                     CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
+                     SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+                     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+                     LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED
+                     VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER
+                     EXCEPT UNDER THIS DISCLAIMER; AND
+                   </para>
+                 </listitem>
+                 <listitem>
+                   <para>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL
+                        THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE),
+                        CONTRACT, OR OTHERWISE, SHALL THE AUTHOR,
+                        INITIAL WRITER, ANY CONTRIBUTOR, OR ANY
+                        DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION
+                        OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH
+                        PARTIES, BE LIABLE TO ANY PERSON FOR ANY
+                        DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
+                        CONSEQUENTIAL DAMAGES OF ANY CHARACTER
+                        INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS
+                        OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
+                        MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR
+                        LOSSES ARISING OUT OF OR RELATING TO USE OF THE
+                        DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT,
+                        EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF
+                        THE POSSIBILITY OF SUCH DAMAGES.
+                   </para>
+                 </listitem>
+           </orderedlist>
+         </para>
+   </legalnotice>
+ 
\ No newline at end of file

Added: trunk/doc/C/moserial.xml
==============================================================================
--- (empty file)
+++ trunk/doc/C/moserial.xml	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,427 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd";[
+  <!ENTITY legal SYSTEM "legal.xml">
+  <!ENTITY appversion "1.0.0">
+  <!ENTITY manualversion "1.0.0">
+  <!ENTITY date "February 2009">
+  <!ENTITY appname "moserial">
+  <!ENTITY app "<application>moserial</application>">
+<!-- replace version above with actual application version number -->
+<!--  Template Version: 1.0.1  (do not remove this line) -->
+]>
+
+<!-- =============Document Header ============================= -->
+
+<article id="index" lang="en"> <!-- please do not change the id -->
+
+  <articleinfo>
+    <title>&app; Manual V&manualversion;</title>
+    <copyright>
+      <year>2009</year>
+      <holder>Michael J. Chudobiak</holder>
+    </copyright>
+
+    <!-- translators: uncomment this:
+
+    <copyright>
+     <year>2000</year>
+     <holder>ME-THE-TRANSLATOR (Latin translation)</holder>
+    </copyright>
+
+    -->
+
+    <!-- An address can be added to the publisher information.  If a role is
+     not specified, the publisher/author is the same for all versions of the
+     document.  -->
+    <publisher>
+      <publishername> GNOME Documentation Project </publishername>
+    </publisher>
+
+    &legal;
+
+    <authorgroup>
+      <author role="maintainer">
+        <firstname>Michael</firstname>
+	<surname>Chudobiak</surname>
+	<affiliation>
+	  <address> <email>mjc svn gnome org</email> </address>
+        </affiliation>
+      </author>
+    </authorgroup>
+    <!-- do not put authorname in the header except in copyright - use
+         section "authors" below -->
+    <revhistory>
+      <revision>
+	<revnumber>&manualversion;</revnumber>
+	<date>&date;</date>
+	<revdescription>
+	  <para role="author">Michael J. Chudobiak</para>
+	  <para role="publisher">GNOME Documentation Project</para>
+	</revdescription>
+      </revision>
+    </revhistory>
+
+
+    <!-- this is version of manual, not application -->
+    <releaseinfo>
+      This is manual describes version &appversion; of &appname;
+    </releaseinfo>
+    <abstract role="description"><para>&app; is a serial terminal for the GNOME desktop, optimized for logging and file capture.</para></abstract>
+  </articleinfo>
+
+  <indexterm>
+    <primary>&appname;</primary>
+  </indexterm>
+  <indexterm>
+    <primary>serial</primary>
+  </indexterm>
+  <indexterm>
+    <secondary>terminal</secondary>
+  </indexterm>
+
+  <!-- ============= Document Body ============================= -->
+
+  <!-- ============= Introduction ============================== -->
+
+  <sect1 id="intro">
+    <title>Introduction</title>
+    <para>
+      &app; is a serial terminal for the GNOME desktop, optimized for logging 
+      and file capture. &app; is primarily intended for technical users
+      who need to communicate with embedded systems, consoles, and electronic
+      test equipment. 
+    </para>
+    <para>
+      Despite the technical orientation of the intended audience, &app; is
+      designed to be user-friendly. Care has been taken to ensure that
+      operations are simple to execute, by minimizing the number of
+      clicks needed. The number of configuration options has also been
+      kept small.
+    </para>
+    <para>
+      To further improve efficiency, &app; also supports profile files
+      to store frequently-used configurations.
+    </para>
+  </sect1>
+
+  <sect1 id="ports">
+    <title>System Port Permissions</title>
+    <para>
+      Before using &app; with a serial port, you need to make sure that
+      you actually have permission to read and/or write to the port.
+    </para>
+    <para>
+      There are a number of ways this is done on a Linux system.
+      On Fedora 10, you may need to use the PolicyKit tool, invoked using
+      <menuchoice><guisubmenu>System</guisubmenu>
+                  <guisubmenu>Preferences</guisubmenu>
+		  <guisubmenu>System</guisubmenu>
+                  <guimenuitem>Authorizations</guimenuitem></menuchoice>. 
+      Then, navigate to the
+      <menuchoice><guisubmenu>org</guisubmenu>
+                  <guisubmenu>freedesktop</guisubmenu>
+                  <guisubmenu>device-access</guisubmenu>
+                  <guimenuitem>Directly access serial modem devices</guimenuitem></menuchoice>,
+      and click <guilabel>edit</guilabel>. Set <guilabel>Anyone:</guilabel> to "Yes".
+    </para>
+    <figure id="authorizations-fig">
+    <title>Serial Port Authorizations on Fedora 10</title>
+      <graphic format="PNG" fileref="figures/authorizations.png"/>
+    </figure>
+    <para>
+      On some systems, you may need to do something like "sudo chmod o+rw /dev/ttyS*" and
+      "sudo chmod o+rw /dev/ttyUSB*" to obtain read/write permissions (for all users) on the serial ports.
+    </para>
+    <para>
+      Alternatively, you can see what group the devices belong to, and make your account a member of
+      that group.
+    </para>
+  </sect1>
+
+  <sect1 id="basic-usage">
+    <title>Basic Usage</title>
+    <sect2 id="main-toolbar">
+      <title>The Main Toolbar</title>
+      <para>
+        Most &app; functions are accessed through the main toolbar, shown below:
+      </para>
+      <para>
+        <graphic format="PNG" fileref="figures/main-toolbar.png"/>
+      </para>
+    </sect2>
+    <sect2 id="port-setup">
+      <title>Port Setup</title>
+      <para>
+        The first step in using &app; is to configure the serial port parameters. Click
+        <guibutton>Port Setup</guibutton> to do this. In the port setup dialog, you will
+        set the port to use, whether the port should be open for reads, writes, or both,
+        its baud rate, its parity, the number of data and stop bits, and the 
+        handshaking method. The settings specified in this dialog will override
+        any system default settings for the port.
+      </para>
+      <para>
+        The &app; port setup dialog will only list the /dev/ttySnn and /dev/ttyUSBnn ports
+        that actually exist on the system, for values of "nn" between 0 and 31.
+      </para>
+      <para>
+        A local echo can be enabled from this dialog. If enabled, all data that &app;
+        receives will be echoed back to the sending device. This should normally be
+        disabled, as it can cause unexpected behaviour, especially if the remote device
+        also has echo enabled. (This would cause an infinite loop of echoes!) 
+      </para>
+      <para>
+        <graphic format="PNG" fileref="figures/port-setup.png"/>
+      </para>
+    </sect2>
+    <sect2 id="connect">
+      <title>Open the Connection</title>
+      <para>
+        The next step in communicating with your remote device is to click 
+        <guibutton>Connect</guibutton>. This opens the port. If you do not
+        have the necessary privileges to open the port, an error will be reported.
+      </para>
+      <para>
+	<graphic format="PNG" fileref="figures/connect.png"/>
+      </para>
+      <para>
+        This step is optional. If you skip it, &app; will try to connect
+        automatically when needed.
+      </para>
+      <para>
+        Once you have connected, the <guibutton>Connect</guibutton> button will
+        change into a <guibutton>Disconnect</guibutton> button. 
+        Clicking <guibutton>Disconnect</guibutton> closes the port, and resets the
+        TX and RX counters.
+      </para>
+      <para>
+         <graphic format="PNG" fileref="figures/disconnect.png"/>
+      </para>
+    </sect2>
+    <sect2 id="basic-io">
+      <title>Basic Input and Output</title>
+      <para>
+        Once the port has been opened, any text received from the remote
+        device will be displayed in the <guilabel>Received ASCII</guilabel>
+        text area. If &app; detects a large number of unprintable characters,
+        it will switch automatically to the <guilabel>Received HEX</guilabel>
+        view.
+      </para>
+      <para>
+        <graphic format="PNG" fileref="figures/received-tabs.png"/>
+      </para>
+      <para>
+        To switch between HEX and ASCII views, simply click on the 
+        appropriate tabs.
+      </para>
+      <para>
+        To send data to the remote device, you can type text into the
+        <guilabel>Outgoing</guilabel> single-line text box, and click
+        the <guibutton>Send</guibutton> button. Your line of text will
+	be terminated with the sequence selected in the area to the
+        right of the <guibutton>Send</guibutton> button. If you aren't
+        sure which termination sequence is best, start with "CR+LF end".
+        The <guibutton>ASCII/HEX</guibutton> button should be set to
+        ASCII to send text.
+      </para>
+      <para>
+        <graphic format="PNG" fileref="figures/outgoing.png"/>
+      </para>
+      <para>
+        If the <guibutton>ASCII/HEX</guibutton> button is set to HEX,
+        do not enter text in the <guilabel>Outgoing</guilabel> area.
+        Instead, enter hexadecimal numbers in the form "1234ABCD....".
+      </para>
+      <para>
+        Once your data has been transmitted, a record of it will exist
+        in the <guilabel>Sent ASCII</guilabel> and <guilabel>Sent HEX</guilabel>
+        text areas. These text areas are not editable.
+      </para>
+      <para>
+        <graphic format="PNG" fileref="figures/sent-tabs.png"/>
+      </para>
+      <para>
+        The remote device may echo your sent data. If &app; detects
+        echoed text in the <guilabel>Received ASCII</guilabel> text area,
+        it will highlight the echoed text (using the highlight color defined
+        in the preferences dialog).
+      </para>
+      <para>
+        The statusbar at the bottom of the main window shows the state of
+        port, and a count of the sent (TX) and received (RX) bytes.
+        If some of the received data is unprintable, a count of these
+        items is shown as well.
+      </para>
+      <para>
+        <graphic format="PNG" fileref="figures/statusbar.png"/>
+      </para>
+    </sect2>
+  </sect1>
+  <sect1 id="recording">
+    <title>Recording Input and Output</title>
+    <para>
+      &app; can be used to record your sent and received data to a file.
+      This function is also useful for receiving and storing straight
+      binary data dumped from a remote device. For instance, some oscilloscopes
+      will dump screenshots to a serial port, without using any error
+      correction protocols (like the Tektronic 11801).
+    </para>
+    <para>
+      <graphic format="PNG" fileref="figures/record.png"/>
+    </para>
+    <para>
+      When you are ready to record to a file, simply click <guibutton>Record</guibutton>,
+      select the desired data to record (Incoming and/or Outgoing) in 
+      the <guilabel>Stream to Record</guilabel> selection box, and enter the
+      filename in the filechooser area.
+    </para>
+    <para>
+      <graphic format="PNG" fileref="figures/record-dialog.png"/>
+    </para>
+    <para>
+      When recording begins, the <guibutton>Record</guibutton> button will
+      change into a <guibutton>Stop Recording</guibutton> button. You will need
+      to click this when you wish to stop recording, or you have received
+      the entire binary file that you wanted to download.
+    </para>
+    <para>
+      <graphic format="PNG" fileref="figures/stop-recording.png"/>
+    </para>
+    <para>
+      &app; can optionally launch the recorded file with the default application
+      for its file type, when recording has finished. Use the 
+      <link linkend="preferences">Preferences</link> dialog to enable or
+      disable this feature.
+    </para>
+    <para>
+      Note that if you wish to receive files using an error correction protocol
+      (xmodem, ymodem, or zmodem), you will need to use the 
+       <link linkend="receiving">Receive File</link>
+      function instead. Unlike the <guibutton>Record</guibutton> function, the
+      <guibutton>Receive File</guibutton> function can automatically determine when
+      the file download is complete.
+    </para>
+    <para>
+      <graphic format="PNG" fileref="figures/receive-file.png"/>
+    </para>
+  </sect1>
+  <sect1 id="sending">
+    <title>Sending Files</title>
+    <para>
+      &app; can transmit files in a straight binary data stream, and it can
+      also send files using the xmodem, ymodem, and zmodem error correction
+      protocols. During file transmission, the sent data is not logged to the
+      <guilabel>Sent ASCII</guilabel> or <guilabel>Sent HEX</guilabel>
+      text areas. 
+    </para>
+    <para>
+      <graphic format="PNG" fileref="figures/send-file.png"/>
+    </para>
+    <para>
+      When you are ready to send a file, simply click <guibutton>Send File</guibutton>,
+      select the desired file to send. You will also need to select the 
+      appropriate protocol below.
+    </para>
+    <para>
+      <graphic format="PNG" fileref="figures/send-file-dialog.png"/>
+    </para>
+    <para>
+      When recording begins, a progress bar will display the status of the file
+      transmission. 
+    </para>
+    <para>
+      <graphic format="PNG" fileref="figures/send-progress.png"/>
+    </para>
+    <para>
+      moserial does not implement the xmodem, ymodem, or zmodem protocols directly.
+      It relies on the standard rz and sz utilities to send and receive data.
+      These utilities, part of the lrzsz package, must be installed on your
+      system.
+    </para>
+  </sect1>
+
+  <sect1 id="receiving">
+    <title>Receiving Files</title>
+    <para>
+      &app; can receive files sent in a straight binary data stream, and it can
+      also receive files using the xmodem, ymodem, and zmodem error correction
+      protocols. During file transmission, the received data is not logged to the
+      <guilabel>Sent ASCII</guilabel> or <guilabel>Sent HEX</guilabel>
+      text areas.
+    </para>
+    <para>
+      To receive straight binary data streams, use the <link linkend="recording">Record</link>
+      function instead of the <guibutton>Receive File</guibutton> function.
+    </para>
+    <para>
+      To receive files sent with the xmodem, ymodem, or zmodem error correction
+      protocols, using the <guibutton>Receive File</guibutton> function.
+    </para>
+    <para>
+      <graphic format="PNG" fileref="figures/receive-file.png"/>
+    </para>
+    <para>
+      When you are ready to receive a file, simply click <guibutton>Receive File</guibutton>,
+      select a folder to store the received file. You will also need to select the
+      appropriate protocol below.
+    </para>
+    <para>
+      <graphic format="PNG" fileref="figures/receive-file-dialog.png"/>
+    </para>
+    <para>
+      When recording begins, a progress bar will display the status of the file
+      reception.
+    </para>
+    <para>
+      <graphic format="PNG" fileref="figures/receive-progress.png"/>
+    </para>
+    <para>
+      moserial does not implement the xmodem, ymodem, or zmodem protocols directly.
+      It relies on the standard rz and sz utilities to send and receive data.
+      These utilities, part of the lrzsz package, must be installed on your
+      system.
+    </para>
+  </sect1>
+
+  <sect1 id="preferences">
+    <title>Other Preferences</title>
+    <para>
+      &app; has several options that can be configured from the
+      <guilabel>Preferences</guilabel> dialog.
+    </para>
+    <para>
+      <graphic format="PNG" fileref="figures/preferences.png"/>
+    </para>
+    <para>
+      The color of the text area foreground, background, and highlighting
+      can be configured, as can the font type and size.
+    </para>
+    <para>
+      If <guilabel>Launch recorded files</guilabel> is enabled, a recorded file
+      will be opened immediately after it is saved, using the default application
+      for the file type. The default application is defined by the desktop environment.
+    </para>
+  </sect1>
+
+  <sect1 id="profiles">
+    <title>Using Profiles</title>
+    <para>
+      &app; can load and save its settings from profile files, so that you can
+      store and recall commonly used configurations. To save a profile, simply
+      use the <menuchoice><guisubmenu>File</guisubmenu><guimenuitem>Save</guimenuitem></menuchoice>
+      or <menuchoice><guisubmenu>File</guisubmenu><guimenuitem>Save As</guimenuitem></menuchoice>
+      dialogs. To load a profile, use the
+      <menuchoice><guisubmenu>File</guisubmenu><guimenuitem>Open</guimenuitem></menuchoice>
+      dialog.
+    </para>
+    <para>
+      Loading a profile will automatically disconnect any connected port.
+    </para>
+    <para>
+      When you quit &app;, the settings currently in use are stored in a 
+      default profile file. These settings will automatically be recalled
+      the next time you launch &app;.
+    </para>
+  </sect1>
+
+</article>

Added: trunk/doc/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/doc/Makefile.am	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,26 @@
+include $(top_srcdir)/gnome-doc-utils.make
+dist-hook: doc-dist-hook
+
+DOC_MODULE = moserial
+DOC_ENTITIES = legal.xml
+DOC_INCLUDES = 
+DOC_FIGURES =	figures/main-toolbar.png \
+		figures/statusbar.png \
+		figures/port-setup.png \
+		figures/connect.png \
+		figures/disconnect.png \
+		figures/outgoing.png \
+		figures/received-tabs.png \
+		figures/sent-tabs.png \
+		figures/record.png \
+		figures/record-dialog.png \
+		figures/stop-recording.png \
+		figures/receive-file.png \
+		figures/send-file-dialog.png \
+		figures/send-file.png \
+		figures/send-progress.png \
+		figures/receive-progress.png \
+		figures/receive-file-dialog.png \
+		figures/preferences.png \
+		figures/authorizations.png
+DOC_LINGUAS = 

Added: trunk/doc/moserial.omf.in
==============================================================================
--- (empty file)
+++ trunk/doc/moserial.omf.in	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="no"?>
+<omf>
+  <resource>
+    <subject category="GNOME|Utilities"/>
+    <type>
+      user's guide
+    </type>
+    <relation seriesid="0168b163-809e-12c7-c0c4-3fc6c3686497b0"/>
+    <rights type="GNU FDL" license.version="1.1" holder="Michael J. Chudobiak"/>
+  </resource>
+</omf>

Added: trunk/gnome-doc-utils.make
==============================================================================
--- (empty file)
+++ trunk/gnome-doc-utils.make	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,574 @@
+# gnome-doc-utils.make - make magic for building documentation
+# Copyright (C) 2004-2005 Shaun McCance <shaunm gnome org>
+#
+# 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+################################################################################
+## @@ Generating Header Files
+
+## @ DOC_H_FILE
+## The name of the header file to generate
+DOC_H_FILE ?=
+
+## @ DOC_H_DOCS
+## The input DocBook files for generating the header file
+DOC_H_DOCS ?=
+
+$(DOC_H_FILE): $(DOC_H_DOCS);
+	@rm -f $  tmp; touch $  tmp;
+	echo 'const gchar* documentation_credits[] = {' >> $  tmp
+	list='$(DOC_H_DOCS)'; for doc in $$list; do \
+	  xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
+	  if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
+	  xsltproc --path "$$xmlpath" $(_credits) $$doc; \
+	done | sort | uniq \
+	  | awk 'BEGIN{s=""}{n=split($$0,w,"<");if(s!=""&&s!=substr(w[1],1,length(w[1])-1)){print s};if(n>1){print $$0;s=""}else{s=$$0}};END{if(s!=""){print s}}' \
+	  | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $  tmp
+	echo '	NULL' >> $  tmp
+	echo '};' >> $  tmp
+	echo >> $  tmp
+	list='$(DOC_H_DOCS)'; for doc in $$list; do \
+	  xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
+	  if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
+	  docid=`echo "$$doc" | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \
+	    | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`; \
+	  echo $$xmlpath; \
+	  ids=`xsltproc --xinclude --path "$$xmlpath" $(_ids) $$doc`; \
+	  for id in $$ids; do \
+	    echo '#define HELP_'`echo $$docid`'_'`echo $$id \
+	      | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $  tmp; \
+	  done; \
+	  echo >> $  tmp; \
+	done;
+	cp $  tmp $@ && rm -f $  tmp
+
+dist-check-gdu:
+if !HAVE_GNOME_DOC_UTILS
+	@echo "*** GNOME Doc Utils must be installed in order to make dist"
+	@false
+endif
+
+.PHONY: dist-doc-header
+dist-doc-header: $(DOC_H_FILE)
+	@if test -f "$(DOC_H_FILE)"; then d=; else d="$(srcdir)/"; fi; \
+	echo "$(INSTALL_DATA) $${d}$(DOC_H_FILE) $(distdir)/$(DOC_H_FILE)"; \
+	$(INSTALL_DATA) "$${d}$(DOC_H_FILE)" "$(distdir)/$(DOC_H_FILE)";
+
+doc-dist-hook: dist-check-gdu $(if $(DOC_H_FILE),dist-doc-header)
+
+.PHONY: clean-doc-header
+_clean_doc_header = $(if $(DOC_H_FILE),clean-doc-header)
+clean-local: $(_clean_doc_header)
+distclean-local: $(_clean_doc_header)
+mostlyclean-local: $(_clean_doc_header)
+maintainer-clean-local: $(_clean_doc_header)
+clean-doc-header:
+	rm -f $(DOC_H_FILE)
+
+all: $(DOC_H_FILE)
+
+
+################################################################################
+## @@ Generating Documentation Files
+
+## @ DOC_MODULE
+## The name of the document being built
+DOC_MODULE ?=
+
+## @ DOC_ENTITIES
+## Files included with a SYSTEM entity
+DOC_ENTITIES ?=
+
+## @ DOC_INCLUDES
+## Files included with XInclude
+DOC_INCLUDES ?=
+
+## @ DOC_FIGURES
+## Figures and other external data
+DOC_FIGURES ?=
+
+## @ DOC_FORMATS
+## The default formats to be built and installed
+DOC_FORMATS ?= docbook
+_DOC_REAL_FORMATS = $(if $(DOC_USER_FORMATS),$(DOC_USER_FORMATS),$(DOC_FORMATS))
+
+## @ DOC_LINGUAS
+## The languages this document is translated into
+DOC_LINGUAS ?=
+_DOC_REAL_LINGUAS = $(if $(filter environment,$(origin LINGUAS)),		\
+	$(filter $(LINGUAS),$(DOC_LINGUAS)),					\
+	$(DOC_LINGUAS))
+
+_DOC_ABS_SRCDIR = @abs_srcdir@
+
+
+################################################################################
+## Variables for Bootstrapping
+
+_xml2po ?= `which xml2po`
+
+_db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils`
+_db2omf  ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
+_chunks  ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
+_credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
+_ids ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/ids.xsl
+
+if ENABLE_SK
+_ENABLE_SK = true
+_skpkgdatadir ?= `scrollkeeper-config --pkgdatadir`
+_sklocalstatedir ?= `scrollkeeper-config --pkglocalstatedir`
+_skcontentslist ?= $(_skpkgdatadir)/Templates/C/scrollkeeper_cl.xml
+endif
+
+
+################################################################################
+## @@ Rules for OMF Files
+
+db2omf_args =									\
+	--stringparam db2omf.basename $(DOC_MODULE)				\
+	--stringparam db2omf.format $(3)					\
+	--stringparam db2omf.dtd						\
+	$(shell xmllint --format $(2) | grep -h PUBLIC | head -n 1 		\
+		| sed -e 's/.*PUBLIC \(\"[^\"]*\"\).*/\1/')			\
+	--stringparam db2omf.lang $(notdir $(patsubst %/$(notdir $(2)),%,$(2)))	\
+	--stringparam db2omf.omf_dir "$(OMF_DIR)"				\
+	--stringparam db2omf.help_dir "$(HELP_DIR)"				\
+	--stringparam db2omf.omf_in "$(_DOC_OMF_IN)"				\
+	$(if $(_ENABLE_SK),							\
+	  --stringparam db2omf.scrollkeeper_cl "$(_skcontentslist)")		\
+	$(_db2omf) $(2)
+
+## @ _DOC_OMF_IN
+## The OMF input file
+_DOC_OMF_IN = $(if $(DOC_MODULE),$(wildcard $(_DOC_ABS_SRCDIR)/$(DOC_MODULE).omf.in))
+
+## @ _DOC_OMF_DB
+## The OMF files for DocBook output
+_DOC_OMF_DB = $(if $(_DOC_OMF_IN),						\
+	$(foreach lc,C $(_DOC_REAL_LINGUAS),$(DOC_MODULE)-$(lc).omf))
+
+$(_DOC_OMF_DB) : $(_DOC_OMF_IN)
+$(_DOC_OMF_DB) : $(DOC_MODULE)-%.omf : %/$(DOC_MODULE).xml
+	@test "x$(_ENABLE_SK)" != "xtrue" -o -f "$(_skcontentslist)" || {	\
+	  echo "The file '$(_skcontentslist)' does not exist." >&2;		\
+	  echo "Please check your ScrollKeeper installation." >&2;		\
+	  exit 1; }
+	xsltproc -o $@ $(call db2omf_args,$@,$<,'docbook') || { rm -f "$@"; exit 1; }
+
+## @ _DOC_OMF_HTML
+## The OMF files for HTML output
+_DOC_OMF_HTML = $(if $(_DOC_OMF_IN),						\
+	$(foreach lc,C $(_DOC_REAL_LINGUAS),$(DOC_MODULE)-html-$(lc).omf))
+
+$(_DOC_OMF_HTML) : $(_DOC_OMF_IN)
+$(_DOC_OMF_HTML) : $(DOC_MODULE)-html-%.omf : %/$(DOC_MODULE).xml
+if ENABLE_SK
+	@test "x$(_ENABLE_SK)" != "xtrue" -o -f "$(_skcontentslist)" || {	\
+	  echo "The file '$(_skcontentslist)' does not exist" >&2;		\
+	  echo "Please check your ScrollKeeper installation." >&2;		\
+	  exit 1; }
+endif
+	xsltproc -o $@ $(call db2omf_args,$@,$<,'xhtml') || { rm -f "$@"; exit 1; }
+
+## @ _DOC_OMF_ALL
+## All OMF output files to be built
+# FIXME
+_DOC_OMF_ALL =									\
+	$(if $(filter docbook,$(_DOC_REAL_FORMATS)),$(_DOC_OMF_DB))		\
+	$(if $(filter html HTML,$(_DOC_REAL_FORMATS)),$(_DOC_OMF_HTML))
+
+.PHONY: omf
+omf: $(_DOC_OMF_ALL)
+
+
+################################################################################
+## @@ C Locale Documents
+
+## @ _DOC_C_MODULE
+## The top-level documentation file in the C locale
+_DOC_C_MODULE = $(if $(DOC_MODULE),C/$(DOC_MODULE).xml)
+
+## @ _DOC_C_ENTITIES
+## Files included with a SYSTEM entity in the C locale
+_DOC_C_ENTITIES = $(foreach ent,$(DOC_ENTITIES),C/$(ent))
+
+## @ _DOC_C_XINCLUDES
+## Files included with XInclude in the C locale
+_DOC_C_INCLUDES = $(foreach inc,$(DOC_INCLUDES),C/$(inc))
+
+## @ _DOC_C_DOCS
+## All documentation files in the C locale
+_DOC_C_DOCS =								\
+	$(_DOC_C_ENTITIES)	$(_DOC_C_INCLUDES)			\
+	$(_DOC_C_MODULE)
+
+## @ _DOC_C_DOCS_NOENT
+## All documentation files in the C locale,
+## except files included with a SYSTEM entity
+_DOC_C_DOCS_NOENT =							\
+	$(_DOC_C_MODULE)	$(_DOC_C_INCLUDES)
+
+## @ _DOC_C_FIGURES
+## All figures and other external data in the C locale
+_DOC_C_FIGURES = $(if $(DOC_FIGURES),					\
+	$(foreach fig,$(DOC_FIGURES),C/$(fig)),				\
+	$(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/C/figures/*.png)))
+
+## @ _DOC_C_HTML
+## All HTML documentation in the C locale
+# FIXME: probably have to shell escape to determine the file names
+_DOC_C_HTML = $(foreach f,						\
+	$(shell xsltproc --xinclude 					\
+	  --stringparam db.chunk.basename "$(DOC_MODULE)"		\
+	  $(_chunks) "C/$(DOC_MODULE).xml"),				\
+	C/$(f).xhtml)
+
+###############################################################################
+## @@ Other Locale Documentation
+
+## @ _DOC_POFILES
+## The .po files used for translating the document
+_DOC_POFILES = $(if $(DOC_MODULE),						\
+	$(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(lc).po))
+
+.PHONY: po
+po: $(_DOC_POFILES)
+
+## @ _DOC_LC_MODULES
+## The top-level documentation files in all other locales
+_DOC_LC_MODULES = $(if $(DOC_MODULE),						\
+	$(foreach lc,$(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xml))
+
+## @ _DOC_LC_XINCLUDES
+## Files included with XInclude in all other locales
+_DOC_LC_INCLUDES =								\
+	$(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach inc,$(_DOC_C_INCLUDES),	\
+		$(lc)/$(notdir $(inc)) ))
+
+## @ _DOC_LC_HTML
+## All HTML documentation in all other locales
+# FIXME: probably have to shell escape to determine the file names
+_DOC_LC_HTML =									\
+	$(foreach lc,$(_DOC_REAL_LINGUAS),$(foreach doc,$(_DOC_C_HTML),		\
+		$(lc)/$(notdir $(doc)) ))
+
+## @ _DOC_LC_DOCS
+## All documentation files in all other locales
+_DOC_LC_DOCS =									\
+	$(_DOC_LC_MODULES)	$(_DOC_LC_INCLUDES)				\
+	$(if $(filter html HTML,$(_DOC_REAL_FORMATS)),$(_DOC_LC_HTML))
+
+## @ _DOC_LC_FIGURES
+## All figures and other external data in all other locales
+_DOC_LC_FIGURES = $(foreach lc,$(_DOC_REAL_LINGUAS),				\
+	$(patsubst C/%,$(lc)/%,$(_DOC_C_FIGURES)) )
+
+_DOC_SRC_FIGURES =								\
+	$(foreach fig,$(_DOC_C_FIGURES), $(foreach lc,C $(_DOC_REAL_LINGUAS),	\
+		$(wildcard $(srcdir)/$(lc)/$(patsubst C/%,%,$(fig))) ))
+
+$(_DOC_POFILES):
+	@if ! test -d $(dir $@); then \
+	  echo "mkdir $(dir $@)"; \
+	  mkdir "$(dir $@)"; \
+	fi
+	@if test ! -f $@ -a -f $(srcdir)/$@; then \
+	  echo "cp $(srcdir)/$@ $@"; \
+	  cp "$(srcdir)/$@" "$@"; \
+	fi;
+	@docs=; \
+	list='$(_DOC_C_DOCS_NOENT)'; for doc in $$list; do \
+	  docs="$$docs $(_DOC_ABS_SRCDIR)/$$doc"; \
+	done; \
+	if ! test -f $@; then \
+	  echo "(cd $(dir $@) && \
+	    $(_xml2po) -e $$docs > $(notdir $@).tmp && \
+	    cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)"; \
+	  (cd $(dir $@) && \
+	    $(_xml2po) -e $$docs > $(notdir $@).tmp && \
+	    cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp); \
+	else \
+	  echo "(cd $(dir $@) && \
+	    $(_xml2po) -e -u $(notdir $@) $$docs)"; \
+	  (cd $(dir $@) && \
+	    $(_xml2po) -e -u $(notdir $@) $$docs); \
+	fi
+
+# FIXME: fix the dependancy
+# FIXME: hook xml2po up
+$(_DOC_LC_DOCS) : $(_DOC_POFILES)
+$(_DOC_LC_DOCS) : $(_DOC_C_DOCS)
+	if ! test -d $(dir $@); then mkdir $(dir $@); fi
+	if [ -f "C/$(notdir $@)" ]; then d="../"; else d="$(_DOC_ABS_SRCDIR)/"; fi; \
+	(cd $(dir $@) && \
+	  $(_xml2po) -e -p \
+	    "$${d}$(dir $@)$(patsubst %/$(notdir $@),%,$@).po" \
+	    "$${d}C/$(notdir $@)" > $(notdir $@).tmp && \
+	    cp $(notdir $@).tmp $(notdir $@) && rm -f $(notdir $@).tmp)
+
+## @ _DOC_POT
+## A pot file
+_DOC_POT = $(if $(DOC_MODULE),$(DOC_MODULE).pot)
+.PHONY: pot
+pot: $(_DOC_POT)
+$(_DOC_POT): $(_DOC_C_DOCS_NOENT)
+	$(_xml2po) -e -o $@ $^
+
+
+################################################################################
+## @@ All Documentation
+
+## @ _DOC_HTML_ALL
+## All HTML documentation, only if it's built
+_DOC_HTML_ALL = $(if $(filter html HTML,$(_DOC_REAL_FORMATS)), \
+	$(_DOC_C_HTML) $(_DOC_LC_HTML))
+
+_DOC_HTML_TOPS = $(foreach lc,C $(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xhtml)
+
+$(_DOC_HTML_TOPS): $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
+	xsltproc -o $@ --xinclude --param db.chunk.chunk_top "false()" --stringparam db.chunk.basename "$(DOC_MODULE)" --stringparam db.chunk.extension ".xhtml" $(_db2html) $(patsubst %.xhtml,%.xml,$@)
+
+
+################################################################################
+
+all:							\
+	$(_DOC_C_DOCS)		$(_DOC_LC_DOCS)		\
+	$(_DOC_OMF_ALL)		$(_DOC_DSK_ALL)		\
+	$(_DOC_HTML_ALL)	$(_DOC_POFILES)
+
+
+.PHONY: clean-doc-omf clean-doc-dsk clean-doc-lc clean-doc-dir
+
+clean-doc-omf: ; rm -f $(_DOC_OMF_DB) $(_DOC_OMF_HTML)
+clean-doc-dsk: ; rm -f $(_DOC_DSK_DB) $(_DOC_DSK_HTML)
+clean-doc-lc:
+	rm -f $(_DOC_LC_DOCS)
+	@list='$(_DOC_POFILES)'; for po in $$list; do \
+	  if ! test "$$po" -ef "$(srcdir)/$$po"; then \
+	    echo "rm -f $$po"; \
+	    rm -f "$$po"; \
+	  fi; \
+	done
+	@for lc in C $(_DOC_REAL_LINGUAS); do \
+	  if test -f "$$lc/.xml2po.mo"; then \
+	    echo "rm -f $$lc/.xml2po.mo"; \
+	    rm -f "$$lc/.xml2po.mo"; \
+	  fi; \
+	done
+clean-doc-dir:
+	@for lc in C $(_DOC_REAL_LINGUAS); do \
+	  for dir in `find $$lc -depth -type d`; do \
+	    if ! test $$dir -ef $(srcdir)/$$dir; then \
+	      echo "rmdir $$dir"; \
+	      rmdir "$$dir"; \
+	   fi; \
+	  done; \
+	done
+
+_clean_omf = $(if $(_DOC_OMF_IN),clean-doc-omf)
+_clean_dsk = $(if $(_DOC_DSK_IN),clean-doc-dsk)
+_clean_lc  = $(if $(_DOC_REAL_LINGUAS),clean-doc-lc)
+_clean_dir = $(if $(DOC_MODULE),clean-doc-dir)
+
+clean-local:						\
+	$(_clean_omf)		$(_clean_dsk)		\
+	$(_clean_lc)		$(_clean_dir)
+distclean-local:					\
+	$(_clean_omf)		$(_clean_dsk)		\
+	$(_clean_lc)		$(_clean_dir)
+mostlyclean-local:					\
+	$(_clean_omf)		$(_clean_dsk)		\
+	$(_clean_lc)		$(_clean_dir)
+maintainer-clean-local:					\
+	$(_clean_omf)		$(_clean_dsk)		\
+	$(_clean_lc)		$(_clean_dir)
+
+
+.PHONY: dist-doc-docs dist-doc-figs dist-doc-omf dist-doc-dsk
+doc-dist-hook: 					\
+	$(if $(DOC_MODULE),dist-doc-docs)	\
+	$(if $(_DOC_C_FIGURES),dist-doc-figs)	\
+	$(if $(_DOC_OMF_IN),dist-doc-omf)
+#	$(if $(_DOC_DSK_IN),dist-doc-dsk)
+
+dist-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)
+	@for lc in C $(_DOC_REAL_LINGUAS); do \
+	  echo " $(mkinstalldirs) $(distdir)/$$lc"; \
+	  $(mkinstalldirs) "$(distdir)/$$lc"; \
+	done
+	@list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS) $(_DOC_POFILES)'; \
+	for doc in $$list; do \
+	  if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \
+	    docdir=`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
+	    if ! test -d "$(distdir)/$$docdir"; then \
+	      echo "$(mkinstalldirs) $(distdir)/$$docdir"; \
+	      $(mkinstalldirs) "$(distdir)/$$docdir"; \
+	    fi; \
+	  echo "$(INSTALL_DATA) $$d$$doc $(distdir)/$$doc"; \
+	  $(INSTALL_DATA) "$$d$$doc" "$(distdir)/$$doc"; \
+	done
+
+dist-doc-figs: $(_DOC_SRC_FIGURES)
+	@list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; \
+	for fig in $$list; do \
+	  if test -f "$$fig"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f "$$d$$fig"; then \
+	    figdir=`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
+	    if ! test -d "$(distdir)/$$figdir"; then \
+	      echo "$(mkinstalldirs) $(distdir)/$$figdir"; \
+	      $(mkinstalldirs) "$(distdir)/$$figdir"; \
+	    fi; \
+	    echo "$(INSTALL_DATA) $$d$$fig $(distdir)/$$fig"; \
+	    $(INSTALL_DATA) "$$d$$fig" "$(distdir)/$$fig"; \
+	  fi; \
+	done;
+
+dist-doc-omf:
+	@if test -f "$(_DOC_OMF_IN)"; then d=; else d="$(srcdir)/"; fi; \
+	echo "$(INSTALL_DATA) $$d$(_DOC_OMF_IN) $(distdir)/$(notdir $(_DOC_OMF_IN))"; \
+	$(INSTALL_DATA) "$$d$(_DOC_OMF_IN)" "$(distdir)/$(notdir $(_DOC_OMF_IN))"
+
+dist-doc-dsk:
+	@if test -f "$(_DOC_DSK_IN)"; then d=; else d="$(srcdir)/"; fi; \
+	echo "$(INSTALL_DATA) $$d$(_DOC_DSK_IN) $(distdir)/$(notdir $(_DOC_DSK_IN))"; \
+	$(INSTALL_DATA) "$$d$(_DOC_DSK_IN)" "$(distdir)/$(notdir $(_DOC_DSK_IN))"
+
+
+.PHONY: check-doc-docs check-doc-omf
+check:							\
+	$(if $(DOC_MODULE),check-doc-docs)		\
+	$(if $(_DOC_OMF_IN),check-doc-omf)
+
+check-doc-docs: $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
+	@for lc in C $(_DOC_REAL_LINGUAS); do \
+	  if test -f "$$lc"; \
+	    then d=; \
+	    xmlpath="$$lc"; \
+	  else \
+	    d="$(srcdir)/"; \
+	    xmlpath="$$lc:$(srcdir)/$$lc"; \
+	  fi; \
+	  echo "xmllint --noout --noent --path $$xmlpath --xinclude --postvalid $$d$$lc/$(DOC_MODULE).xml"; \
+	  xmllint --noout --noent --path "$$xmlpath" --xinclude --postvalid "$$d$$lc/$(DOC_MODULE).xml"; \
+	done
+
+check-doc-omf: $(_DOC_OMF_ALL)
+	@list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
+	  echo "xmllint --noout --xinclude --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf"; \
+	  xmllint --noout --xinclude --dtdvalid 'http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd' $$omf; \
+	done
+
+
+.PHONY: install-doc-docs install-doc-html install-doc-figs install-doc-omf install-doc-dsk
+install-data-local:					\
+	$(if $(DOC_MODULE),install-doc-docs)		\
+	$(if $(_DOC_HTML_ALL),install-doc-html)		\
+	$(if $(_DOC_C_FIGURES),install-doc-figs)	\
+	$(if $(_DOC_OMF_IN),install-doc-omf)
+#	$(if $(_DOC_DSK_IN),install-doc-dsk)
+
+install-doc-docs:
+	@for lc in C $(_DOC_REAL_LINGUAS); do \
+	  echo "$(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc"; \
+	  $(mkinstalldirs) $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$lc; \
+	done
+	@list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
+	  if test -f "$$doc"; then d=; else d="$(srcdir)/"; fi; \
+	  docdir="$$lc/"`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
+	  docdir="$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$docdir"; \
+	  if ! test -d "$$docdir"; then \
+	    echo "$(mkinstalldirs) $$docdir"; \
+	    $(mkinstalldirs) "$$docdir"; \
+	  fi; \
+	  echo "$(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
+	  $(INSTALL_DATA) $$d$$doc $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc; \
+	done
+
+install-doc-figs:
+	@list='$(patsubst C/%,%,$(_DOC_C_FIGURES))'; for fig in $$list; do \
+	  for lc in C $(_DOC_REAL_LINGUAS); do \
+	    if test -f "$$lc/$$fig"; then \
+	      figfile="$$lc/$$fig"; \
+	    elif test -f "$(srcdir)/$$lc/$$fig"; then \
+	      figfile="$(srcdir)/$$lc/$$fig"; \
+	    elif test -f "C/$$fig"; then \
+	      figfile="C/$$fig"; \
+	    else \
+	      figfile="$(srcdir)/C/$$fig"; \
+	    fi; \
+	    figdir="$$lc/"`echo $$fig | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`; \
+	    figdir="$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$figdir"; \
+	    if ! test -d "$$figdir"; then \
+	      echo "$(mkinstalldirs) $$figdir"; \
+	      $(mkinstalldirs) "$$figdir"; \
+	    fi; \
+	    figbase=`echo $$fig | sed -e 's/^.*\///'`; \
+	    echo "$(INSTALL_DATA) $$figfile $$figdir$$figbase"; \
+	    $(INSTALL_DATA) "$$figfile" "$$figdir$$figbase"; \
+	  done; \
+	done
+
+install-doc-html:
+	echo install-html
+
+install-doc-omf:
+	$(mkinstalldirs) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)
+	@list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
+	  echo "$(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
+	  $(INSTALL_DATA) $$omf $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf; \
+	done
+	@if test "x$(_ENABLE_SK)" = "xtrue"; then \
+	  echo "scrollkeeper-update -p $(DESTDIR)$(_sklocalstatedir) -o $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
+	  scrollkeeper-update -p "$(DESTDIR)$(_sklocalstatedir)" -o "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)"; \
+	fi;
+
+install-doc-dsk:
+	echo install-dsk
+
+
+.PHONY: uninstall-doc-docs uninstall-doc-html uninstall-doc-figs uninstall-doc-omf uninstall-doc-dsk
+uninstall-local:					\
+	$(if $(DOC_MODULE),uninstall-doc-docs)		\
+	$(if $(_DOC_HTML_ALL),uninstall-doc-html)	\
+	$(if $(_DOC_C_FIGURES),uninstall-doc-figs)	\
+	$(if $(_DOC_OMF_IN),uninstall-doc-omf)
+#	$(if $(_DOC_DSK_IN),uninstall-doc-dsk)
+
+uninstall-doc-docs:
+	@list='$(_DOC_C_DOCS) $(_DOC_LC_DOCS)'; for doc in $$list; do \
+	  echo " rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
+	  rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$doc"; \
+	done
+
+uninstall-doc-figs:
+	@list='$(_DOC_C_FIGURES) $(_DOC_LC_FIGURES)'; for fig in $$list; do \
+	  echo "rm -f $(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
+	  rm -f "$(DESTDIR)$(HELP_DIR)/$(DOC_MODULE)/$$fig"; \
+	done;
+
+uninstall-doc-omf:
+	@list='$(_DOC_OMF_ALL)'; for omf in $$list; do \
+	  if test "x$(_ENABLE_SK)" = "xtrue"; then \
+	    echo "scrollkeeper-uninstall -p $(_sklocalstatedir) $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
+	    scrollkeeper-uninstall -p "$(_sklocalstatedir)" "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
+	  fi; \
+	  echo "rm -f $(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
+	  rm -f "$(DESTDIR)$(OMF_DIR)/$(DOC_MODULE)/$$omf"; \
+	done

Added: trunk/omf.make
==============================================================================
--- (empty file)
+++ trunk/omf.make	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,61 @@
+# 
+# No modifications of this Makefile should be necessary.
+#
+# This file contains the build instructions for installing OMF files.  It is
+# generally called from the makefiles for particular formats of documentation.
+#
+# Note that you must configure your package with --localstatedir=/var
+# so that the scrollkeeper-update command below will update the database
+# in the standard scrollkeeper directory.
+#
+# If it is impossible to configure with --localstatedir=/var, then
+# modify the definition of scrollkeeper_localstate_dir so that
+# it points to the correct location. Note that you must still use 
+# $(localstatedir) in this or when people build RPMs it will update
+# the real database on their system instead of the one under RPM_BUILD_ROOT.
+#
+# Note: This make file is not incorporated into xmldocs.make because, in
+#       general, there will be other documents install besides XML documents
+#       and the makefiles for these formats should also include this file.
+#
+# About this file:
+#	This file was derived from scrollkeeper_example2, a package
+#	illustrating how to install documentation and OMF files for use with
+#	ScrollKeeper 0.3.x and 0.4.x.  For more information, see:
+#		http://scrollkeeper.sourceforge.net/	
+# 	Version: 0.1.3 (last updated: March 20, 2002)
+#
+
+omf_dest_dir=$(datadir)/omf/@PACKAGE@
+scrollkeeper_localstate_dir = $(localstatedir)/scrollkeeper
+
+# At some point, it may be wise to change to something like this:
+# scrollkeeper_localstate_dir = @SCROLLKEEPER_STATEDIR@
+
+omf: omf_timestamp
+
+omf_timestamp: $(omffile)
+	-for file in $(omffile); do \
+	  scrollkeeper-preinstall $(docdir)/$(docname).xml $(srcdir)/$$file $$file.out; \
+	done; \
+	touch omf_timestamp
+
+install-data-hook-omf:
+	$(mkinstalldirs) $(DESTDIR)$(omf_dest_dir)
+	for file in $(omffile); do \
+		$(INSTALL_DATA) $$file.out $(DESTDIR)$(omf_dest_dir)/$$file; \
+	done
+	-scrollkeeper-update -p $(DESTDIR)$(scrollkeeper_localstate_dir) -o $(DESTDIR)$(omf_dest_dir)
+
+uninstall-local-omf:
+	-for file in $(srcdir)/*.omf; do \
+		basefile=`basename $$file`; \
+		rm -f $(DESTDIR)$(omf_dest_dir)/$$basefile; \
+	done
+	-rmdir $(DESTDIR)$(omf_dest_dir)
+	-scrollkeeper-update -p $(DESTDIR)$(scrollkeeper_localstate_dir)
+
+clean-local-omf:
+	-for file in $(omffile); do \
+		rm -f $$file.out; \
+	done

Added: trunk/po/LINGUAS
==============================================================================
--- (empty file)
+++ trunk/po/LINGUAS	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,2 @@
+# please keep this list sorted alphabetically
+#

Added: trunk/po/Makefile.in.in
==============================================================================
--- (empty file)
+++ trunk/po/Makefile.in.in	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,217 @@
+# Makefile for program source directory in GNU NLS utilities package.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper gnu ai mit edu>
+# Copyright (C) 2004-2008 Rodney Dawes <dobey pwns gmail com>
+#
+# This file may be copied and used freely without restrictions.  It may
+# be used in projects which are not available under a GNU Public License,
+# but which still want to provide support for the GNU gettext functionality.
+#
+# - Modified by Owen Taylor <otaylor redhat com> to use GETTEXT_PACKAGE
+#   instead of PACKAGE and to look for po2tbl in ./ not in intl/
+#
+# - Modified by jacob berkman <jacob ximian com> to install
+#   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey pwns gmail com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
+
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = @datadir@
+datarootdir = @datarootdir@
+libdir = @libdir@
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po
+install_sh = @install_sh@
+# Automake >= 1.8 provides @mkdir_p  
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = @XGETTEXT@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
+GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
+
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
+
+POTFILES = \
+# This comment gets stripped out
+
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
+
+.SUFFIXES:
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
+
+.po.pox:
+	$(MAKE) $(GETTEXT_PACKAGE).pot
+	$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
+
+.po.mo:
+	$(MSGFMT) -o $@ $<
+
+.po.gmo:
+	file=`echo $* | sed 's,.*/,,'`.gmo \
+	  && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+.po.cat:
+	sed -f ../intl/po2msg.sed < $< > $*.msg \
+	  && rm -f $@ && gencat $@ $*.msg
+
+
+all: all- USE_NLS@
+
+all-yes: $(CATALOGS)
+all-no:
+
+$(GETTEXT_PACKAGE).pot: $(POTFILES)
+	$(GENPOT)
+
+install: install-data
+install-data: install-data- USE_NLS@
+install-data-no: all
+install-data-yes: all
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+	  $(mkdir_p) $$dir; \
+	  if test -r $$lang.gmo; then \
+	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
+	  else \
+	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+	    echo "installing $(srcdir)/$$lang.gmo as" \
+		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
+	  fi; \
+	  if test -r $$lang.gmo.m; then \
+	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
+	  else \
+	    if test -r $(srcdir)/$$lang.gmo.m ; then \
+	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+		$$dir/$(GETTEXT_PACKAGE).mo.m; \
+	      echo "installing $(srcdir)/$$lang.gmo.m as" \
+		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
+	    else \
+	      true; \
+	    fi; \
+	  fi; \
+	done
+
+# Empty stubs to satisfy archaic automake needs
+dvi info tags TAGS ID:
+
+# Define this as empty until I found a useful application.
+install-exec installcheck:
+
+uninstall:
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
+	done
+
+check: all $(GETTEXT_PACKAGE).pot
+	rm -f missing notexist
+	srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+	if [ -r missing -o -r notexist ]; then \
+	  exit 1; \
+	fi
+
+mostlyclean:
+	rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
+	rm -f .intltool-merge-cache
+
+clean: mostlyclean
+
+distclean: clean
+	rm -f Makefile Makefile.in POTFILES stamp-it
+	rm -f *.mo *.msg *.cat *.cat.m *.gmo
+
+maintainer-clean: distclean
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+	rm -f Makefile.in.in
+
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
+	dists="$(DISTFILES)"; \
+	extra_dists="$(EXTRA_DISTFILES)"; \
+	for file in $$extra_dists; do \
+	  test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+	done; \
+	for file in $$dists; do \
+	  test -f $$file || file="$(srcdir)/$$file"; \
+	  ln $$file $(distdir) 2> /dev/null \
+	    || cp -p $$file $(distdir); \
+	done
+
+update-po: Makefile
+	$(MAKE) $(GETTEXT_PACKAGE).pot
+	tmpdir=`pwd`; \
+	linguas="$(USE_LINGUAS)"; \
+	for lang in $$linguas; do \
+	  echo "$$lang:"; \
+	  result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
+	  if $$result; then \
+	    if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+	      rm -f $$tmpdir/$$lang.new.po; \
+            else \
+	      if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+	        :; \
+	      else \
+	        echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+	        rm -f $$tmpdir/$$lang.new.po; \
+	        exit 1; \
+	      fi; \
+	    fi; \
+	  else \
+	    echo "msgmerge for $$lang.gmo failed!"; \
+	    rm -f $$tmpdir/$$lang.new.po; \
+	  fi; \
+	done
+
+Makefile POTFILES: stamp-it
+	@if test ! -f $@; then \
+	  rm -f stamp-it; \
+	  $(MAKE) stamp-it; \
+	fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
+	       $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: trunk/po/POTFILES.in
==============================================================================
--- (empty file)
+++ trunk/po/POTFILES.in	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,14 @@
+[encoding: UTF-8]
+# List of source files which contain translatable strings.
+data/glade/moserial.glade
+data/moserial.desktop.in
+src/MainWindow.vala
+src/Settings.vala
+src/Main.vala
+src/Preferences.vala
+src/Profile.vala
+src/SendProgressDialog.vala
+src/SerialConnection.vala
+src/SerialStreamRecorder.vala
+src/Szwrapper.vala
+src/InputParser.vala

Added: trunk/po/POTFILES.skip
==============================================================================
--- (empty file)
+++ trunk/po/POTFILES.skip	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,11 @@
+data/glade/moserial.ui
+src/MainWindow.c
+src/Settings.c
+src/Main.c
+src/Preferences.c
+src/Profile.c
+src/SendProgressDialog.c
+src/SerialConnection.c
+src/SerialStreamRecorder.c
+src/Szwrapper.c
+src/InputParser.c

Added: trunk/src/AutoScroll.vala
==============================================================================
--- (empty file)
+++ trunk/src/AutoScroll.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,28 @@
+using Gtk;
+public class moserial.AutoScroll : GLib.Object
+{
+        public static void scroll (Gtk.Adjustment va)	{
+                va.value=va.upper-va.page_size;
+        }
+
+        public static void doAutoScroll (Gtk.Adjustment va) {
+                if (va.value==va.upper-va.page_size) 
+                                va.changed+=scroll;
+                else
+                                va.changed-=scroll;        
+               }
+
+        public static void setup(Gtk.Adjustment incomingAsciiVerticalAdjuster, Gtk.Adjustment incomingHexVerticalAdjuster, Gtk.Adjustment outgoingAsciiVerticalAdjuster, Gtk.Adjustment outgoingHexVerticalAdjuster) {
+                incomingAsciiVerticalAdjuster.changed+=scroll;
+                incomingAsciiVerticalAdjuster.value_changed+=doAutoScroll;
+
+                incomingHexVerticalAdjuster.changed+=scroll;
+                incomingHexVerticalAdjuster.value_changed+=doAutoScroll;
+
+                outgoingAsciiVerticalAdjuster.changed+=scroll;
+                outgoingAsciiVerticalAdjuster.value_changed+=doAutoScroll;
+
+                outgoingHexVerticalAdjuster.changed+=scroll;
+                outgoingHexVerticalAdjuster.value_changed+=doAutoScroll;
+        }
+}

Added: trunk/src/Config.vapi
==============================================================================
--- (empty file)
+++ trunk/src/Config.vapi	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,6 @@
+[CCode (cprefix="", lower_case_cprefix="", cheader_filename="config.h")]
+namespace Config
+{
+	public const string VERSION;
+	public const string MOSERIAL_GLADEDIR;
+}

Added: trunk/src/DefaultPaths.vala
==============================================================================
--- (empty file)
+++ trunk/src/DefaultPaths.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,47 @@
+using GLib;
+public class DefaultPaths : GLib.Object
+{
+        public string? recordTo { get; set; }
+        public string? receiveTo {get; set; }
+        public string? sendFrom {get; set; }
+
+        public DefaultPaths (string? RecordTo, string? ReceiveTo, string? SendFrom) {
+                this.recordTo=RecordTo;
+                this.receiveTo=ReceiveTo;
+                this.sendFrom=SendFrom;
+        }
+
+        public void saveToProfile(Profile profile) {
+                if (recordTo != null)
+                        profile.keyFile.set_string("paths", "last_record_path", recordTo);
+                if (receiveTo != null)
+                        profile.keyFile.set_string("paths", "last_receive_path", receiveTo);
+                if (sendFrom != null)
+                        profile.keyFile.set_string("paths", "last_send_path", sendFrom);
+        }
+
+        public static DefaultPaths loadFromProfile(Profile profile) {
+                string? RecordTo = null;
+                string? ReceiveTo = null;
+                string? SendFrom = null;
+
+                RecordTo = getPath (profile, "paths", "last_record_path");
+                ReceiveTo = getPath (profile, "paths", "last_receive_path");
+                SendFrom = getPath (profile, "paths", "last_send_path");
+
+                return new DefaultPaths (RecordTo, ReceiveTo, SendFrom);
+        }
+
+        public static string? getPath (Profile profile, string group, string key) {
+                string? path = null;
+                try {
+                        path = profile.keyFile.get_string(group, key);
+                        if (!MoUtils.fileExists(path))
+                                return null;
+                } catch (GLib.KeyFileError e) {
+                        //stdout.printf("%s\n", e.message);
+                }
+                return path;
+        }
+}
+

Added: trunk/src/HexTextBuffer.vala
==============================================================================
--- (empty file)
+++ trunk/src/HexTextBuffer.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,104 @@
+using Gtk;
+using GLib;
+
+public class moserial.HexTextBuffer : TextBuffer
+{
+	private TextMark nextHexMark;
+        private TextMark nextCharMark;
+        private TextTag addressTag;
+        private TextTag oddTag;
+        private int hexBytes;
+        construct {
+		setup();
+     	        addressTag = this.create_tag("hex_address", "foreground", "#2020ff", null);
+     	        oddTag = this.create_tag("hex_odd", "foreground", "#2020ff", null);
+     	        
+        }
+        public void applyPreferences(Preferences preferences) {
+        	addressTag.foreground=preferences.highlightColor;
+	       	oddTag.foreground=preferences.highlightColor;
+        }
+        public void clear() {
+        	this.delete_mark(nextHexMark);
+        	this.delete_mark(nextCharMark);
+		this.set_text("", 0);
+		setup();
+        }
+        private void setup() {
+		TextIter nextHexIter;
+		TextIter nextCharIter;
+	        this.get_end_iter(out nextHexIter);
+	        nextHexMark = new TextMark("nextHex", true);
+	        this.add_mark(nextHexMark, nextHexIter);
+	        nextCharIter=nextHexIter;
+	        nextCharMark = new TextMark("nextChar", true);
+     	        this.add_mark(nextCharMark, nextCharIter);
+     	        hexBytes=0;
+        }
+        public void add(uchar data) {
+		TextIter nextHexIter;
+        	TextIter nextCharIter;
+        	string incomingHexBuffer = "";
+        	if((hexBytes % 16)==0 ){
+                                TextIter startIter;
+	                        this.get_iter_at_mark(out nextCharIter, nextCharMark);
+                        	TextMark startMark = new TextMark("startMark", true);
+                        	this.add_mark(startMark, nextCharIter);
+	                        this.insert(nextCharIter, "\n%08x".printf(hexBytes), 9);
+	                        this.get_iter_at_mark(out startIter, startMark);
+	                        this.apply_tag_by_name("hex_address", startIter, nextCharIter);
+	                        this.delete_mark(startMark);
+	                        this.insert(nextCharIter, " ", 1);
+	                        this.delete_mark(nextHexMark);
+	                        nextHexIter=nextCharIter;
+				nextHexMark = new TextMark("nextHex", true);
+	                        this.add_mark(nextHexMark, nextHexIter);
+	                        this.insert(nextCharIter, "                                                   ", 51);
+	                        this.delete_mark(nextCharMark);
+	                        nextCharMark = new TextMark("nextChar", true);
+	                        this.add_mark(nextCharMark, nextCharIter);
+	                }
+                        else if((hexBytes % 8)==0) {
+	                        this.get_iter_at_mark(out nextHexIter, nextHexMark);
+	                        this.insert(nextHexIter, "  ", 2);
+	                        TextIter tempIter;
+	                        //remove space to align chars
+	                        tempIter = nextHexIter;
+        	                tempIter.forward_chars(2);
+        	                this.delete(nextHexIter, tempIter);
+	                        this.delete_mark(nextHexMark);
+	                        nextHexMark = new TextMark("nextHex", true);
+	                        this.add_mark(nextHexMark, nextHexIter);
+			}
+			this.get_iter_at_mark(out nextHexIter, nextHexMark);
+                        incomingHexBuffer+="%02X ".printf(data);
+                        this.insert(nextHexIter, incomingHexBuffer, (int)incomingHexBuffer.length);
+                        //remove space to align chars
+                        TextIter tempIter;
+                        tempIter = nextHexIter;
+                        tempIter.forward_chars(3);
+                        this.delete(nextHexIter, tempIter);
+			//add odd coloring
+			/*if(((hexBytes+1)%2)==0) {
+	      	                tempIter.backward_chars(3);
+	      	                this.apply_tag_by_name("hex_odd", tempIter, nextHexIter);
+      	                }*/
+                        incomingHexBuffer="";
+                        hexBytes++;
+                        this.delete_mark(nextHexMark);
+                        nextHexMark = new TextMark("nextHex", true);
+                        this.add_mark(nextHexMark, nextHexIter);
+                        
+                        this.get_iter_at_mark(out nextCharIter, nextCharMark);
+                        unichar c = "%c".printf(data).get_char();
+                        string s = "%c".printf(data);
+                        if(s.validate() && c.isprint())
+	                        this.insert(nextCharIter, s, (int)s.length);
+                        else
+	                        this.insert(nextCharIter, ".", 1);
+			
+			this.delete_mark(nextCharMark);
+                        nextCharMark = new TextMark("nextChar", true);
+                        this.add_mark(nextCharMark, nextCharIter);
+        }
+}

Added: trunk/src/InputParser.vala
==============================================================================
--- (empty file)
+++ trunk/src/InputParser.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,121 @@
+errordomain HexParseError {
+	INVALID_INPUT;
+}
+public class InputParser : GLib.Object
+{
+	/* We need this due to some strange Vala bug stopping us using string.replace in two different classes 
+	   should look into it and possibly file a bug */
+	public static string statusReplace(string oldString) { 
+		return oldString.replace("\\r", "\\n");
+	}
+	
+	public static uchar[] parseHex(string s) throws HexParseError {
+		
+		long len = s.length;
+		uchar[] r=new uchar[(len+1)/2];
+        	for(int x=0; x<(len+1)/2; x++) {
+        		unichar c;
+        		char i;
+        		char temp;
+
+	       		c=s.get_char();
+	       		if(len>1) {
+		       		i=xtoi(c)*16;
+	       			if(i<0)
+	       				throw new HexParseError.INVALID_INPUT(_("Invalid Input"));
+		       		s=s.next_char();
+	       		
+		       		c=s.get_char();
+	       		
+	       			temp=xtoi(c);
+	       			if(temp<0)
+	       				throw new HexParseError.INVALID_INPUT(_("Invalid Input"));
+	       			i=i+temp;
+		       	}
+		       	else {
+		       		i=xtoi(c);
+	       			if(i<0)
+	       				throw new HexParseError.INVALID_INPUT(_("Invalid Input"));
+		       	}
+	       		s=s.next_char();
+	       		r[x]=i;
+        	}
+        	
+		return r;
+	}
+	
+	// There should be bindings to something in vala that can do this but there dosen't seem to be yet 2009-01-31
+	private static char xtoi(unichar c) {
+		char i=-1;
+		switch(c){
+			case '0':
+			i=0;
+			break;
+			case '1':
+			i=1;
+			break;
+			case '2':
+			i=2;
+			break;
+			case '3':
+			i=3;
+			break;
+			case '4':
+			i=4;
+			break;
+			case '5':
+			i=5;
+			break;
+			case '6':
+			i=6;
+			break;
+			case '7':
+			i=7;
+			break;
+			case '8':
+			i=8;
+			break;
+			case '9':
+			i=9;
+			break;
+			case 'a':
+			i=10;
+			break;
+			case 'b':
+			i=11;
+			break;
+			case 'c':
+			i=12;
+			break;
+			case 'd':
+			i=13;
+			break;
+			case 'e':
+			i=14;
+			break;
+			case 'f':
+			i=15;
+			break;
+			
+			case 'A':
+			i=10;
+			break;
+			case 'B':
+			i=11;
+			break;
+			case 'C':
+			i=12;
+			break;
+			case 'D':
+			i=13;
+			break;
+			case 'E':
+			i=14;
+			break;
+			case 'F':
+			i=15;
+			break;
+		}
+		return i;				
+	}
+}

Added: trunk/src/Main.vala
==============================================================================
--- (empty file)
+++ trunk/src/Main.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,42 @@
+using Gtk;
+
+class moserial.Main : GLib.Object
+{
+        static string profileFilename;
+        const OptionEntry[] options = {
+                { "profile", 'p', 0, OptionArg.FILENAME, out profileFilename, N_("Profile file to load"), "foo.conf" },
+                { null }
+        };
+        public void run() {
+
+                moserial.MainWindow mainWindow;
+                Builder builder = new Builder();
+                try {
+                        builder.add_from_file(Config.MOSERIAL_GLADEDIR + "/moserial.ui");
+                } catch (Error e) {
+                        var msg = new MessageDialog (null, DialogFlags.MODAL, MessageType.ERROR, ButtonsType.CANCEL, _("Failed to load UI\n%s"), e.message);
+                        msg.run ();
+                }
+                mainWindow = new moserial.MainWindow(builder, profileFilename);
+                mainWindow.show();
+        }
+        public static int main (string[] args) {
+                Gtk.init (ref args);
+                OptionContext context = new OptionContext(_("- moserial serial terminal"));
+                context.add_main_entries (options, null);
+                context.add_group (Gtk.get_option_group(true));
+                try {
+                        if (!context.parse (ref args)) {
+                                stdout.printf (_("Run '%s --help' to see a full list of available command line options.\n"), args[0]);
+                        } else {
+                                Main app = new Main();
+                                app.run();
+                                Gtk.main ();
+                        }
+                } catch (GLib.OptionError e) {
+                        stdout.printf ("%s\n", e.message);
+                        stdout.printf (_("Run '%s --help' to see a full list of available command line options.\n"), args[0]);
+                }
+                return 0;
+        }
+}

Added: trunk/src/MainWindow.vala
==============================================================================
--- (empty file)
+++ trunk/src/MainWindow.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,809 @@
+using Gtk;
+using Gdk;
+
+public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get signals working. Why?
+{
+        const string[] authors = {
+                "Michael J. Chudobiak <mjc svn gnome org>",
+                "marlodavampire",
+                null
+        };
+        const string translators = N_("translator-credits");
+        const string[] license = {
+                N_("moserial 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 3 of the License, or (at your option) any later version.\n"),
+                N_("moserial 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.\n"),
+                N_("You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.")
+        };
+
+        public Builder builder {get; construct; }
+        private Gtk.Window window;
+        private SettingsDialog settingsDialog;
+        private ToolButton settingsButton;
+        private ToggleToolButton recordButton;
+        private Settings currentSettings;
+        private Preferences currentPreferences;
+	private DefaultPaths currentPaths;
+        private Statusbar statusbar;
+        private Statusbar bytecountbar;
+        private uint statusbarContext;
+        private uint bytecountbarContext;
+        private ToolButton send;
+        private SendProgressDialog sendProgressDialog;
+        private SendChooserDialog sendChooserDialog;
+        private ToolButton receive;
+        private ReceiveProgressDialog receiveProgressDialog;
+        private ReceiveChooserDialog receiveChooserDialog;
+        private RecordDialog recordDialog;
+        private PreferencesDialog preferencesDialog;
+        private SerialConnection serialConnection = new SerialConnection();
+        private TextView incomingHexTextView;
+        private TextView incomingAsciiTextView;
+        private TextView outgoingHexTextView;
+        private TextView outgoingAsciiTextView;
+        private ComboBox inputMode;
+        private ComboBox terminationMode;
+        private ToggleToolButton connectButton;
+        private Label disconnectLabel;
+        private Label connectLabel;
+        private Label recordLabel;
+        private Label stopRecordingLabel;
+        private Paned paned;
+        private Notebook incoming_notebook;
+        private HexTextBuffer incomingHexTextBuffer;
+        private HexTextBuffer outgoingHexTextBuffer;
+        private TextBuffer incomingAsciiTextBuffer;
+        private TextTag echoTag;
+        private TextBuffer outgoingAsciiTextBuffer;
+        private TextMark echoStartMark;
+        private XmodemFilenameDialog xmodemFilenameDialog;
+        private Gtk.Entry entry;
+        private Button sendButton;
+        private SerialStreamRecorder streamRecorder = new SerialStreamRecorder();
+        private bool recordDataReceived=false;
+        private uint recordTimeoutID=0;
+        private Rzwrapper rz;
+        private Szwrapper? sz;
+        private Profile profile;
+        public string? startupProfileFilename{get; construct; }
+        private string profileFilename=null;
+        private bool profileChanged=false;
+        private Gtk.Action cutMenuItem;
+        private Gtk.Action copyMenuItem;
+        public MainWindow(Builder builder, string? profileFilename) {
+                this.builder=builder;
+                this.startupProfileFilename=profileFilename;
+        }
+        construct {
+                //setup window
+                window = (Gtk.Window)builder.get_object("window");
+                window.destroy += quitSave;
+                window.delete_event += deleteSaveSize;
+
+		//load defaults
+                profile=new Profile();
+                profile.load(null, window);
+		currentSettings=Settings.loadFromProfile(profile);
+                int width = profile.getWindowWidth();
+                int height = profile.getWindowHeight();
+                int panedPosition = profile.getWindowPanedPosition();
+                if ((width>0) && (height>0))
+                        window.resize (width, height);
+
+                //setup paned
+                paned = (Paned)builder.get_object("vpaned");
+                if (panedPosition>=-1)
+                        paned.set_position(panedPosition);
+		else
+			paned.set_position(-1);
+
+                //setup menu items
+                Action quit = (Action)builder.get_object("menubar_quit");
+                quit.activate += quitSizeSave;
+                Action saveAs = (Action)builder.get_object("menubar_save_settings_as");
+                saveAs.activate += saveProfileAs;
+                Action save = (Action)builder.get_object("menubar_save_settings");
+                save.activate += saveProfile;
+                Action open = (Action)builder.get_object("menubar_open_settings");
+                open.activate += loadProfile;
+                copyMenuItem = (Action)builder.get_object("menubar_copy");
+		copyMenuItem.activate += this.copy;
+		Action editMenuItem = (Action)builder.get_object("menubar_edit");
+		editMenuItem.activate += this.editMenu;
+		cutMenuItem = (Action)builder.get_object("menubar_cut");
+		copyMenuItem.set_sensitive(false);
+		cutMenuItem.set_sensitive(false);
+		cutMenuItem.activate += this.cut;
+		Action pasteMenuItem = (Action)builder.get_object("menubar_paste");
+		pasteMenuItem.activate += this.paste;
+		Action clearMenuItem = (Action)builder.get_object("menubar_clear");
+		clearMenuItem.activate += this.clear;
+		
+                //setup the Port Settings Dialog
+                settingsDialog = new SettingsDialog(builder);
+                settingsDialog.updateSettings += this.updateSettings;
+                settingsButton = (ToolButton)builder.get_object("toolbar_settings");
+                settingsButton.clicked += this.showSettingsDialog;
+
+                //setup the Help button
+                ToolButton helpButton = (ToolButton)builder.get_object("toolbar_help");
+                helpButton.clicked += showHelpButton;
+
+                //setup the statusbar
+                statusbar = (Statusbar)builder.get_object("statusbar");
+                statusbarContext = statusbar.get_context_id("moserial port status");
+                statusbar.push(statusbarContext, currentSettings.getStatusbarString(false));
+
+                //setup the byte count bar
+                bytecountbar = (Statusbar)builder.get_object("bytecountbar");
+                bytecountbarContext = statusbar.get_context_id("moserial byte counts");
+                bytecountbar.push(bytecountbarContext, _("TX: 0, RX: 0"));
+
+                //setup the about dialog
+                Action about = (Action)builder.get_object("menubar_about");
+                about.activate += showAboutDialog;
+
+                //setup send
+                sendProgressDialog = new SendProgressDialog(builder);
+                sendChooserDialog = new SendChooserDialog(builder);
+                send = (ToolButton)builder.get_object("toolbar_send");
+                send.clicked += doSendChooser;
+                sendChooserDialog.startTransfer += this.doSend;
+                sz = new Szwrapper(Szwrapper.Protocol.NULL, null, null);
+
+                //setup receive
+                receiveProgressDialog = new ReceiveProgressDialog(builder);
+                receiveChooserDialog = new ReceiveChooserDialog(builder);
+                receive = (ToolButton)builder.get_object("toolbar_receive");
+                receive.clicked += doReceiveChooser;
+                receiveChooserDialog.startTransfer += this.doReceive;
+                xmodemFilenameDialog = new XmodemFilenameDialog(builder);
+                rz = new Rzwrapper(Rzwrapper.Protocol.NULL, null, null, null);
+
+
+                //setup recording
+                recordDialog = new RecordDialog(builder);
+                recordButton = (ToggleToolButton)builder.get_object("toolbar_logging");
+                recordButton.clicked += this.record;
+                recordDialog.stopRecording += this.stopRecording;
+                recordDialog.startRecording += this.startRecording;
+                recordLabel = (Label)builder.get_object("record_label");
+                stopRecordingLabel = (Label)builder.get_object("stop_recording_label");
+
+                //setup preferences
+                preferencesDialog = new PreferencesDialog(builder);
+                preferencesDialog.updatePreferences += this.updatePreferences;
+                ToolButton preferences = (ToolButton)builder.get_object("toolbar_preferences");
+                preferences.clicked += this.showPreferencesDialog;
+
+                //setup connectbutton
+                connectButton = (ToggleToolButton)builder.get_object("toolbar_connect");
+                connectButton.clicked += this.connect;
+                disconnectLabel = (Label)builder.get_object("disconnect_label");
+                connectLabel = (Label)builder.get_object("connect_label");
+
+                //setup help
+                Action contents = (Action)builder.get_object("menubar_contents");
+                contents.activate += showHelpAction;
+
+                //setup incoming notebook
+                incoming_notebook = (Notebook)builder.get_object("incoming_notebook");
+
+                //setup textBuffers;
+                incomingHexTextBuffer = new HexTextBuffer();
+                incomingAsciiTextBuffer = new TextBuffer(new TextTagTable());
+                outgoingHexTextBuffer = new HexTextBuffer();
+                outgoingAsciiTextBuffer = new TextBuffer(new TextTagTable());
+
+                echoTag = incomingAsciiTextBuffer.create_tag("echo", null);
+
+                incomingHexTextView = (TextView)builder.get_object("incoming_hex_textview");
+                incomingHexTextView.modify_font(Pango.FontDescription.from_string("Monospace 10"));
+                incomingHexTextView.set_buffer(incomingHexTextBuffer);
+
+                incomingAsciiTextView = (TextView)builder.get_object("incoming_ascii_textview");
+                incomingAsciiTextView.modify_font(Pango.FontDescription.from_string("Monospace 10"));
+                incomingAsciiTextView.set_buffer(incomingAsciiTextBuffer);
+
+                outgoingHexTextView = (TextView)builder.get_object("outgoing_hex_textview");
+                outgoingHexTextView.modify_font(Pango.FontDescription.from_string("Monospace 10"));
+                outgoingHexTextView.set_buffer(outgoingHexTextBuffer);
+
+                outgoingAsciiTextView = (TextView)builder.get_object("outgoing_ascii_textview");
+                outgoingAsciiTextView.modify_font(Pango.FontDescription.from_string("Monospace 10"));
+                outgoingAsciiTextView.set_buffer(outgoingAsciiTextBuffer);
+                
+                //setup scrolling
+                ScrolledWindow incomingAsciiScrolledWindow = (ScrolledWindow)builder.get_object("incoming_ascii_scrolledwindow");
+                Adjustment va1 = incomingAsciiScrolledWindow.get_vadjustment();
+               	ScrolledWindow incomingHexScrolledWindow = (ScrolledWindow)builder.get_object("incoming_hex_scrolledwindow");
+                Adjustment va2 = incomingHexScrolledWindow.get_vadjustment();
+                ScrolledWindow outgoingAsciiScrolledWindow = (ScrolledWindow)builder.get_object("outgoing_ascii_scrolledwindow");
+                Adjustment va3 = outgoingAsciiScrolledWindow.get_vadjustment();
+                ScrolledWindow outgoingHexScrolledWindow = (ScrolledWindow)builder.get_object("outgoing_hex_scrolledwindow");
+                Adjustment va4 = outgoingHexScrolledWindow.get_vadjustment();
+		AutoScroll.setup(va1, va2, va3, va4);
+		
+                //setup entry
+                sendButton = (Button)builder.get_object("send");
+                sendButton.clicked += sendString;
+                entry = (Gtk.Entry)builder.get_object("entry");
+                entry.activate += sendString;
+                inputMode = (ComboBox)builder.get_object("input_mode");
+                inputMode.set_active(0);
+                terminationMode = (ComboBox)builder.get_object("termination_mode");
+                terminationMode.set_active(0);
+                
+                //load and apply preferences
+                currentPreferences = Preferences.loadFromProfile(profile);
+       		updatePreferences(null, currentPreferences);
+       		profileChanged=false;
+       		if(!(startupProfileFilename==null))
+       			loadProfileOnStartup(startupProfileFilename);
+
+		currentPaths = DefaultPaths.loadFromProfile(profile);
+        }
+	
+
+
+        private void insertBufferEnd (TextBuffer buf, string s) {
+                TextIter iter;
+                buf.get_end_iter(out iter);
+                buf.insert(iter, s, (int)s.length);
+        }
+
+        public void sendString(Widget w) {
+
+                if (!ensureConnected())
+                        return;
+
+                string s;
+                s=entry.get_text();
+                serialConnection.echoReference=s;
+
+                long len;
+                if (inputMode.get_active()==0) {
+                        len = s.length;
+
+                        for (int x=0; x<len; x++) {
+                                serialConnection.sendByte((uchar)s.get_char());
+                                streamRecorder.writeOutgoing((uchar)s.get_char());
+                                outgoingHexTextBuffer.add((uchar)s.get_char());
+                                insertBufferEnd(outgoingAsciiTextBuffer, "%c".printf((uchar)s.get_char()));
+                                s=s.next_char();
+                        }
+
+                        string t = serialConnection.getLineEnd(terminationMode.get_active());
+                        len = t.length;
+
+                        for (int x=0; x<len; x++) {
+                                serialConnection.sendByte((uchar)t.get_char());
+                                streamRecorder.writeOutgoing((uchar)t.get_char());
+                                outgoingHexTextBuffer.add((uchar)t.get_char());
+
+                                /* Just display the first byte of the terminator in the ASCII window,
+                                   so that CRLF doesn't cause two line advances. */
+                                if (x==0)
+                                        insertBufferEnd(outgoingAsciiTextBuffer, "%c".printf((uchar)t.get_char()));
+
+                                t=t.next_char();
+                        }
+
+                } else {
+                	try {
+		                uchar[] h = InputParser.parseHex(s);
+		                len = h.length;
+		                for (int x=0; x<len; x++) {
+		                        serialConnection.sendByte(h[x]);
+		                        streamRecorder.writeOutgoing(h[x]);
+		                        outgoingHexTextBuffer.add(h[x]);
+		                        insertBufferEnd(outgoingAsciiTextBuffer, "%c".printf(h[x]));
+		                }
+			}
+			catch (HexParseError e) {
+	                        var errorDialog = new MessageDialog (window, DialogFlags.DESTROY_WITH_PARENT, MessageType.ERROR, ButtonsType.CLOSE, e.message);
+				errorDialog.run();
+				errorDialog.destroy();
+			}
+                }
+                bytecountbar.pop(bytecountbarContext);
+                bytecountbar.push(bytecountbarContext, serialConnection.getBytecountbarString());
+                entry.set_text("");
+
+                /* Start listening for an echo */
+                serialConnection.echoCompare="";
+                TextIter echoStartIter;
+                incomingAsciiTextBuffer.get_end_iter(out echoStartIter);
+                echoStartMark = incomingAsciiTextBuffer.create_mark ("echo",echoStartIter,true);
+        }
+
+        private void doSendChooser(ToolButton button) {
+                if (!ensureConnected())
+                        return;
+                sendChooserDialog.show(currentPaths.sendFrom);
+        }
+        private void doSend(SendChooserDialog dialog) {
+                Szwrapper.Protocol protocol;
+                string filename;
+                filename=dialog.filename;
+		currentPaths.sendFrom=MoUtils.getParentFolder(filename);
+                switch (dialog.protocolCombo.get_active()) {
+                case 0:
+                        protocol=Szwrapper.Protocol.XMODEM;
+                        break;
+                case 1:
+                        protocol=Szwrapper.Protocol.YMODEM;
+                        break;
+                case 2:
+                default:
+                        protocol=Szwrapper.Protocol.ZMODEM;
+                        break;
+                case 3:
+                	protocol=Szwrapper.Protocol.RAW;
+                	break;
+                }                	
+                sz = new Szwrapper(protocol, serialConnection, filename);
+                if(sz.running)
+		{
+			sendProgressDialog.show();
+		        sz.updateStatus+=sendProgressDialog.updateStatus;
+		        sendProgressDialog.transferCanceled+=sz.transferCanceled;
+		        sz.transferComplete += this.sendComplete;
+		}
+        }
+        public void sendComplete(GLib.Object o) {
+	        sz.updateStatus-=sendProgressDialog.updateStatus;
+        	sendProgressDialog.transferCanceled-=sz.transferCanceled;
+                sendProgressDialog.hide(sendProgressDialog);
+        }
+        private void doReceiveChooser(ToolButton button) {
+                if (!ensureConnected())
+                        return;
+
+                receiveChooserDialog.show(currentPaths.receiveTo);
+        }
+
+        private void doReceive(ReceiveChooserDialog dialog) {
+                string filename="";
+		currentPaths.receiveTo=dialog.path;
+                if (dialog.protocolCombo.get_active()==0) { //get the filename for xmodem
+                        xmodemFilenameDialog.show();
+                        filename = xmodemFilenameDialog.filename;
+                }
+                Rzwrapper.Protocol protocol;
+                switch (dialog.protocolCombo.get_active()) {
+                case 0:
+                        protocol=Rzwrapper.Protocol.XMODEM;
+                        break;
+                case 1:
+                        protocol=Rzwrapper.Protocol.YMODEM;
+                        break;
+                case 2:
+                default:
+                        protocol=Rzwrapper.Protocol.ZMODEM;
+                        break;
+                }
+                rz = new Rzwrapper(protocol, serialConnection, dialog.path, filename);
+                if(rz.running)
+                {
+		        receiveProgressDialog.show();
+		        rz.updateStatus+=receiveProgressDialog.updateStatus;
+		        receiveProgressDialog.transferCanceled+=rz.transferCanceled;
+		        rz.transferComplete += this.receiveComplete;
+		}
+        }
+
+        public void receiveComplete(GLib.Object o) {
+                rz.updateStatus-=receiveProgressDialog.updateStatus;
+                receiveProgressDialog.transferCanceled-=rz.transferCanceled;
+                receiveProgressDialog.hide(receiveProgressDialog);
+        }
+        public void record(ToggleToolButton button) {
+                if (button.get_active()) {
+                        button.set_label_widget(stopRecordingLabel);
+                        recordDialog.show(currentPaths.recordTo);
+                } else {
+                        streamRecorder.close(currentPreferences.recordLaunch);
+                        button.set_label_widget(recordLabel);
+			if (recordTimeoutID > 0) {
+				GLib.Source.remove (recordTimeoutID);
+				recordTimeoutID = 0;
+			}
+                }
+        }
+
+        public void stopRecording(moserial.RecordDialog dialog) {
+                recordButton.set_active(false); //this generates recordButton.clicked signal
+        }
+
+        public void startRecording(moserial.RecordDialog dialog, string filename, moserial.SerialStreamRecorder.Direction direction) {
+                try {
+                        streamRecorder.open(filename, direction);
+			currentPaths.recordTo=MoUtils.getParentFolder(filename);
+                        if (!ensureConnected())
+                                stopRecording(dialog);
+                } catch (GLib.Error e) {
+                        warning(_("Error: Could not open %s\n"), filename);
+                        var errorDialog = new MessageDialog (window, DialogFlags.DESTROY_WITH_PARENT, MessageType.ERROR, ButtonsType.CLOSE, "%s: %s\n%s".printf(_("Error: Could not open file"), filename, e.message));
+                        errorDialog.run();
+                        errorDialog.destroy();
+                        stopRecording(dialog);
+                }
+        }
+
+	public bool recordTimeout() {
+		recordButton.set_active(false);
+		return false;
+	}
+
+        public void show() {
+                window.show_all();
+        }
+
+        private void updateSettings(SettingsDialog d, Settings newSettings) {
+                currentSettings = newSettings;
+                statusbar.pop(statusbarContext);
+                statusbar.push(statusbarContext, currentSettings.getStatusbarString(false));
+                profileChanged=true;
+        }
+        
+        private void updatePreferences(PreferencesDialog? d, Preferences newPreferences) {
+        	currentPreferences = newPreferences;
+        	string font;
+        	if(currentPreferences.useSystemMonospaceFont)
+        		font=Preferences.getSystemDefaultMonospaceFont();
+        	else
+        		font=currentPreferences.font;
+        	incomingAsciiTextView.modify_font(Pango.FontDescription.from_string(font));
+        	incomingAsciiTextView.modify_text(Gtk.StateType.NORMAL, Preferences.getGdkColor(currentPreferences.fontColor));
+        	incomingAsciiTextView.modify_base(Gtk.StateType.NORMAL, Preferences.getGdkColor(currentPreferences.backgroundColor));
+        	echoTag.foreground=currentPreferences.highlightColor;
+		
+		incomingHexTextView.modify_font(Pango.FontDescription.from_string(font));
+ 	      	incomingHexTextView.modify_text(Gtk.StateType.NORMAL, Preferences.getGdkColor(currentPreferences.fontColor));
+        	incomingHexTextView.modify_base(Gtk.StateType.NORMAL, Preferences.getGdkColor(currentPreferences.backgroundColor));
+        	incomingHexTextBuffer.applyPreferences(currentPreferences);
+		
+		outgoingAsciiTextView.modify_font(Pango.FontDescription.from_string(font));
+        	outgoingAsciiTextView.modify_text(Gtk.StateType.NORMAL, Preferences.getGdkColor(currentPreferences.fontColor));
+        	outgoingAsciiTextView.modify_base(Gtk.StateType.NORMAL, Preferences.getGdkColor(currentPreferences.backgroundColor));
+
+        	outgoingHexTextView.modify_font(Pango.FontDescription.from_string(font));
+ 	      	outgoingHexTextView.modify_text(Gtk.StateType.NORMAL, Preferences.getGdkColor(currentPreferences.fontColor));
+        	outgoingHexTextView.modify_base(Gtk.StateType.NORMAL, Preferences.getGdkColor(currentPreferences.backgroundColor));
+        	outgoingHexTextBuffer.applyPreferences(currentPreferences);
+        	profileChanged=true;
+        }
+
+        private void showSettingsDialog(GLib.Object o) {
+                settingsDialog.show(currentSettings);
+        }
+        
+        private void showPreferencesDialog(GLib.Object o) {
+                preferencesDialog.show(currentPreferences, recordButton.get_active());
+        }
+
+	public bool ensureConnected () {
+                if (!connectButton.get_active())
+                        connectButton.set_active(true);
+
+                /* Is this a race condition? We want to know if the
+                   set_active attempt was successful. */
+                return connectButton.get_active();
+        }
+
+        public void ensureDisconnected () {
+                if (connectButton.get_active())
+                        connectButton.set_active(false);
+        }
+
+        private bool startConnection() {
+                if (!(serialConnection.connect(currentSettings))) {
+                        connectButton.set_active(false);
+                        warning(_("Error: Could not open %s\n"), currentSettings.device);
+                        var dialog = new MessageDialog (window, DialogFlags.DESTROY_WITH_PARENT, MessageType.ERROR, ButtonsType.CLOSE, "%s: %s".printf(_("Error: Could not open device"), currentSettings.device));
+                        dialog.run();
+                        dialog.destroy();
+                        return false;
+                }
+                incomingHexTextBuffer.clear();
+                incomingAsciiTextBuffer.set_text("",0);
+                outgoingHexTextBuffer.clear();
+                outgoingAsciiTextBuffer.set_text("",0);
+
+                settingsButton.set_sensitive(false);
+                statusbar.pop(statusbarContext);
+                statusbar.push(statusbarContext, currentSettings.getStatusbarString(true));
+                serialConnection.newData += this.updateIncoming;
+                connectButton.set_label_widget(disconnectLabel);
+                return true;
+        }
+
+        private void connect(ToggleToolButton button) {
+                if (button.get_active()) {
+                        startConnection();
+                } else {
+                        settingsButton.set_sensitive(true);
+                        serialConnection.disconnect();
+                        serialConnection.newData -= this.updateIncoming;
+                        bytecountbar.pop(bytecountbarContext);
+                        bytecountbar.push(bytecountbarContext, serialConnection.getBytecountbarString());
+                        //serialConnection = new SerialConnection();
+                        statusbar.pop(statusbarContext);
+                        statusbar.push(statusbarContext, currentSettings.getStatusbarString(false));
+                        button.set_label_widget(connectLabel);
+
+                        if (recordButton.get_active())
+                                recordButton.set_active(false);
+                }
+        }
+
+	private void updateIncoming(SerialConnection sc, uchar[1000] data, int size) {
+                if (rz.running) {
+                        for (int x=0; x<size; x++) {
+	                        rz.writeChar(data[x]);
+                        }
+                        rz.flush();
+                } else if (sz.running) {
+                        for (int x=0; x<size; x++) {
+                                sz.writeChar(data[x]);
+                        }
+                } else {
+                        for (int x=0; x<size; x++) {
+
+                                incomingHexTextBuffer.add(data[x]);
+
+                                unichar c = "%c".printf(data[x]).get_char();
+                                string s = "%c".printf(data[x]);
+
+                                /* Keep a record of any possible echo */
+                                if (sc.echoCompare.length < sc.echoReference.length)
+                                        sc.echoCompare += s;
+
+                                if (s.validate() && (c.isprint() || c.isspace())) {
+                                        /* Ignore LF if last char was CR (CRLF terminator) */
+                                        if (! (sc.lastRxCharWasCR && (c == '\n'))) {
+                                                insertBufferEnd(incomingAsciiTextBuffer, s);
+                                        }
+                                } else
+                                        ++sc.nonprintable;
+
+                                sc.lastRxCharWasCR = (c == '\r');
+
+                                /* Highlight any text that is an exact echo of the last transmission */
+                                if (sc.echoCompare.length > 0 && (sc.echoCompare.length == sc.echoReference.length)) {
+                                        if (sc.echoCompare == sc.echoReference) {
+                                                TextIter echoStartIter;
+                                                TextIter echoStopIter;
+                                                incomingAsciiTextBuffer.get_iter_at_mark (out echoStartIter, echoStartMark);
+                                                incomingAsciiTextBuffer.get_end_iter(out echoStopIter);
+                                                incomingAsciiTextBuffer.apply_tag_by_name("echo",echoStartIter,echoStopIter);
+                                        }
+                                        sc.echoCompare="";
+                                        sc.echoReference="";
+                                }
+
+                                /* Auto-select hex view for binary data */
+                                if ((sc.rx > 32) && (sc.nonprintable > 0) && (sc.rx / sc.nonprintable < 4) && !sc.forced_hex_view) {
+                                        sc.forced_hex_view = true;
+                                        incoming_notebook.set_current_page(1);
+                                }
+
+				if(currentPreferences.enableTimeout && recordButton.get_active()) {
+					if (recordTimeoutID > 0)
+						GLib.Source.remove (recordTimeoutID);
+					if (currentPreferences.timeout > 0)
+						recordTimeoutID = GLib.Timeout.add_seconds(currentPreferences.timeout, recordTimeout);
+				}
+
+                                streamRecorder.writeIncoming(data[x]);
+				recordDataReceived=true;
+                                bytecountbar.pop(bytecountbarContext);
+                                bytecountbar.push(bytecountbarContext, sc.getBytecountbarString());
+                        }
+                }
+        }
+
+	private void showHelpButton (ToolButton button) {
+		showHelp ();
+	}
+	
+	private void showHelpAction (Action a) {
+		showHelp ();
+	}
+
+        private void showHelp () {
+                try {
+                        show_uri(null, "ghelp:moserial", Gdk.CURRENT_TIME);
+                } catch (GLib.Error e) {
+                        warning(_("Unable to display help file: %s"), e.message);
+                }
+        }
+
+        private void showAboutDialog () {
+
+                string license_trans = license[0] + "\n" + license[1] + "\n" + license[2];
+
+                AboutDialog.set_url_hook (url_hook);
+                show_about_dialog (window,
+                                   "version", Config.VERSION,
+                                   "copyright", "Copyright  2009\nMichael J. Chudobiak\n<mjc svn gnome org>",
+                                   "comments", _("A serial terminal for the GNOME desktop, optimized for logging and file capture."),
+                                   "authors", authors,
+                                   "translator-credits", translators,
+                                   "logo-icon-name", "moserial",
+                                   "wrap-license", true,
+                                   "license", license_trans,
+                                   "website", "http://sf.net/projects/moserial";,
+                                   null);
+        }
+
+        private void url_hook (AboutDialog about, string link) {
+                try {
+                        show_uri (null, link, Gdk.CURRENT_TIME);
+                } catch (GLib.Error e) {
+                        warning (_("Can't display a clickable URL: %s"), e.message);
+                }
+        }
+
+        private void quitSizeSave () {
+                windowSizeSave();
+                quitSave();
+        }
+
+        private bool deleteSaveSize(Widget widget, Event event) {
+                windowSizeSave();
+                quitSave();
+                Gtk.main_quit();
+                return true;
+        }
+
+        private void windowSizeSave () {
+                int width = 0;
+                int height = 0;
+
+                int pos = paned.get_position();
+                window.get_size (out width, out height);
+                profile.saveWindowSize(width, height);
+                profile.saveWindowPanedPosition(pos);
+        }
+
+        private void quitSave() {
+                currentPreferences.saveToProfile(profile);
+                currentSettings.saveToProfile(profile);
+		currentPaths.saveToProfile(profile);
+		if (profileFilename != null) {
+			if (profileChanged) {
+                		var dialog = new MessageDialog (window, DialogFlags.DESTROY_WITH_PARENT, MessageType.QUESTION, ButtonsType.YES_NO, _("You have changed your setting or preferences. Do you want to save these changes to the loaded profile?"));
+	                	int response = dialog.run();
+        	        	if(response == Gtk.ResponseType.YES)
+	        	        	saveProfile();
+                		dialog.destroy();
+			} else {
+				/* Save the profile even if settings or preferences have not
+                                   changed, to save the default file locations */
+				saveProfile();
+			}
+                }
+                profile.save(null, window);
+                Gtk.main_quit ();
+        }
+	private void saveProfile () {
+                currentPreferences.saveToProfile(profile);
+                currentSettings.saveToProfile(profile);
+		currentPaths.saveToProfile(profile);
+		if(profileFilename==null)
+			saveProfileAs();
+		if(profileFilename==null)
+			return;
+		profile.save(profileFilename, window);
+		profileChanged=false;
+	}	
+	private void saveProfileAs () {
+                var dialog = new FileChooserDialog (null, window, Gtk.FileChooserAction.SAVE);
+                dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_SAVE, Gtk.ResponseType.ACCEPT, null);
+                dialog.set_do_overwrite_confirmation(true);
+                dialog.set_local_only(false);
+	        int response = dialog.run();
+	        if(response == Gtk.ResponseType.ACCEPT) {
+		        profileFilename=dialog.get_filename();
+		}
+                dialog.destroy();
+                if(response == Gtk.ResponseType.ACCEPT)
+                	saveProfile();
+	}
+	private void loadProfileOnStartup(string profileFilename) {
+	        if (profile.load(profileFilename, window)) {
+			ensureDisconnected();
+		        currentSettings = Settings.loadFromProfile(profile);
+        	        currentPreferences = Preferences.loadFromProfile(profile);
+			currentPaths = DefaultPaths.loadFromProfile(profile);
+			updatePreferences(null, currentPreferences);
+        		statusbar.pop(statusbarContext);
+        		statusbar.push(statusbarContext, currentSettings.getStatusbarString(false));
+			window.set_title("moserial - %s".printf(GLib.Path.get_basename(profileFilename)));
+			profileChanged=false;
+			this.profileFilename=profileFilename;
+		}
+	}
+	private void loadProfile() {
+                var dialog = new FileChooserDialog (null, window, Gtk.FileChooserAction.OPEN);
+                dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT, null);
+                dialog.set_local_only(false);
+	        int response = dialog.run();
+	        if(response == Gtk.ResponseType.ACCEPT) {
+		        profileFilename=dialog.get_filename();
+		        if (profile.load(profileFilename, window)) {
+				ensureDisconnected();
+			        currentSettings = Settings.loadFromProfile(profile);
+        	                currentPreferences = Preferences.loadFromProfile(profile);
+				currentPaths = DefaultPaths.loadFromProfile(profile);
+	       			updatePreferences(null, currentPreferences);
+	                	statusbar.pop(statusbarContext);
+        	        	statusbar.push(statusbarContext, currentSettings.getStatusbarString(false));
+				window.set_title("moserial - %s".printf(GLib.Path.get_basename(profileFilename)));
+				profileChanged=false;
+			}
+		}
+                dialog.destroy();
+	}
+	
+	private void copy() {
+		if(window.get_focus()==(Gtk.Widget)outgoingAsciiTextView || window.get_focus()==(Gtk.Widget)incomingAsciiTextView || window.get_focus()==(Gtk.Widget)outgoingHexTextView || window.get_focus()==(Gtk.Widget)incomingHexTextView) {
+			TextView tv = (TextView)window.get_focus();
+			tv.buffer.copy_clipboard(Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD));
+		}
+		else if(window.get_focus()==(Gtk.Widget)entry) {
+			entry.copy_clipboard();
+		}
+	}
+	
+	private void cut() {
+		if(window.get_focus()==(Gtk.Widget)entry) {
+			entry.cut_clipboard();
+		}
+	}
+	
+	private void editMenu(Action a) {
+		if(window.get_focus()==(Gtk.Widget)outgoingAsciiTextView || window.get_focus()==(Gtk.Widget)incomingAsciiTextView || window.get_focus()==(Gtk.Widget)outgoingHexTextView || window.get_focus()==(Gtk.Widget)incomingHexTextView) {
+			cutMenuItem.set_sensitive(false);
+			TextView tv = (TextView)window.get_focus();
+			if(tv.buffer.has_selection)
+				copyMenuItem.set_sensitive(true);
+			else
+				copyMenuItem.set_sensitive(false);
+		}
+		else if(window.get_focus()==(Gtk.Widget)entry){
+			int s=0;
+			int e=0;
+			if(entry.get_selection_bounds(s, e)) {
+				cutMenuItem.set_sensitive(true);
+				copyMenuItem.set_sensitive(true);
+			}
+			else {
+				cutMenuItem.set_sensitive(false);
+				copyMenuItem.set_sensitive(false);
+			}
+		}
+		else {
+			cutMenuItem.set_sensitive(false);
+			copyMenuItem.set_sensitive(false);
+		}
+	}
+	
+	private void paste() {
+		entry.paste_clipboard();
+		if (!entry.has_focus) {
+			entry.grab_focus();
+			entry.set_position(-1);
+		}
+	}
+
+	private void clear() {
+                incomingHexTextBuffer.clear();
+                incomingAsciiTextBuffer.set_text("",0);
+                outgoingHexTextBuffer.clear();
+                outgoingAsciiTextBuffer.set_text("",0);
+                entry.set_text("");
+	}
+}
+

Added: trunk/src/MoUtils.vala
==============================================================================
--- (empty file)
+++ trunk/src/MoUtils.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,81 @@
+using GLib;
+public class MoUtils : GLib.Object
+{
+	public static GLib.File newFile (string path) {
+		string uri;
+                if ("://" in path)
+                	uri = path;
+                else
+                        uri = "file://%s".printf(path);
+                return File.new_for_uri(uri);
+	}
+
+	public static bool fileExists (string path) {
+		GLib.File file=newFile(path);
+		return file.query_exists(null);
+	}
+
+	public static int64 fileSize (string path) {
+		GLib.File file=newFile(path);
+		try {
+			GLib.FileInfo info=file.query_info(GLib.FILE_ATTRIBUTE_STANDARD_SIZE,0,null);
+			return info.get_size();
+                } catch (GLib.Error e) {
+                        warning("%s", e.message);
+                }
+		return 0;
+	}
+
+        public static string getParentFolder (string path) {
+                GLib.File file=newFile(path);
+		GLib.File parent=file.get_parent();
+		return parent.get_parse_name();
+        }
+	
+	public static string? getKeyString (Profile profile, string group, string key) {
+		string? result=null;
+                try {
+                        result = profile.keyFile.get_string(group, key);
+                }
+                catch (GLib.KeyFileError e) {
+                        stdout.printf("%s\n", e.message);
+                }
+		return result;
+	}
+
+        public static int getKeyInteger (Profile profile, string group, string key, int default_val) {
+                int result=default_val;
+                try {
+                        result = profile.keyFile.get_integer(group, key);
+                }
+                catch (GLib.KeyFileError e) {
+                        stdout.printf("%s\n", e.message);
+                }
+		return result;
+	}
+
+        public static bool getKeyBoolean (Profile profile, string group, string key, bool default_val) {
+                bool result=default_val;
+                try {
+                        result = profile.keyFile.get_boolean(group, key);
+                }
+                catch (GLib.KeyFileError e) {
+                        stdout.printf("%s\n", e.message);
+                }
+		return result;
+	}
+
+	public static string? getLastMessage (string? messages) {
+		string? message=null;
+		string? escaped=messages.escape("");
+		escaped=InputParser.statusReplace(escaped);
+		string[] splitMessages;
+		splitMessages = escaped.split("\\n", 20);
+		for(int x=0; x<GLib.strv_length(splitMessages); x++) {
+			if(splitMessages[x].length > 5)
+				message=splitMessages[x];
+		}
+		return message;
+	}
+}
+

Added: trunk/src/Preferences.vala
==============================================================================
--- (empty file)
+++ trunk/src/Preferences.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,105 @@
+using GLib;
+public class Preferences : GLib.Object
+{
+	public static bool DEFAULT_USE_SYSTEM_MONOSPACE_FONT=true;
+	public static string DEFAULT_FONT="Monospace 10";
+	public static string DEFAULT_FONT_COLOR="black";
+	public static string DEFAULT_BACKGROUND_COLOR="white";
+	public static string DEFAULT_HIGHLIGHT_COLOR="#2020ff";
+	public static bool DEFAULT_RECORD_LAUNCH=true;
+	
+	public bool useSystemMonospaceFont {get; construct;}
+	public string? font {get; construct;}
+	public string? fontColor {get; construct;}
+	public string? backgroundColor {get; construct;}
+	public string? highlightColor {get; construct;}
+	public bool recordLaunch {get; construct;}
+	public bool enableTimeout {get; construct;}
+	public int timeout {get; construct;}
+	
+	public Preferences (bool useSystemMonospaceFont, string? font, string? fontColor,string? backgroundColor,string? highlightColor, bool recordLaunch, bool enableTimeout, int timeout) {
+		this.useSystemMonospaceFont=useSystemMonospaceFont;
+		this.font=font;
+		this.recordLaunch=recordLaunch;
+		this.fontColor=fontColor;
+		this.backgroundColor=backgroundColor;
+		this.highlightColor=highlightColor;
+		this.enableTimeout=enableTimeout;
+		this.timeout=timeout;
+	}
+	construct {
+		if(font==null)
+			font=DEFAULT_FONT;
+		if(fontColor==null)
+			fontColor=DEFAULT_FONT_COLOR;
+		if(backgroundColor==null)
+			backgroundColor=DEFAULT_BACKGROUND_COLOR;
+		if(highlightColor==null)
+			highlightColor=DEFAULT_HIGHLIGHT_COLOR;
+	}
+	public static string getSystemDefaultMonospaceFont() {
+		string value = "";
+
+                var gc = GConf.Client.get_default ();
+                try {
+                        value = gc.get_string("/desktop/gnome/interface/monospace_font_name");
+                } catch (GLib.Error e) {
+                        warning(_("Unable to retrieve gconf key: %s"), e.message);
+                        value = "Monospace 10";
+                }
+                return value;
+	}
+	public static Gdk.Color getGdkColor(string color) {
+		Gdk.Color c;
+		Gdk.Color.parse(color, out c);
+		return c;
+	}
+	public void toString() {
+		stdout.printf("useSystemMonospaceFont: ");
+		if(useSystemMonospaceFont)
+			stdout.printf("true\n");
+		else
+			stdout.printf("false\n");
+		stdout.printf("font: %s\n", font);
+		stdout.printf("fontColor: %s\n", fontColor);
+		stdout.printf("backgroundColor: %s\n", backgroundColor);
+		stdout.printf("highlightColor: %s\n", highlightColor);
+		stdout.printf("recordLaunch: ");
+		if(recordLaunch)
+			stdout.printf("true\n");
+		else
+			stdout.printf("false\n");
+		
+	}
+	public void saveToProfile(Profile profile) {
+		profile.keyFile.set_boolean("preferences", "use_system_monospace_font", useSystemMonospaceFont);
+		profile.keyFile.set_string("preferences", "font", font);
+		profile.keyFile.set_string("preferences", "font_color", fontColor);
+		profile.keyFile.set_string("preferences", "background_color", backgroundColor);
+		profile.keyFile.set_string("preferences", "highlight_color", highlightColor);
+		profile.keyFile.set_boolean("preferences", "record_launch", recordLaunch);
+		profile.keyFile.set_boolean("preferences", "enable_timeout", enableTimeout);
+		profile.keyFile.set_integer("preferences", "timeout", timeout);
+	}
+	public static Preferences loadFromProfile(Profile profile) {
+		bool useSystemMonospaceFont;
+		string? font=null;
+		string? fontColor=null;
+		string? backgroundColor=null;
+		string? highlightColor=null;
+		bool recordLaunch;
+		bool enableTimeout;
+		int timeout;
+
+		useSystemMonospaceFont = MoUtils.getKeyBoolean(profile, "preferences", "use_system_monospace_font", Preferences.DEFAULT_USE_SYSTEM_MONOSPACE_FONT);
+		font = MoUtils.getKeyString(profile, "preferences", "font");	
+		fontColor = MoUtils.getKeyString(profile, "preferences", "font_color");
+		backgroundColor = MoUtils.getKeyString(profile, "preferences", "background_color");
+		highlightColor = MoUtils.getKeyString(profile, "preferences", "highlight_color");
+		recordLaunch = MoUtils.getKeyBoolean(profile, "preferences", "record_launch", true);
+		enableTimeout = MoUtils.getKeyBoolean(profile, "preferences", "enable_timeout", false);
+		timeout = MoUtils.getKeyInteger(profile, "preferences", "timeout", 30);
+		return new Preferences (useSystemMonospaceFont, font, fontColor, backgroundColor, highlightColor, recordLaunch, enableTimeout, timeout);
+	
+	}
+}

Added: trunk/src/PreferencesDialog.vala
==============================================================================
--- (empty file)
+++ trunk/src/PreferencesDialog.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,129 @@
+using Gtk;
+public class moserial.PreferencesDialog : GLib.Object
+{
+        public Builder builder {get; construct;}
+        private Dialog dialog;
+        private Button discardButton;
+        private Button applyButton;
+        private CheckButton systemFont;
+        private FontButton fontButton;
+        private ColorButton fontColorButton;
+        private ColorButton backgroundColorButton;
+        private ColorButton highlightColorButton;
+        private CheckButton recordLaunch;
+        private CheckButton enableTimeout;
+        private SpinButton timeout;
+        public signal void updatePreferences(Preferences preferences);
+        public PreferencesDialog(Builder builder) {
+                this.builder=builder;
+        }
+        construct {
+                dialog = (Dialog)builder.get_object("preferences_dialog");
+                applyButton = (Button)builder.get_object("preferences_apply");
+                discardButton = (Button)builder.get_object("preferences_discard");
+                systemFont = (CheckButton)builder.get_object("preferences_use_system_font");
+                fontButton = (FontButton)builder.get_object("preferences_font_button");
+                fontColorButton = (ColorButton)builder.get_object("preferences_font_color_button");
+                backgroundColorButton = (ColorButton)builder.get_object("preferences_background_color_button");
+                highlightColorButton = (ColorButton)builder.get_object("preferences_highlight_color_button");
+                recordLaunch = (CheckButton)builder.get_object("preferences_record_launch");
+                enableTimeout = (CheckButton)builder.get_object("preferences_record_enable_timeout");
+                timeout = (SpinButton)builder.get_object("preferences_record_timeout");
+                systemFont.toggled += this.systemFontToggled;
+                enableTimeout.toggled += this.enableTimeoutToggled;
+                applyButton.clicked += apply;
+                discardButton.clicked += discard;
+                dialog.delete_event += hide;
+        }
+        public void apply(Button button) {
+        	hide(button);
+        	bool pSystemFont;
+        	string pFont;
+        	string pFontColor;
+        	string pBackgroundColor;
+        	string pHighlightColor;
+        	bool pRecordLaunch;
+        	bool pEnableTimeout;
+        	int pTimeout;
+		if(systemFont.get_active())
+			pSystemFont=true;
+		else
+			pSystemFont=false;
+		pFont=fontButton.get_font_name();
+		Gdk.Color c;
+		fontColorButton.get_color(out c);
+		pFontColor=c.to_string();
+		backgroundColorButton.get_color(out c);
+		pBackgroundColor=c.to_string();
+		highlightColorButton.get_color(out c);
+		pHighlightColor=c.to_string();
+		if(recordLaunch.get_active())
+			pRecordLaunch=true;
+		else
+			pRecordLaunch=false;
+		if(enableTimeout.get_active())
+			pEnableTimeout=true;
+		else
+			pEnableTimeout=false;
+		pTimeout=(int)timeout.get_value();
+        	Preferences preferences=new Preferences(pSystemFont, pFont, pFontColor,pBackgroundColor,pHighlightColor, pRecordLaunch, pEnableTimeout, pTimeout);
+		this.updatePreferences(preferences);
+        }
+        
+        public void show(Preferences preferences, bool recording) {
+         	if(preferences.useSystemMonospaceFont) {
+        		fontButton.set_sensitive(false);
+        		systemFont.set_active(true);
+        	}
+        	else {
+        	 	fontButton.set_sensitive(true);
+        		systemFont.set_active(false);
+        	}
+        	fontButton.set_font_name(preferences.font);
+        	fontColorButton.set_color(Preferences.getGdkColor(preferences.fontColor));
+        	backgroundColorButton.set_color(Preferences.getGdkColor(preferences.backgroundColor));
+        	highlightColorButton.set_color(Preferences.getGdkColor(preferences.highlightColor));
+        	if(preferences.recordLaunch)
+        		recordLaunch.set_active(true);
+        	else
+	        	recordLaunch.set_active(false);
+        	if(preferences.enableTimeout) {
+        		enableTimeout.set_active(true);
+        		timeout.set_sensitive(true);
+        	}
+        	else {
+	        	enableTimeout.set_active(false);
+        		timeout.set_sensitive(false);
+	        }
+       		if(recording) {
+	        	enableTimeout.set_sensitive(false);
+	        	timeout.set_sensitive(false);
+	        }
+	        else
+		        enableTimeout.set_sensitive(true);
+	        timeout.set_value(preferences.timeout); 		
+                dialog.show_all();
+        }
+        public void discard(Widget w) {
+                //currentPreferences=null;
+                hide(w);
+        }
+        public bool hide(Widget w) {
+                dialog.hide_all();
+                return true;
+        }
+        public void systemFontToggled(CheckButton button)
+        {
+        	if(button.get_active())
+        		fontButton.set_sensitive(false);
+        	else
+	        	fontButton.set_sensitive(true);
+        }
+        public void enableTimeoutToggled(CheckButton button)
+        {
+        	if(button.get_active())
+        		timeout.set_sensitive(true);
+        	else
+	        	timeout.set_sensitive(false);
+        }
+}

Added: trunk/src/Profile.vala
==============================================================================
--- (empty file)
+++ trunk/src/Profile.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,94 @@
+using Gtk;
+
+public class Profile : GLib.Object
+{
+        public KeyFile keyFile;
+        construct {
+                keyFile = new KeyFile();
+        }
+        public void saveWindowSize(int w, int h) {
+                if (w>0)
+                        keyFile.set_integer("window", "width", w);
+                if (h>0)
+                        keyFile.set_integer("window", "height", h);
+        }
+        public void saveWindowPanedPosition(int pos) {
+                keyFile.set_integer("window", "paned_pos", pos);
+        }
+        public int getWindowPanedPosition() {
+                try {
+                        return keyFile.get_integer("window", "paned_pos");
+                } catch (GLib.KeyFileError e) {
+                        return -1;
+                }
+        }
+        public int getWindowWidth() {
+                try {
+                        return keyFile.get_integer("window", "width");
+                } catch (GLib.KeyFileError e) {
+                        return -1;
+                }
+        }
+        public int getWindowHeight() {
+                try {
+                        return keyFile.get_integer("window", "height");
+                } catch (GLib.KeyFileError e) {
+                        return -1;
+                }
+        }
+        public bool load(string? filename, Gtk.Window window) {
+                string f;
+                bool default_profile=false;
+
+                if (filename==null) {
+                        default_profile=true;
+                        f="%s/moserial.conf".printf(GLib.Environment.get_user_config_dir());
+                } else
+                        f=filename;
+                try {
+                        keyFile.load_from_file(f, GLib.KeyFileFlags.NONE);
+                        return true;
+                } catch (GLib.KeyFileError e) {
+                        stdout.printf("%s\n", e.message);
+                        /* try loading the non-broken parts of the profile - return true */
+                        return true;
+                } catch (GLib.FileError e) {
+                        if (!default_profile) {
+                                var errorDialog = new MessageDialog (window, DialogFlags.DESTROY_WITH_PARENT, MessageType.ERROR, ButtonsType.CLOSE, "%s: %s\n%s".printf(_("Error: Could not open file"), filename, e.message));
+                                errorDialog.run();
+                                errorDialog.destroy();
+                        }
+                        return false;
+                }
+        }
+        public void toString() {
+                size_t s;
+                stdout.printf("%s\n", keyFile.to_data(out s));
+        }
+        public void save(string? filename, Gtk.Window window) {
+                GLib.File? file;
+                FileOutputStream? fos;
+                string f;
+		bool default_profile=false;
+                if (filename==null) {
+			default_profile=true;
+                        f="%s/moserial.conf".printf(GLib.Environment.get_user_config_dir());
+		} else
+                        f=filename;
+                file = File.new_for_path(f);
+		try {
+	                size_t s;
+	                string data;
+	                fos = file.replace(null, false, GLib.FileCreateFlags.NONE, null);
+			data = keyFile.to_data(out s);
+			fos.write(data, s, null);
+		} catch (GLib.Error e) {
+			stdout.printf("profile.save error: %s\n", e.message);	
+                        if (!default_profile) {
+                                var errorDialog = new MessageDialog (window, DialogFlags.DESTROY_WITH_PARENT, MessageType.ERROR, ButtonsType.CLOSE, "%s: %s\n%s".printf(_("Error: Could not open file"), filename, e.message));
+                                errorDialog.run();
+                                errorDialog.destroy();
+                        }
+		}
+        }
+}

Added: trunk/src/ReceiveChooserDialog.vala
==============================================================================
--- (empty file)
+++ trunk/src/ReceiveChooserDialog.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,46 @@
+using Gtk;
+public class moserial.ReceiveChooserDialog : GLib.Object
+{
+        public Builder builder {get; construct;}
+        private FileChooserDialog dialog;
+        public ComboBox protocolCombo;
+        signal void startTransfer();
+        public string path;
+        public ReceiveChooserDialog(Builder builder) {
+                this.builder=builder;
+        }
+
+        construct {
+                dialog = (FileChooserDialog)builder.get_object("receive_chooser_dialog");
+                protocolCombo = (ComboBox)builder.get_object("receive_chooser_protocol");
+                dialog.delete_event += hide;
+                dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT, null);
+                protocolCombo.set_active(2);
+                dialog.response += response;
+        }
+
+        public void show(string? folder) {
+                if ((folder != null) && MoUtils.fileExists(folder))
+                        dialog.set_current_folder(folder);
+                dialog.run();
+        }
+
+        public bool hide(Widget w) {
+                dialog.hide();
+                return true;
+        }
+
+        private void response(Widget w, int r){
+        	if(r == Gtk.ResponseType.CANCEL) {
+        		hide(w);
+	        }
+	        else if(r == Gtk.ResponseType.ACCEPT) {
+		        hide(w);
+		        path = dialog.get_current_folder();
+		        startTransfer();
+	        }
+	        else {
+		        //
+	        }	        	
+        }
+}

Added: trunk/src/ReceiveProgressDialog.vala
==============================================================================
--- (empty file)
+++ trunk/src/ReceiveProgressDialog.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,41 @@
+using Gtk;
+public class moserial.ReceiveProgressDialog : GLib.Object
+{
+        public Builder builder {get; construct;}
+        private Dialog dialog;
+        private Button cancelButton;
+        private Gtk.Label status;
+        private ProgressBar progressBar;
+        signal void transferCanceled();
+        public ReceiveProgressDialog(Builder builder) {
+                this.builder=builder;
+        }
+        construct {
+                dialog = (Dialog)builder.get_object("receive_progress_dialog");
+                cancelButton = (Button)builder.get_object("receive_progress_cancel");
+                cancelButton.clicked += this.cancel;
+                status = (Gtk.Label)builder.get_object("receive_statusbox");
+                progressBar = (ProgressBar)builder.get_object("receive_progressbar");
+                dialog.delete_event += hide;
+
+        }
+        public void show() {
+                dialog.show_all();
+                status.set_text("");
+        }
+
+        public bool hide(GLib.Object o) {
+                dialog.hide_all();
+                return true;
+        }
+        
+        public void updateStatus(GLib.Object o, string newStatus) {
+        	status.set_text(newStatus);
+        	progressBar.pulse();
+        }
+        
+        public void cancel(GLib.Object o) {
+        	//TODO: make canceling transfers actually work
+        	transferCanceled();
+        }
+}

Added: trunk/src/RecordDialog.vala
==============================================================================
--- (empty file)
+++ trunk/src/RecordDialog.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,67 @@
+using Gtk;
+public class moserial.RecordDialog : GLib.Object
+{
+        public Builder builder {get; construct;}
+        private FileChooserDialog dialog;
+        private Button cancelButton;
+        private ComboBox streamCombo;
+        public string fileName { get; private set;}
+        public signal void startRecording(string fileName, SerialStreamRecorder.Direction direction);
+        public signal void stopRecording();
+        public SerialStreamRecorder.Direction direction;
+        public RecordDialog(Builder builder) {
+                this.builder=builder;
+        }
+        construct {
+                dialog = (FileChooserDialog)builder.get_object("record_dialog");
+                cancelButton = (Button)builder.get_object("record_cancel");
+                streamCombo = (ComboBox)builder.get_object("record_stream");
+                dialog.delete_event += hide;
+                dialog.response += response;
+                dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_SAVE, Gtk.ResponseType.ACCEPT, null);
+                dialog.set_do_overwrite_confirmation(true);
+		dialog.set_local_only(false);
+                streamCombo.set_active(0);
+                fileName=null;
+        }
+
+        public void show(string? folder) {
+		if ((folder != null) && MoUtils.fileExists(folder))
+			dialog.set_current_folder(folder);
+                dialog.run();
+        }
+
+        public bool hide(Widget w) {
+                dialog.hide();
+                return true;
+        }
+        
+        private void response(Widget w, int r){
+        	if(r == Gtk.ResponseType.CANCEL) {
+        		fileName=null;
+        		hide(w);
+        		stopRecording();
+	        }
+	        else if(r == Gtk.ResponseType.ACCEPT) {
+		        fileName=dialog.get_filename();
+		        switch(streamCombo.get_active())
+		        {
+		        	case 0:
+		        	default:
+		        		direction=SerialStreamRecorder.Direction.INCOMING;
+		        		break;
+		        	case 1:
+		        		direction=SerialStreamRecorder.Direction.OUTGOING;
+		        		break;
+		        	case 2:
+		        		direction=SerialStreamRecorder.Direction.BOTH;
+		        		break;
+		        }
+		        hide(w);
+		        startRecording(this.fileName, direction);
+	        }
+	        else {
+		        stopRecording();
+	        }
+        }
+}

Added: trunk/src/Rzwrapper.vala
==============================================================================
--- (empty file)
+++ trunk/src/Rzwrapper.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,212 @@
+//Class for communicating with the rz program
+public class moserial.Rzwrapper: GLib.Object
+{
+	public enum Protocol {XMODEM, YMODEM, ZMODEM, NULL}
+	public Protocol protocol {get; construct;}
+	public SerialConnection? sc;
+        private IOChannel IOChannelInput;
+        private IOChannel IOChannelOutput;
+        private IOChannel IOChannelError;
+        //int inputChannelId;
+	uint outputChannelId;
+        uint errorChannelId;
+        private GLib.Pid pid;
+        signal void transferComplete();
+        signal void updateStatus(string newStatus);
+        public bool running=false;
+        public string? path {get; construct;}
+        public string filename {get; construct;}
+	public Rzwrapper(Protocol? protocol, SerialConnection? sc, string? p, string? filename) {
+		this.protocol = protocol;
+		this.sc = sc;
+		this.path = p;
+		this.filename = filename;
+	}
+	construct {
+		if(protocol==Protocol.NULL || path==null) {
+			running=false;
+		}
+		else
+		{
+			string[] argv;
+			if(protocol==Protocol.XMODEM)
+				argv = new string[4];
+			else
+				argv = new string[3];
+			argv[0] = "rz";
+			switch(protocol) {
+				case Protocol.XMODEM:
+					argv[1] = "--xmodem";
+					break;
+				case Protocol.YMODEM:
+					argv[1] = "--ymodem";
+					break;
+				case Protocol.ZMODEM:
+				default:
+					argv[1] = "--zmodem";
+					break;
+			
+			}
+			argv[2] = "-vv";
+			if(protocol==Protocol.XMODEM)
+				argv[3]=filename;
+			int output;
+			int error;
+			int input;
+			//size_t bytesRead=0;
+			//char[1000] m_buf = new char[1000];
+		
+			try{
+				Process.spawn_async_with_pipes(path, argv, null, SpawnFlags.SEARCH_PATH, null, out pid, out input, out output, out error);
+				IOChannelOutput = new GLib.IOChannel.unix_new(output);
+				IOChannelInput = new GLib.IOChannel.unix_new(input);
+				IOChannelError = new GLib.IOChannel.unix_new(error);
+				IOChannelOutput.set_encoding(null);
+				IOChannelOutput.set_flags(GLib.IOFlags.NONBLOCK);
+				IOChannelError.set_encoding(null);
+				IOChannelError.set_flags(GLib.IOFlags.NONBLOCK);
+				IOChannelInput.set_encoding(null);
+				//IOChannelInput.set_flags(GLib.IOFlags.NONBLOCK);
+
+				outputChannelId = IOChannelOutput.add_watch(GLib.IOCondition.IN, this.readBytes);
+				errorChannelId = IOChannelError.add_watch(GLib.IOCondition.IN, this.readError);
+				running=true;
+			}
+			catch(GLib.SpawnError e)
+			{
+				running=false;
+				stdout.printf("spawn error: %s\n", e.message);
+				var errorDialog = new Gtk.MessageDialog (null, Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.ERROR, Gtk.ButtonsType.CLOSE, "%s".printf(e.message));
+                        	errorDialog.run();
+                        	errorDialog.destroy();
+			}
+		}
+	}
+	public void writeChar(uchar byte) {
+		if(running)
+		{
+			size_t bytesWritten;
+			char[] b = new char[1];
+			b[0] = (char)byte;
+			try {
+				if(running)
+					IOChannelInput.write_chars(b, out bytesWritten);
+				//if(running)
+				//	IOChannelInput.flush();
+			}
+			catch(GLib.IOChannelError e)
+			{
+				shutdown();
+				stdout.printf("writeChar() %s\n", e.message);
+			}
+			catch(GLib.ConvertError e)
+			{
+				stdout.printf("%s\n", e.message);
+			}
+		}
+	}
+	public void flush()
+	{
+		if(running)
+		{
+			try {
+				if(running)
+					IOChannelInput.flush();
+			}
+			catch(GLib.IOChannelError e)
+			{
+				shutdown();
+				stdout.printf("flush() %s\n", e.message);
+			}
+		}
+	}
+	private bool readError(GLib.IOChannel source, GLib.IOCondition condition) {
+                if(running) {
+		        char[1000] m_buf = new char[1000];
+			string message="";
+			string messages="";
+		        size_t bytesRead=0;
+		        if(!(condition == IOCondition.IN))
+		        	return true;
+		        try {
+			        source.read_chars(m_buf, out bytesRead);
+			}
+			catch (ConvertError e)	        {
+				stdout.printf("readError() %s\n", e.message);
+			}
+			for (int x=0; x<bytesRead; x++) {
+				unichar c = m_buf[x];
+				if(c.isprint() || c.isspace())
+					messages=messages+"%c".printf(m_buf[x]);
+			}
+
+			message = MoUtils.getLastMessage(messages);
+			if(!(message==""))
+				updateStatus(message);
+			if(!(messages.str("Transfer complete")==null)) {
+				shutdown();
+			}
+			if(!(messages.str("Transfer incomplete")==null)) {
+				shutdown();
+			}
+	                return true;
+		}
+		else
+			return false;
+
+        }
+        public void transferCanceled(GLib.Object o) {
+        	//send cancel string to remote client and rz
+        	
+        	if(running) {
+	        	updateStatus("canceled");
+	        	for(int x=0;x<20;x++) {
+	        		if(protocol==Protocol.ZMODEM) {
+			        	sc.sendByte('X'&037);
+			        	writeChar('X'&037);
+		        	}
+		        	else
+		        		sc.sendByte(0x18);
+        		}
+        		GLib.Timeout.add(2000, shutdown_timeout);
+        	}
+        }
+        private bool shutdown_timeout()
+        {
+        	shutdown();
+        	return false;
+        }
+        private void shutdown() {
+        	if(running) {
+	        	running=false;
+			GLib.Source.remove(outputChannelId);
+			GLib.Source.remove(errorChannelId);
+			Process.close_pid(pid);
+			transferComplete();
+		}
+        }
+        private bool readBytes(GLib.IOChannel source, GLib.IOCondition condition) {
+                if(running) {
+		        char[1000] m_buf = new char[1000];
+
+		        size_t bytesRead=0;
+		        if(!(condition == IOCondition.IN))
+		        	return true;
+		        try {
+			        source.read_chars(m_buf, out bytesRead);
+			}
+			catch (ConvertError e)	        {
+				stdout.printf("readBytes() %s\n", e.message);
+			}
+			for (int x=0; x<bytesRead; x++) {
+				sc.sendByte(m_buf[x]);
+				//sendByte(m_buf[x]);
+				//outgoingHexTextBuffer.add(m_buf[x]);
+			}
+		
+		        return true;
+                }
+                else
+                	return false;
+        }
+}

Added: trunk/src/SendChooserDialog.vala
==============================================================================
--- (empty file)
+++ trunk/src/SendChooserDialog.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,45 @@
+using Gtk;
+public class moserial.SendChooserDialog : GLib.Object
+{
+        public Builder builder {get; construct;}
+        private FileChooserDialog dialog;
+        public ComboBox protocolCombo;
+        signal void startTransfer();
+        public string filename;
+        public SendChooserDialog(Builder builder) {
+                this.builder=builder;
+        }
+        construct {
+                dialog = (FileChooserDialog)builder.get_object("send_chooser_dialog");
+                protocolCombo = (ComboBox)builder.get_object("send_chooser_protocol");
+                dialog.delete_event += hide;
+                dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT, null);
+                protocolCombo.set_active(2);
+                dialog.response += response;
+        }
+
+        public void show(string? folder) {
+                if ((folder != null) && MoUtils.fileExists(folder))
+                        dialog.set_current_folder(folder);
+                dialog.run();
+        }
+
+        public bool hide(Widget w) {
+                dialog.hide();
+                return true;
+        }
+
+        private void response(Widget w, int r){
+        	if(r == Gtk.ResponseType.CANCEL) {
+        		hide(w);
+	        }
+	        else if(r == Gtk.ResponseType.ACCEPT) {
+		        hide(w);
+		        filename = dialog.get_filename();
+		        startTransfer();
+	        }
+	        else {
+		        //
+	        }
+        }
+}

Added: trunk/src/SendProgressDialog.vala
==============================================================================
--- (empty file)
+++ trunk/src/SendProgressDialog.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,41 @@
+using Gtk;
+public class moserial.SendProgressDialog : GLib.Object
+{
+        public Builder builder {get; construct;}
+        private Dialog dialog;
+        private Button cancelButton;
+        private Gtk.Label status;
+        private ProgressBar progressBar;
+        signal void transferCanceled();
+        public SendProgressDialog(Builder builder) {
+                this.builder=builder;
+        }
+        construct {
+                dialog = (Dialog)builder.get_object("send_progress_dialog");
+                cancelButton = (Button)builder.get_object("send_progress_cancel");
+                cancelButton.clicked += this.cancel;
+                status = (Gtk.Label)builder.get_object("send_statusbox");
+                progressBar = (ProgressBar)builder.get_object("send_progressbar");
+                dialog.delete_event += hide;
+
+        }
+        public void show() {
+                dialog.show_all();
+                status.set_text(_("Waiting for remote host"));
+        }
+
+        public bool hide(GLib.Object o) {
+                dialog.hide_all();
+                return true;
+        }
+        
+        public void updateStatus(GLib.Object o, string newStatus) {
+        	status.set_text(newStatus);
+        	progressBar.pulse();
+        }
+        
+        public void cancel(GLib.Object o) {
+        	//TODO: make canceling transfers actually work
+        	transferCanceled();
+        }
+}

Added: trunk/src/SerialConnection.vala
==============================================================================
--- (empty file)
+++ trunk/src/SerialConnection.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,277 @@
+public class moserial.SerialConnection : GLib.Object
+{
+        private bool connected;
+	public ulong tx=0;
+	public ulong rx=0;
+	public ulong nonprintable=0;
+	public bool forced_hex_view=false;
+	public bool lastRxCharWasCR=false;
+
+	public string echoReference="";
+	public string echoCompare="";
+
+        private POSIX.Termios newtio;
+        private POSIX.Termios restoretio;
+        private int m_fd=-1;
+        private GLib.IOChannel IOChannelFd;
+        signal void newData(uchar[100] data, int size);
+        private  int flags=0;
+	public enum LineEnd{ CRLF, CR, LF, TAB, NONE }
+	uint? sourceId;
+	bool localEcho;
+        public bool connect (Settings settings) {
+
+                if (settings.accessMode==Settings.AccessMode.READWRITE)
+                        flags=POSIX.File.AccessMode.RDWR;
+                else if (settings.accessMode==Settings.AccessMode.READONLY)
+                        flags=POSIX.File.AccessMode.RDONLY;
+                else
+                        flags=POSIX.File.AccessMode.WRONLY;
+
+                m_fd = POSIX.File.open(settings.device, flags | POSIX.File.FileStatus.NDELAY | POSIX.File.FileStatus.NONBLOCK);
+                if (m_fd<0) {
+                        m_fd=-1;
+                        // TODO display error in gui
+                        return false;
+                }
+                POSIX.Termios.flush(m_fd, POSIX.LineControl.IOFLUSH);
+                int n = POSIX.File.fcntl(m_fd, POSIX.File.FDFlag.GETFL);
+                POSIX.File.fcntl_with_arg(m_fd, POSIX.File.FDFlag.SETFL, n & ~POSIX.File.FileStatus.NDELAY);
+		restoretio.get_attributes(m_fd);
+                applySettings(settings);
+                newtio.set_attribute(m_fd, POSIX.AttributeSelection.NOW);
+
+                connected=true;
+
+                IOChannelFd = new GLib.IOChannel.unix_new(m_fd);
+                sourceId = IOChannelFd.add_watch(GLib.IOCondition.IN, this.readBytes);
+                localEcho=settings.localEcho;
+                return true;
+        }
+        
+        public void sendByte(uchar byte)
+        {
+        	if(connected)
+        	{
+	        	uchar[] b = new uchar[1];
+	        	b[0]=byte;
+	        	size_t x = POSIX.File.write(m_fd, b, 1);
+	        	//POSIX.Termios.drain(m_fd);
+	        	
+			tx=tx+x;
+	        }
+        }
+        
+        public void sendBytes(char[] bytes, size_t size)
+        {
+                if(connected)
+        	{
+        		size_t x = POSIX.File.write(m_fd, bytes, size);
+	        	POSIX.Termios.drain(m_fd);
+			tx=tx+x;
+        	}
+        }
+	public string getLineEnd(int e)
+	{
+		string s;
+
+		switch(e) {
+			case LineEnd.CR: {
+				s = "\r";
+				break;
+			}
+                        case LineEnd.LF: {
+                                s = "\n";
+                                break;
+                        }
+                        case LineEnd.CRLF: {
+                                s = "\r\n";
+                                break;
+                        }
+                        case LineEnd.TAB: {
+                                s = "\t";
+                                break;
+                        }
+                        case LineEnd.NONE:
+			default: {
+				s = "";
+                                break;
+                        }
+		}
+		return s;
+	}
+
+        public void disconnect () {
+        	if(connected) {
+	        	GLib.Source.remove(sourceId);
+	        	sourceId = null;
+	        	try {
+        		IOChannelFd.shutdown(true);
+        		}
+        		catch (GLib.IOChannelError e){
+        			warning("%s", e.message);
+        		}
+	        	IOChannelFd=null;
+	                connected=false;
+			forced_hex_view=false;
+			lastRxCharWasCR=false;
+			tx=rx=nonprintable=0;
+			echoReference="";
+			echoCompare="";
+        	        newtio.set_attribute(m_fd, POSIX.AttributeSelection.NOW);
+        	        POSIX.File.close(m_fd);
+        	}
+        }
+
+        private bool readBytes(GLib.IOChannel source, GLib.IOCondition condition) {
+                uchar[1000] m_buf = new uchar[1000];
+                int bytesRead=(int)POSIX.File.read(m_fd, m_buf, 1000);
+		rx += (ulong) bytesRead;
+                if (bytesRead<0)
+                        return false;
+                newData(m_buf, bytesRead);
+                if(localEcho)
+                	sendBytes((char[])m_buf, bytesRead);
+                return connected;
+        }
+	
+        private void applySettings(Settings settings) {
+                //BaudRate
+                uint baudRate = 0;
+                switch (settings.baudRate) {
+                case 300:
+                        baudRate=POSIX.BaudRate.B300;
+                        break;
+                case 600:
+                        baudRate=POSIX.BaudRate.B600;
+                        break;
+                case 1200:
+                        baudRate=POSIX.BaudRate.B1200;
+                        break;
+                case 2400:
+                        baudRate=POSIX.BaudRate.B2400;
+                        break;
+                case 4800:
+                        baudRate=POSIX.BaudRate.B4800;
+                        break;
+                case 9600:
+                        baudRate=POSIX.BaudRate.B9600;
+                        break;
+                case 19200:
+                        baudRate=POSIX.BaudRate.B19200;
+                        break;
+                case 38400:
+                        baudRate=POSIX.BaudRate.B38400;
+                        break;
+                case 57600:
+                        baudRate=POSIX.BaudRate.B57600;
+                        break;
+                case 115200:
+                        baudRate=POSIX.BaudRate.B115200;
+                        break;
+                case 230400:
+                        baudRate=POSIX.BaudRate.B230400;
+                        break;
+                case 460800:
+                        baudRate=POSIX.BaudRate.B460800;
+                        break;
+                case 576000:
+                        baudRate=POSIX.BaudRate.B576000;
+                        break;
+                case 921600:
+                        baudRate=POSIX.BaudRate.B921600;
+                        break;
+                }
+
+                newtio.set_output_speed(baudRate);
+                newtio.set_input_speed(baudRate);
+
+                //DataBits
+                int dataBits;
+                dataBits = settings.dataBits;
+                // We generate mark and space parity
+                if (settings.dataBits == 7 && (settings.parity==Settings.Parity.MARK || settings.parity==Settings.Parity.SPACE))
+                        dataBits=8;
+
+                switch (dataBits) {
+                case 5:
+                        newtio.c_cflag = (newtio.c_cflag & ~POSIX.ControlMode.CSIZE) | POSIX.ControlMode.CS5;
+                        break;
+                case 6:
+                        newtio.c_cflag = (newtio.c_cflag & ~POSIX.ControlMode.CSIZE) | POSIX.ControlMode.CS6;
+                        break;
+                case 7:
+                        newtio.c_cflag = (newtio.c_cflag & ~POSIX.ControlMode.CSIZE) | POSIX.ControlMode.CS7;
+                        break;
+                case 8:
+                default:
+                        newtio.c_cflag = (newtio.c_cflag & ~POSIX.ControlMode.CSIZE) | POSIX.ControlMode.CS8;
+                        break;
+                }
+                newtio.c_cflag |= POSIX.ControlMode.CLOCAL | POSIX.ControlMode.CREAD;
+
+                //Parity
+                newtio.c_cflag &= ~(POSIX.ControlMode.PARENB | POSIX.ControlMode.PARODD);
+                if (settings.parity==Settings.Parity.EVEN)
+                        newtio.c_cflag |= POSIX.ControlMode.PARENB;
+                else if (settings.parity==Settings.Parity.ODD)
+                        newtio.c_cflag |= (POSIX.ControlMode.PARENB | POSIX.ControlMode.PARODD);
+
+                newtio.c_cflag &= ~POSIX.InputMode.CRTSCTS;
+
+
+                //Stop Bits
+                if (settings.stopBits==2)
+                        newtio.c_cflag |= POSIX.ControlMode.CSTOPB;
+                else
+                        newtio.c_cflag &= ~POSIX.ControlMode.CSTOPB;
+
+                //Input Settings
+                newtio.c_iflag = POSIX.InputMode.IGNBRK;
+
+                //Handshake
+                if (settings.handshake==Settings.Handshake.SOFTWARE || settings.handshake == Settings.Handshake.BOTH)
+                        newtio.c_iflag |= POSIX.InputMode.IXON | POSIX.InputMode.IXOFF;
+                else
+                        newtio.c_iflag &= ~(POSIX.InputMode.IXON | POSIX.InputMode.IXOFF | POSIX.InputMode.IXANY);
+
+                newtio.c_lflag = 0;
+                newtio.c_oflag = 0;
+
+                newtio.c_cc[POSIX.Misc.VTIME]=1;
+                newtio.c_cc[POSIX.Misc.VMIN]=1;
+	
+	
+		//Some other port settings from minicom.
+		
+//		newtio.c_iflag &= ~(IGNBRK | IGNCR | INLCR | ICRNL | IUCLC | IXANY | IXON | IXOFF | INPCK | ISTRIP);
+		//newtio.c_iflag &= ~(POSIX.InputMode.IGNBRK | POSIX.InputMode.IGNCR | POSIX.InputMode.INLCR | POSIX.InputMode.ICRNL | POSIX.InputMode.IXANY | POSIX.InputMode.IXON | POSIX.InputMode.IXOFF | POSIX.InputMode.INPCK | POSIX.InputMode.ISTRIP);
+		//newtio.c_iflag |= (POSIX.InputMode.BRKINT | POSIX.InputMode.IGNPAR);
+		//newtio.c_oflag &= ~POSIX.OutputMode.OPOST;
+		//newtio.c_lflag &= ~(XCASE|ECHONL|NOFLSH);
+		newtio.c_lflag &= ~(POSIX.LocalMode.ECHONL|POSIX.LocalMode.NOFLSH);
+		//newtio.c_lflag &= ~(POSIX.LocalMode.ICANON | POSIX.LocalMode.ISIG | POSIX.LocalMode.ECHO);
+		//newtio.c_cflag |= CREAD;
+		//newtio.c_cc[VTIME] = 5;
+
+                int mcs=0;
+                POSIX.ioctl.ioctl(m_fd, POSIX.ioctl.TIOCMGET, out mcs);
+                mcs |= POSIX.ioctl.TIOCM_RTS;
+                POSIX.ioctl.ioctl(m_fd, POSIX.ioctl.TIOCMSET, out mcs);
+
+                if (settings.handshake == Settings.Handshake.HARDWARE || settings.handshake == Settings.Handshake.BOTH)
+                        newtio.c_cflag |= POSIX.InputMode.CRTSCTS;
+                else
+                        newtio.c_cflag &= ~POSIX.InputMode.CRTSCTS;
+        }
+
+        public string getBytecountbarString() {
+                string r;
+
+		if (nonprintable > 0)
+			r = _("TX: %lu, RX: %lu (%lu unprintable)").printf(tx, rx, nonprintable);
+		else
+			r = _("TX: %lu, RX: %lu").printf(tx, rx);
+                return r;
+        }
+}

Added: trunk/src/SerialStreamRecorder.vala
==============================================================================
--- (empty file)
+++ trunk/src/SerialStreamRecorder.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,71 @@
+using Gtk;
+
+public class moserial.SerialStreamRecorder {
+	private GLib.File? file;
+	private string uri;
+	private bool isOpen=false;
+	private FileOutputStream? fos;
+	public static enum Direction { INCOMING, OUTGOING, BOTH, NULL }
+	private Direction direction;
+	public void open (string filename, Direction direction) throws GLib.Error {
+		try {
+			file = File.new_for_path(filename);
+			fos = file.replace(null, false, GLib.FileCreateFlags.NONE, null);
+			isOpen=true;
+			uri = file.get_uri();
+			this.direction=direction;
+		}
+		catch(GLib.Error e) {
+			isOpen=false;
+			file=null;
+			fos=null;
+			throw e;
+		}
+	}
+	private void write(uchar data) {
+		if(isOpen) {
+			uchar[] o = new uchar[1];
+			o[0]=data;
+			try {
+				fos.write(o, 1, null);
+			}
+			catch(GLib.Error e) {
+				stdout.printf(_("error: %s\n"), e.message);
+				// What should be done here?
+			}
+		}
+	
+	}
+	public void writeOutgoing(uchar data) {
+		if(isOpen && (direction==Direction.OUTGOING || direction==Direction.BOTH))
+			write(data);
+	}
+	public void writeIncoming(uchar data) {
+		if(isOpen && (direction==Direction.INCOMING || direction==Direction.BOTH))
+			write(data);
+	}
+	public void close (bool launch){
+		if(isOpen) {
+			try {
+				fos.flush(null);
+				fos.close(null);
+			}
+			catch(GLib.Error e) {
+				stdout.printf(_("error: %s\n"), e.message);
+				// Error closing the file?
+			}
+
+			/* TODO: allow this feature to be enabled / disabled */
+			if(launch && (MoUtils.fileSize(uri)>0)) {
+				try {
+					show_uri(null, uri,  Gdk.CURRENT_TIME);
+				} catch (GLib.Error e) {
+					warning(_("Unable to launch %s: %s"), uri, e.message);
+				}
+			}
+			fos=null;
+			file = null;
+			isOpen=false;
+		}
+	}
+}

Added: trunk/src/Settings.vala
==============================================================================
--- (empty file)
+++ trunk/src/Settings.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,115 @@
+using GLib;
+
+public class Settings : GLib.Object
+{
+        public enum Parity {NONE, ODD, EVEN, MARK, SPACE}
+        public enum Handshake {NONE, HARDWARE, SOFTWARE, BOTH}
+        public enum AccessMode {READWRITE, READONLY, WRITEONLY}
+        public static string DEFAULT_DEVICEFILE = "/dev/ttyS0";
+        public static int DEFAULT_BAUDRATE = 1200;
+        public static int DEFAULT_DATABITS = 8;
+        public static int DEFAULT_STOPBITS = 1;
+        public static Parity DEFAULT_PARITY = Parity.NONE;
+        public static Handshake DEFAULT_HANDSHAKE = Handshake.HARDWARE;
+        public static AccessMode DEFAULT_ACCESSMODE = AccessMode.READWRITE;
+        public static bool DEFAULT_LOCAL_ECHO = false;
+        public string? device {get; construct;}
+        public int baudRate {get; construct;}
+        public int dataBits {get; construct;}
+        public int stopBits {get; construct;}
+        public Parity parity {get; construct;}
+        public Handshake handshake {get; construct;}
+        public AccessMode accessMode {get; construct;}
+        public bool localEcho {get; construct;}
+        public Settings(string? device, int baudRate, int dataBits, int stopBits, Parity parity, Handshake handshake, AccessMode accessMode, bool localEcho) {
+                this.device = device;
+                this.baudRate = baudRate;
+                this.dataBits = dataBits;
+                this.stopBits = stopBits;
+                this.parity = parity;
+                this.handshake = handshake;
+                this.accessMode = accessMode;
+                this.localEcho = localEcho;
+        }
+        construct {
+                if (device==null)
+                        device = DEFAULT_DEVICEFILE;
+                if (baudRate==0)
+                        baudRate = DEFAULT_BAUDRATE;
+                if (dataBits==0)
+                        dataBits = DEFAULT_DATABITS;
+                if (stopBits==0)
+                        stopBits = DEFAULT_STOPBITS;
+        }
+
+        public string parityToChar() {
+                switch (parity) {
+                case Parity.NONE: {
+			/* TRANSLATORS: first letter of "None", a serial port parity setting */
+                        return _("N");
+                }
+                case Parity.ODD: {
+			/* TRANSLATORS: first letter of "Odd", a serial port parity setting */
+                        return _("O");
+                }
+                case Parity.EVEN: {
+			/* TRANSLATORS: first letter of "Even", a serial port parity setting */
+                        return _("E");
+                }
+                case Parity.MARK: {
+			/* TRANSLATORS: first letter of "Mark", a serial port parity setting */
+                        return _("M");
+                }
+                case Parity.SPACE: {
+			/* TRANSLATORS: first letter of "Space", a serial port parity setting */
+                        return _("S");
+                }
+                }
+                return "?";
+        }
+
+        public string getStatusbarString(bool open) {
+                string r;
+                r="%s".printf(device);
+                if (open)
+                        r=r+" "+_("OPEN")+" ";
+                else r=r+" "+_("CLOSED")+" ";
+                r=r+"%i,%i%s%i".printf(baudRate, dataBits, parityToChar(), stopBits);
+                return r;
+        }
+        
+        public void saveToProfile(Profile profile) {
+        	profile.keyFile.set_string("port_settings", "device", device);
+	       	profile.keyFile.set_integer("port_settings", "baud_rate", baudRate);
+	       	profile.keyFile.set_integer("port_settings", "data_bits", dataBits);
+	       	profile.keyFile.set_integer("port_settings", "stop_bits", stopBits);
+	       	profile.keyFile.set_integer("port_settings", "parity", parity);
+	       	profile.keyFile.set_integer("port_settings", "handshake", handshake);
+	       	profile.keyFile.set_integer("port_settings", "access_mode", accessMode);
+	       	profile.keyFile.set_boolean("port_settings", "local_echo", localEcho);
+        }
+        
+        public static Settings loadFromProfile(Profile profile) {
+       		string? device=Settings.DEFAULT_DEVICEFILE;
+        	int baudRate;
+        	int dataBits;
+        	int stopBits;
+        	Parity parity;
+        	Handshake handshake;
+        	AccessMode accessMode;
+		bool localEcho;
+
+		device = MoUtils.getKeyString(profile, "port_settings", "device");	
+		baudRate = MoUtils.getKeyInteger(profile, "port_settings", "baud_rate", Settings.DEFAULT_BAUDRATE);
+		dataBits = MoUtils.getKeyInteger(profile, "port_settings", "data_bits", Settings.DEFAULT_DATABITS);
+		stopBits = MoUtils.getKeyInteger(profile, "port_settings", "stop_bits", Settings.DEFAULT_STOPBITS);
+		parity = (Settings.Parity)MoUtils.getKeyInteger(profile, "port_settings", "parity", Settings.DEFAULT_PARITY);
+		handshake = (Settings.Handshake)MoUtils.getKeyInteger(profile, "port_settings", "handshake", Settings.DEFAULT_HANDSHAKE);
+		accessMode = (Settings.AccessMode)MoUtils.getKeyInteger(profile, "port_settings", "access_mode", Settings.DEFAULT_ACCESSMODE);
+		localEcho = MoUtils.getKeyBoolean(profile, "port_settings", "local_echo", Settings.DEFAULT_LOCAL_ECHO);
+
+		return new Settings(device, baudRate, dataBits, stopBits, parity, handshake, accessMode, localEcho);
+	
+	}
+        
+}

Added: trunk/src/SettingsDialog.vala
==============================================================================
--- (empty file)
+++ trunk/src/SettingsDialog.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,190 @@
+using Gtk;
+using GLib;
+
+public class moserial.SettingsDialog : GLib.Object
+{
+	// Does anyone have more than 32 serial ports?
+	const int max_devices = 32;
+
+        public Builder builder {get; construct;}
+        private Settings currentSettings;
+        private Dialog dialog;
+        private Button discardButton;
+        private Button applyButton;
+        private Settings settings;
+        private ComboBoxEntry deviceCombo;
+        private ComboBox baudRateCombo;
+        private ComboBox dataBitsCombo;
+        private ComboBox stopBitsCombo;
+        private ComboBox parityCombo;
+        private CheckButton hardwareHandshake;
+        private CheckButton softwareHandshake;
+        private ComboBox accessModeCombo;
+        private CheckButton localEcho;
+        public signal void updateSettings(Settings settings);
+        public SettingsDialog(Builder builder) {
+                this.builder=builder;
+        }
+
+        construct {
+                dialog = (Dialog)builder.get_object("settings_dialog");
+                discardButton = (Button)builder.get_object("settings_discard_button");
+                applyButton = (Button)builder.get_object("settings_apply_button");
+
+                deviceCombo = (ComboBoxEntry)builder.get_object("settings_device");
+                baudRateCombo = (ComboBox)builder.get_object("settings_baud_rate");
+                dataBitsCombo = (ComboBox)builder.get_object("settings_data_bits");
+                stopBitsCombo = (ComboBox)builder.get_object("settings_stop_bits");
+                parityCombo = (ComboBox)builder.get_object("settings_parity");
+                hardwareHandshake = (CheckButton)builder.get_object("settings_hardware_handshake");
+                softwareHandshake = (CheckButton)builder.get_object("settings_software_handshake");
+                accessModeCombo = (ComboBox)builder.get_object("settings_open_for");
+                localEcho = (CheckButton)builder.get_object("settings_local_echo");
+                dialog.delete_event += hide;
+                discardButton.clicked += this.discard;
+                applyButton.clicked += this.apply;
+                
+		populateDevices();
+
+        }
+
+        private void populateDevices(){
+                var ls = new ListStore(2, typeof(string), typeof(string));
+                
+                deviceCombo.set_model(ls);
+                deviceCombo.set_text_column(1);
+                TreeIter iter;
+	
+		for (int i = 0; i < max_devices; i++) {
+			string dev = "/dev/ttyS%d".printf(i);
+			if (FileUtils.test (dev, FileTest.EXISTS)) {
+		 		ls.append(out iter);
+        		        ls.set(iter, 0, "", 1, dev, -1);
+			}
+		}
+                
+                for (int i = 0; i < max_devices; i++) {
+                        string dev = "/dev/ttyUSB%d".printf(i);
+                        if (FileUtils.test (dev, FileTest.EXISTS)) {
+	                        ls.append(out iter);
+        	                ls.set(iter, 0, "", 1, dev, -1);
+			}
+                }
+                
+        }
+
+        public void show(Settings settings) {
+                this.currentSettings = settings;
+                loadSettings();
+                dialog.show_all();
+        }
+
+        // Load the current settings into the dialog
+        public void loadSettings() {
+                TreeModel t;
+                TreeIter ti;
+                bool success;
+                
+                //Device
+                t = deviceCombo.get_model();
+                success = t.get_iter_first(out ti);
+                while (success) {
+                        Value str_data;
+                        t.get_value(ti, 1, out str_data);
+                        if (str_data.get_string()==currentSettings.device)
+                                deviceCombo.set_active_iter(ti);
+                        success = t.iter_next (ref ti);
+                }
+
+                //Baud Rate
+                t = baudRateCombo.get_model();
+                success = t.get_iter_first(out ti);
+                while (success) {
+                        Value str_data;
+                        t.get_value(ti, 0, out str_data);
+                        if (str_data.get_string()=="%i".printf(currentSettings.baudRate))
+                                baudRateCombo.set_active_iter(ti);
+                        success = t.iter_next (ref ti);
+                }
+
+                //Data Bits
+                t = dataBitsCombo.get_model();
+                success = t.get_iter_first(out ti);
+                while (success) {
+                        Value str_data;
+                        t.get_value(ti, 0, out str_data);
+                        if (str_data.get_string()=="%i".printf(currentSettings.dataBits))
+                                dataBitsCombo.set_active_iter(ti);
+                        success = t.iter_next (ref ti);
+                }
+
+                //Stop Bits
+                t = stopBitsCombo.get_model();
+                success = t.get_iter_first(out ti);
+                while (success) {
+                        Value str_data;
+                        t.get_value(ti, 0, out str_data);
+                        if (str_data.get_string()=="%i".printf(currentSettings.stopBits))
+                                stopBitsCombo.set_active_iter(ti);
+                        success = t.iter_next (ref ti);
+                }
+
+		parityCombo.set_active((int)currentSettings.parity);
+		accessModeCombo.set_active((int)currentSettings.accessMode);
+
+                hardwareHandshake.set_active(false);
+                softwareHandshake.set_active(false);
+                if (currentSettings.handshake==Settings.Handshake.BOTH || currentSettings.handshake==Settings.Handshake.HARDWARE)
+                        hardwareHandshake.set_active(true);
+                if (currentSettings.handshake==Settings.Handshake.BOTH || currentSettings.handshake==Settings.Handshake.SOFTWARE)
+                        softwareHandshake.set_active(true);
+                if(currentSettings.localEcho)
+                	localEcho.set_active(true);
+                else
+                	localEcho.set_active(false);
+        }
+
+        public bool hide(Widget w) {
+                dialog.hide_all();
+                return true;
+        }
+
+        public void discard(Widget w) {
+                currentSettings=null;
+                hide(w);
+        }
+
+        public void apply(Widget w) {
+
+                string device;
+                int baudRate;
+                int dataBits;
+                int stopBits;
+                Settings.Parity parity;
+                Settings.Handshake handshake;
+                Settings.AccessMode accessMode;
+                bool pLocalEcho;
+                device = deviceCombo.get_active_text();
+                baudRate = baudRateCombo.get_active_text().to_int();
+                dataBits = dataBitsCombo.get_active_text().to_int();
+                stopBits = stopBitsCombo.get_active_text().to_int();
+
+		/* Glade choices must be in same order as Settings enums */
+                parity = (Settings.Parity)parityCombo.get_active();
+                accessMode = (Settings.AccessMode)accessModeCombo.get_active();
+
+                if (hardwareHandshake.get_active() && softwareHandshake.get_active())
+                        handshake=Settings.Handshake.BOTH;
+                else if (hardwareHandshake.get_active())
+                        handshake=Settings.Handshake.HARDWARE;
+                else if (softwareHandshake.get_active())
+                        handshake=Settings.Handshake.SOFTWARE;
+                else
+                        handshake=Settings.Handshake.NONE;
+		pLocalEcho = localEcho.get_active();
+                settings = new Settings(device, baudRate, dataBits, stopBits, parity, handshake, accessMode, pLocalEcho);
+                currentSettings = settings;
+                this.updateSettings(currentSettings);
+                this.hide(w);
+        }
+}

Added: trunk/src/Szwrapper.vala
==============================================================================
--- (empty file)
+++ trunk/src/Szwrapper.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,205 @@
+//Class for communicating with the sz program
+public class moserial.Szwrapper: GLib.Object
+{
+	public enum Protocol {XMODEM, YMODEM, ZMODEM, RAW, NULL}
+	public Protocol protocol {get; construct;}
+	public SerialConnection? sc;
+        private IOChannel IOChannelInput;
+        private IOChannel IOChannelOutput;
+        private IOChannel IOChannelError;
+        //int inputChannelId;
+	uint outputChannelId;
+        uint errorChannelId;
+        private GLib.Pid pid;
+        signal void transferComplete();
+        signal void updateStatus(string newStatus);
+        public bool running=false;
+        
+        public string filename {get; construct;}
+	public Szwrapper(Protocol? protocol, SerialConnection? sc, string? filename) {
+		this.protocol = protocol;
+		this.sc = sc;
+		this.filename = filename;
+	}
+	construct {
+		if(protocol==Protocol.NULL || filename==null) {
+			running=false;
+		}
+		else
+		{
+			string[] argv;
+			if(protocol == Protocol.RAW) {
+				argv = new string[2];
+				argv[0] = "cat";
+				argv[1] = filename;
+			}
+			else {
+				argv = new string[4];
+				argv[0] = "sz";
+				switch(protocol) {
+					case Protocol.XMODEM:
+						argv[1] = "--xmodem";
+						break;
+					case Protocol.YMODEM:
+						argv[1] = "--ymodem";
+						break;
+					case Protocol.ZMODEM:
+					default:
+						argv[1] = "--zmodem";
+						break;
+			
+				}
+				argv[2] = "-vv";
+				argv[3] = filename;
+			}
+			int output;
+			int error;
+			int input;
+			//size_t bytesRead=0;
+			//char[1000] m_buf = new char[1000];
+		
+			try{
+				Process.spawn_async_with_pipes(null, argv, null, SpawnFlags.SEARCH_PATH, null, out pid, out input, out output, out error);
+
+				IOChannelOutput = new GLib.IOChannel.unix_new(output);
+				IOChannelInput = new GLib.IOChannel.unix_new(input);
+				IOChannelError = new GLib.IOChannel.unix_new(error);
+				IOChannelOutput.set_encoding(null);
+				IOChannelOutput.set_flags(GLib.IOFlags.NONBLOCK);
+				IOChannelError.set_encoding(null);
+				IOChannelError.set_flags(GLib.IOFlags.NONBLOCK);
+				IOChannelInput.set_encoding(null);
+				//IOChannelInput.set_flags(GLib.IOFlags.NONBLOCK);
+
+				outputChannelId = IOChannelOutput.add_watch(GLib.IOCondition.IN, this.readBytes);
+				errorChannelId = IOChannelError.add_watch(GLib.IOCondition.IN, this.readError);
+				running=true;
+			}
+		
+			catch(GLib.SpawnError e)
+			{
+				running=false;
+				stdout.printf("spawn error: %s\n", e.message);
+				var errorDialog = new Gtk.MessageDialog (null, Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.ERROR, Gtk.ButtonsType.CLOSE, "%s".printf(e.message));
+                        	errorDialog.run();
+                        	errorDialog.destroy();
+			}
+		}
+	}
+	public void writeChar(uchar byte) {
+		if(running)
+		{
+			size_t bytesWritten;
+			char[] b = new char[1];
+			b[0] = (char)byte;
+			try {
+				if(running)
+					IOChannelInput.write_chars(b, out bytesWritten);
+				if(running)
+					IOChannelInput.flush();
+			}
+			catch(GLib.IOChannelError e)
+			{
+				shutdown();
+				stdout.printf("writeChar() %s\n", e.message);
+			}
+			catch(GLib.ConvertError e)
+			{
+				stdout.printf("%s\n", e.message);
+			}
+		}
+	}
+	private bool readError(GLib.IOChannel source, GLib.IOCondition condition) {
+                while(Gtk.events_pending() || Gdk.events_pending())
+        		Gtk.main_iteration_do(true);
+        	if(running) {
+        	
+                	char[1000] m_buf = new char[1000];
+			string messages="";
+			string message="";
+        	        size_t bytesRead=0;
+	                if(!(condition == IOCondition.IN))
+        	        	return true;
+		        try {
+			        source.read_chars(m_buf, out bytesRead);
+			}
+			catch (ConvertError e)	        {
+				stdout.printf("%s\n", e.message);
+			}
+			for (int x=0; x<bytesRead; x++) {
+				unichar c = m_buf[x];
+				if(c.isprint() || c.isspace())
+					messages=messages+"%c".printf(m_buf[x]);
+			}
+			message = MoUtils.getLastMessage(messages);
+			if(!(message==""))
+				updateStatus(message);
+			if(!(messages.str("Transfer complete")==null)) {
+				GLib.Timeout.add(2000, shutdown_timeout); //Wait 2 seconds for for the final remote packet to get ackd
+				//shutdown();
+			}
+			if(!(messages.str("Transfer incomplete")==null)) {
+				shutdown();
+			}
+		        return true;
+		}
+		else
+			return false;
+        }
+ 
+        public void transferCanceled(GLib.Object o) {
+        	//send cancel string to remote client and rz
+        	
+        	if(running) {
+	        	updateStatus(_("canceled"));
+	        	if(protocol==Protocol.XMODEM || protocol==Protocol.YMODEM || protocol==Protocol.ZMODEM) {
+		        	for(int x=0;x<20;x++) {
+					if(protocol==Protocol.ZMODEM) {
+						sc.sendByte('X'&037);
+						writeChar('X'&037);
+					}
+					else
+						sc.sendByte(0x18);
+        			}
+        		}
+        		if(protocol==Protocol.XMODEM || protocol==Protocol.YMODEM || protocol==Protocol.RAW)
+        			shutdown();
+        	}
+        }
+        private bool shutdown_timeout()
+        {
+        	shutdown();
+        	return false;
+        }
+        private void shutdown() {
+	        if(running) {
+			running=false;
+			GLib.Source.remove(outputChannelId);
+			GLib.Source.remove(errorChannelId);
+			Process.close_pid(pid);
+			transferComplete();
+		}
+        }
+        private bool readBytes(GLib.IOChannel source, GLib.IOCondition condition) {
+		while(Gtk.events_pending() || Gdk.events_pending())
+			Gtk.main_iteration_do(true);
+	         if(running) {
+
+		        char[1024] m_buf = new char[1024];
+
+		        size_t bytesRead=0;
+		        if(!(condition == IOCondition.IN))
+		        	return true;
+		        try {
+			        source.read_chars(m_buf, out bytesRead);
+			}
+			catch (ConvertError e) {
+				stdout.printf("%s\n", e.message);
+			}
+			sc.sendBytes(m_buf, bytesRead);
+			return true;
+		}
+                else
+                	return false;
+        }
+}

Added: trunk/src/XmodemFilenameDialog.vala
==============================================================================
--- (empty file)
+++ trunk/src/XmodemFilenameDialog.vala	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,32 @@
+using Gtk;
+public class moserial.XmodemFilenameDialog : GLib.Object
+{
+        public Builder builder {get; construct;}
+        private Dialog dialog;
+	private Gtk.Entry xmodemFilename;
+	public string filename;
+        public XmodemFilenameDialog(Builder builder) {
+                this.builder=builder;
+        }
+	construct {
+		dialog = (Dialog)builder.get_object("xmodem_filename_dialog");
+		xmodemFilename = (Gtk.Entry)builder.get_object("xmodem_filename");
+		dialog.delete_event += hide;
+                dialog.response += response;
+	}
+	public void show() {
+                dialog.run();
+        }
+
+        public bool hide(Widget w) {
+                dialog.hide();
+                return true;
+        }
+        
+        private void response(Widget w, int r){
+        	filename = xmodemFilename.get_text();
+		hide(w);
+		if(filename=="")
+			filename="xmodem.file";
+        }
+}

Added: trunk/src/posix.vapi
==============================================================================
--- (empty file)
+++ trunk/src/posix.vapi	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,746 @@
+/* posix.vapi
+ *
+ * Copyright (C) 2008  Emmanuele Bassi
+ * Copyright (C) 2008  Matias De la Puente
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library 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
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+ *
+ * Authors:
+ * 	Matias De la Puente <mfpuente ar gmail com>
+ *  Emmanuele Bassi
+ */
+
+namespace POSIX
+{
+	[CCode (cname = "assert", cheader_filename = "assert.h")]
+	public static void assert (string expresion);
+	
+	
+	[CCode (lower_case_cprefix = "", cheader_filename = "ctype.h")]
+	namespace CType
+	{
+		public static int digittoint (int c);
+		public static bool isalnum (int c);
+		public static bool isalpha (int c);
+		public static bool isascii (int c);
+		public static bool iscntrl (int c);
+		public static bool isdigit (int c);
+		public static bool isgraph (int c);
+		public static bool ishexnumber (int c);
+		public static bool isideogram (int c);
+		public static bool islower (int c);
+		public static bool isnumber (int c);
+		public static bool isphonogram (int c);
+		public static bool isspecial (int c);
+		public static bool isprint (int c);
+		public static bool ispunct (int c);
+		public static bool isrune (int c);
+		public static bool isspace (int c);
+		public static bool isupper (int c);
+		public static bool isxdigit (int c);
+		public static int toascii (int c);
+		public static int tolower (int c);
+		public static int toupper (int c);
+	}
+	
+	
+	[CCode (cname = "dirent", cheader_filename = "dirent.h")]
+	public struct Dirent
+	{
+		public ulong d_ino;
+		public long d_off;
+		public ushort d_reclen;
+		public weak string d_name;
+	}
+		
+	[Compact]
+	[CCode (cname = "DIR", free_function = "closedir", cheader_filename = "dirent.h")]
+	public class Directory
+	{
+		[CCode (cname = "opendir")]
+		public static Directory open (string name);
+		[CCode (cname = "readdir")]
+		public Dirent read ();
+		[CCode (cname = "rewinddir")]
+		public Dirent rewind ();
+		[CCode (cname = "seekdir")]
+		public void seek (long offset);
+		[CCode (cname = "telldir")]
+		public long tell ();
+		[CCode (cname = "dirfd")]
+		public int get_fd ();
+	}
+
+	
+	[CCode (lower_case_cprefix = "", cheader_filename = "errno.h")]
+	namespace Error
+	{
+		// see errno(3)
+		public const int E2BIG;
+		public const int EACCESS;
+		public const int EADDRINUSE;
+		public const int EADDRNOTAVAIL;
+		public const int EAFNOSUPPORT;
+		public const int EAGAIN;
+		public const int EALREADY;
+		public const int EBADE;
+		public const int EBADF;
+		public const int EBADFD;
+		public const int EBADMSG;
+		public const int EBADR;
+		public const int EBADRQC;
+		public const int EBADSLT;
+		public const int EBUSY;
+		public const int ECANCELED;
+		public const int ECHILD;
+		public const int ECHRNG;
+		public const int ECOMM;
+		public const int ECONNABORTED;
+		public const int ECONNREFUSED;
+		public const int ECONNRESET;
+		public const int EDEADLK;
+		public const int EDEADLOCK;
+		public const int EDESTADDRREQ;
+		public const int EDOM;
+		public const int EDQUOT;
+		public const int EEXIST;
+		public const int EFAULT;
+		public const int EFBIG;
+		public const int EHOSTDOWN;
+		public const int EHOSTUNREACH;
+		public const int EIDRM;
+		public const int EILSEQ;
+		public const int EINPROGRESS;
+		public const int EINTR;
+		public const int EINVAL;
+		public const int EIO;
+		public const int EISCONN;
+		public const int EISDIR;
+		public const int EISNAM;
+		public const int EKEYEXPIRED;
+		public const int EKEYREJECTED;
+		public const int EKEYREVOKED;
+		public const int EL2HLT;
+		public const int EL2NSYNC;
+		public const int EL3HLT;
+		public const int EL3RST;
+		public const int ELIBACC;
+		public const int ELIBBAD;
+		public const int ELIBMAX;
+		public const int ELIBSCN;
+		public const int ELIBEXEC;
+		public const int ELOOP;
+		public const int EMEDIUMTYPE;
+		public const int EMFILE;
+		public const int EMLINK;
+		public const int EMSGSIZE;
+		public const int EMULTIHOP;
+		public const int ENAMETOOLONG;
+		public const int ENETDOWN;
+		public const int ENETRESET;
+		public const int ENETUNREACH;
+		public const int ENFILE;
+		public const int ENOBUFS;
+		public const int ENODATA;
+		public const int ENODEV;
+		public const int ENOENT;
+		public const int ENOEXEC;
+		public const int ENOKEY;
+		public const int ENOLCK;
+		public const int ENOLINK;
+		public const int ENOMEDIUM;
+		public const int ENOMEM;
+		public const int ENOMSG;
+		public const int ENONET;
+		public const int ENOPKG;
+		public const int ENOPROTOOPT;
+		public const int ENOSPC;
+		public const int ENOSR;
+		public const int ENOSTR;
+		public const int ENOSYS;
+		public const int ENOTBLK;
+		public const int ENOTCONN;
+		public const int ENOTDIR;
+		public const int ENOTEMPTY;
+		public const int ENOTSOCK;
+		public const int ENOTSUP;
+		public const int ENOTTY;
+		public const int ENOTUNIQ;
+		public const int ENXIO;
+		public const int EOPNOTSUPP;
+		public const int EOVERFLOW;
+		public const int EPERM;
+		public const int EPFNOSUPPORT;
+		public const int EPIPE;
+		public const int EPROTO;
+		public const int EPROTONOSUPPORT;
+		public const int EPROTOTYPE;
+		public const int ERANGE;
+		public const int EREMCHG;
+		public const int EREMOTE;
+		public const int EREMOTEIO;
+		public const int ERESTART;
+		public const int EROFS;
+		public const int ESHUTDOWN;
+		public const int ESPIPE;
+		public const int ESOCKTNOSUPPORT;
+		public const int ESRCH;
+		public const int ESTALE;
+		public const int ESTRPIPE;
+		public const int ETIME;
+		public const int ETIMEDOUT;
+		public const int ETXTBSY;
+		public const int EUCLEAN;
+		public const int EUNATCH;
+		public const int EUSERS;
+		public const int EWOULDBLOCK;
+		public const int EXDEV;
+		public const int EXFULL;
+
+		// this is a const int because you're only supposed to copy
+		// the errno value, not change it
+		public const int errno;
+
+		[CCode (cname = "strerror")]
+		public static weak string to_string (int err_no);
+
+		[CCode (cname = "perror")]
+		public static void print_error (string? prefix = null);
+	}
+	
+	
+	[CCode (cheader_filename = "fcntl.h,unistd.h")]
+	namespace File
+	{
+		[CCode (lower_case_cprefix = "F_")]
+		namespace FDFlag
+		{
+			public const int DUPFD;
+			public const int DUP2FD;
+			public const int GETFD;
+			public const int SETFD;
+			public const int GETFL;
+			public const int SETFL;
+			public const int GETOWN;
+			public const int SETOWN;
+			public const int GETSIG;
+			public const int SETSIG;
+			public const int FREESP;
+			public const int GETLK;
+			public const int GETLK64;
+			public const int SETLK;
+			public const int SETLK64;
+			public const int SETLKW;
+			public const int SETLKW64;
+			public const int SHARE;
+			public const int UNSHARE;
+			// linux 2.4 onwards
+			public const int GETLEASE;
+			public const int SETLEASE;
+			public const int RDLCK;
+			public const int WRLCK;
+			public const int UNLCK;
+			public const int NOTIFY;
+		}
+		
+		[CCode (lower_case_cprefix = "DN_")]
+		namespace NotifyMask
+		{
+			public const int ACCESS;
+			public const int MODIFY;
+			public const int CREATE;
+			public const int DELETE;
+			public const int RENAME;
+			public const int ATTRIB;
+			public const int MULTISHOT;
+		}
+		
+		[CCode (lower_case_cprefix = "O_")]
+		namespace AccessMode
+		{
+			public const int ACCMODE;
+			public const int RDONLY;
+			public const int WRONLY;
+			public const int RDWR;
+		}
+		
+		[CCode (lower_case_cprefix = "O_")]
+		namespace FileCreation
+		{
+			public const int CREAT;
+			public const int EXCL;
+			public const int NOCTTY;
+			public const int TRUNC;
+			public const int XATTR;
+		}
+		
+		[CCode (lower_case_cprefix = "O_")]
+		namespace FileStatus
+		{
+			public const int APPEND;
+			public const int ASYNC;
+			public const int DIRECT;
+			public const int DIRECTORY;
+			public const int DSYNC;
+			public const int LARGEFILE;
+			public const int NOATIME;
+			public const int NOFOLLOW;
+			public const int NONBLOCK;
+			public const int NDELAY;
+			public const int RSYNC;
+			public const int SYNC;
+		}
+		
+		[CCode (lower_case_cprefix = "S_")]
+		namespace FileMode
+		{
+			public const ulong IRWXU;
+			public const ulong IRUSR;
+			public const ulong IWUSR;
+			public const ulong IXUSR;
+			public const ulong IRWXG;
+			public const ulong IRGRP;
+			public const ulong IWGRP;
+			public const ulong IXGRP;
+			public const ulong IRWXO;
+			public const ulong IROTH;
+			public const ulong IWOTH;
+			public const ulong IXOTH;
+		}
+		
+		[CCode (cname = "flock")]
+		public struct FLock
+		{
+			public short l_type;
+			public short l_whence;
+			public long l_start;
+			public long l_len;
+			public long l_pid;
+		}
+		
+		[CCode (cname = "iovec", cheader_filename = "sys/uio.h")]
+		public struct IOVector
+		{
+			public void* iov_base;
+			public size_t iov_len;
+		}
+		
+		[CCode (cname = "fcntl")]
+		public static int fcntl (int fd, int cmd);
+		[CCode (cname = "fcntl")]
+		public static int fcntl_with_arg (int fd, int cmd, ulong arg);
+		[CCode (cname = "fcntl")]
+		public static int fcntl_with_flock (int fd, int cmd, FLock @lock);
+		[CCode (cname = "open")]
+		public static int open (string pathname, int flags, ulong mode = 0);
+		[CCode (cname = "creat")]
+		public static int creat (string pathname, ulong mode);
+		[CCode (cname = "openat")]
+		public static int open_at (int dirfd, string pathname, int flags, ulong mode = 0);
+		[CCode (cname = "read")]
+		public static ssize_t read (int fd, void* buf, size_t nbyte);
+		[CCode (cname = "pread")]
+		public static ssize_t pread (int fd, void* buf, size_t nbyte, long offset);
+		[CCode (cname = "readv", cheader_filename = "sys/uio.h")]
+		public static int read_vector (int fd, IOVector vector, size_t count);
+		[CCode (cname = "write")]
+		public static ssize_t write (int fd, void* buf, size_t nbyte);
+		[CCode (cname = "pwrite")]
+		public static ssize_t pwrite (int fd, void* buf, size_t nbyte, long offset);
+		[CCode (cname = "writev", cheader_filename = "sys/uio.h")]
+		public static int write_vector (int fd, IOVector vector, size_t count);
+		[CCode (cname = "close")]
+		public static int close (int fd);
+	}
+
+	
+	[CCode (lower_case_cprefix = "", cheader_filename = "fenv.h")]
+	namespace FloatEnv
+	{
+		[CCode (cname = "fenv_t")]
+		public struct FloatEnv { }
+		
+		public static int feclearexcept (int excepts);
+		public static int fegetexceptflag (out ushort flagp, int excepts);
+		public static int feraiseexcept (int excepts);
+		public static int fesetexceptflag (ref ushort flagp, int excepts);
+		public static int fetestexcept (int excepts);
+		public static int fegetround ();
+		public static int fesetround (int rounding_mode);
+		public static int fegetenv (out FloatEnv envp);
+		public static int feholdexcept (out FloatEnv envp);
+		public static int fesetenv (ref FloatEnv envp);
+		public static int feupdateenv (ref FloatEnv envp);
+	}
+
+	
+	[CCode (cname = "group", cheader_filename = "grp.h")]
+	public struct Group
+	{
+		public weak string gr_name;
+		public weak string gr_passwd;
+		public long gr_gid;
+		public weak string[] gr_mem;
+		
+		[CCode (cname = "getgrnam")]
+		public static Group get_by_name (string name);
+		[CCode (cname = "getgrgid")]
+		public static Group get_by_gid (long gid);
+		[CCode (cname = "getgrent")]
+		public static Group get_entry ();
+		[CCode (cname = "setgrent")]
+		public static void set_entry ();
+		[CCode (cname = "entgrent")]
+		public static void end_entry ();
+		[CCode (cname = "fgetgrent")]
+		public static Group get_entry_by_stream (GLib.FileStream stream);
+	}
+	
+	[CCode (cname = "passwd", cheader_filename = "pwd.h")]
+	public struct Password
+	{
+		public weak string pw_name;
+		public weak string pw_passwd;
+		public long pw_uid;
+		public long pw_gid;
+		public weak string pw_gecos;
+		public weak string pw_dir;
+		public weak string pw_shell;
+		
+		[CCode (cname = "getpw")]
+		public static int reconstruct (long uid, string buf);
+		[CCode (cname = "getpwnam")]
+		public static Password get_by_name (string name);
+		[CCode (cname = "getpwuid")]
+		public static Password get_by_uid (long uid);
+		[CCode (cname = "getpwent")]
+		public static Password get_entry ();
+		[CCode (cname = "setpwent")]
+		public static void set_entry ();
+		[CCode (cname = "entpwent")]
+		public static void end_entry ();
+		[CCode (cname = "fgetpwent")]
+		public static Password get_entry_by_stream (GLib.FileStream stream);
+	}
+	
+	[CCode (cheader_filename = "signal.h")]
+	namespace Signal
+	{
+		// signals defined in signal(7)
+		[CCode (cname = "SIGHUP")]
+		public const int HUP;
+		[CCode (cname = "SIGINT")]
+		public const int INT;
+		[CCode (cname = "SIGQUIT")]
+		public const int QUIT;
+		[CCode (cname = "SIGILL")]
+		public const int ILL;
+		[CCode (cname = "SIGABRT")]
+		public const int ABRT;
+		[CCode (cname = "SIGFPE")]
+		public const int FPE;
+		[CCode (cname = "SIGKILL")]
+		public const int KILL;
+		[CCode (cname = "SIGSEGV")]
+		public const int SEGV;
+		[CCode (cname = "SIGPIPE")]
+		public const int PIPE;
+		[CCode (cname = "SIGALRM")]
+		public const int ALRM;
+		[CCode (cname = "SIGTERM")]
+		public const int TERM;
+		
+		// dispositions defined in signal(2)
+		[CCode (cname = "SIG_DFL")]
+		public const int DFL;
+		[CCode (cname = "SIG_IGN")]
+		public const int IGN;
+		
+		public static delegate void Handler (int sig_num);
+		
+		// vala does not have overloading, so we simply create
+		// to functions, one taking the handler and one taking
+		// the value
+		[CCode (cname = "signal")]
+		public static void set_handler (int sig_num, Handler hnd);
+		[CCode (cname = "signal")]
+		public static void set_value (int sig_num, int disposition = DFL);
+		
+		[CCode (cname = "siginfo_t")]
+		public struct Info
+		{
+			int si_signo;
+			int si_errno;
+			int si_code;
+			// pid_t si_pid;
+			long si_pid;
+			// uid_t si_uid;
+			long si_uid;
+			int si_status;
+			// clock_t si_utime;
+			long si_utime;
+			// clock_t si_stime;
+			long si_stime;
+			// sigval_t si_value;
+			int si_value;
+			int si_int;
+			void* si_ptr;
+			void* si_addr;
+			int si_band;
+			int si_fd;
+		}
+
+		public static delegate void ActionHandler (int sig_num, Info info, void* context);
+		
+		[CCode (cname = "struct sigaction")]
+		public struct Action
+		{
+			public Handler sa_handler;
+			public ActionHandler sa_sigaction;
+			public int sa_mask;
+			public int sa_flags;
+		}
+		
+		[CCode (cname = "SA_NOCLDSTOP")]
+		public const int NO_CLDSTOP;
+		[CCode (cname = "SA_NOCLDWAIT")]
+		public const int NO_CLDWAIT;
+		[CCode (cname = "SA_RESETHAND")]
+		public const int RESETHAND;
+		[CCode (cname = "SA_ONSTACK")]
+		public const int ONSTACK;
+		[CCode (cname = "SA_RESTART")]
+		public const int RESTART;
+		[CCode (cname = "SA_NODEFER")]
+		public const int NODEFER;
+		[CCode (cname = "SA_SIGINFO")]
+		public const int SIGINFO;
+		
+		[CCode (cname = "sigaction")]
+		public static int set_action (int sig_num, Action act, out Action? old_act = null);
+		[CCode (cname = "kill")]
+		public static int kill (long pid, int sig);
+		[CCode (cname = "killpg")]
+		public static int kill_process_group (long pgrp, int sig);
+		[CCode (cname = "raise")]
+		public static int raise (int sig);
+		[CCode (cname = "sigpause")]
+		public static int pause (int sig);
+		[CCode (cname = "sighold")]
+		public static int hold (int sig);
+		[CCode (cname = "sigignore")]
+		public static int ignore (int sig);
+		[CCode (cname = "sigrelse")]
+		public static int relse (int sig);	
+	}
+
+
+	[CCode (cname="struct termios", cheader_filename = "termios.h")]
+	public struct Termios
+	{
+		public uint c_iflag;
+		public uint c_oflag;
+		public uint c_cflag;
+		public uint c_lflag;
+		public uchar c_line;
+		public weak uchar[] c_cc;
+		public uint c_ispeed;
+		public uint c_ospeed;
+			
+		[CCode (cname = "cfgetispeed")]
+		public uint get_input_speed ();
+		[CCode (cname = "cfgetospeed")]
+		public uint get_output_speed ();
+		[CCode (cname = "cfsetispeed")]
+		public int set_input_speed (uint speed);
+		[CCode (cname = "cfsetospeed")]
+		public int set_output_speed (uint speed);
+		[CCode (cname = "tcdrain")]
+		public static int drain (int fd);
+		[CCode (cname = "tcflow")]
+		public static int flow (int fd, int action);
+		[CCode (cname = "tcflush")]
+		public static int flush (int fd, int queue_selector);
+		[CCode (cname = "tcgetattr", instance_pos = -1)]
+		public int get_attributes (int fd);
+		[CCode (cname = "tcgetsid")]
+		public static long get_session_id (int fd);
+		[CCode (cname = "tcsendbreak")]
+		public static int send_break (int fd, int duration);
+		[CCode (cname = "tcsetattr", instance_pos = -1)]
+		public int set_attribute (int fd, int optional_actions);
+	}
+			
+	[CCode (lower_case_cprefix = "V", cheader_filename = "termios.h")]
+	namespace CCIndex
+	{
+		public const int INTR;
+		public const int QUIT;
+		public const int ERASE;
+		public const int KILL;
+		public const int EOF;
+		public const int MIN;
+		public const int EOL;
+		public const int TIME;
+		public const int START;
+		public const int STOP;
+		public const int SUSP;
+	}
+		
+	[CCode (lower_case_cprefix = "", cheader_filename = "termios.h")]
+	namespace InputMode
+	{
+		public const uint BRKINT;
+		public const uint ICRNL;
+		public const uint IGNBRK;
+		public const uint IGNCR;
+		public const uint IGNPAR;
+		public const uint INLCR;
+		public const uint INPCK;
+		public const uint ISTRIP;
+		public const uint IXANY;
+		public const uint IXOFF;
+		public const uint IXON;
+		public const uint PARMRK;
+		
+		public const uint CRTSCTS;
+	}
+	
+	[CCode (lower_case_cprefix = "", cheader_filename = "termios.h")]
+	namespace OutputMode
+	{
+		public const uint OPOST;
+		public const uint ONLCR;
+		public const uint OCRNL;
+		public const uint ONOCR;
+		public const uint ONLRET;
+		public const uint OFILL;
+		public const uint NLDLY;
+		public const uint NL0;
+		public const uint NL1;
+		public const uint CRDLY;
+		public const uint CR0;
+		public const uint CR1;
+		public const uint CR2;
+		public const uint CR3;
+		public const uint TABDLY;
+		public const uint TAB0;
+		public const uint TAB1;
+		public const uint TAB2;
+		public const uint TAB3;
+		public const uint BSDLY;
+		public const uint BS0;
+		public const uint BS1;
+		public const uint VTDLY;
+		public const uint VT0;
+		public const uint VT1;
+		public const uint FFDLY;
+		public const uint FF0;
+		public const uint FF1;
+	}
+	
+	[CCode (lower_case_cprefix = "", cheader_filename = "termios.h")]
+	namespace Misc
+	{
+		public const int VTIME;
+		public const int VMIN;
+	}
+	[CCode (lower_case_cprefix = "", cheader_filename = "termios.h")]
+	namespace BaudRate
+	{
+		public const uint B0;
+		public const uint B50;
+		public const uint B75;
+		public const uint B110;
+		public const uint B134;
+		public const uint B150;
+		public const uint B200;
+		public const uint B300;
+		public const uint B600;
+		public const uint B1200;
+		public const uint B1800;
+		public const uint B2400;
+		public const uint B4800;
+		public const uint B9600;
+		public const uint B19200;
+		public const uint B38400;
+	
+		public const uint B57600;	
+		public const uint B115200;
+		public const uint B230400;
+		public const uint B460800;
+		public const uint B576000;
+		public const uint B921600;
+	}
+	
+	[CCode (lower_case_cprefix = "", cheader_filename = "termios.h")]
+	namespace ControlMode
+	{
+		public const uint CSIZE;
+		public const uint CS5;
+		public const uint CS6;
+		public const uint CS7;
+		public const uint CS8;
+		public const uint CSTOPB;
+		public const uint CREAD;
+		public const uint PARENB;
+		public const uint PARODD;
+		public const uint HUPCL;
+		public const uint CLOCAL;
+	}
+	
+	[CCode (lower_case_cprefix = "", cheader_filename = "termios.h")]
+	namespace LocalMode
+	{
+		public const uint ECHO;
+		public const uint ECHOE;
+		public const uint ECHOK;
+		public const uint ECHONL;
+		public const uint ICANON;
+		public const uint IEXTEN;
+		public const uint ISIG;
+		public const uint NOFLSH;
+		public const uint TOSTOP;
+	}
+	
+	[CCode (lower_case_cprefix = "TCSA", cheader_filename = "termios.h")]
+	namespace AttributeSelection
+	{
+		public const int NOW;
+		public const int DRAIN;
+		public const int FLUSH;
+	}
+	
+	[CCode (lower_case_cprefix = "TC", cheader_filename = "termios.h")]
+	namespace LineControl
+	{
+		public const int IFLUSH;
+		public const int IOFLUSH;
+		public const int OFLUSH;
+		public const int IOFF;
+		public const int ION;
+		public const int OOFF;
+		public const int OON;
+	}
+	[CCode (lower_case_cprefix = "", cheader_filename = "sys/ioctl.h")]
+	namespace ioctl
+	{
+		public const int TIOCMGET;
+		public const int TIOCMSET;
+		public const int TIOCM_RTS;
+		[CCode (cname = "ioctl")]
+		public static int ioctl (int fd, int a, out int b);
+	}
+}

Added: trunk/xmldocs.make
==============================================================================
--- (empty file)
+++ trunk/xmldocs.make	Fri Mar  6 18:32:35 2009
@@ -0,0 +1,101 @@
+#
+# No modifications of this Makefile should be necessary.
+#
+# To use this template:
+#     1) Define: figdir, docname, lang, omffile, and entities in
+#        your Makefile.am file for each document directory,
+#        although figdir, omffile, and entities may be empty
+#     2) Make sure the Makefile in (1) also includes 
+#	 "include $(top_srcdir)/xmldocs.make" and
+#	 "dist-hook: app-dist-hook".
+#     3) Optionally define 'entities' to hold xml entities which
+#        you would also like installed
+#     4) Figures must go under $(figdir)/ and be in PNG format
+#     5) You should only have one document per directory 
+#     6) Note that the figure directory, $(figdir)/, should not have its
+#        own Makefile since this Makefile installs those figures.
+#
+# example Makefile.am:
+#   figdir = figures
+#   docname = scrollkeeper-manual
+#   lang = C
+#   omffile=scrollkeeper-manual-C.omf
+#   entities = fdl.xml
+#   include $(top_srcdir)/xmldocs.make
+#   dist-hook: app-dist-hook
+#
+# About this file:
+#	This file was taken from scrollkeeper_example2, a package illustrating
+#	how to install documentation and OMF files for use with ScrollKeeper 
+#	0.3.x and 0.4.x.  For more information, see:
+#		http://scrollkeeper.sourceforge.net/
+#	Version: 0.1.2 (last updated: March 20, 2002)
+#
+
+
+# **********  Begin of section some packagers may need to modify  **********
+# This variable (docdir) specifies where the documents should be installed.
+# This default value should work for most packages.
+docdir = $(datadir)/gnome/help/$(docname)/$(lang)
+
+# **********  You should not have to edit below this line  **********
+xml_files = $(entities) $(docname).xml
+
+EXTRA_DIST = $(xml_files) $(omffile)
+CLEANFILES = omf_timestamp
+
+include $(top_srcdir)/omf.make
+
+all: omf
+
+$(docname).xml: $(entities)
+	-ourdir=`pwd`;  \
+	cd $(srcdir);   \
+	cp $(entities) $$ourdir
+
+app-dist-hook:
+	if test "$(figdir)"; then \
+	  $(mkinstalldirs) $(distdir)/$(figdir); \
+	  for file in $(srcdir)/$(figdir)/*.png; do \
+	    basefile=`echo $$file | sed -e  's,^.*/,,'`; \
+	    $(INSTALL_DATA) $$file $(distdir)/$(figdir)/$$basefile; \
+	  done \
+	fi
+
+install-data-local: omf
+	$(mkinstalldirs) $(DESTDIR)$(docdir)
+	for file in $(xml_files); do \
+	  cp $(srcdir)/$$file $(DESTDIR)$(docdir); \
+	done
+	if test "$(figdir)"; then \
+	  $(mkinstalldirs) $(DESTDIR)$(docdir)/$(figdir); \
+	  for file in $(srcdir)/$(figdir)/*.png; do \
+	    basefile=`echo $$file | sed -e  's,^.*/,,'`; \
+	    $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/$(figdir)/$$basefile; \
+	  done \
+	fi
+
+install-data-hook: install-data-hook-omf
+
+uninstall-local: uninstall-local-doc uninstall-local-omf
+
+uninstall-local-doc:
+	-if test "$(figdir)"; then \
+	  for file in $(srcdir)/$(figdir)/*.png; do \
+	    basefile=`echo $$file | sed -e  's,^.*/,,'`; \
+	    rm -f $(DESTDIR)$(docdir)/$(figdir)/$$basefile; \
+	  done; \
+	  rmdir $(DESTDIR)$(docdir)/$(figdir); \
+	fi
+	-for file in $(xml_files); do \
+	  rm -f $(DESTDIR)$(docdir)/$$file; \
+	done
+	-rmdir $(DESTDIR)$(docdir)
+
+clean-local: clean-local-doc clean-local-omf
+
+# for non-srcdir builds, remove the copied entities.
+clean-local-doc:
+	if test $(srcdir) != .; then \
+	  rm -f $(entities); \
+	fi



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