Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Jenirok
Summary Tracker SCM Files
authoreshe <jessehakanen@gmail.com>
Sat, 17 Apr 2010 11:52:07 +0000 (12:52 +0100)
committereshe <jessehakanen@gmail.com>
Sat, 17 Apr 2010 11:52:07 +0000 (12:52 +0100)
14 files changed:
COPYING
Makefile
debian/control
debian/postrm
debian/preinst
debian/prerm
src/common/eniro.cpp
src/common/eniro.h
src/common/translations/fi_FI.qm
src/common/translations/fi_FI.ts
src/daemon/Makefile
src/gui/Makefile
src/gui/detailwindow.cpp
src/gui/settingsdialog.cpp

diff --git a/COPYING b/COPYING
index 94a9ed0..6ddee8b 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -631,8 +631,7 @@ to attach them to the start of each source file to most effectively
 state the exclusion of warranty; and each file should have at least
 the "copyright" line and a pointer to where the full notice is found.
 
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
+    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
@@ -652,7 +651,7 @@ Also add information on how to contact you by electronic and paper mail.
   If the program does terminal interaction, make it output a short
 notice like this when it starts in an interactive mode:
 
-    <program>  Copyright (C) <year>  <name of author>
+    Jenirok Copyright (C) 2010 Jesse Hakanen
     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.
index 8b93f1f..bf8ed45 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: jenirok
-# Generated by qmake (2.01a) (Qt 4.6.2) on: Fri Apr 16 11:46:54 2010
+# Generated by qmake (2.01a) (Qt 4.6.2) on: Sat Apr 17 12:38:18 2010
 # Project:  jenirok.pro
 # Template: subdirs
 # Command: /usr/bin/qmake -unix -o Makefile jenirok.pro
index 73fbc0b..6db7d1e 100644 (file)
@@ -2,7 +2,7 @@ Source: jenirok
 Section: user/other
 Priority: optional
 Maintainer: Jesse Hakanen <jessehakanen@gmail.com>
-Build-Depends: debhelper (>= 5), libqt4-dev
+Build-Depends: debhelper (>= 5), libqt4-dev, libebook-dev, libx11-dev
 Standards-Version: 3.7.2
 
 Package: jenirok
index cca0a15..b479182 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/sh -e
 
 rm -f /home/user/.jenirok.db
+update-rc.d -f jenirokd remove
 
 exit 0
 
index 6d0f2ba..e672a47 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh -e
 
-/etc/init.d/jenirokd stop
+/etc/init.d/jenirokd stop >/dev/null 2>&1
 
 exit 0
 
index 6d0f2ba..e672a47 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh -e
 
-/etc/init.d/jenirokd stop
+/etc/init.d/jenirokd stop >/dev/null 2>&1
 
 exit 0
 
index 0b8579b..20af69c 100644 (file)
 
 namespace
 {
-    static const QString SITE_URLS[] =
+    static const QString SITE_URLS[Eniro::SITE_COUNT] =
     {
             "http://wap.eniro.fi/",
             "http://wap.eniro.se/",
             "http://wap.eniro.dk/"
     };
 
-    const QString INVALID_LOGIN_STRING = "Invalid login details";
-    const QString PERSON_REGEXP = "<td class=\"hTd2\">(.*)<b>(.*)</td>";
-    const QString YELLOW_REGEXP = "<td class=\"hTd2\">(.*)<span class=\"gray\"\\}>(.*)</td>";
-    const QString NUMBER_REGEXP = "<div class=\"callRow\">(.*)</div>";
-    const QString LOGIN_CHECK = "<input class=\"inpTxt\" id=\"loginformUsername\"";
+    static const QString SITE_NAMES[Eniro::SITE_COUNT] =
+    {
+         "finnish",
+         "swedish",
+         "danish"
+    };
+
+    static const QString SITE_IDS[Eniro::SITE_COUNT] =
+    {
+         "fi",
+         "se",
+         "dk"
+    };
+
+    static const QString INVALID_LOGIN_STRING = "Invalid login details";
+    static const QString PERSON_REGEXP = "<td class=\"hTd2\">(.*)<b>(.*)</td>";
+    static const QString YELLOW_REGEXP = "<td class=\"hTd2\">(.*)<span class=\"gray\"\\}>(.*)</td>";
+    static const QString NUMBER_REGEXP = "<div class=\"callRow\">(.*)</div>";
+    static const QString LOGIN_CHECK = "<input class=\"inpTxt\" id=\"loginformUsername\"";
 }
 
 // Regexp used to remove numbers from string
