From 89496ceee9788c2908c27ad4e2535f2728310d76 Mon Sep 17 00:00:00 2001 From: Jesse Hakanen Date: Thu, 15 Apr 2010 19:55:23 +0100 Subject: [PATCH] First commit --- COPYING | 674 ++++++++++++++++++++++++++++++++++++++ Makefile | 137 ++++++++ debian/changelog | 6 + debian/compat | 1 + debian/control | 49 +++ debian/copyright | 14 + debian/dirs | 3 + debian/postinst | 13 + debian/postrm | 6 + debian/preinst | 6 + debian/prerm | 6 + debian/rules | 54 +++ jenirok.pro | 8 + src/common/connectionmanager.cpp | 122 +++++++ src/common/connectionmanager.h | 54 +++ src/common/contactmanager.cpp | 176 ++++++++++ src/common/contactmanager.h | 50 +++ src/common/db.cpp | 103 ++++++ src/common/db.h | 43 +++ src/common/eniro.cpp | 592 +++++++++++++++++++++++++++++++++ src/common/eniro.h | 140 ++++++++ src/common/settings.cpp | 155 +++++++++ src/common/settings.h | 45 +++ src/common/translations.grc | 5 + src/common/translations/fi_FI.qm | Bin 0 -> 4290 bytes src/common/translations/fi_FI.ts | 275 ++++++++++++++++ src/daemon/Makefile | 333 +++++++++++++++++++ src/daemon/calllistener.cpp | 239 ++++++++++++++ src/daemon/calllistener.h | 60 ++++ src/daemon/daemon.pro | 32 ++ src/daemon/data/jenirokd | 32 ++ src/daemon/informationbox.cpp | 220 +++++++++++++ src/daemon/informationbox.h | 89 +++++ src/daemon/main.cpp | 39 +++ src/gui/Makefile | 433 ++++++++++++++++++++++++ src/gui/buttonselector.cpp | 83 +++++ src/gui/buttonselector.h | 46 +++ src/gui/daemon.cpp | 117 +++++++ src/gui/daemon.h | 37 +++ src/gui/data/26x26/jenirok.png | Bin 0 -> 4167 bytes src/gui/data/48x48/jenirok.png | Bin 0 -> 5732 bytes src/gui/data/64x64/jenirok.png | Bin 0 -> 6930 bytes src/gui/data/jenirok.desktop | 9 + src/gui/data/maemo/jenirok.xpm | 326 ++++++++++++++++++ src/gui/detailwindow.cpp | 146 +++++++++ src/gui/detailwindow.h | 60 ++++ src/gui/gui.pro | 43 +++ src/gui/icons.grc | 6 + src/gui/icons/start.png | Bin 0 -> 7908 bytes src/gui/icons/stop.png | Bin 0 -> 8456 bytes src/gui/main.cpp | 52 +++ src/gui/mainwindow.cpp | 167 ++++++++++ src/gui/mainwindow.h | 56 ++++ src/gui/resultwindow.cpp | 165 ++++++++++ src/gui/resultwindow.h | 53 +++ src/gui/searchdialog.cpp | 80 +++++ src/gui/searchdialog.h | 57 ++++ src/gui/settingsdialog.cpp | 149 +++++++++ src/gui/settingsdialog.h | 53 +++ 59 files changed, 5919 insertions(+) create mode 100644 COPYING create mode 100644 Makefile create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/postinst create mode 100644 debian/postrm create mode 100644 debian/preinst create mode 100644 debian/prerm create mode 100755 debian/rules create mode 100644 jenirok.pro create mode 100644 src/common/connectionmanager.cpp create mode 100644 src/common/connectionmanager.h create mode 100644 src/common/contactmanager.cpp create mode 100644 src/common/contactmanager.h create mode 100644 src/common/db.cpp create mode 100644 src/common/db.h create mode 100644 src/common/eniro.cpp create mode 100644 src/common/eniro.h create mode 100644 src/common/settings.cpp create mode 100644 src/common/settings.h create mode 100644 src/common/translations.grc create mode 100644 src/common/translations/fi_FI.qm create mode 100644 src/common/translations/fi_FI.ts create mode 100644 src/daemon/Makefile create mode 100644 src/daemon/calllistener.cpp create mode 100644 src/daemon/calllistener.h create mode 100644 src/daemon/daemon.pro create mode 100755 src/daemon/data/jenirokd create mode 100644 src/daemon/informationbox.cpp create mode 100644 src/daemon/informationbox.h create mode 100644 src/daemon/main.cpp create mode 100644 src/gui/Makefile create mode 100644 src/gui/buttonselector.cpp create mode 100644 src/gui/buttonselector.h create mode 100644 src/gui/daemon.cpp create mode 100644 src/gui/daemon.h create mode 100644 src/gui/data/26x26/jenirok.png create mode 100644 src/gui/data/48x48/jenirok.png create mode 100644 src/gui/data/64x64/jenirok.png create mode 100644 src/gui/data/jenirok.desktop create mode 100755 src/gui/data/maemo/jenirok.xpm create mode 100644 src/gui/detailwindow.cpp create mode 100644 src/gui/detailwindow.h create mode 100644 src/gui/gui.pro create mode 100644 src/gui/icons.grc create mode 100755 src/gui/icons/start.png create mode 100755 src/gui/icons/stop.png create mode 100644 src/gui/main.cpp create mode 100644 src/gui/mainwindow.cpp create mode 100644 src/gui/mainwindow.h create mode 100644 src/gui/resultwindow.cpp create mode 100644 src/gui/resultwindow.h create mode 100644 src/gui/searchdialog.cpp create mode 100644 src/gui/searchdialog.h create mode 100644 src/gui/settingsdialog.cpp create mode 100644 src/gui/settingsdialog.h delete mode 100644 welcome diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9281321 --- /dev/null +++ b/Makefile @@ -0,0 +1,137 @@ +############################################################################# +# Makefile for building: jenirok +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed Apr 14 21:02:29 2010 +# Project: jenirok.pro +# Template: subdirs +# Command: /usr/bin/qmake -unix -o Makefile jenirok.pro +############################################################################# + +first: make_default +MAKEFILE = Makefile +QMAKE = /usr/bin/qmake +DEL_FILE = rm -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p +COPY = cp -f +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +INSTALL_FILE = install -m 644 -p +INSTALL_PROGRAM = install -m 755 -p +INSTALL_DIR = $(COPY_DIR) +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p +SUBTARGETS = \ + sub-src-gui \ + sub-src-daemon + +src/gui/$(MAKEFILE): + @$(CHK_DIR_EXISTS) src/gui/ || $(MKDIR) src/gui/ + cd src/gui/ && $(QMAKE) /home/maemo/workspace/jenirok/src/gui/gui.pro -unix -o $(MAKEFILE) +sub-src-gui-qmake_all: FORCE + @$(CHK_DIR_EXISTS) src/gui/ || $(MKDIR) src/gui/ + cd src/gui/ && $(QMAKE) /home/maemo/workspace/jenirok/src/gui/gui.pro -unix -o $(MAKEFILE) +sub-src-gui: src/gui/$(MAKEFILE) FORCE + cd src/gui/ && $(MAKE) -f $(MAKEFILE) +sub-src-gui-make_default: src/gui/$(MAKEFILE) FORCE + cd src/gui/ && $(MAKE) -f $(MAKEFILE) +sub-src-gui-make_first: src/gui/$(MAKEFILE) FORCE + cd src/gui/ && $(MAKE) -f $(MAKEFILE) first +sub-src-gui-all: src/gui/$(MAKEFILE) FORCE + cd src/gui/ && $(MAKE) -f $(MAKEFILE) all +sub-src-gui-clean: src/gui/$(MAKEFILE) FORCE + cd src/gui/ && $(MAKE) -f $(MAKEFILE) clean +sub-src-gui-distclean: src/gui/$(MAKEFILE) FORCE + cd src/gui/ && $(MAKE) -f $(MAKEFILE) distclean +sub-src-gui-install_subtargets: src/gui/$(MAKEFILE) FORCE + cd src/gui/ && $(MAKE) -f $(MAKEFILE) install +sub-src-gui-uninstall_subtargets: src/gui/$(MAKEFILE) FORCE + cd src/gui/ && $(MAKE) -f $(MAKEFILE) uninstall +src/daemon/$(MAKEFILE): + @$(CHK_DIR_EXISTS) src/daemon/ || $(MKDIR) src/daemon/ + cd src/daemon/ && $(QMAKE) /home/maemo/workspace/jenirok/src/daemon/daemon.pro -unix -o $(MAKEFILE) +sub-src-daemon-qmake_all: FORCE + @$(CHK_DIR_EXISTS) src/daemon/ || $(MKDIR) src/daemon/ + cd src/daemon/ && $(QMAKE) /home/maemo/workspace/jenirok/src/daemon/daemon.pro -unix -o $(MAKEFILE) +sub-src-daemon: src/daemon/$(MAKEFILE) FORCE + cd src/daemon/ && $(MAKE) -f $(MAKEFILE) +sub-src-daemon-make_default: src/daemon/$(MAKEFILE) FORCE + cd src/daemon/ && $(MAKE) -f $(MAKEFILE) +sub-src-daemon-make_first: src/daemon/$(MAKEFILE) FORCE + cd src/daemon/ && $(MAKE) -f $(MAKEFILE) first +sub-src-daemon-all: src/daemon/$(MAKEFILE) FORCE + cd src/daemon/ && $(MAKE) -f $(MAKEFILE) all +sub-src-daemon-clean: src/daemon/$(MAKEFILE) FORCE + cd src/daemon/ && $(MAKE) -f $(MAKEFILE) clean +sub-src-daemon-distclean: src/daemon/$(MAKEFILE) FORCE + cd src/daemon/ && $(MAKE) -f $(MAKEFILE) distclean +sub-src-daemon-install_subtargets: src/daemon/$(MAKEFILE) FORCE + cd src/daemon/ && $(MAKE) -f $(MAKEFILE) install +sub-src-daemon-uninstall_subtargets: src/daemon/$(MAKEFILE) FORCE + cd src/daemon/ && $(MAKE) -f $(MAKEFILE) uninstall + +Makefile: jenirok.pro /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++/qmake.conf /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf + $(QMAKE) -unix -o Makefile jenirok.pro +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf: +qmake: qmake_all FORCE + @$(QMAKE) -unix -o Makefile jenirok.pro + +qmake_all: sub-src-gui-qmake_all sub-src-daemon-qmake_all FORCE + +make_default: sub-src-gui-make_default sub-src-daemon-make_default FORCE +make_first: sub-src-gui-make_first sub-src-daemon-make_first FORCE +all: sub-src-gui-all sub-src-daemon-all FORCE +clean: sub-src-gui-clean sub-src-daemon-clean FORCE +distclean: sub-src-gui-distclean sub-src-daemon-distclean FORCE + -$(DEL_FILE) Makefile +install_subtargets: sub-src-gui-install_subtargets sub-src-daemon-install_subtargets FORCE +uninstall_subtargets: sub-src-gui-uninstall_subtargets sub-src-daemon-uninstall_subtargets FORCE + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all +install: install_subtargets FORCE + +uninstall: uninstall_subtargets FORCE + +FORCE: + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..b5e58de --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +jenirok (0.1.0-1) unstable; urgency=low + + * Initial release + + -- Jesse Hakanen Wed, 14 Apr 2010 20:06:51 +0100 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..73fbc0b --- /dev/null +++ b/debian/control @@ -0,0 +1,49 @@ +Source: jenirok +Section: user/other +Priority: optional +Maintainer: Jesse Hakanen +Build-Depends: debhelper (>= 5), libqt4-dev +Standards-Version: 3.7.2 + +Package: jenirok +Architecture: any +Depends: ${shlibs:Depends} +Description: Searches unknown callers with Eniro's person search. + Jenirok finds unknown callers' details + using Eniro person search. Person search + can also be done by using a gui application. +XB-Maemo-Display-Name: Jenirok +XB-Maemo-Icon26: + iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAGXRFWHRTb2Z0 + d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAYBQTFRFcm5s8EdH/P38FAsK + 4ru73BQUmxgY+sXF29jaWlkVRUVE6uMbOHfU/f3cqqqb+9XVYhsb4SMj/+Pj + FVi6xsRX/f3k6uTjlpWWvdT3QXvSJmfJ4eHUxsfITIjivLq1+/hdozY25jIy + 5Nsm2d/n/PphMTExjokX6uEn6t3d8uko/fzKwrsn9vOp2+b3qqhHLkt3mJY6 + DlO5ByxjGly/1E1NXpz5M2ez+fZZpaeqUIznRIHd58fH9vJU//9q0zw86hgY + 4+39//9lqZeX+PWz///vjoWD7/f9vbxZu7qf2tnL+faqm4mJUlJSVZDpx8K8 + X19fpqVSNTQO/vtk81pa//xVM3HOtKuogYB9+fAh4+FUCRIg//9d5jw8+PWl + HSAeDkebNwwMYqT/G1Kl9O9Q1M/NrbrNH2HD+/dU/PmqYFhYmZuc9vRg9/So + ycAnM1J/IViqhoU4paI/8u1PxcrTc3EqmJiOsbG0oaCfsa9RCkahFU2g1dRa + 9/bh9O7oAAAA////ZgJY2QAAAIB0Uk5T//////////////////////////// + //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// + /////////////////////wA4BUtnAAADLUlEQVR42pTWi1fSUBzA8bkbNDBi + koDEI1IXwzJ6mKGmNoXKF4QvdNqNiizspWnaw/381/tdcOMyN099zwHOGfdz + 7t6bcPqfCfYFqcbiBTUS54ACF+Z3AHsvXdtzBH8mXXvuCHonl12a/OkMtOa/ + mqbZgeYGBpe1SW350ycNfwa5XIGm/bnnq1Ba8e1vato/gF4f24M6wS9yuKkN + 3jjLDewBKNVS/MSIpwQK5J4ltpxBBciPk0IhHA4XCqJRBTjcuvG42dZdRwDK + XCEcYDEjliiKC4ESKQTOQhEW6xT2t56wnIBEyFzHeBQpoJsfGFhlIF/uSIGq + EWedmONRlGFv9R22uo+A2E5HKkkJ7CAetirEgX7nQO5rzuyrAsKzAUyqx8OB + oVaBsOiH24/bIPnmkdmbHByJT7HhROnjvNlsoAi3NrLZ7MatJogtWT2icPCM + gYPoi4+vzGaHroJvo7u7+zxY0kFCMNz3HsFns9mhFzYwZrZEGRjua4I7Zp1A + h9hY0mzpASREHN8xwx22SocbmfYM1vjkWA52xb4WmG/PEBBwozP9/dkWWEuO + myVHYTFylM/nj3ePr5qtp+oKUF+/BUbbYDymk6MUDuc6ziei7IjezrSADqPj + MavxHPjViUt8ExOqAmliAZwhdoVLh4VQ8DJXMCSAvNIBrnQCMsOLYKgIZKQF + MmdgjU/H1S2GTBIMBQUg6ZURBP0m+HadTwcZ76DrQTQh/MzgFSivMPAlm8k6 + g/RIDS/T8sLMTLFBARYVXCMElUrFR5vg7fUdLgQrXemadbdexwtO7hoxL5sG + Azs20IVNpWVZTnthUTSMMi4iUI1iuxEEv3cecjGwvb3d1UqGY8Oo67UpApGz + JxCCh9faMbDdbopQNWIUQSYgWeD1NT4dvDe5vCAYqsoeSzy4z8VAT7ubNZKK + RNY7wX0b6OHz4sklqQ0e/LoQ9MgQVaUSgQELPOgIwTQ/ftpDaF1Sq1C0gD3v + tIdvGrdbrUsKae1XYdf26CZ24PHUyJFa8kPd+U1AOQdwCn+RgiC6Ao89ma1p + 5NQNkPMBdxzsoOzykkENF1AqOxdtbcLpXwEGAN04iD9YnhjMAAAAAElFTkSu + QmCC diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..8e8e2e4 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,14 @@ +Copyright (c) 2010 Jesse Hakanen + +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 . diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..21eff11 --- /dev/null +++ b/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/share/applications/hildon +etc/init.d diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..3eb2f3c --- /dev/null +++ b/debian/postinst @@ -0,0 +1,13 @@ +#!/bin/sh -e + +gtk-update-icon-cache -f /usr/share/icons/hicolor + +# Make jenirok autostart on boot if this is a new install +oldversion="$2" +if [ -z "$oldversion" ]; then + update-rc.d jenirokd defaults 99 >/dev/null +fi + +/etc/init.d/jenirokd start + +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..cca0a15 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,6 @@ +#!/bin/sh -e + +rm -f /home/user/.jenirok.db + +exit 0 + diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 0000000..6d0f2ba --- /dev/null +++ b/debian/preinst @@ -0,0 +1,6 @@ +#!/bin/sh -e + +/etc/init.d/jenirokd stop + +exit 0 + diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..6d0f2ba --- /dev/null +++ b/debian/prerm @@ -0,0 +1,6 @@ +#!/bin/sh -e + +/etc/init.d/jenirokd stop + +exit 0 + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..a9afddc --- /dev/null +++ b/debian/rules @@ -0,0 +1,54 @@ +#!/usr/bin/make -f +APPNAME := jenirok +builddir: + mkdir -p builddir + +builddir/Makefile: builddir + cd builddir && qmake-qt4 PREFIX=/usr ../$(APPNAME).pro + +build: build-stamp + +build-stamp: builddir/Makefile + dh_testdir + # Add here commands to compile the package. + cd builddir && $(MAKE) + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + # Add here commands to clean up after the build process. + rm -rf builddir + dh_clean +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + +# Add here commands to install the package into debian/your_appname + cd builddir && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/$(APPNAME) install +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installman + dh_link + dh_strip --dbg-package=my-application-dbg + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/jenirok.pro b/jenirok.pro new file mode 100644 index 0000000..2ebbf98 --- /dev/null +++ b/jenirok.pro @@ -0,0 +1,8 @@ +QMAKEVERSION = $$[QMAKE_VERSION] +ISQT4 = $$find(QMAKEVERSION, ^[2-9]) +isEmpty( ISQT4 ) { + error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4"); +} + +TEMPLATE = subdirs +SUBDIRS = src/gui src/daemon diff --git a/src/common/connectionmanager.cpp b/src/common/connectionmanager.cpp new file mode 100644 index 0000000..2793d83 --- /dev/null +++ b/src/common/connectionmanager.cpp @@ -0,0 +1,122 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include +#include +#include "connectionmanager.h" + +ConnectionManager* ConnectionManager::instance_ = 0; + +ConnectionManager::ConnectionManager(): connection_(0), connected_(false) +{ + DBusError err; + DBusConnection* conn; + dbus_error_init(&err); + conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err); + + if(conn) + { + dbus_connection_setup_with_g_main(conn, NULL); + } + else + { + qDebug() << "Unable to connect to DBUS: " << err.message; + dbus_error_free(&err); + } + + connection_ = con_ic_connection_new(); + + g_signal_connect(G_OBJECT(connection_), "connection-event", G_CALLBACK(connectionHandler), NULL); + + +} + +ConnectionManager& ConnectionManager::instance() +{ + if(!instance_) + { + instance_ = new ConnectionManager; + } + + return *instance_; +} + +bool ConnectionManager::connect() +{ + return con_ic_connection_connect(connection_, CON_IC_CONNECT_FLAG_NONE); +} + +bool ConnectionManager::disconnect() +{ + return con_ic_connection_disconnect(connection_); +} + +bool ConnectionManager::isConnected() +{ + return connected_; +} +void ConnectionManager::connectionHandler(ConIcConnection *connection, + ConIcConnectionEvent *event, + gpointer user_data) +{ + Q_UNUSED(connection); + Q_UNUSED(user_data); + + ConIcConnectionStatus status = con_ic_connection_event_get_status(event); + + switch(status) + { + + case CON_IC_STATUS_CONNECTED: + qDebug() << "Connected"; + instance_->emit connected(); + instance_->connected_ = true; + break; + + case CON_IC_STATUS_DISCONNECTING: + case CON_IC_STATUS_NETWORK_UP: + break; + + case CON_IC_STATUS_DISCONNECTED: + ConIcConnectionError err = con_ic_connection_event_get_error(event); + switch(err) + { + case CON_IC_CONNECTION_ERROR_NONE: + case CON_IC_CONNECTION_ERROR_USER_CANCELED: + qDebug() << "Disconnected"; + instance_->emit disconnected(); + instance_->connected_ = false; + break; + + case CON_IC_CONNECTION_ERROR_INVALID_IAP: + qDebug() << "Invalid IAP"; + instance_->emit error("Invalid IAP"); + break; + + case CON_IC_CONNECTION_ERROR_CONNECTION_FAILED: + qDebug() << "Connection failed"; + instance_->emit error("Connection failed"); + break; + + default: + break; + } + break; + } +} diff --git a/src/common/connectionmanager.h b/src/common/connectionmanager.h new file mode 100644 index 0000000..fd31ab6 --- /dev/null +++ b/src/common/connectionmanager.h @@ -0,0 +1,54 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef CONNECTIONMANAGER_H +#define CONNECTIONMANAGER_H + +#include +#include +#include +#include +#include + +class ConnectionManager : public QObject +{ + Q_OBJECT + +public: + static ConnectionManager& instance(); + bool connect(); + bool disconnect(); + bool isConnected(); + +signals: + void connected(); + void disconnected(); + void error(QString const& error); + + +private: + ConnectionManager(); + static void connectionHandler(ConIcConnection *connection, + ConIcConnectionEvent *event, + gpointer user_data); + static ConnectionManager* instance_; + ConIcConnection* connection_; + bool connected_; +}; + +#endif diff --git a/src/common/contactmanager.cpp b/src/common/contactmanager.cpp new file mode 100644 index 0000000..3f8affe --- /dev/null +++ b/src/common/contactmanager.cpp @@ -0,0 +1,176 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include "contactmanager.h" + +namespace +{ + const int COUNTRY_CODES[] = {358, 45, 46, 47}; + const int NUM_OF_CODES = 4; +} + +ContactManager::ContactManager(): book_(0) +{ +} + +ContactManager::~ContactManager() +{ +} + +bool ContactManager::numberExists(QString const& number) +{ + if(!load()) + { + return false; + } + + EBookQuery* query; + GList *g_contacts; + + QString copy(number); + QString clean = removeCountryCode(copy); + + query = e_book_query_any_field_contains(clean.toLatin1()); + + if (!e_book_get_contacts (book_, query, &g_contacts, NULL)) + { + qDebug() << "Couldn't get query results.\n"; + return false; + } + + if (g_contacts == 0) + { + qDebug() << "no contacts"; + return false; + } + + return true; + +} + +bool ContactManager::addContact(Contact const& contact) +{ + if(!load()) + { + return false; + } + + EContact* newContact = e_contact_new(); + GError* error = NULL; + //EContactAddress* addr = new EContactAddress; + + if(!contact.name.isEmpty()) + { + char* name = contact.name.toLatin1().data(); + e_contact_set(newContact, E_CONTACT_FULL_NAME, (gpointer)name); + } + + // Doesn't work for some reason + /*if(!contact.city.isEmpty() || !contact.street.isEmpty()) + { + addr->street = contact.street.toLatin1().data(); + addr->locality = contact.city.toLatin1().data(); + e_contact_set(newContact, E_CONTACT_ADDRESS_HOME, (gpointer)addr); + }*/ + + if(!contact.number.isEmpty()) + { + char* number = contact.number.toLatin1().data(); + e_contact_set(newContact, E_CONTACT_PHONE_HOME, (gpointer)number); + } + + if(!e_book_add_contact(book_, newContact, &error)) + { + qDebug() << "Couldn't add contact: %s" << error->message; + g_error_free(error); + return false; + } + + return true; +} + +bool ContactManager::load() +{ + if(book_) + { + return true; + } + + GError* error = NULL; + book_ = e_book_new_system_addressbook(&error); + + if (!book_) + { + qDebug() << "Couldn't open addressbook: %s" << error->message; + g_error_free(error); + return false; + } + + /* Open connection to the address book */ + if (!e_book_open(book_, FALSE, &error)) + { + qDebug() << "Couldn't open addressbook: %s" << error->message; + g_error_free(error); + return false; + } + + return true; + +} + +QString& ContactManager::removeCountryCode(QString& number) +{ + if(number.isEmpty()) + { + return number; + } + + if(number.at(0) == '0') + { + return number.remove(0, 1); + } + else if(number.at(0) != '+') + { + return number; + } + + static QRegExp countryCodeCleaner; + static bool countryCodeCleanerLoaded = false; + + if(!countryCodeCleanerLoaded) + { + QString match = ""; + + for(int i = 0; i < NUM_OF_CODES; i++) + { + if(i > 0) + { + match += "|"; + } + + match += "\\+" + QString::number(COUNTRY_CODES[i]); + } + + countryCodeCleaner = QRegExp("^(" + match + ")"); + countryCodeCleanerLoaded = true; + } + + return number.replace(countryCodeCleaner, ""); +} + diff --git a/src/common/contactmanager.h b/src/common/contactmanager.h new file mode 100644 index 0000000..904e103 --- /dev/null +++ b/src/common/contactmanager.h @@ -0,0 +1,50 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef CONTACTMANAGER_H +#define CONTACTMANAGER_H + +#include +#include +#include +#include +#include + +class ContactManager +{ +public: + struct Contact + { + QString name; + QString number; + QString street; + QString city; + }; + + ContactManager(); + ~ContactManager(); + bool addContact(Contact const& contact); + bool numberExists(QString const& number); + static QString& removeCountryCode(QString& number); + +private: + bool load(); + EBook* book_; +}; + +#endif diff --git a/src/common/db.cpp b/src/common/db.cpp new file mode 100644 index 0000000..e5ce316 --- /dev/null +++ b/src/common/db.cpp @@ -0,0 +1,103 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include +#include +#include "db.h" +#include + +namespace +{ + const QString SQL_DRIVER = "QSQLITE"; + const QString SQL_DATABASE = ".jenirok.db"; +} + +bool DB::initialized_ = false; +QSqlDatabase DB::db_; + +bool DB::connect() +{ + if(!initialized_) + { + db_ = QSqlDatabase::addDatabase(SQL_DRIVER); + QString path = QDir::home().path() + QDir::separator() + SQL_DATABASE; + db_.setDatabaseName(QDir::toNativeSeparators(path)); + } + + bool ret = db_.open(); + + if(!ret) + { + QSqlError error = db_.lastError(); + qDebug() << error.text(); + } + + if(ret && !initialized_) + { + QSqlQuery query("SELECT value FROM settings WHERE name = 'initialized'"); + + if(!query.next()) + { + ret = createTables(); + } + } + + if(!initialized_) + { + initialized_ = true; + } + + return ret; +} + +void DB::disconnect() +{ + db_.close(); +} + +void DB::removeDatabase() +{ + db_.close(); + db_ = QSqlDatabase(); + QSqlDatabase::removeDatabase(QSqlDatabase::defaultConnection); + initialized_ = false; +} + +bool DB::connected() +{ + return db_.isOpen(); +} + +QSqlDatabase& DB::instance() +{ + return db_; +} + +bool DB::createTables() +{ + QSqlQuery query; + + bool ret = true; + + ret = ret && query.exec("CREATE TABLE cache (id INTEGER PRIMARY KEY, number VARCHAR(32) NOT NULL UNIQUE, name VARCHAR(255) NOT NULL, street VARCHAR(255) NOT NULL, city VARCHAR(255) NOT NULL)"); + ret = ret && query.exec("CREATE TABLE settings (name VARCHAR(255) NOT NULL PRIMARY KEY, value VARCHAR(255) NOT NULL)"); + ret = ret && query.exec("INSERT INTO settings(name, value) VALUES('initialized', '1')"); + + return ret; +} diff --git a/src/common/db.h b/src/common/db.h new file mode 100644 index 0000000..20eeae2 --- /dev/null +++ b/src/common/db.h @@ -0,0 +1,43 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef DB_H +#define DB_H + +#include +#include + +class DB +{ + +public: + static bool connect(); + static bool connected(); + static void disconnect(); + static void removeDatabase(); + QSqlDatabase& instance(); + +private: + DB(); + static bool createTables(); + static QSqlDatabase db_; + static bool initialized_; +}; + +#endif // DB_H + diff --git a/src/common/eniro.cpp b/src/common/eniro.cpp new file mode 100644 index 0000000..56f27fe --- /dev/null +++ b/src/common/eniro.cpp @@ -0,0 +1,592 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include "eniro.h" + +namespace +{ + static const QString SITE_URLS[] = + { + "http://wap.eniro.fi/", + "http://wap.eniro.se/", + "http://wap.eniro.dk/" + }; + + const QString INVALID_LOGIN_STRING = "Invalid login details"; + const QString PERSON_REGEXP = "(.*)(.*)"; + const QString YELLOW_REGEXP = "(.*)(.*)"; + const QString NUMBER_REGEXP = "
(.*)
"; + const QString LOGIN_CHECK = "]+)>"); + +Eniro::Eniro(Site site, QObject *parent): QObject(parent), site_(site), +username_(""), password_(""), loggedIn_(false), error_(NO_ERROR), +errorString_(""), maxResults_(10), findNumber_(true), +pendingSearches_(), pendingNumberRequests_() +{ + connect(&http_, SIGNAL(requestFinished(int, bool)), this, SLOT(httpReady(int, bool))); +} + +Eniro::~Eniro() +{ + abort(); +} + +void Eniro::abort() +{ + http_.abort(); + + for(searchMap::iterator sit = pendingSearches_.begin(); + sit != pendingSearches_.end(); sit++) + { + if(sit.value() != 0) + { + delete sit.value(); + sit.value() = 0; + } + } + + pendingSearches_.clear(); + + for(numberMap::iterator nit = pendingNumberRequests_.begin(); + nit != pendingNumberRequests_.end(); nit++) + { + if(nit.value() != 0) + { + delete nit.value(); + nit.value() = 0; + } + } + + pendingNumberRequests_.clear(); + pendingLoginRequests_.clear(); +} + +void Eniro::setMaxResults(unsigned int value) +{ + maxResults_ = value; +} + +void Eniro::setFindNumber(bool value) +{ + findNumber_ = value; +} + +void Eniro::setSite(Eniro::Site site) +{ + site_ = site; +} + +void Eniro::login(QString const& username, + QString const& password) +{ + username_ = username; + password_ = password; + loggedIn_ = true; +} + +void Eniro::logout() +{ + username_ = ""; + password_ = ""; + loggedIn_ = false; +} + +void Eniro::testLogin() +{ + QUrl url = createUrl("", ""); + + url.addQueryItem("what", "mobwp"); + http_.setHost(url.host(), url.port(80)); + int id = http_.get(url.encodedPath() + '?' + url.encodedQuery()); + + pendingLoginRequests_.insert(id); +} + +bool Eniro::search(SearchDetails const& details) +{ + SearchType type = details.type; + + // Only logged in users can use other than person search + if(!loggedIn_) + { + type = PERSONS; + } + + QUrl url = createUrl(details.query, details.location); + QString what; + + if(loggedIn_) + { + switch(type) + { + case YELLOW_PAGES: + what = "mobcs"; + break; + + case PERSONS: + what = "mobwp"; + break; + + default: + what = "moball"; + } + + } + else + { + what = "moball"; + } + + url.addQueryItem("what", what); + + http_.setHost(url.host(), url.port(80)); + int id = http_.get(url.encodedPath() + '?' + url.encodedQuery()); + + QVector results; + + // Store search data for later identification + SearchData* newData = new SearchData; + newData->details = details; + newData->results = results; + newData->foundNumbers = 0; + newData->numbersTotal = 0; + + // Store request id so that it can be identified later + pendingSearches_[id] = newData; + + return true; +} + +Eniro::Error Eniro::error() const +{ + return error_; +} + +const QString& Eniro::errorString() const +{ + return errorString_; +} + +void Eniro::httpReady(int id, bool error) +{ + if(error) + { + qDebug() << "Error: " << http_.errorString(); + } + + searchMap::const_iterator searchIt; + numberMap::const_iterator numberIt; + + // Check if request is pending search request + if((searchIt = pendingSearches_.find(id)) != + pendingSearches_.end()) + { + if(error) + { + error_ = CONNECTION_FAILURE; + errorString_ = http_.errorString(); + emitRequestFinished(id, searchIt.value(), true); + return; + } + + QString result(http_.readAll()); + + // Load results from html data + loadResults(id, result); + } + + // Check if request is pending number requests + else if((numberIt = pendingNumberRequests_.find(id)) != + pendingNumberRequests_.end()) + { + if(error) + { + error_ = CONNECTION_FAILURE; + errorString_ = http_.errorString(); + delete pendingNumberRequests_[id]; + pendingNumberRequests_.remove(id); + return; + } + + QString result(http_.readAll()); + + // Load number from html data + loadNumber(id, result); + } + + // Check for login request + else if(pendingLoginRequests_.find(id) != + pendingLoginRequests_.end()) + { + bool success = true; + + if(!error) + { + QString result(http_.readAll()); + + // If html source contains LOGIN_CHECK, login failed + if(result.indexOf(LOGIN_CHECK) != -1) + { + success = false; + } + } + else + { + success = false; + } + + emit loginStatus(success); + } + +} + +// Loads results from html source code +void Eniro::loadResults(int id, QString const& httpData) +{ + searchMap::iterator it = pendingSearches_.find(id); + QString expr; + + switch(it.value()->details.type) + { + case YELLOW_PAGES: + expr = YELLOW_REGEXP; + break; + case PERSONS: + expr = PERSON_REGEXP; + break; + default: + return; + } + + QRegExp rx(expr); + rx.setMinimal(true); + + bool requestsPending = false; + int pos = 0; + QString data; + + // Find all matches + while((pos = rx.indexIn(httpData, pos)) != -1) + { + pos += rx.matchedLength(); + + data = rx.cap(2); + data = stripTags(data); + QStringList rows = data.split('\n'); + + for(int i = 0; i < rows.size(); i++) + { + // Remove white spaces + QString trimmed = rows.at(i).trimmed().toLower(); + + // Remove empty strings + if(trimmed.isEmpty()) + { + rows.removeAt(i); + i--; + } + else + { + // Convert words to uppercase + rows[i] = ucFirst(trimmed); + } + } + + Result result; + + int size = rows.size(); + + switch(size) + { + case 1: + result.name = rows[0]; + break; + + case 2: + result.name = rows[0]; + result.city = rows[1]; + break; + + case 3: + result.name = rows[0]; + result.street = rows[1]; + result.city = rows[2]; + break; + + case 4: + result.name = rows[0]; + // Remove slashes and spaces from number + result.number = cleanUpNumber(rows[1]); + result.street = rows[2]; + result.city = rows[3]; + break; + + default: + continue; + + } + + it.value()->results.push_back(result); + + unsigned int foundResults = ++(it.value()->numbersTotal); + + // If phone number searh is enabled, we have to make another + // request to find it out + if(findNumber_ && size < 4 && loggedIn_ && + it.value()->details.type != YELLOW_PAGES) + { + requestsPending = true; + getNumberForResult(id, it.value()->results.size() - 1, it.value()->details); + } + // Otherwise result is ready + else + { + emit resultAvailable(result, it.value()->details); + } + + // Stop searching if max results is reached + if(maxResults_ && (foundResults >= maxResults_)) + { + break; + } + } + + // If number there were no results or no phone numbers needed to + // be fetched, the whole request is ready + if(it.value()->numbersTotal == 0 || !requestsPending) + { + bool error = false; + + if(httpData.indexOf(LOGIN_CHECK) != -1) + { + error_ = INVALID_LOGIN; + errorString_ = INVALID_LOGIN_STRING; + error = true; + } + + emitRequestFinished(it.key(), it.value(), error); + } +} + +// Loads phone number from html source +void Eniro::loadNumber(int id, QString const& result) +{ + numberMap::iterator numberIt = pendingNumberRequests_.find(id); + + // Make sure that id exists in pending number requests + if(numberIt == pendingNumberRequests_.end() || numberIt.value() == 0) + { + return; + } + + searchMap::iterator searchIt = pendingSearches_.find(numberIt.value()->searchId); + + if(searchIt == pendingSearches_.end() || searchIt.value() == 0) + { + return; + } + + QRegExp rx(NUMBER_REGEXP); + rx.setMinimal(true); + + int pos = 0; + bool error = true; + + if((pos = rx.indexIn(result, pos)) != -1) + { + QString data = rx.cap(1); + data = stripTags(data); + + QString trimmed = data.trimmed(); + + if(!trimmed.isEmpty()) + { + // Remove whitespaces from number + searchIt.value()->results[numberIt.value()->index].number = cleanUpNumber(trimmed); + + emit resultAvailable(searchIt.value()->results[numberIt.value()->index], searchIt.value()->details); + + unsigned int found = ++searchIt.value()->foundNumbers; + + // Check if all numbers have been found + if(found >= searchIt.value()->numbersTotal) + { + emitRequestFinished(searchIt.key(), searchIt.value(), false); + } + + // If number was found, there was no error + error = false; + } + } + + if(error) + { + error_ = INVALID_LOGIN; + errorString_ = INVALID_LOGIN; + emitRequestFinished(searchIt.key(), searchIt.value(), true); + } + + // Remove number request + int key = numberIt.key(); + + delete pendingNumberRequests_[key]; + pendingNumberRequests_[key] = 0; + pendingNumberRequests_.remove(key); + +} + +QUrl Eniro::createUrl(QString const& query, QString const& location) +{ + QUrl url(SITE_URLS[site_] + "query"); + + if(!query.isEmpty()) + { + url.addQueryItem("search_word", query); + } + + if(!location.isEmpty()) + { + url.addQueryItem("geo_area", location); + } + + if(maxResults_) + { + url.addQueryItem("hpp", QString::number(maxResults_)); + } + if(loggedIn_) + { + url.addQueryItem("login_name", username_); + url.addQueryItem("login_password", password_); + } + + QByteArray path = url.encodedQuery().replace('+', "%2B"); + url.setEncodedQuery(path); + + return url; +} + +// Creates a new request for phone number retrieval +void Eniro::getNumberForResult(int id, int index, SearchDetails const& details) +{ + QUrl url = createUrl(details.query, details.location); + url.addQueryItem("what", "mobwpinfo"); + url.addQueryItem("search_number", QString::number(index + 1)); + + http_.setHost(url.host(), url.port(80)); + int requestId = http_.get(url.encodedPath() + '?' + url.encodedQuery()); + NumberData* number = new NumberData; + number->searchId = id; + number->index = index; + pendingNumberRequests_[requestId] = number; + +} + +void Eniro::emitRequestFinished(int key, SearchData* data, bool error) +{ + + // Do not emit "Request aborted" error + if(!(error && (http_.error() == QHttp::Aborted))) + { + emit requestFinished(data->results, data->details, error); + } + + delete pendingSearches_[key]; + pendingSearches_[key] = 0; + pendingSearches_.remove(key); +} + +QString Eniro::ucFirst(QString& str) +{ + if (str.size() < 1) { + return ""; + } + + QStringList tokens = str.split(" "); + QList::iterator tokItr; + + for (tokItr = tokens.begin(); tokItr != tokens.end(); ++tokItr) + { + (*tokItr) = (*tokItr).at(0).toUpper() + (*tokItr).mid(1); + } + + return tokens.join(" "); +} + +QString& Eniro::cleanUpNumber(QString& number) +{ + return number.replace(numberCleaner_, ""); +} + +QString& Eniro::stripTags(QString& string) +{ + return string.replace(tagStripper_, ""); +} + +QMap Eniro::getSites() +{ + QMap sites; + SiteDetails details; + details.name = tr("Finnish"); + details.id = "fi"; + sites[FI] = details; + + details.name = tr("Swedish"); + details.id = "se"; + sites[SE] = details; + + details.name = tr("Danish"); + details.id = "dk"; + sites[DK] = details; + + return sites; +} + +Eniro::Site Eniro::stringToSite(QString const& str) +{ + Site site = FI; + + QString lower = str.toLower(); + + if(lower == "se" || lower == "swedish") + { + site = SE; + } + else if(lower == "dk" || lower == "danish") + { + site = DK; + } + + return site; +} + +Eniro::SearchDetails::SearchDetails(QString const& q, + QString const& loc, + SearchType t) +{ + query = q; + location = loc; + type = t; +} diff --git a/src/common/eniro.h b/src/common/eniro.h new file mode 100644 index 0000000..af3d3b1 --- /dev/null +++ b/src/common/eniro.h @@ -0,0 +1,140 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef ENIRO_H +#define ENIRO_H + +#include +#include +#include +#include +#include +#include +#include + +class Eniro: public QObject +{ + Q_OBJECT + +public: + + enum Site {FI, SE, DK}; + + enum SearchType {YELLOW_PAGES, PERSONS}; + + enum Error {NO_ERROR, CONNECTION_FAILURE, INVALID_LOGIN}; + + struct Result + { + QString name; + QString street; + QString city; + QString number; + }; + + struct SearchDetails + { + QString query; + QString location; + SearchType type; + SearchDetails(QString const& query = "", + QString const& location = "", + SearchType type = PERSONS); + }; + + struct SiteDetails + { + QString name; + QString id; + }; + + Eniro(Site site, QObject *parent = 0); + + ~Eniro(); + + void login(QString const& username, QString const& password); + void logout(); + void testLogin(); + void setSite(Site); + void setMaxResults(unsigned int value); + void setFindNumber(bool value); + bool search(SearchDetails const& details); + void abort(); + Error error() const; + const QString& errorString() const; + static QMap getSites(); + static Site stringToSite(QString const& str); + +signals: + void resultAvailable(Eniro::Result const& result, Eniro::SearchDetails const& details); + void requestFinished(QVector const& results, Eniro::SearchDetails const& details, bool error); + void loginStatus(bool success); + +private slots: + void httpReady(int id, bool error); + +private: + + Q_DISABLE_COPY(Eniro); + + struct NumberData + { + int searchId; + int index; + }; + + struct SearchData + { + SearchDetails details; + QVector results; + unsigned int foundNumbers; + unsigned int numbersTotal; + }; + + QUrl createUrl(QString const& query, QString const& location); + void loadResults(int id, QString const& data); + void loadNumber(int id, QString const& data); + void getNumberForResult(int id, int index, SearchDetails const& details); + void emitRequestFinished(int key, SearchData* data, bool error); + QString ucFirst(QString& string); + QString& cleanUpNumber(QString& number); + QString& stripTags(QString& string); + + QHttp http_; + Site site_; + QString username_; + QString password_; + bool loggedIn_; + Error error_; + QString errorString_; + unsigned int maxResults_; + bool findNumber_; + typedef QMap searchMap; + typedef QMap numberMap; + + searchMap pendingSearches_; + numberMap pendingNumberRequests_; + QSet pendingLoginRequests_; + + static QRegExp numberCleaner_; + static QRegExp tagStripper_; + +}; + +#endif // ENIRO_H + diff --git a/src/common/settings.cpp b/src/common/settings.cpp new file mode 100644 index 0000000..25fc13b --- /dev/null +++ b/src/common/settings.cpp @@ -0,0 +1,155 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include +#include "settings.h" +#include "db.h" + +Settings* Settings::instance_ = 0; + +Settings* Settings::instance() +{ + if(!instance_) + { + instance_ = new Settings; + } + + return instance_; +} + +bool Settings::set(QString const& name, QString const& value) +{ + bool connected = DB::connected(); + + if(!connected) + { + if(!DB::connect()) + { + return false; + } + } + + QSqlQuery deleteQuery; + deleteQuery.prepare("DELETE FROM settings WHERE name = :name"); + deleteQuery.bindValue(":name", QVariant(name)); + deleteQuery.exec(); + + QSqlQuery query; + query.prepare("INSERT INTO settings(name, value) VALUES(:name, :value)"); + query.bindValue(":name", QVariant(name)); + query.bindValue(":value", QVariant(value)); + + bool returnValue = query.exec(); + + if(!connected) + { + DB::disconnect(); + } + + return returnValue; +} + +QString Settings::get(QString const& name) +{ + QString result = ""; + + bool connected = DB::connected(); + + if(!connected) + { + if(!DB::connect()) + { + return result; + } + } + + QSqlQuery query; + + query.prepare("SELECT value FROM settings WHERE name = :name"); + query.bindValue(":name", name); + + if(query.exec() && query.next()) + { + result = query.value(0).toString(); + } + else + { + result = getDefaultValue(name); + } + + if(!connected) + { + DB::disconnect(); + } + + return result; + +} + +QString Settings::getDefaultValue(QString const& name) +{ + static bool defaultValuesLoaded = false; + static QMap defaultValues; + + if(!defaultValuesLoaded) + { + defaultValues["autostart"] = "1"; + defaultValues["eniro_site"] = tr("fi"); + defaultValues["cache_size"] = "200"; + defaultValuesLoaded = true; + } + + QMap::const_iterator it = defaultValues.find(name); + + if(it != defaultValues.end()) + { + return it.value(); + } + + return ""; + +} + +bool Settings::reset() +{ + bool connected = DB::connected(); + + if(!connected) + { + if(!DB::connect()) + { + return false; + } + } + + QSqlQuery query; + + bool ret = query.exec("DELETE FROM settings"); + + if(!connected) + { + DB::disconnect(); + } + + return ret; +} + +Settings::Settings() +{ +} diff --git a/src/common/settings.h b/src/common/settings.h new file mode 100644 index 0000000..51bdf6c --- /dev/null +++ b/src/common/settings.h @@ -0,0 +1,45 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef SETTINGS_H +#define SETTINGS_H + +#include +#include + +class Settings; + +class Settings +{ + Q_DECLARE_TR_FUNCTIONS(Settings) + +public: + static Settings* instance(); + bool set(QString const& name, QString const& value); + QString get(QString const& name); + QString getDefaultValue(QString const& name); + bool reset(); + +private: + Settings(); + static Settings* instance_; + +}; + +#endif + diff --git a/src/common/translations.grc b/src/common/translations.grc new file mode 100644 index 0000000..7dd5380 --- /dev/null +++ b/src/common/translations.grc @@ -0,0 +1,5 @@ + + + translations/fi_FI.qm + + diff --git a/src/common/translations/fi_FI.qm b/src/common/translations/fi_FI.qm new file mode 100644 index 0000000000000000000000000000000000000000..88980f053315775d3735638fd696f13e0fac4387 GIT binary patch literal 4290 zcmb_fTWB0*6h292FWKE}LoIDmOPPpBZ>CtR52c80l3vmnLbp`{eQ=Wfx0z-$v&d0e0A*t$7Klp5Fi*4_b*K5gT^ zi$oolwNpoWq3@vf$=FdM?NjZ}{Ve2H#g3kb-qgw1hllVyenVZ;x!C!)zr{I(k3_ zeFPjA(g%Ls1N(jHgRAkKE@rmB_czY>W)6>@hTcn=D{U_9-&5D@FPU%lg14^Ux?*EL zLC?*u(?33m?=NGo?fthE1$s6nE|6%95G!_Si)&z15eNn zsGWupR$Zcbn6dCO$%T3!*G+-)Y)%-?g^aBoP$*?EU4L>?xNgBO7R$Pk&x<-g6roLyJO@W?xM4~vbXX2Eig7Vr z)A%gOoXP`Zk)HWM{ zjv6x}`tZKGdeDJ8^z2c1UBKU(EL}Gm)=wSflXl6ha9$;$1?kIa3^aoS8F;R!fb@Xa zOl`47`H=Zhz}Z;=}s}?*pOv9wk+HfFB+y*)0wt4 z0Vx3nw*YS3|0@W)RB8cY;bLrroTQy#sX%rRJ8h>`usL##N3%36Gl(nQrs+T+F)TR5 z(@`>UH5!7maWxF0jxMGxpo&TI5kGksh$VBv^DseV-)_XU7zI-w?r@4^avUx_FM}Cn zHH(miAqoZ4InORFAUDzwYVPfgS=U&0JjEOPzYl-ItXmeAp3JiffXHNP%z8#pn{FOR zsW1EgwqH~FZs>oc`RgcV?kPMebvU7NybLmR6r&2HS_pI+l7+}w^Rx`F>WwZ=9>7^0 zPhDBSEXNB3Kdb6c$)KjYT83C!bu!*z)L5N`ZWFqzLEv)7Hi7SaFNbxc)lYd zDOg2kJ`E;g<(I~`w$xtNWI0*&Jb+r$hbsGN4N#tGoX92KpaKzXPr0O4 zlqUTv(SdmCb2f2qaTC*JkY+h-fr`wyC>HHGy=3ecEud=X#i7mig2_w-?N9Q!p}F6| z8t<*V`Oe_Zz#We}Mk2T3072&#-?L?FVZDgAO5_^npT#c6>mcuETwQ9bR_%>b&xWm4 zh(WO1z}o6S|B?Y?a!Tl~`Kr)YsZhGBTba^0zXQ?apy~47A$QCuWGVPv2C`z!zl6k) z+*Ml2tf=cf4P7QMomF*SGF*4gR!eRafaML!Ol%y!Bq*GoDW%FaJ((*}YI^F_a4lB) zVIv;j6^>Qei=z|`HYEZl9=AO;3+i_wZg_c_ro8`i8P)$!TY`qc!;)K>nwORTYf+}V f<=Q9zG)VN}>Zj$5*_N(9@{Dh^c?j9s-q!XnhYzjL literal 0 HcmV?d00001 diff --git a/src/common/translations/fi_FI.ts b/src/common/translations/fi_FI.ts new file mode 100644 index 0000000..91dcfb8 --- /dev/null +++ b/src/common/translations/fi_FI.ts @@ -0,0 +1,275 @@ + + + + + CallListener + + Searching... + Haetaan... + + + Search failed: + Haku epäonnistui: + + + Phone number was not found + Numeroa ei löytynyt + + + + DetailWindow + + + + Add to contacts + Lisää yhteistietoihin + + + + Copy number to clipboard + Kopioi numero leikepöydälle + + + + + Name + Nimi + + + + Street + Katu + + + + City + Kaupunki + + + + Phone number + Puhelinnumero + + + + Add + Lisää + + + + Contact was successfully added to contacts. + Yhteystieto lisättiin onnistuneesti. + + + + Error + Virhe + + + + Unable to add contact. + Yhteystiedon lisääminen epäonnistui, + + + + Number was successfully copied to clipboard. + Numero kopioitiin onnistuneesti leikepöydälle. + + + + Eniro + + + Finnish + Suomi + + + + Swedish + Ruotsi + + + + Danish + Tanska + + + + MainWindow + + + Jenirok + Jenirok + + + + + Stop daemon + Pysäytä + + + + + Start daemon + Käynnistä + + + + Search + Hae + + + + Settings + Asetukset + + + + Daemon was successfully stopped. + Palvelu pysäytettiin onnistuneesti. + + + + Unable to stop daemon. + Palvelun pysäyttäminen ei onnistunut. + + + + Daemon was successfully started. + Palvelu käynnistettiin onnistuneesti. + + + + Unable to start daemon. + Palvelun käynnistäminen ei onnistunut. + + + + Error + Virhe + + + + Info + Info + + + + You need to set Eniro login details in settings before using this feature. + Sinun täytyy asettaa Eniro-tunnus ja -salasana asetuksista ennen kuin voit käyttää tätä ominaisuutta. + + + + ResultWindow + + + Search results + Hakutulokset + + + + Error + Virhe + + + + No results found + Ei hakutuloksia + + + + SearchDialog + + + + Search + Haku + + + + Name/number + Numero/nimi + + + + Location + Sijainti + + + + Type + Tyyppi + + + + Persons + Henkilöt + + + + Yellow pages + Keltaiset sivut + + + + Settings + + + fi + fi + + + + SettingsDialog + + + Settings + Asetukset + + + + Eniro username + Eniro-tunnus + + + + Eniro password + Eniro-salasana + + + + Cache size (numbers) + Välimuistin koko (numeroa) + + + + Eniro site + Eniro-sivusto + + + + Autostart + Käynnistä automaattisesti + + + + Enabled + Kyllä + + + + Disabled + Ei + + + + Save + Tallenna + + + + Restarting daemon... + Käynnistetään palvelu uudelleen... + + + diff --git a/src/daemon/Makefile b/src/daemon/Makefile new file mode 100644 index 0000000..7cf83fb --- /dev/null +++ b/src/daemon/Makefile @@ -0,0 +1,333 @@ +############################################################################# +# Makefile for building: jenirokd +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed Apr 14 21:02:47 2010 +# Project: daemon.pro +# Template: app +# Command: /usr/bin/qmake -unix -o Makefile daemon.pro +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DDATADIR=\"/usr/share\" -DPKGDATADIR=\"\" -DQT_NO_DEBUG -DQT_MAEMO5_LIB -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -O2 -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) +CXXFLAGS = -pipe -O2 -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) +INCPATH = -I/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++ -I. -I/targets/FREMANTLE_X86/usr/include/QtCore -I/targets/FREMANTLE_X86/usr/include/QtNetwork -I/targets/FREMANTLE_X86/usr/include/QtGui -I/targets/FREMANTLE_X86/usr/include/QtSql -I/targets/FREMANTLE_X86/usr/include/QtMaemo5 -I/targets/FREMANTLE_X86/usr/include -I/targets/FREMANTLE_X86/usr/include/QtDBus -I../common -I. +LINK = g++ +LFLAGS = -Wl,-O1 -Wl,-rpath,/usr/lib +LIBS = $(SUBLIBS) -L/usr/lib -lebook-1.2 -ledataserver-1.2 -lxml2 -lgconf-2 -ldbus-glib-1 -lconic -ldbus-1 -lgobject-2.0 -lglib-2.0 -L/usr/lib -lQtMaemo5 -L/usr/X11R6/lib -lQtSql -lQtGui -lQtNetwork -lQtDBus -lQtXml -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp \ + calllistener.cpp \ + informationbox.cpp \ + ../common/eniro.cpp \ + ../common/contactmanager.cpp \ + ../common/db.cpp \ + ../common/settings.cpp \ + ../common/connectionmanager.cpp moc_calllistener.cpp \ + moc_informationbox.cpp \ + moc_eniro.cpp \ + moc_connectionmanager.cpp \ + qrc_translations.cpp +OBJECTS = main.o \ + calllistener.o \ + informationbox.o \ + eniro.o \ + contactmanager.o \ + db.o \ + settings.o \ + connectionmanager.o \ + moc_calllistener.o \ + moc_informationbox.o \ + moc_eniro.o \ + moc_connectionmanager.o \ + qrc_translations.o +DIST = /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qdbus.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusinterfaces.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusadaptors.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf \ + daemon.pro +QMAKE_TARGET = jenirokd +DESTDIR = +TARGET = jenirokd + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: daemon.pro /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++/qmake.conf /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qdbus.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusinterfaces.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusadaptors.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf \ + /usr/lib/libQtDBus.prl \ + /usr/lib/libQtXml.prl \ + /usr/lib/libQtCore.prl \ + /usr/lib/libQtMaemo5.prl \ + /usr/lib/libQtGui.prl \ + /usr/lib/libQtSql.prl \ + /usr/lib/libQtNetwork.prl + $(QMAKE) -unix -o Makefile daemon.pro +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qdbus.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusinterfaces.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/dbusadaptors.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf: +/usr/lib/libQtDBus.prl: +/usr/lib/libQtXml.prl: +/usr/lib/libQtCore.prl: +/usr/lib/libQtMaemo5.prl: +/usr/lib/libQtGui.prl: +/usr/lib/libQtSql.prl: +/usr/lib/libQtNetwork.prl: +qmake: FORCE + @$(QMAKE) -unix -o Makefile daemon.pro + +dist: + @$(CHK_DIR_EXISTS) .tmp/jenirokd1.0.0 || $(MKDIR) .tmp/jenirokd1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/jenirokd1.0.0/ && $(COPY_FILE) --parents calllistener.h informationbox.h ../common/eniro.h ../common/contactmanager.h ../common/db.h ../common/settings.h ../common/connectionmanager.h .tmp/jenirokd1.0.0/ && $(COPY_FILE) --parents ../common/translations.grc .tmp/jenirokd1.0.0/ && $(COPY_FILE) --parents main.cpp calllistener.cpp informationbox.cpp ../common/eniro.cpp ../common/contactmanager.cpp ../common/db.cpp ../common/settings.cpp ../common/connectionmanager.cpp .tmp/jenirokd1.0.0/ && $(COPY_FILE) --parents ../common/translations/fi_FI.ts .tmp/jenirokd1.0.0/ && (cd `dirname .tmp/jenirokd1.0.0` && $(TAR) jenirokd1.0.0.tar jenirokd1.0.0 && $(COMPRESS) jenirokd1.0.0.tar) && $(MOVE) `dirname .tmp/jenirokd1.0.0`/jenirokd1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/jenirokd1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +compiler_moc_header_make_all: moc_calllistener.cpp moc_informationbox.cpp moc_eniro.cpp moc_connectionmanager.cpp +compiler_moc_header_clean: + -$(DEL_FILE) moc_calllistener.cpp moc_informationbox.cpp moc_eniro.cpp moc_connectionmanager.cpp +moc_calllistener.cpp: informationbox.h \ + calllistener.h + /usr/bin/moc $(DEFINES) $(INCPATH) calllistener.h -o moc_calllistener.cpp + +moc_informationbox.cpp: informationbox.h + /usr/bin/moc $(DEFINES) $(INCPATH) informationbox.h -o moc_informationbox.cpp + +moc_eniro.cpp: ../common/eniro.h + /usr/bin/moc $(DEFINES) $(INCPATH) ../common/eniro.h -o moc_eniro.cpp + +moc_connectionmanager.cpp: ../common/connectionmanager.h + /usr/bin/moc $(DEFINES) $(INCPATH) ../common/connectionmanager.h -o moc_connectionmanager.cpp + +compiler_dbus_interface_source_make_all: +compiler_dbus_interface_source_clean: +compiler_dbus_adaptor_source_make_all: +compiler_dbus_adaptor_source_clean: +compiler_rcc_make_all: qrc_translations.cpp +compiler_rcc_clean: + -$(DEL_FILE) qrc_translations.cpp +qrc_translations.cpp: ../common/translations.grc \ + ../common/translations/fi_FI.qm + /usr/bin/rcc -name translations ../common/translations.grc -o qrc_translations.cpp + +compiler_image_collection_make_all: qmake_image_collection.cpp +compiler_image_collection_clean: + -$(DEL_FILE) qmake_image_collection.cpp +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_dbus_interface_header_make_all: +compiler_dbus_interface_header_clean: +compiler_dbus_interface_moc_make_all: +compiler_dbus_interface_moc_clean: +compiler_dbus_adaptor_header_make_all: +compiler_dbus_adaptor_header_clean: +compiler_dbus_adaptor_moc_make_all: +compiler_dbus_adaptor_moc_clean: +compiler_uic_make_all: +compiler_uic_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_moc_header_clean compiler_rcc_clean + +####### Compile + +main.o: main.cpp calllistener.h \ + informationbox.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +calllistener.o: calllistener.cpp calllistener.h \ + informationbox.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o calllistener.o calllistener.cpp + +informationbox.o: informationbox.cpp informationbox.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o informationbox.o informationbox.cpp + +eniro.o: ../common/eniro.cpp ../common/eniro.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o eniro.o ../common/eniro.cpp + +contactmanager.o: ../common/contactmanager.cpp ../common/contactmanager.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o contactmanager.o ../common/contactmanager.cpp + +db.o: ../common/db.cpp ../common/db.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o db.o ../common/db.cpp + +settings.o: ../common/settings.cpp ../common/settings.h \ + ../common/db.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o settings.o ../common/settings.cpp + +connectionmanager.o: ../common/connectionmanager.cpp ../common/connectionmanager.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o connectionmanager.o ../common/connectionmanager.cpp + +moc_calllistener.o: moc_calllistener.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_calllistener.o moc_calllistener.cpp + +moc_informationbox.o: moc_informationbox.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_informationbox.o moc_informationbox.cpp + +moc_eniro.o: moc_eniro.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_eniro.o moc_eniro.cpp + +moc_connectionmanager.o: moc_connectionmanager.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_connectionmanager.o moc_connectionmanager.cpp + +qrc_translations.o: qrc_translations.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_translations.o qrc_translations.cpp + +####### Install + +install_target: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/bin/ + -$(INSTALL_PROGRAM) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + -$(STRIP) "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + +uninstall_target: FORCE + -$(DEL_FILE) "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + -$(DEL_DIR) $(INSTALL_ROOT)/usr/bin/ + + +install_init: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/etc/init.d/ || $(MKDIR) $(INSTALL_ROOT)/etc/init.d/ + -$(INSTALL_PROGRAM) /home/maemo/workspace/jenirok/src/daemon/data/jenirokd $(INSTALL_ROOT)/etc/init.d/ + -strip $(INSTALL_ROOT)/etc/init.d/jenirokd + + +uninstall_init: FORCE + -$(DEL_FILE) -r $(INSTALL_ROOT)/etc/init.d/jenirokd + -$(DEL_DIR) $(INSTALL_ROOT)/etc/init.d/ + + +install: install_target install_init FORCE + +uninstall: uninstall_target uninstall_init FORCE + +FORCE: + diff --git a/src/daemon/calllistener.cpp b/src/daemon/calllistener.cpp new file mode 100644 index 0000000..93fb100 --- /dev/null +++ b/src/daemon/calllistener.cpp @@ -0,0 +1,239 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include +#include "calllistener.h" +#include "settings.h" +#include "db.h" + +namespace +{ + const QString CALL_SERVICE_NAME = "com.nokia.csd"; + const QString CALL_SERVICE_PATH = "/com/nokia/csd/call"; + const QString CALL_SERVICE_INTERFACE = "com.nokia.csd.Call"; + const QString CALL_SERVICE_INSTANCE_NAME = "com.nokia.csd.Call.Instance"; + const QString CALL_SIGNAL_INCOMING = "Coming"; + const QString CALL_SIGNAL_RELEASE = "Release"; + const QString CALL_SIGNAL_TERMINATED = "Terminated"; +} + +QDBusConnection CallListener::systemBus_ = QDBusConnection::systemBus(); + +CallListener::CallListener(): eniro_(0), contactManager_(0), box_(0), label_(0) +{ +} + +CallListener::~CallListener() +{ + end(); +} + +void CallListener::begin() +{ + systemBus_.connect(CALL_SERVICE_NAME, + CALL_SERVICE_PATH, + CALL_SERVICE_INTERFACE, + CALL_SIGNAL_INCOMING, + this, + SLOT(incomingCall(QDBusObjectPath, QString))); + + systemBus_.connect(CALL_SERVICE_NAME, + CALL_SERVICE_PATH, + CALL_SERVICE_INTERFACE, + CALL_SIGNAL_RELEASE, + this, + SLOT(callTerminate())); + + contactManager_ = new ContactManager; + + eniro_ = new Eniro(Eniro::stringToSite(Settings::instance()->get("site"))); + + eniro_->setMaxResults(1); + eniro_->setFindNumber(false); + + connect(eniro_, SIGNAL(requestFinished(QVector const&, + Eniro::SearchDetails const&, bool)), + this, SLOT(requestFinished(QVector const&, + Eniro::SearchDetails const&, bool))); + + box_ = new InformationBox(); + label_ = new QLabel("", box_); + label_->setMargin(10); + box_->setWidget(label_); + +} + +void CallListener::end() +{ + systemBus_.disconnect(CALL_SERVICE_NAME, + CALL_SERVICE_PATH, + CALL_SERVICE_INTERFACE, + CALL_SIGNAL_INCOMING, + this, + SLOT(incomingCall(QDBusObjectPath, QString))); + + systemBus_.disconnect(CALL_SERVICE_NAME, + CALL_SERVICE_PATH, + CALL_SERVICE_INTERFACE, + CALL_SIGNAL_RELEASE, + this, + SLOT(callTerminate())); + + delete eniro_; + eniro_ = 0; + delete box_; + box_ = 0; + delete label_; + label_ = 0; +} + +void CallListener::search(Eniro::SearchDetails const& details) +{ + label_->setText(tr("Searching...")); + box_->show(); + + DB::connect(); + + QSqlQuery query; + query.prepare("SELECT name, street, city FROM cache WHERE number = :number"); + query.bindValue(":number", details.query); + + if(query.exec() && query.next()) + { + showResult(createResult(query.value(0).toString(), + query.value(1).toString(), + query.value(2).toString())); + + } + else + { + eniro_->search(details); + } + + DB::disconnect(); + +} + +void CallListener::requestFinished(QVector const& results, + Eniro::SearchDetails const& details, + bool error) +{ + qDebug() << "Found: " << results.size(); + + // If box is not visible, the call must have been terminated already + if(!box_->isVisible()) + { + return; + } + + QString message; + + if(error) + { + qDebug() << "Error: " << eniro_->errorString(); + message = tr("Search failed:") + " " + eniro_->errorString(); + } + else if(results.size() == 0) + { + message = tr("Phone number was not found"); + } + else + { + message = createResult(results.at(0).name, results.at(0).street, results.at(0).city); + QSqlQuery query; + + DB::connect(); + + query.prepare("INSERT INTO cache(number, name, street, city) VALUES(:number, :name, :street, :city)"); + query.bindValue(":number", details.query); + query.bindValue(":name", results.at(0).name); + query.bindValue(":street", results.at(0).street); + query.bindValue(":city", results.at(0).city); + + if(!query.exec()) + { + qDebug() << "Unable to save cache"; + } + + QString cacheSize = Settings::instance()->get("cache_size"); + + // Delete old entries from cache + if(cacheSize.toInt() > 0) + { + if(!query.exec("DELETE c1 FROM cache AS c1 LEFT JOIN (SELECT id FROM cache ORDER BY id DESC LIMIT " + cacheSize + ") AS c2 ON c1.id = c2.id WHERE c2.id IS NULL")) + { + qDebug() << "Unable to delete old cache entries"; + } + } + + DB::disconnect(); + } + + showResult(message); + +} + +QString CallListener::createResult(QString const& name, QString const& street, QString const& city) +{ + QString result = "" + name + ""; + + if(!street.isEmpty() || !city.isEmpty()) + { + result += "
"; + + if(!street.isEmpty()) + { + result += street + ", "; + } + + result += city; + } + + return result; +} + +void CallListener::showResult(QString const& text) +{ + label_->setText(text); + box_->hide(); + box_->show(); +} + +void CallListener::incomingCall(QDBusObjectPath path, QString number) +{ + qDebug() << number; + + if(!contactManager_->numberExists(number)) + { + + systemBus_.connect(CALL_SERVICE_NAME, + path.path(), + CALL_SERVICE_INSTANCE_NAME, + CALL_SIGNAL_TERMINATED, + this, + SLOT(callTerminate())); + + search(Eniro::SearchDetails(number)); + } +} + +void CallListener::callTerminate() +{ + box_->hide(); +} diff --git a/src/daemon/calllistener.h b/src/daemon/calllistener.h new file mode 100644 index 0000000..7e47306 --- /dev/null +++ b/src/daemon/calllistener.h @@ -0,0 +1,60 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef CALLLISTENER_H +#define CALLLISTENER_H + +#include +#include +#include +#include +#include +#include "informationbox.h" +#include "eniro.h" +#include "contactmanager.h" + +class CallListener: public QObject +{ + + Q_OBJECT + +public: + CallListener(); + ~CallListener(); + void begin(); + void end(); + +private slots: + void requestFinished(QVector const& results, Eniro::SearchDetails const& details, bool error); + void incomingCall(QDBusObjectPath path, QString numbe); + void callTerminate(); + +private: + Q_DISABLE_COPY(CallListener); + + void search(Eniro::SearchDetails const& details); + void showResult(QString const& text); + QString createResult(QString const& name, QString const& street, QString const& city); + Eniro* eniro_; + ContactManager* contactManager_; + InformationBox* box_; + QLabel* label_; + static QDBusConnection systemBus_; +}; + +#endif // CALLLISTENER_H diff --git a/src/daemon/daemon.pro b/src/daemon/daemon.pro new file mode 100644 index 0000000..3a8b219 --- /dev/null +++ b/src/daemon/daemon.pro @@ -0,0 +1,32 @@ +QT += network sql maemo5 +TARGET = jenirokd +CONFIG += qdbus +TEMPLATE = app +SOURCES += main.cpp calllistener.cpp informationbox.cpp ../common/eniro.cpp ../common/contactmanager.cpp ../common/db.cpp ../common/settings.cpp ../common/connectionmanager.cpp +HEADERS += calllistener.h informationbox.h ../common/eniro.h ../common/contactmanager.h ../common/db.h ../common/settings.h ../common/connectionmanager.h +TRANSLATIONS = ../common/translations/fi_FI.ts +RESOURCES = ../common/translations.grc +INCLUDEPATH += ../common +CONFIG += link_pkgconfig +PKGCONFIG += libebook-1.2 glib-2.0 conic + +unix { + #VARIABLES + isEmpty(PREFIX) { + PREFIX = /usr + } + + BINDIR = $$PREFIX/bin + DATADIR =$$PREFIX/share + + DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\" + + #MAKE INSTALL + + INSTALLS += target init + + target.path =$$BINDIR + + init.path = /etc/init.d + init.files += data/jenirokd +} diff --git a/src/daemon/data/jenirokd b/src/daemon/data/jenirokd new file mode 100755 index 0000000..4be7cda --- /dev/null +++ b/src/daemon/data/jenirokd @@ -0,0 +1,32 @@ +#!/bin/sh + +NAME=jenirokd +DAEMON=/usr/bin/jenirokd + +export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" + +case "$1" in + start) + echo -n "Starting daemon: "$NAME + start-stop-daemon --start --background --exec $DAEMON + echo "." + ;; + stop) + echo -n "Stopping daemon: "$NAME + start-stop-daemon --stop --oknodo --name $NAME + echo "." + ;; + restart) + echo -n "Restarting daemon: "$NAME + start-stop-daemon --stop --quiet --oknodo --retry 30 --name $NAME + start-stop-daemon --start --quiet --background --exec $DAEMON + echo "." + ;; + + *) + echo "Usage: "$0" {start|stop|restart}" + exit 1 +esac + +exit 0 + diff --git a/src/daemon/informationbox.cpp b/src/daemon/informationbox.cpp new file mode 100644 index 0000000..e0795a3 --- /dev/null +++ b/src/daemon/informationbox.cpp @@ -0,0 +1,220 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "informationbox.h" + +class InformationBoxPrivate +{ + Q_DECLARE_PUBLIC(InformationBox) + +public: + InformationBoxPrivate() + : m_timeout(InformationBox::DefaultTimeout), + m_timer_id(0), m_layout(0), m_widget(0), q_ptr(0) + { } + + void enforceInformationType(); + + int m_timeout; + int m_timer_id; + QBoxLayout *m_layout; + QWidget *m_widget; + InformationBox *q_ptr; +}; + +/*! + Constructs an information box with no text, a default timeout + (\c DefaultTimeout) and the given \a parent widget. +*/ +InformationBox::InformationBox(QWidget *parent) + : QDialog(parent, Qt::CustomizeWindowHint), d_ptr(new InformationBoxPrivate()) +{ + Q_D(InformationBox); + d_ptr->q_ptr = this; + + setAttribute(Qt::WA_X11NetWmWindowTypeNotification); + setAttribute(Qt::WA_ShowWithoutActivating); + setFocusPolicy(Qt::NoFocus); + d->m_layout = new QHBoxLayout(this); + d->m_layout->setContentsMargins(8, 0, 8, 0); // 8 == HILDON_MARGIN_DEFAULT + setFixedWidth(QApplication::desktop()->screenGeometry().width()); + //move(0, 56 /*HILDON_WINDOW_TITLEBAR_HEIGHT*/); +} + +/*! + Destroys the information box. +*/ +InformationBox::~InformationBox() +{ } + +/*! \internal + */ +void InformationBoxPrivate::enforceInformationType() +{ + Q_Q(InformationBox); + + const char *type = "_HILDON_NOTIFICATION_TYPE_BANNER"; + + Atom atom = XInternAtom(QX11Info::display(), "_HILDON_NOTIFICATION_TYPE", False); + + XChangeProperty(QX11Info::display(), q->winId(), atom, XA_STRING, 8, + PropModeReplace, (unsigned char *) type, qstrlen(type)); +} + +/*! + \property InformationBox::timeout + \brief the timeout after which the informaton box should automatically be + hidden. + + Setting this value while the box is already visible will reset its timer. + + The timeout value can be specified as an arbitrary millisecond value, + although it is recommended to use the predefined values \c NoTimeout (for + Hildon Notes) and \c DefaultTimeout (for style guide compliant Banners). + + The default value of this property is \c DefaultTimeout (3 seconds). +*/ + +int InformationBox::timeout() const +{ + Q_D(const InformationBox); + return d->m_timeout; +} + +void InformationBox::setTimeout(unsigned int ms) +{ + Q_D(InformationBox); + d->m_timeout = ms; + + // restart the timer + if (d->m_timeout != InformationBox::NoTimeout + && d->m_timer_id) { + killTimer(d->m_timer_id); + d->m_timer_id = startTimer(d->m_timeout); + } +} + +/*! + Returns the central widget of the information box. +*/ +QWidget *InformationBox::widget() const +{ + Q_D(const InformationBox); + return d->m_widget; +} + +/*! + Sets the central widget of the information box to \a widget. + + InformationBox will take ownership of \a widget by reparenting + it. Any previously set widget() will be destroyed. +*/ +void InformationBox::setWidget(QWidget *widget) +{ + Q_D(InformationBox); + delete d->m_widget; + d->m_widget = widget; + if (widget) { + d->m_layout->addWidget(widget); + widget->show(); + } +} + +/*! \reimp +*/ +void InformationBox::showEvent(QShowEvent *) +{ + Q_D(InformationBox); + + d->enforceInformationType(); + if (d->m_timeout != InformationBox::NoTimeout) + d->m_timer_id = startTimer(d->m_timeout); +} + +/*! \reimp +*/ +void InformationBox::timerEvent(QTimerEvent *te) +{ + Q_D(InformationBox); + + if (te->timerId() == d->m_timer_id) { + killTimer(d->m_timer_id); + hide(); + } +} + +/*! \reimp +*/ +void InformationBox::mousePressEvent(QMouseEvent *me) +{ + if (me->button() == Qt::LeftButton) { + hide(); + emit clicked(); + } +} + +/*! \reimp +*/ +void InformationBox::paintEvent(QPaintEvent *) +{ + if (qobject_cast(style())) { + QPainter painter(this); + QStyleOption option; + option.initFrom(this); + style()->drawPrimitive(static_cast(QMaemo5Style::PE_Maemo5InformationBox), + &option, &painter, this); + } +} + diff --git a/src/daemon/informationbox.h b/src/daemon/informationbox.h new file mode 100644 index 0000000..df3c7fc --- /dev/null +++ b/src/daemon/informationbox.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* Modifications done for Jenirok: + * All boxes changed to notifications + * Default timeout changed to 0 + * Box hides itself on click instead of closing + */ + +#ifndef InformationBox_H +#define InformationBox_H + +#include + +class InformationBoxPrivate; + +class InformationBox: public QDialog +{ + Q_OBJECT + Q_PROPERTY(int timeout READ timeout WRITE setTimeout) + +public: + explicit InformationBox(QWidget *parent = 0); + ~InformationBox(); + + void setWidget(QWidget *widget); + QWidget *widget() const; + + enum { NoTimeout = 0, DefaultTimeout = 0 }; + + void setTimeout(unsigned int ms); + int timeout() const; + +signals: + void clicked(); + +protected: + void showEvent(QShowEvent *se); + void timerEvent(QTimerEvent *te); + void mousePressEvent(QMouseEvent *me); + void paintEvent(QPaintEvent *pe); + +protected: + QScopedPointer d_ptr; + +private: + Q_DISABLE_COPY(InformationBox) + Q_DECLARE_PRIVATE(InformationBox) +}; + +#endif // InformationBox_H diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp new file mode 100644 index 0000000..e069e26 --- /dev/null +++ b/src/daemon/main.cpp @@ -0,0 +1,39 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include +#include +#include +#include "calllistener.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QTranslator translator; + translator.load(":/translations/" + QLocale::system().name()); + app.installTranslator(&translator); + + CallListener listener; + + listener.begin(); + + return app.exec(); + +} diff --git a/src/gui/Makefile b/src/gui/Makefile new file mode 100644 index 0000000..7d03770 --- /dev/null +++ b/src/gui/Makefile @@ -0,0 +1,433 @@ +############################################################################# +# Makefile for building: jenirok +# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed Apr 14 21:02:34 2010 +# Project: gui.pro +# Template: app +# Command: /usr/bin/qmake -unix -o Makefile gui.pro +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DDATADIR=\"/usr/share\" -DPKGDATADIR=\"\" -DQT_NO_DEBUG -DQT_MAEMO5_LIB -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -O2 -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) +CXXFLAGS = -pipe -O2 -I/usr/include/evolution-data-server-1.4 -I/usr/include/dbus-1.0 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gconf/2 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/conic -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -W -D_REENTRANT $(DEFINES) +INCPATH = -I/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++ -I. -I/targets/FREMANTLE_X86/usr/include/QtCore -I/targets/FREMANTLE_X86/usr/include/QtNetwork -I/targets/FREMANTLE_X86/usr/include/QtGui -I/targets/FREMANTLE_X86/usr/include/QtSql -I/targets/FREMANTLE_X86/usr/include/QtMaemo5 -I/targets/FREMANTLE_X86/usr/include -I../common -I. +LINK = g++ +LFLAGS = -Wl,-O1 -Wl,-rpath,/usr/lib +LIBS = $(SUBLIBS) -L/usr/lib -lebook-1.2 -ledataserver-1.2 -lxml2 -lgconf-2 -ldbus-glib-1 -lconic -ldbus-1 -lgobject-2.0 -lglib-2.0 -lQtMaemo5 -L/usr/lib -L/usr/X11R6/lib -lQtSql -lQtGui -lQtNetwork -lQtDBus -lQtXml -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp \ + mainwindow.cpp \ + searchdialog.cpp \ + resultwindow.cpp \ + detailwindow.cpp \ + settingsdialog.cpp \ + buttonselector.cpp \ + daemon.cpp \ + ../common/eniro.cpp \ + ../common/contactmanager.cpp \ + ../common/db.cpp \ + ../common/settings.cpp \ + ../common/connectionmanager.cpp moc_mainwindow.cpp \ + moc_searchdialog.cpp \ + moc_resultwindow.cpp \ + moc_detailwindow.cpp \ + moc_settingsdialog.cpp \ + moc_eniro.cpp \ + moc_connectionmanager.cpp \ + qrc_icons.cpp \ + qrc_translations.cpp +OBJECTS = main.o \ + mainwindow.o \ + searchdialog.o \ + resultwindow.o \ + detailwindow.o \ + settingsdialog.o \ + buttonselector.o \ + daemon.o \ + eniro.o \ + contactmanager.o \ + db.o \ + settings.o \ + connectionmanager.o \ + moc_mainwindow.o \ + moc_searchdialog.o \ + moc_resultwindow.o \ + moc_detailwindow.o \ + moc_settingsdialog.o \ + moc_eniro.o \ + moc_connectionmanager.o \ + qrc_icons.o \ + qrc_translations.o +DIST = /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf \ + gui.pro +QMAKE_TARGET = jenirok +DESTDIR = +TARGET = jenirok + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: gui.pro /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/linux-g++/qmake.conf /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf \ + /targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf \ + /usr/lib/libQtMaemo5.prl \ + /usr/lib/libQtDBus.prl \ + /usr/lib/libQtXml.prl \ + /usr/lib/libQtCore.prl \ + /usr/lib/libQtGui.prl \ + /usr/lib/libQtSql.prl \ + /usr/lib/libQtNetwork.prl + $(QMAKE) -unix -o Makefile gui.pro +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/g++.conf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/unix.conf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/common/linux.conf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/qconfig.pri: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_functions.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt_config.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_pre.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/release.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/default_post.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/link_pkgconfig.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/warn_on.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/qt.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/unix/thread.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/moc.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/resources.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/uic.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/yacc.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/lex.prf: +/targets/FREMANTLE_X86/usr/share/qt4/mkspecs/features/include_source_dir.prf: +/usr/lib/libQtMaemo5.prl: +/usr/lib/libQtDBus.prl: +/usr/lib/libQtXml.prl: +/usr/lib/libQtCore.prl: +/usr/lib/libQtGui.prl: +/usr/lib/libQtSql.prl: +/usr/lib/libQtNetwork.prl: +qmake: FORCE + @$(QMAKE) -unix -o Makefile gui.pro + +dist: + @$(CHK_DIR_EXISTS) .tmp/jenirok1.0.0 || $(MKDIR) .tmp/jenirok1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/jenirok1.0.0/ && $(COPY_FILE) --parents mainwindow.h searchdialog.h resultwindow.h detailwindow.h settingsdialog.h buttonselector.h daemon.h ../common/eniro.h ../common/contactmanager.h ../common/db.h ../common/settings.h ../common/connectionmanager.h .tmp/jenirok1.0.0/ && $(COPY_FILE) --parents icons.grc ../common/translations.grc .tmp/jenirok1.0.0/ && $(COPY_FILE) --parents main.cpp mainwindow.cpp searchdialog.cpp resultwindow.cpp detailwindow.cpp settingsdialog.cpp buttonselector.cpp daemon.cpp ../common/eniro.cpp ../common/contactmanager.cpp ../common/db.cpp ../common/settings.cpp ../common/connectionmanager.cpp .tmp/jenirok1.0.0/ && $(COPY_FILE) --parents ../common/translations/fi_FI.ts .tmp/jenirok1.0.0/ && (cd `dirname .tmp/jenirok1.0.0` && $(TAR) jenirok1.0.0.tar jenirok1.0.0 && $(COMPRESS) jenirok1.0.0.tar) && $(MOVE) `dirname .tmp/jenirok1.0.0`/jenirok1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/jenirok1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +compiler_moc_header_make_all: moc_mainwindow.cpp moc_searchdialog.cpp moc_resultwindow.cpp moc_detailwindow.cpp moc_settingsdialog.cpp moc_eniro.cpp moc_connectionmanager.cpp +compiler_moc_header_clean: + -$(DEL_FILE) moc_mainwindow.cpp moc_searchdialog.cpp moc_resultwindow.cpp moc_detailwindow.cpp moc_settingsdialog.cpp moc_eniro.cpp moc_connectionmanager.cpp +moc_mainwindow.cpp: searchdialog.h \ + buttonselector.h \ + settingsdialog.h \ + mainwindow.h + /usr/bin/moc $(DEFINES) $(INCPATH) mainwindow.h -o moc_mainwindow.cpp + +moc_searchdialog.cpp: buttonselector.h \ + searchdialog.h + /usr/bin/moc $(DEFINES) $(INCPATH) searchdialog.h -o moc_searchdialog.cpp + +moc_resultwindow.cpp: searchdialog.h \ + buttonselector.h \ + resultwindow.h + /usr/bin/moc $(DEFINES) $(INCPATH) resultwindow.h -o moc_resultwindow.cpp + +moc_detailwindow.cpp: searchdialog.h \ + buttonselector.h \ + detailwindow.h + /usr/bin/moc $(DEFINES) $(INCPATH) detailwindow.h -o moc_detailwindow.cpp + +moc_settingsdialog.cpp: buttonselector.h \ + settingsdialog.h + /usr/bin/moc $(DEFINES) $(INCPATH) settingsdialog.h -o moc_settingsdialog.cpp + +moc_eniro.cpp: ../common/eniro.h + /usr/bin/moc $(DEFINES) $(INCPATH) ../common/eniro.h -o moc_eniro.cpp + +moc_connectionmanager.cpp: ../common/connectionmanager.h + /usr/bin/moc $(DEFINES) $(INCPATH) ../common/connectionmanager.h -o moc_connectionmanager.cpp + +compiler_rcc_make_all: qrc_icons.cpp qrc_translations.cpp +compiler_rcc_clean: + -$(DEL_FILE) qrc_icons.cpp qrc_translations.cpp +qrc_icons.cpp: icons.grc \ + icons/stop.png \ + icons/start.png + /usr/bin/rcc -name icons icons.grc -o qrc_icons.cpp + +qrc_translations.cpp: ../common/translations.grc \ + ../common/translations/fi_FI.qm + /usr/bin/rcc -name translations ../common/translations.grc -o qrc_translations.cpp + +compiler_image_collection_make_all: qmake_image_collection.cpp +compiler_image_collection_clean: + -$(DEL_FILE) qmake_image_collection.cpp +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: +compiler_uic_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_moc_header_clean compiler_rcc_clean + +####### Compile + +main.o: main.cpp mainwindow.h \ + searchdialog.h \ + buttonselector.h \ + settingsdialog.h \ + resultwindow.h \ + detailwindow.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +mainwindow.o: mainwindow.cpp mainwindow.h \ + searchdialog.h \ + buttonselector.h \ + settingsdialog.h \ + daemon.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp + +searchdialog.o: searchdialog.cpp searchdialog.h \ + buttonselector.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o searchdialog.o searchdialog.cpp + +resultwindow.o: resultwindow.cpp resultwindow.h \ + searchdialog.h \ + buttonselector.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o resultwindow.o resultwindow.cpp + +detailwindow.o: detailwindow.cpp detailwindow.h \ + searchdialog.h \ + buttonselector.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o detailwindow.o detailwindow.cpp + +settingsdialog.o: settingsdialog.cpp settingsdialog.h \ + buttonselector.h \ + daemon.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o settingsdialog.o settingsdialog.cpp + +buttonselector.o: buttonselector.cpp buttonselector.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o buttonselector.o buttonselector.cpp + +daemon.o: daemon.cpp daemon.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o daemon.o daemon.cpp + +eniro.o: ../common/eniro.cpp ../common/eniro.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o eniro.o ../common/eniro.cpp + +contactmanager.o: ../common/contactmanager.cpp ../common/contactmanager.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o contactmanager.o ../common/contactmanager.cpp + +db.o: ../common/db.cpp ../common/db.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o db.o ../common/db.cpp + +settings.o: ../common/settings.cpp ../common/settings.h \ + ../common/db.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o settings.o ../common/settings.cpp + +connectionmanager.o: ../common/connectionmanager.cpp ../common/connectionmanager.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o connectionmanager.o ../common/connectionmanager.cpp + +moc_mainwindow.o: moc_mainwindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp + +moc_searchdialog.o: moc_searchdialog.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_searchdialog.o moc_searchdialog.cpp + +moc_resultwindow.o: moc_resultwindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_resultwindow.o moc_resultwindow.cpp + +moc_detailwindow.o: moc_detailwindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_detailwindow.o moc_detailwindow.cpp + +moc_settingsdialog.o: moc_settingsdialog.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_settingsdialog.o moc_settingsdialog.cpp + +moc_eniro.o: moc_eniro.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_eniro.o moc_eniro.cpp + +moc_connectionmanager.o: moc_connectionmanager.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_connectionmanager.o moc_connectionmanager.cpp + +qrc_icons.o: qrc_icons.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_icons.o qrc_icons.cpp + +qrc_translations.o: qrc_translations.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_translations.o qrc_translations.cpp + +####### Install + +install_target: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/bin/ + -$(INSTALL_PROGRAM) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + -$(STRIP) "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + +uninstall_target: FORCE + -$(DEL_FILE) "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + -$(DEL_DIR) $(INSTALL_ROOT)/usr/bin/ + + +install_desktop: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/applications/hildon/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/applications/hildon/ + -$(INSTALL_FILE) /home/maemo/workspace/jenirok/src/gui/data/jenirok.desktop $(INSTALL_ROOT)/usr/share/applications/hildon/ + + +uninstall_desktop: FORCE + -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/applications/hildon/jenirok.desktop + -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/applications/hildon/ + + +install_iconxpm: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/pixmap/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/pixmap/ + -$(INSTALL_PROGRAM) /home/maemo/workspace/jenirok/src/gui/data/maemo/jenirok.xpm $(INSTALL_ROOT)/usr/share/pixmap/ + -strip $(INSTALL_ROOT)/usr/share/pixmap/jenirok.xpm + + +uninstall_iconxpm: FORCE + -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/pixmap/jenirok.xpm + -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/pixmap/ + + +install_icon26: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/icons/hicolor/26x26/apps/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/26x26/apps/ + -$(INSTALL_FILE) /home/maemo/workspace/jenirok/src/gui/data/26x26/jenirok.png $(INSTALL_ROOT)/usr/share/icons/hicolor/26x26/apps/ + + +uninstall_icon26: FORCE + -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/icons/hicolor/26x26/apps/jenirok.png + -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/26x26/apps/ + + +install_icon48: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/icons/hicolor/48x48/apps/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/48x48/apps/ + -$(INSTALL_FILE) /home/maemo/workspace/jenirok/src/gui/data/48x48/jenirok.png $(INSTALL_ROOT)/usr/share/icons/hicolor/48x48/apps/ + + +uninstall_icon48: FORCE + -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/icons/hicolor/48x48/apps/jenirok.png + -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/48x48/apps/ + + +install_icon64: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ + -$(INSTALL_FILE) /home/maemo/workspace/jenirok/src/gui/data/64x64/jenirok.png $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ + + +uninstall_icon64: FORCE + -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/jenirok.png + -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ + + +install: install_target install_desktop install_iconxpm install_icon26 install_icon48 install_icon64 FORCE + +uninstall: uninstall_target uninstall_desktop uninstall_iconxpm uninstall_icon26 uninstall_icon48 uninstall_icon64 FORCE + +FORCE: + diff --git a/src/gui/buttonselector.cpp b/src/gui/buttonselector.cpp new file mode 100644 index 0000000..67ef3db --- /dev/null +++ b/src/gui/buttonselector.cpp @@ -0,0 +1,83 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include "buttonselector.h" + +ButtonSelector::ButtonSelector(QString const& text, QWidget* parent): QMaemo5ValueButton(text, parent), +selector_(0), model_(0) +{ + setValueLayout(QMaemo5ValueButton::ValueBesideText); + selector_ = new QMaemo5ListPickSelector(this); + model_ = new QStandardItemModel(0, 1); + selector_->setModel(model_); + setPickSelector(selector_); +} + +void ButtonSelector::addItem(QString const& text) +{ + addItem(text, QVariant(text)); +} + +void ButtonSelector::addItem(QString const& text, QVariant const& value) +{ + QStandardItem* item = new QStandardItem(text); + item->setData(value, Qt::UserRole); + item->setTextAlignment(Qt::AlignCenter); + item->setEditable(false); + model_->appendRow(item); + + if(selector_->currentIndex() < 0) + { + selector_->setCurrentIndex(0); + } +} + +void ButtonSelector::clear() +{ + model_->clear(); +} + +void ButtonSelector::setCurrentIndex(int index) +{ + selector_->setCurrentIndex(index); +} + +int ButtonSelector::currentIndex() const +{ + return selector_->currentIndex(); +} + +QString ButtonSelector::text() const +{ + return selector_->currentValueText(); +} + +QVariant ButtonSelector::value() const +{ + int currentIndex = selector_->currentIndex(); + + if(currentIndex < 0) + { + return QVariant(""); + } + + QStandardItem* item = model_->item(currentIndex); + + return item->data(Qt::UserRole); +} diff --git a/src/gui/buttonselector.h b/src/gui/buttonselector.h new file mode 100644 index 0000000..74f878e --- /dev/null +++ b/src/gui/buttonselector.h @@ -0,0 +1,46 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef BUTTONSELECTOR_H +#define BUTTONSELECTOR_H + +#include +#include +#include +#include +#include + +class ButtonSelector : public QMaemo5ValueButton +{ +public: + ButtonSelector(QString const& text, QWidget* parent = 0); + void addItem(QString const& text); + void addItem(QString const& text, QVariant const& value); + void clear(); + void setCurrentIndex(int index); + int currentIndex() const; + QString text() const; + QVariant value() const; + +private: + QMaemo5ListPickSelector* selector_; + QStandardItemModel* model_; + +}; + +#endif diff --git a/src/gui/daemon.cpp b/src/gui/daemon.cpp new file mode 100644 index 0000000..32a3f1a --- /dev/null +++ b/src/gui/daemon.cpp @@ -0,0 +1,117 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include +#include "daemon.h" + +namespace +{ + const QString DAEMON_NAME = "jenirokd"; + const QString INIT_DIR = "/etc/init.d"; + const QString AUTOSTART_ENABLE = "update-rc.d jenirokd defaults 99"; + const QString AUTOSTART_DISABLE = "update-rc.d -f jenirokd remove"; +} + +bool Daemon::start() +{ + QProcess proc; + proc.start(INIT_DIR + "/" + DAEMON_NAME, QStringList() << "start"); + + proc.waitForStarted(); + proc.waitForFinished(); + + if(proc.exitCode() != 0) + { + return false; + } + + return true; +} + +bool Daemon::stop() +{ + QProcess proc; + proc.start(INIT_DIR + "/" + DAEMON_NAME, QStringList() << "stop"); + + proc.waitForStarted(); + proc.waitForFinished(); + + if(proc.exitCode() != 0) + { + return false; + } + + return true; +} + +bool Daemon::restart() +{ + stop(); + return start(); +} + +bool Daemon::isRunning() +{ + QProcess proc; + + proc.start("pgrep", QStringList() << "-n" << DAEMON_NAME); + + if(!proc.waitForStarted()) + { + return false; + } + + if(!proc.waitForFinished()) + { + return false; + } + + QString result = proc.readAll(); + + return !result.isEmpty(); +} + +bool Daemon::setAutostart(bool enabled) +{ + QProcess proc; + + if(enabled) + { + proc.start(AUTOSTART_ENABLE); + } + else + { + proc.start(AUTOSTART_DISABLE); + } + + proc.waitForStarted(); + proc.waitForFinished(); + + if(proc.exitCode() != 0) + { + return false; + } + + return true; + +} + +Daemon::Daemon() +{ +} diff --git a/src/gui/daemon.h b/src/gui/daemon.h new file mode 100644 index 0000000..b6c65ab --- /dev/null +++ b/src/gui/daemon.h @@ -0,0 +1,37 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef DAEMON_H +#define DAEMON_H + +class Daemon +{ +public: + + static bool start(); + static bool stop(); + static bool restart(); + static bool isRunning(); + static bool setAutostart(bool enabled); + +private: + Daemon(); +}; + + +#endif diff --git a/src/gui/data/26x26/jenirok.png b/src/gui/data/26x26/jenirok.png new file mode 100644 index 0000000000000000000000000000000000000000..09e7eefb668d0b8e6dff2f7553026dfb49fd9023 GIT binary patch literal 4167 zcmV-N5V-G&P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-a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oh_ogM zBf@B|Rw^Z0zwiJgwb9kIh*gUkSk=_XUAMQedhHrcoqmgh`v-V# z<3{dC)!}#!uH)e{%cF7-;gtid3g>o=H8YTicv_h2ooPzX0ig{Rbvz?DnW#(=;NR;BI(6={l0rRa&e3u zeSP?CZ8W#GQZ5!bbN)Qrw{GQE2M_Y%-o5lsP0>&X`v;~t@XHLw2tfXN)@h-eXAdVwM)=8z6QmsnrQ`{vp5dFDHu3D^kF$MvnCZz$ zfXl#{8|4C^ji9t4()MGjj3Cxxayd*chstKD%*;@lo+g*cu+kWMD;0k5jN>KRaJ+dMlmlXE62;Kcr8IjUdY<;1c3u9Q&9bkfgA=d5%G>X}!$W<2 z|4>TZU+wkP^u7lZ-S#PMVwK}KN7Gt+^~Rv)ops>bsT6OXJ8vz8a58zu56@WQQtnt-Q)hFciuG%x_1{b=KV0|1Ia@q5%1 R5TpPA002ovPDHLkV1lI(>7oDt literal 0 HcmV?d00001 diff --git a/src/gui/data/48x48/jenirok.png b/src/gui/data/48x48/jenirok.png new file mode 100644 index 0000000000000000000000000000000000000000..15378ef3e35c29830809c00d5990849d0231f89f GIT binary patch literal 5732 zcmV-q7MtmbP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk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7&t*CRbLSd0<`CiII_7MS52PGoJfS`0|&Tc^=cf)L2FGm zo8{yWevq#%TL!>AO-*$A{>T8(Wi7GMMmYmyE{D!$M;u-z!$jZbrkWZ69$B}Jt=qN{ zi$qXLkxr+%@~dCvgt>D`1p&Dr7$F13s1{KDe1O(E)Pdro=@CTQ_i0EZI5&~N^F03Z z_S?yO9s=-upX%yrR$h1Ah(vqrw?KalQ0j>Le>nP}gMe=ze>@e2!Paft`1uo05Rb=0 z7Nk;q{Jirx|J-v&4nX+&ff$p}eOt{S<)|YU1T3;FzFJiUzz=`)Bbu64oMC9^DxgDoxG{lEi6ih`KS@xl4? zx#BBdDc*S+FljhF=5AmDhJ}buV$_Ea;HS}E_(J6E)zw^?NYJCk<_8m1hQazwhO0U| zacr9>*RA7}MT^L0vzVqyCY$Aw&wrl1jg0{J0@obAdWCNRakK(IJvLF+5cyan!l{-; zey9TdD8o~V4_Fp&_&$3)k9V7zXt?Milu`siz=TAC`no!v`^|4qN-YA`109D0APdX` zGC*>SLIE*=k2wyDEsK1ySux7cTH^r!V46JXy6oG(pZdBwPFc7RB_)<^)6v<4b85PUzA;l6B^y4qTP{lpU>1oy99 z%cJYplXG2w9l+U#V?fa_`;6`3m5ZQ|GJJh)43E4JERRIkn9tML(!z=xZ{%QWE4$x$ zr+CVHz$Xqj`C%6fqwyE2(BTQj7yuur7J?h1QC4I!Y<}gH{-+!`9QBVG0IOY>hx7Sy z`O#eQ;rI~H+QWLeYn%Ycmfi}{nvVD92ip1f6M$!c2EyMEzaK|8aNF>n?EjtreE$Cj Y0Lp;F3hnHVjsO4v07*qoM6N<$g4<&l82|tP literal 0 HcmV?d00001 diff --git a/src/gui/data/jenirok.desktop b/src/gui/data/jenirok.desktop new file mode 100644 index 0000000..514e7d7 --- /dev/null +++ b/src/gui/data/jenirok.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=0.1.0 +Type=Application +Name=Jenirok +Exec=/usr/bin/jenirok +Icon=jenirok +X-Window-Icon=jenirok +X-Window-Icon-Dimmed=jenirok diff --git a/src/gui/data/maemo/jenirok.xpm b/src/gui/data/maemo/jenirok.xpm new file mode 100755 index 0000000..b959baf --- /dev/null +++ b/src/gui/data/maemo/jenirok.xpm @@ -0,0 +1,326 @@ +/* XPM */ +static char *jenirok[] = { +/* columns rows colors chars-per-pixel */ +"64 64 256 2", +" c #000000", +". c #0C0B0C", +"X c #080607", +"o c #1F0202", +"O c #130A0A", +"+ c #1B0B0B", +"@ c #120505", +"# c #13120A", +"$ c #0E0E11", +"% c #010A18", +"& c #060B13", +"* c #121213", +"= c #1B1A1A", +"- c #191915", +"; c #210303", +": c #281818", +"> c #3B1414", +", c #2E2D09", +"< c #252508", +"1 c #3A3808", +"2 c #373615", +"3 c #302E09", +"4 c #020F22", +"5 c #051124", +"6 c #0E192B", +"7 c #0A1423", +"8 c #111D2E", +"9 c #111823", +"0 c #141F30", +"q c #152132", +"w c #242322", +"e c #2B2A29", +"r c #312D2D", +"t c #3E3A3A", +"y c #353432", +"u c #461515", +"i c #4C1212", +"p c #671717", +"a c #6F1414", +"s c #463333", +"d c #7B2525", +"f c #682020", +"g c #555314", +"h c #6C6A27", +"j c #74742C", +"k c #5E5C2A", +"l c #1B2E4B", +"z c #193053", +"x c #072E67", +"c c #0D326B", +"v c #153A72", +"b c #11366F", +"n c #1D4177", +"m c #21457D", +"M c #4A4A48", +"N c #5B5C56", +"B c #565549", +"V c #645F5F", +"C c #6E6E4D", +"Z c #696666", +"A c #757171", +"S c #860C0C", +"D c #871515", +"F c #981313", +"G c #BB1818", +"H c #8C2828", +"J c #953838", +"K c #912F2F", +"L c #BB3636", +"P c #DA0F0F", +"I c #DD1414", +"U c #DE1B1B", +"Y c #D51717", +"T c #E81717", +"R c #CF3838", +"E c #E02222", +"W c #ED2323", +"Q c #E22929", +"! c #ED2B2B", +"~ c #E33434", +"^ c #E53C3C", +"/ c #E83535", +"( c #F23B3B", +") c #F02D2D", +"_ c #817B19", +"` c #A26060", +"' c #D84848", +"] c #DA5656", +"[ c #C64E4E", +"{ c #E64444", +"} c #EC4545", +"| c #E94B4B", +" . c #F34545", +".. c #F54C4C", +"X. c #F84B4B", +"o. c #EC5454", +"O. c #EE5A5A", +"+. c #FB5959", +"@. c #F36262", +"#. c #B9B21B", +"$. c #BBB517", +"%. c #B4AE1D", +"&. c #908F36", +"*. c #A39B20", +"=. c #B4AD21", +"-. c #ADA933", +";. c #8C8615", +":. c #C4BF29", +">. c #E7DF1D", +",. c #EAE21D", +"<. c #ECE516", +"1. c #F4ED1B", +"2. c #E5DD23", +"3. c #E1D72A", +"4. c #E3DA29", +"5. c #E9DF2A", +"6. c #EEE524", +"7. c #EBE12C", +"8. c #EFE82D", +"9. c #F2E825", +"0. c #FAF22B", +"q. c #F4E830", +"w. c #89894D", +"e. c #B6B458", +"r. c #B3B149", +"t. c #84847D", +"y. c #C2BE46", +"u. c #D1CD4E", +"i. c #D7D557", +"p. c #CBC94D", +"a. c #F3EE4F", +"s. c #E8E65A", +"d. c #F4EF51", +"f. c #F2EF5D", +"g. c #F6F254", +"h. c #FEFA55", +"j. c #F9F65A", +"k. c #FCFA5D", +"l. c #FAF552", +"z. c #DEDD62", +"x. c #C2C261", +"c. c #E0DF66", +"v. c #FDFC63", +"b. c #FFFF6C", +"n. c #EEED6C", +"m. c #E1DC49", +"M. c #0A4CAF", +"N. c #0D50B5", +"B. c #0D52BB", +"V. c #1052B6", +"C. c #1355B9", +"Z. c #1658BB", +"A. c #1A5BBE", +"S. c #0A4CB0", +"D. c #2F5A9C", +"F. c #4067A1", +"G. c #426AA6", +"H. c #1D5FC1", +"J. c #145AC4", +"K. c #0D55C0", +"L. c #1D61C8", +"P. c #2263C5", +"I. c #2566C9", +"U. c #2869CA", +"Y. c #3170CF", +"T. c #3C73C5", +"R. c #3675D2", +"E. c #3B78D5", +"W. c #3E7BD9", +"Q. c #3477DC", +"!. c #286DD5", +"~. c #3C7EE0", +"^. c #417EDA", +"/. c #487CC9", +"(. c #4482DD", +"). c #4C81D3", +"_. c #4985E0", +"`. c #4D89E3", +"'. c #4685E5", +"]. c #528EE6", +"[. c #538FE9", +"{. c #5691EA", +"}. c #5895EE", +"|. c #5D9CF8", +" X c #60A0FF", +".X c #8C8685", +"XX c #938888", +"oX c #97989A", +"OX c #9A9A9B", +"+X c #999494", +"@X c #8D8F90", +"#X c #A49999", +"$X c #ACAC9E", +"%X c #A5A599", +"&X c #9F9FA1", +"*X c #9EA0A4", +"=X c #A4A2A3", +"-X c #A8A8A8", +";X c #B7A9A9", +":X c #B3B2A6", +">X c #B8B7B5", +",X c #A7ACB2", +"X -.h.d.d.d.d.d.l.u.. ", +" q |.|.|.|.|.|.|.|.|.|.|.|.|.|.|. Xl M PXKXHXHXHXHXHXHXuXwXeX8X5X5X5X5X5X5X5X5X5X5X5X5X6X7XbXvX= h 0.8.8.8.8.8.0.:. ", +" q }.{.{.{.{.{.{.{.{.{.{.{.{.{.}.].7 Z PXHXHXHXHXHXHXHX9X&X%X3X3X3X3X3X3X3X3X3X3X3X3X3X5X6X7XbXy g 1.<.<.<.<.<.1.$. ", +" q }.{.{.{.{.{.{.{.{.{.{.{.{.{.}.).& .XPXHXHXHXHXHXBXmX*XoX$X2X3X2X2X2X2X2X2X2X2X2X2X2X4X6X7XbXB 3 ,.,.,.,.,.,.1.$. ", +" q {.{.].].].].].].].].].].].].{./.X @XPXHXHXHXHXBXqXqX=XoX$X2X2X2X2X2X2X2X2X2X2X2X2X2X4X6X7XbXN , >.,.,.,.,.,.1.$. ", +" 0 [.].].].].].].].].].].].].].{./.& @XPXKXHXHXmXqXqXqX=XoX$X4X4X4X4X4X4X4X4X4X4X4X4X4X4X6X7XbXN , >.,.,.,.,.,.1.$. ", +" 8 ].`.`.`.`.`.`.`.`.`.`.`.`.`.].).& A PXKXHXBXqXqXqXqX=XoX$X4X4X4X4X4X4X4X4X4X4X4X4X4X4X6X7XbXM 1 6.,.,.,.,.,.9.#. ", +" 8 `.`.`.`.`.`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E E E E E E E E E E E E E W a - rXgXyXgX>X. UXUXUXUXUXUXUXUXUX", +" 4 S.S.M.M.M.M.M.M.M.M.M.M.M.M.M.M.M.B.x D W U U U U U U U U U U U U U U U U U T Y ; V hXyXyXgXZ UXUXUXUXUXUXUXUXUX", +" % % % % % % % % % % % % % % % % % % X D T U U U U U U U U U U U U U U U U U U T F X ;XgXrXyXeXw UXUXUXUXUXUXUXUX", +" S T U U U U U U U U U U U U U U U U U U U T i t yXrXrXfX+XX UXUXUXUXUXUXUXUX", +"UX S T I I I I I I I I I I I I I I I I I I I T G X .XfXyXfX=X* UXUXUXUXUXUXUXUX", +"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX S T I I I I I I I I I I I I I I I I I I I I T a = eXeXV X UXUXUXUXUXUXUXUX", +"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX S T I I I I I I I I I I I I I I I I I I I I T P ; t w UXUXUXUXUXUXUXUXUX", +"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX S T P P P P P P P P P P P P P P P P P P P P P T F UXUXUXUXUXUXUXUXUX", +"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX @ ; o o o o o o o o o o o o o o o o o o o o o ; ; UXUXUXUXUXUXUXUXUX", +"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX UXUXUXUXUXUXUXUXUX", +"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX UXUXUXUXUXUXUXUXUXUX", +"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX" +}; diff --git a/src/gui/detailwindow.cpp b/src/gui/detailwindow.cpp new file mode 100644 index 0000000..09b4380 --- /dev/null +++ b/src/gui/detailwindow.cpp @@ -0,0 +1,146 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "detailwindow.h" +#include "contactmanager.h" + +DetailWindow::DetailWindow(QWidget* parent): QMainWindow(parent), addDialog_(0) +{ + setAttribute(Qt::WA_Maemo5StackedWindow); + area_ = new QScrollArea(this); + layout_ = new QVBoxLayout; + QHBoxLayout* top = new QHBoxLayout; + QHBoxLayout* bottom = new QHBoxLayout; + + QPushButton* addButton = new QPushButton(QIcon::fromTheme("general_contacts"), tr("Add to contacts")); + QPushButton* copyButton = new QPushButton(tr("Copy number to clipboard")); + + connect(addButton, SIGNAL(pressed()), this, SLOT(showAddToContactsDialog())); + connect(copyButton, SIGNAL(pressed()), this, SLOT(copyToClipboard())); + + nameButton_ = new QMaemo5ValueButton(QIcon::fromTheme("general_default_avatar"), tr("Name"), this); + streetButton_ = new QMaemo5ValueButton(tr("Street"), this); + cityButton_ = new QMaemo5ValueButton(tr("City"), this); + numberButton_ = new QMaemo5ValueButton(QIcon::fromTheme("general_call"), tr("Phone number"), this); + + connect(numberButton_, SIGNAL(pressed()), this, SLOT(makeCall())); + + top->addWidget(nameButton_); + bottom->addWidget(streetButton_); + top->addWidget(numberButton_); + bottom->addWidget(cityButton_); + layout_->addLayout(top); + layout_->addLayout(bottom); + layout_->addWidget(addButton); + layout_->addWidget(copyButton); + area_->setLayout(layout_); + setCentralWidget(area_); +} + +void DetailWindow::loadData(Eniro::Result const& details) +{ + setWindowTitle(details.name); + nameButton_->setValueText(details.name); + streetButton_->setValueText(details.street); + cityButton_->setValueText(details.city); + numberButton_->setValueText(details.number); + layout_->update(); + show(); +} + +void DetailWindow::makeCall() +{ + QString number = numberButton_->valueText(); + + qDebug() << number; + + if(number.isEmpty()) + { + return; + } + + QDBusMessage msg = QDBusMessage::createMethodCall("com.nokia.csd", + "/com/nokia/csd/call", + "com.nokia.csd.Call", + "CreateWith"); + QList arguments; + + arguments.append(QVariant(number)); + arguments.append(QVariant(0)); + + msg.setArguments(arguments); + + QDBusConnection::systemBus().send(msg); + +} + +void DetailWindow::showAddToContactsDialog() +{ + if(!addDialog_) + { + addDialog_ = new QDialog(this); + addDialog_->setWindowTitle(tr("Add to contacts")); + addContactInput_ = new QLineEdit(); + QHBoxLayout* layout = new QHBoxLayout(); + QLabel* name = new QLabel(tr("Name")); + QPushButton* button = new QPushButton(tr("Add")); + connect(button, SIGNAL(pressed()), this, SLOT(addToContacts())); + layout->addWidget(name); + layout->addWidget(addContactInput_); + layout->addWidget(button); + addDialog_->setLayout(layout); + } + + addContactInput_->setText(nameButton_->valueText()); + addDialog_->show(); +} + +void DetailWindow::addToContacts() +{ + ContactManager cm; + ContactManager::Contact contact; + contact.name = addContactInput_->text(); + contact.number = numberButton_->valueText(); + + addDialog_->hide(); + + if(cm.addContact(contact)) + { + QMaemo5InformationBox::information(this, tr("Contact was successfully added to contacts.")); + } + else + { + QMessageBox::critical(this, tr("Error"), tr("Unable to add contact.")); + } + +} + +void DetailWindow::copyToClipboard() +{ + QApplication::clipboard()->setText(numberButton_->valueText()); + QMaemo5InformationBox::information(this, tr("Number was successfully copied to clipboard.")); +} diff --git a/src/gui/detailwindow.h b/src/gui/detailwindow.h new file mode 100644 index 0000000..19a6660 --- /dev/null +++ b/src/gui/detailwindow.h @@ -0,0 +1,60 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef DETAILWINDOW_H +#define DETAILWINDOW_H + +#include +#include +#include +#include +#include +#include +#include "searchdialog.h" +#include "eniro.h" + +class DetailWindow : public QMainWindow +{ + Q_OBJECT + +public: + DetailWindow(QWidget* parent = 0); + +public slots: + void loadData(Eniro::Result const& details); + +private slots: + void makeCall(); + void showAddToContactsDialog(); + void addToContacts(); + void copyToClipboard(); + +private: + QScrollArea* area_; + QVBoxLayout* layout_; + QMaemo5ValueButton* nameButton_; + QMaemo5ValueButton* streetButton_; + QMaemo5ValueButton* cityButton_; + QMaemo5ValueButton* numberButton_; + QDialog* addDialog_; + QLineEdit* addContactInput_; + + +}; + +#endif diff --git a/src/gui/gui.pro b/src/gui/gui.pro new file mode 100644 index 0000000..cddf745 --- /dev/null +++ b/src/gui/gui.pro @@ -0,0 +1,43 @@ +QT += network sql maemo5 +TARGET = jenirok +TEMPLATE = app +SOURCES += main.cpp mainwindow.cpp searchdialog.cpp resultwindow.cpp detailwindow.cpp settingsdialog.cpp buttonselector.cpp daemon.cpp ../common/eniro.cpp ../common/contactmanager.cpp ../common/db.cpp ../common/settings.cpp ../common/connectionmanager.cpp +HEADERS += mainwindow.h searchdialog.h resultwindow.h detailwindow.h settingsdialog.h buttonselector.h daemon.h ../common/eniro.h ../common/contactmanager.h ../common/db.h ../common/settings.h ../common/connectionmanager.h +TRANSLATIONS = ../common/translations/fi_FI.ts +RESOURCES = icons.grc ../common/translations.grc +INCLUDEPATH += ../common +CONFIG += link_pkgconfig +PKGCONFIG += libebook-1.2 glib-2.0 conic + +unix { + #VARIABLES + isEmpty(PREFIX) { + PREFIX = /usr + } + + BINDIR = $$PREFIX/bin + DATADIR =$$PREFIX/share + + DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\" + + #MAKE INSTALL + + INSTALLS += target desktop iconxpm icon26 icon48 icon64 + + target.path =$$BINDIR + + desktop.path = $$DATADIR/applications/hildon + desktop.files += data/$${TARGET}.desktop + + iconxpm.path = $$DATADIR/pixmap + iconxpm.files += data/maemo/$${TARGET}.xpm + + icon26.path = $$DATADIR/icons/hicolor/26x26/apps + icon26.files += data/26x26/$${TARGET}.png + + icon48.path = $$DATADIR/icons/hicolor/48x48/apps + icon48.files += data/48x48/$${TARGET}.png + + icon64.path = $$DATADIR/icons/hicolor/64x64/apps + icon64.files += data/64x64/$${TARGET}.png +} diff --git a/src/gui/icons.grc b/src/gui/icons.grc new file mode 100644 index 0000000..4ac0e8f --- /dev/null +++ b/src/gui/icons.grc @@ -0,0 +1,6 @@ + + + icons/start.png + icons/stop.png + + diff --git a/src/gui/icons/start.png b/src/gui/icons/start.png new file mode 100755 index 0000000000000000000000000000000000000000..fcc4966d40304bf8bae42fbcca8fc0c010871519 GIT binary patch literal 7908 zcmVKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ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BQL4if(-8owr{V)-E&{zLc1(Xgxe7u_1yYQZA}lyp1qSF%W0a@@-P{riKDJ@(i%UDtP?EN42| zUbpC`O`Esp=XWmXRnV)u{qoDH%46}m&0i@r!T7%>%~M$tL)NTf?MIJQg25o}y6dj# z>(;GX1R(x%_6Z)HI`!GdKV7$WW6U3tGVlMJsoSInqX4)N;#VWQ>dNMW{=J;JE*qnG zyeQ+C1E^|CxNK8F6$k{j-+AZVw|?~gd!K1uzhwLK z?bd$p|3`Babkp@jH~Cx+E(CNT(CNBsj7zp|73l+qDAm=~82{k-MKfm1nAjHKQ?Y=? zW6fr@=k)2*W{n;_W{lbCgvnPOKl=1kRKERh6Xzh(X)If%)Y=jP41k)I!MjbIz`8s% zK@ze;5AOLsGIQq4l2>2-=QO171j*?>F_Lq|6=QFG@`=Acn%T~6H-<>mO?sI`aU`Hb9#JK{XA%;ryyb&WtT=n3C5B#-f zuU=hDjtoe89JIDd_kZ|4ul?X-8rZ&5(xY)InifqhWsXf=DIip5CeIo+RJ0#APGl92 zlB9O+s1Sgs@;E;D;DgfHv**m)zkmN{NZ|>QGY&vfK{lJM;E#X&!~c#RJ$h_m@7_Jr zoleMBD`Z1sMnyRbY~FFe5~tnn$aXrNPP^Tnp(wISsU$OIXqu))eLla}=ks|I4^Ddl1aX!ho<3Iq qG|xMlH-nP=*Od6r$q+)|{|5jKhrI|r0j(hb0000. + * + */ + +#include +#include +#include +#include +#include "mainwindow.h" +#include "searchdialog.h" +#include "resultwindow.h" +#include "detailwindow.h" +#include "eniro.h" + +#include "contactmanager.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QTranslator translator; + translator.load(":/translations/" + QLocale::system().name()); + app.installTranslator(&translator); + + MainWindow window; + ResultWindow results(&window); + DetailWindow details(&results); + + window.show(); + + QObject::connect(&window, SIGNAL(search(SearchDialog::SearchDetails&)), + &results, SLOT(search(SearchDialog::SearchDetails&))); + + QObject::connect(&results, SIGNAL(itemSelected(Eniro::Result const&)), + &details, SLOT(loadData(Eniro::Result const&))); + + return app.exec(); +} diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp new file mode 100644 index 0000000..d340fa1 --- /dev/null +++ b/src/gui/mainwindow.cpp @@ -0,0 +1,167 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "mainwindow.h" +#include "settingsdialog.h" +#include "searchdialog.h" +#include "daemon.h" +#include "settings.h" +#include "db.h" + +namespace +{ + const QString START_ICON = ":/icons/start.png"; + const QString CLOSE_ICON = ":/icons/stop.png"; +} + +MainWindow::MainWindow(QWidget* parent): QMainWindow(parent), +searchResults_(0), settingsDialog_(0), running_(false), +toggleButton_(0), searchDialog_(0) +{ + setWindowTitle(tr("Jenirok")); + setAttribute(Qt::WA_Maemo5StackedWindow); + QWidget* mainWidget = new QWidget(this); + + if(Daemon::isRunning()) + { + toggleButton_ = createButton(tr("Stop daemon")); + toggleButton_->setIcon(QIcon(CLOSE_ICON)); + running_ = true; + } + else + { + toggleButton_ = createButton(tr("Start daemon")); + toggleButton_->setIcon(QIcon(START_ICON)); + running_ = false; + } + + QToolButton* searchButton = createButton(tr("Search")); + searchButton->setIcon(QIcon::fromTheme("general_search")); + + QSize size(64, 64); + searchButton->setIconSize(size); + toggleButton_->setIconSize(size); + + QHBoxLayout *buttonLayout = new QHBoxLayout; + buttonLayout->addWidget(toggleButton_, Qt::AlignLeft); + buttonLayout->addWidget(searchButton, Qt::AlignRight); + + mainWidget->setLayout(buttonLayout); + + connect(toggleButton_, SIGNAL(pressed()), this, SLOT(toggleDaemon())); + connect(searchButton, SIGNAL(pressed()), this, SLOT(openSearch())); + + setCentralWidget(mainWidget); + menuBar()->addAction(tr("Settings"), this, SLOT(showSettings())); +} + +MainWindow::~MainWindow() +{ + DB::removeDatabase(); +} + +void MainWindow::showSettings() +{ + if(!settingsDialog_) + { + settingsDialog_ = new SettingsDialog(this); + } + + settingsDialog_->show(); +} + +void MainWindow::toggleDaemon() +{ + QString readyText; + QString failText; + QString buttonText; + bool ret = false; + + if(running_) + { + readyText = tr("Daemon was successfully stopped."); + failText = tr("Unable to stop daemon."); + buttonText = tr("Start daemon"); + ret = Daemon::stop(); + } + else + { + readyText = tr("Daemon was successfully started."); + failText = tr("Unable to start daemon."); + buttonText = tr("Stop daemon"); + ret = Daemon::start(); + } + + if(!ret) + { + QMessageBox::critical(this, tr("Error"), failText); + } + else + { + QMaemo5InformationBox::information(this, readyText); + toggleButton_->setText(buttonText); + toggleButton_->setIcon(QIcon(running_ ? START_ICON : CLOSE_ICON)); + running_ = !running_; + } + +} + +void MainWindow::openSearch() +{ + DB::connect(); + + QString username = Settings::instance()->get("eniro_username"); + QString password = Settings::instance()->get("eniro_password"); + + DB::disconnect(); + + if(username.isEmpty() || password.isEmpty()) + { + QMessageBox::information(this, tr("Info"), tr("You need to set Eniro login details in settings before using this feature.")); + return; + } + + if(!searchDialog_) + { + searchDialog_ = new SearchDialog(this); + connect(searchDialog_, SIGNAL(search(SearchDialog::SearchDetails&)), this, SLOT(handleSearch(SearchDialog::SearchDetails&))); + } + + searchDialog_->show(); +} + +QToolButton* MainWindow::createButton(QString const& text) +{ + QToolButton* button = new QToolButton(); + button->setText(text); + button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + return button; +} + +void MainWindow::handleSearch(SearchDialog::SearchDetails& details) +{ + emit search(details); +} diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h new file mode 100644 index 0000000..429b92d --- /dev/null +++ b/src/gui/mainwindow.h @@ -0,0 +1,56 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include "searchdialog.h" +#include "settingsdialog.h" + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget* parent = 0); + ~MainWindow(); + +signals: + void search(SearchDialog::SearchDetails& details); + +public slots: + void showSettings(); + void toggleDaemon(); + void openSearch(); + void handleSearch(SearchDialog::SearchDetails& details); + +private: + QToolButton* createButton(QString const& text); + QListWidget* searchResults_; + SettingsDialog* settingsDialog_; + bool running_; + QToolButton* toggleButton_; + SearchDialog* searchDialog_; + +}; + +#endif diff --git a/src/gui/resultwindow.cpp b/src/gui/resultwindow.cpp new file mode 100644 index 0000000..0a5fe23 --- /dev/null +++ b/src/gui/resultwindow.cpp @@ -0,0 +1,165 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include "resultwindow.h" +#include "settings.h" +#include "db.h" + +ResultWindow::ResultWindow(QWidget* parent): QMainWindow(parent), eniro_(0), list_(0) +{ + setAttribute(Qt::WA_Maemo5StackedWindow); + setWindowTitle(tr("Search results")); +} + +void ResultWindow::search(SearchDialog::SearchDetails& details) +{ + if(!list_) + { + list_ = new QListWidget(this); + setCentralWidget(list_); + connect(list_, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(itemClicked(QListWidgetItem*))); + } + else + { + list_->clear(); + } + + DB::connect(); + + Eniro::Site selectedSite = Eniro::stringToSite(Settings::instance()->get("site")); + + if(!eniro_) + { + eniro_ = new Eniro(selectedSite, this); + + connect(eniro_, SIGNAL(resultAvailable(Eniro::Result const&, + Eniro::SearchDetails const&)), + this, SLOT(resultAvailable(Eniro::Result const&, + Eniro::SearchDetails const&))); + + connect(eniro_, SIGNAL(requestFinished(QVector const&, + Eniro::SearchDetails const&, bool)), + this, SLOT(requestFinished(QVector const&, + Eniro::SearchDetails const&, bool))); + } + + QString username = Settings::instance()->get("eniro_username"); + QString password = Settings::instance()->get("eniro_password"); + + if(!username.isEmpty() && !password.isEmpty()) + { + eniro_->login(username, password); + } + + eniro_->setSite(selectedSite); + + DB::disconnect(); + + Eniro::SearchType type; + + switch(details.type) + { + case 0: + type = Eniro::PERSONS; + break; + case 1: + type = Eniro::YELLOW_PAGES; + break; + default: + return; + } + + show(); + setAttribute(Qt::WA_Maemo5ShowProgressIndicator, true); + + eniro_->abort(); + eniro_->search(Eniro::SearchDetails(details.name, details.location, type)); + +} + +void ResultWindow::resultAvailable(Eniro::Result const& result, + Eniro::SearchDetails const& details) +{ + Q_UNUSED(details); + + QString row = result.name; + + if(!result.street.isEmpty()) + { + row += ", " + result.street; + } + + if(!result.city.isEmpty()) + { + row += ", " + result.city; + } + + QListWidgetItem* item = new QListWidgetItem(row, list_); + QMap data; + data["name"] = QVariant(result.name); + data["street"] = QVariant(result.street); + data["city"] = QVariant(result.city); + data["number"] = QVariant(result.number); + + item->setData(Qt::UserRole, QVariant(data)); + + list_->addItem(item); +} + +void ResultWindow::requestFinished(QVector const& results, + Eniro::SearchDetails const& details, + bool error) +{ + Q_UNUSED(details); + + if(error) + { + QMessageBox::critical(this, tr("Error"), eniro_->errorString()); + } + + if(results.size() == 0) + { + QLabel* info = new QLabel(tr("No results found")); + info->setAlignment(Qt::AlignCenter); + setCentralWidget(info); + list_ = 0; + } + + setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false); + +} + +void ResultWindow::itemClicked(QListWidgetItem* item) +{ + QMap data = item->data(Qt::UserRole).toMap(); + Eniro::Result details; + details.name = data["name"].toString(); + details.street = data["street"].toString(); + details.city = data["city"].toString(); + details.number = data["number"].toString(); + + emit itemSelected(details); +} + + diff --git a/src/gui/resultwindow.h b/src/gui/resultwindow.h new file mode 100644 index 0000000..88dc9ca --- /dev/null +++ b/src/gui/resultwindow.h @@ -0,0 +1,53 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef RESULTWINDOW_H +#define RESULTWINDOW_H + +#include +#include +#include +#include +#include "searchdialog.h" +#include "eniro.h" + +class ResultWindow : public QMainWindow +{ + Q_OBJECT + +public: + ResultWindow(QWidget* parent = 0); + +signals: + void itemSelected(Eniro::Result const& result); + +public slots: + void search(SearchDialog::SearchDetails& details); + +private slots: + void resultAvailable(Eniro::Result const& result, Eniro::SearchDetails const& details); + void requestFinished(QVector const& results, Eniro::SearchDetails const& details, bool error); + void itemClicked(QListWidgetItem* item); + +private: + Eniro* eniro_; + QListWidget* list_; + +}; + +#endif diff --git a/src/gui/searchdialog.cpp b/src/gui/searchdialog.cpp new file mode 100644 index 0000000..17fb292 --- /dev/null +++ b/src/gui/searchdialog.cpp @@ -0,0 +1,80 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include "searchdialog.h" + +SearchDialog::SearchDialog(QWidget* parent): QDialog(parent), +numberInput_(0), locationInput_(0), selector_(0) +{ + setWindowTitle(tr("Search")); + + QHBoxLayout* numberLayout = new QHBoxLayout; + QLabel* numberLabel = new QLabel(tr("Name/number")); + numberInput_ = new QLineEdit; + numberLayout->addWidget(numberLabel); + numberLayout->addWidget(numberInput_); + + QHBoxLayout* locationLayout = new QHBoxLayout; + QLabel* locationLabel = new QLabel(tr("Location")); + locationInput_ = new QLineEdit; + locationLayout->addWidget(locationLabel); + locationLayout->addWidget(locationInput_); + + selector_ = new ButtonSelector(tr("Type"), this); + selector_->addItem(tr("Persons")); + selector_->addItem(tr("Yellow pages")); + + QVBoxLayout* leftLayout = new QVBoxLayout; + leftLayout->addLayout(numberLayout); + leftLayout->addLayout(locationLayout); + leftLayout->addWidget(selector_); + + QDialogButtonBox* buttons = new QDialogButtonBox; + QPushButton* submitButton = new QPushButton(tr("Search")); + buttons->addButton(submitButton, QDialogButtonBox::AcceptRole); + connect(submitButton, SIGNAL(pressed()), this, SLOT(searchPressed())); + + QHBoxLayout* mainLayout = new QHBoxLayout; + mainLayout->addLayout(leftLayout, Qt::AlignLeft); + mainLayout->addWidget(buttons); + + setLayout(mainLayout); +} + +void SearchDialog::searchPressed() +{ + SearchDetails details; + details.name = numberInput_->text(); + + if(details.name.isEmpty()) + { + numberInput_->setFocus(); + return; + } + + details.location = locationInput_->text(); + details.type = selector_->currentIndex(); + emit search(details); + hide(); +} diff --git a/src/gui/searchdialog.h b/src/gui/searchdialog.h new file mode 100644 index 0000000..09d13ed --- /dev/null +++ b/src/gui/searchdialog.h @@ -0,0 +1,57 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef SEARCHDIALOG_H +#define SEARCHDIALOG_H + +#include +#include +#include +#include +#include +#include "buttonselector.h" + +class SearchDialog : public QDialog +{ + Q_OBJECT + +public: + + struct SearchDetails + { + QString name; + QString location; + int type; + }; + + SearchDialog(QWidget* parent = 0); + +signals: + void search(SearchDialog::SearchDetails& details); + +private slots: + void searchPressed(); + +private: + QLineEdit* numberInput_; + QLineEdit* locationInput_; + ButtonSelector* selector_; + +}; + +#endif diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp new file mode 100644 index 0000000..25ba29d --- /dev/null +++ b/src/gui/settingsdialog.cpp @@ -0,0 +1,149 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "settingsdialog.h" +#include "settings.h" +#include "db.h" +#include "daemon.h" + +QMap SettingsDialog::sites_ = Eniro::getSites(); + +SettingsDialog::SettingsDialog(QWidget* parent): QDialog(parent), +usernameInput_(0), passwordInput_(0), cacheInput_(0), siteSelector_(0), autostartSelector_(0) +{ + setWindowTitle(tr("Settings")); + + DB::connect(); + + QVBoxLayout* left = new QVBoxLayout; + QHBoxLayout* mainLayout = new QHBoxLayout; + QHBoxLayout* username = new QHBoxLayout; + QHBoxLayout* password = new QHBoxLayout; + QHBoxLayout* cache = new QHBoxLayout; + + QLabel* usernameLabel = new QLabel(tr("Eniro username")); + usernameInput_ = new QLineEdit(Settings::instance()->get("eniro_username")); + + QLabel* passwordLabel = new QLabel(tr("Eniro password")); + passwordInput_ = new QLineEdit(Settings::instance()->get("eniro_password")); + + QLabel* cacheLabel = new QLabel(tr("Cache size (numbers)")); + cacheInput_ = new QLineEdit(Settings::instance()->get("cache_size")); + cacheInput_->setValidator(new QIntValidator(0, 10000, this)); + + siteSelector_ = new ButtonSelector(tr("Eniro site"), this); + QString site = Settings::instance()->get("eniro_site"); + int i = 0; + QMap ::const_iterator it; + for(it = sites_.begin(); it != sites_.end(); it++) + { + siteSelector_->addItem(it.value().name, it.value().id); + + if(it.value().id == site) + { + siteSelector_->setCurrentIndex(i); + } + + i++; + } + + autostartSelector_ = new ButtonSelector(tr("Autostart"), this); + QString autostart = Settings::instance()->get("autostart"); + autostartSelector_->addItem(tr("Enabled"), "1"); + autostartSelector_->addItem(tr("Disabled"), "0"); + autostartSelector_->setCurrentIndex(autostart == "1" ? 0 : 1); + + QPushButton* submitButton = new QPushButton(tr("Save")); + connect(submitButton, SIGNAL(pressed()), this, SLOT(saveSettings())); + + username->addWidget(usernameLabel); + username->addWidget(usernameInput_); + password->addWidget(passwordLabel); + password->addWidget(passwordInput_); + cache->addWidget(cacheLabel); + cache->addWidget(cacheInput_); + left->addLayout(username); + left->addLayout(password); + left->addLayout(cache); + left->addWidget(siteSelector_); + left->addWidget(autostartSelector_); + + mainLayout->addLayout(left); + mainLayout->addWidget(submitButton); + + setLayout(mainLayout); + + DB::disconnect(); +} + +void SettingsDialog::saveSettings() +{ + DB::connect(); + + Settings::instance()->set("eniro_username", usernameInput_->text()); + Settings::instance()->set("eniro_password", passwordInput_->text()); + Settings::instance()->set("cache_size", cacheInput_->text()); + QString site = siteSelector_->value().toString(); + Settings::instance()->set("site", site); + QString autostart = autostartSelector_->value().toString(); + Settings::instance()->set("autostart", autostart); + + DB::disconnect(); + + hide(); + + if(site != currentSite_ && Daemon::isRunning()) + { + QMaemo5InformationBox::information(this, tr("Restarting daemon...")); + Daemon::restart(); + currentSite_ = site; + } + + if(autostart != currentAutostart_) + { + bool value = false; + + if(autostart == "1") + { + value = true; + } + + Daemon::setAutostart(value); + } + +} + +void SettingsDialog::setVisible(bool visible) +{ + QDialog::setVisible(visible); + + if(visible) + { + currentSite_ = siteSelector_->value().toString(); + currentAutostart_ = autostartSelector_->value().toString(); + } + +} diff --git a/src/gui/settingsdialog.h b/src/gui/settingsdialog.h new file mode 100644 index 0000000..52e9774 --- /dev/null +++ b/src/gui/settingsdialog.h @@ -0,0 +1,53 @@ +/* + * This file is part of Jenirok. + * + * Jenirok 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. + * + * Jenirok 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 Jenirok. If not, see . + * + */ + +#ifndef SETTINGSDIALOG_H +#define SETTINGSDIALOG_H + +#include +#include +#include +#include +#include +#include +#include "eniro.h" +#include "buttonselector.h" + +class SettingsDialog : public QDialog +{ + Q_OBJECT + +public: + SettingsDialog(QWidget* parent = 0); + +public slots: + void saveSettings(); + void setVisible(bool visible); + +private: + static QMap sites_; + QLineEdit* usernameInput_; + QLineEdit* passwordInput_; + QLineEdit* cacheInput_; + ButtonSelector* siteSelector_; + ButtonSelector* autostartSelector_; + QString currentSite_; + QString currentAutostart_; +}; + +#endif diff --git a/welcome b/welcome deleted file mode 100644 index e69de29..0000000 -- 1.7.9.5