@@ -549,17 +563,14 @@ QMap <Eniro::Site, Eniro::SiteDetails> Eniro::getSites()
 {
     QMap <Site, SiteDetails> 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;
+    for(int i = 0; i < SITE_COUNT; i++)
+    {
+        SiteDetails details;
+        details.name = SITE_NAMES[i];
+        details.id = SITE_IDS[i];
+        sites[static_cast<Site>(i)] = details;
+    }
 
     return sites;
 }
@@ -567,16 +578,14 @@ QMap <Eniro::Site, Eniro::SiteDetails> Eniro::getSites()
 Eniro::Site Eniro::stringToSite(QString const& str)
 {
     Site site = FI;
-
     QString lower = str.toLower();
 
-    if(lower == "se" || lower == "swedish")
+    for(int i = 0; i < SITE_COUNT; i++)
     {
-        site = SE;
-    }
-    else if(lower == "dk" || lower == "danish")
-    {
-        site = DK;
+        if(lower == SITE_NAMES[i] || lower == SITE_IDS[i])
+        {
+            site = static_cast <Site> (i);
+        }
     }
 
     return site;
index 44165ee..50b0aba 100644 (file)
@@ -34,6 +34,7 @@ class Eniro: public QObject
 public:
 
     enum Site {FI, SE, DK};
+    static const int SITE_COUNT = 3;
 
     enum SearchType {YELLOW_PAGES, PERSONS};
 
index 88980f0..bbbfaef 100644 (file)
Binary files a/src/common/translations/fi_FI.qm and b/src/common/translations/fi_FI.qm differ
index 91dcfb8..e6bd91e 100644 (file)
@@ -20,7 +20,7 @@
     <name>DetailWindow</name>
     <message>
         <location filename="../../gui/detailwindow.cpp" line="39"/>
-        <location filename="../../gui/detailwindow.cpp" line="106"/>
+        <location filename="../../gui/detailwindow.cpp" line="108"/>
         <source>Add to contacts</source>
         <translation>Lisää yhteistietoihin</translation>
     </message>
         <translation>Kopioi numero leikepöydälle</translation>
     </message>
     <message>
-        <location filename="../../gui/detailwindow.cpp" line="45"/>
-        <location filename="../../gui/detailwindow.cpp" line="109"/>
+        <location filename="../../gui/detailwindow.cpp" line="46"/>
+        <location filename="../../gui/detailwindow.cpp" line="111"/>
         <source>Name</source>
         <translation>Nimi</translation>
     </message>
     <message>
-        <location filename="../../gui/detailwindow.cpp" line="46"/>
+        <location filename="../../gui/detailwindow.cpp" line="47"/>
         <source>Street</source>
         <translation>Katu</translation>
     </message>
     <message>
-        <location filename="../../gui/detailwindow.cpp" line="47"/>
+        <location filename="../../gui/detailwindow.cpp" line="48"/>
         <source>City</source>
         <translation>Kaupunki</translation>
     </message>
     <message>
-        <location filename="../../gui/detailwindow.cpp" line="48"/>
+        <location filename="../../gui/detailwindow.cpp" line="50"/>
         <source>Phone number</source>
         <translation>Puhelinnumero</translation>
     </message>
     <message>
-        <location filename="../../gui/detailwindow.cpp" line="110"/>
+        <location filename="../../gui/detailwindow.cpp" line="112"/>
         <source>Add</source>
         <translation>Lisää</translation>
     </message>
     <message>
-        <location filename="../../gui/detailwindow.cpp" line="133"/>
+        <location filename="../../gui/detailwindow.cpp" line="135"/>
         <source>Contact was successfully added to contacts.</source>
         <translation>Yhteystieto lisättiin onnistuneesti.</translation>
     </message>
     <message>
-        <location filename="../../gui/detailwindow.cpp" line="137"/>
+        <location filename="../../gui/detailwindow.cpp" line="139"/>
         <source>Error</source>
         <translation>Virhe</translation>
     </message>
     <message>
-        <location filename="../../gui/detailwindow.cpp" line="137"/>
+        <location filename="../../gui/detailwindow.cpp" line="139"/>
         <source>Unable to add contact.</source>
         <translation>Yhteystiedon lisääminen epäonnistui,</translation>
     </message>
     <message>
-        <location filename="../../gui/detailwindow.cpp" line="145"/>
+        <location filename="../../gui/detailwindow.cpp" line="147"/>
         <source>Number was successfully copied to clipboard.</source>
         <translation>Numero kopioitiin onnistuneesti leikepöydälle.</translation>
     </message>
 </context>
 <context>
-    <name>Eniro</name>
-    <message>
-        <location filename="../eniro.cpp" line="552"/>
-        <source>Finnish</source>
-        <translation>Suomi</translation>
-    </message>
-    <message>
-        <location filename="../eniro.cpp" line="556"/>
-        <source>Swedish</source>
-        <translation>Ruotsi</translation>
-    </message>
-    <message>
-        <location filename="../eniro.cpp" line="560"/>
-        <source>Danish</source>
-        <translation>Tanska</translation>
-    </message>
-</context>
-<context>
     <name>MainWindow</name>
     <message>
         <location filename="../../gui/mainwindow.cpp" line="44"/>
 <context>
     <name>ResultWindow</name>
     <message>
-        <location filename="../../gui/resultwindow.cpp" line="32"/>
+        <location filename="../../gui/resultwindow.cpp" line="33"/>
         <source>Search results</source>
         <translation>Hakutulokset</translation>
     </message>
     <message>
-        <location filename="../../gui/resultwindow.cpp" line="138"/>
+        <location filename="../../gui/resultwindow.cpp" line="140"/>
         <source>Error</source>
         <translation>Virhe</translation>
     </message>
     <message>
-        <location filename="../../gui/resultwindow.cpp" line="143"/>
+        <location filename="../../gui/resultwindow.cpp" line="145"/>
         <source>No results found</source>
         <translation>Ei hakutuloksia</translation>
     </message>
 <context>
     <name>SettingsDialog</name>
     <message>
-        <location filename="../../gui/settingsdialog.cpp" line="37"/>
+        <location filename="../../gui/settingsdialog.cpp" line="38"/>
         <source>Settings</source>
         <translation>Asetukset</translation>
     </message>
     <message>
-        <location filename="../../gui/settingsdialog.cpp" line="47"/>
+        <location filename="../../gui/settingsdialog.cpp" line="48"/>
         <source>Eniro username</source>
         <translation>Eniro-tunnus</translation>
     </message>
     <message>
-        <location filename="../../gui/settingsdialog.cpp" line="50"/>
+        <location filename="../../gui/settingsdialog.cpp" line="51"/>
         <source>Eniro password</source>
         <translation>Eniro-salasana</translation>
     </message>
     <message>
-        <location filename="../../gui/settingsdialog.cpp" line="53"/>
+        <location filename="../../gui/settingsdialog.cpp" line="54"/>
         <source>Cache size (numbers)</source>
         <translation>Välimuistin koko (numeroa)</translation>
     </message>
     <message>
-        <location filename="../../gui/settingsdialog.cpp" line="57"/>
+        <location filename="../../gui/settingsdialog.cpp" line="58"/>
         <source>Eniro site</source>
         <translation>Eniro-sivusto</translation>
     </message>
     <message>
-        <location filename="../../gui/settingsdialog.cpp" line="73"/>
+        <location filename="../../gui/settingsdialog.cpp" line="69"/>
+        <source>Finnish</source>
+        <translation>Suomi</translation>
+    </message>
+    <message>
+        <location filename="../../gui/settingsdialog.cpp" line="72"/>
+        <source>Swedish</source>
+        <translation>Ruotsi</translation>
+    </message>
+    <message>
+        <location filename="../../gui/settingsdialog.cpp" line="75"/>
+        <source>Danish</source>
+        <translation>Tanska</translation>
+    </message>
+    <message>
+        <location filename="../../gui/settingsdialog.cpp" line="91"/>
         <source>Autostart</source>
         <translation>Käynnistä automaattisesti</translation>
     </message>
     <message>
-        <location filename="../../gui/settingsdialog.cpp" line="75"/>
+        <location filename="../../gui/settingsdialog.cpp" line="93"/>
         <source>Enabled</source>
         <translation>Kyllä</translation>
     </message>
     <message>
-        <location filename="../../gui/settingsdialog.cpp" line="76"/>
+        <location filename="../../gui/settingsdialog.cpp" line="94"/>
         <source>Disabled</source>
         <translation>Ei</translation>
     </message>
     <message>
-        <location filename="../../gui/settingsdialog.cpp" line="79"/>
+        <location filename="../../gui/settingsdialog.cpp" line="97"/>
         <source>Save</source>
         <translation>Tallenna</translation>
     </message>
     <message>
-        <location filename="../../gui/settingsdialog.cpp" line="120"/>
+        <location filename="../../gui/settingsdialog.cpp" line="138"/>
         <source>Restarting daemon...</source>
         <translation>Käynnistetään palvelu uudelleen...</translation>
     </message>
index 7cf83fb..196f428 100644 (file)
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: jenirokd
-# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed Apr 14 21:02:47 2010
+# Generated by qmake (2.01a) (Qt 4.6.2) on: Sat Apr 17 12:38:30 2010
 # Project:  daemon.pro
 # Template: app
 # Command: /usr/bin/qmake -unix -o Makefile daemon.pro
index 7d03770..1ccf24e 100644 (file)
@@ -1,6 +1,6 @@
 #############################################################################
 # Makefile for building: jenirok
-# Generated by qmake (2.01a) (Qt 4.6.2) on: Wed Apr 14 21:02:34 2010
+# Generated by qmake (2.01a) (Qt 4.6.2) on: Sat Apr 17 12:38:19 2010
 # Project:  gui.pro
 # Template: app
 # Command: /usr/bin/qmake -unix -o Makefile gui.pro
index 71cffce..1fdbf7e 100644 (file)
@@ -78,8 +78,6 @@ void DetailWindow::makeCall()
 {
     QString number = numberButton_->valueText();
 
-    qDebug() << number;
-
     if(number.isEmpty())
     {
         return;
index b2f3904..757a0ff 100644 (file)
@@ -61,7 +61,25 @@ autostartSelector_(0)
     QMap <Eniro::Site, Eniro::SiteDetails>::const_iterator it;
     for(it = sites_.begin(); it != sites_.end(); it++)
     {
-        siteSelector_->addItem(it.value().name, it.value().id);
+        QString name;
+
+        switch(it.key())
+        {
+        case Eniro::FI:
+            name = tr("Finnish");
+            break;
+        case Eniro::SE:
+            name = tr("Swedish");
+            break;
+        case Eniro::DK:
+            name = tr("Danish");
+            break;
+        default:
+            qDebug() << "Unknown site";
+            continue;
+
+        }
+        siteSelector_->addItem(name, it.value().id);
 
         if(it.value().id == site)
         {

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment