Vicar release 0.6-1 (a.k.a I'm still here release)
authorSudheer K <scifi.guy@hotmail.com>
Mon, 28 Feb 2011 06:57:55 +0000 (22:57 -0800)
committerSudheer K <scifi.guy@hotmail.com>
Mon, 28 Feb 2011 06:57:55 +0000 (22:57 -0800)
39 files changed:
debian/changelog
debian/files
src/vicar-config/src/main.cpp
src/vicar-config/src/profilesettingsdialog.cpp
src/vicar-config/src/profilesettingsdialog.h
src/vicar-config/src/profileswindow.cpp
src/vicar-config/src/profileswindow.h
src/vicar-config/uis/profilesettingsdialog.ui
src/vicar-config/uis/profileswindow.ui
src/vicar-config/uis/ui_profilesettingsdialog.h
src/vicar-config/uis/ui_profileswindow.h
src/vicar-daemon/src/callrouter.cpp
src/vicar-daemon/src/callrouter.h
src/vicar-daemon/src/main.cpp
src/vicar-lib/src/connectioninterfacerequeststypes.cpp
src/vicar-lib/src/connectioninterfacerequeststypes.h
src/vicar-lib/src/databaseutility.cpp
src/vicar-lib/src/databaseutility.h
src/vicar-lib/src/dbusutility.cpp
src/vicar-lib/src/dbusutility.h
src/vicar-lib/src/gconfutility.cpp
src/vicar-lib/src/gconfutility.h
src/vicar-lib/src/telepathyutility.cpp
src/vicar-lib/src/telepathyutility.h
src/vicar-telepathy/src/connection.cpp
src/vicar-telepathy/src/connection.h
src/vicar-telepathy/src/connectioninterfacecapabilitiestypes.cpp
src/vicar-telepathy/src/connectioninterfacecapabilitiestypes.h
src/vicar-telepathy/src/connectioninterfacerequeststypes.cpp
src/vicar-telepathy/src/connectioninterfacerequeststypes.h
src/vicar-telepathy/src/connectionmanager.cpp
src/vicar-telepathy/src/connectionmanager.h
src/vicar-telepathy/src/connectionmanagertypes.cpp
src/vicar-telepathy/src/connectionmanagertypes.h
src/vicar-telepathy/src/connectiontypes.cpp
src/vicar-telepathy/src/connectiontypes.h
src/vicar-telepathy/src/main.cpp
src/vicar-telepathy/src/names.h
src/vicar-utils/src/main.cpp

index f85ba85..2e5f963 100755 (executable)
@@ -1,7 +1,9 @@
-vicar (0.5-3) unstable; urgency=low
+vicar (0.6-1) unstable; urgency=low
 
-  * Fix for infrequent "No routing profile defined for this number" error.
-  * Vicar will only process phone numbers with 0-9,+,p,* and #.
+  * Added support for blank space in phone numbers.
+  * Added a default profile to be used if no matching profile is found for a number. This feature can be accessed via "Edit Default Profile" button in context menu.
+  * Removed the pause before the DTMF tone (This was hardcoded in previous releases, to add more delay before sending DTMF tone, add "p" (pause) characters in DTMF Prefix field as necessary.
+  * Minor UI changes in VICaR config screen (Button resize, label changes).
 
- -- Sudheer K. <scifi1947 at gmail.com>  Fri,  07 Nov 2010 23:10:00 -0800
+ -- Sudheer K. <scifi1947 at gmail.com>  Sun,  27 Feb 2011 16:10:00 -0800
 
index e288da5..80c4ebc 100644 (file)
@@ -1 +1 @@
-vicar_0.5-3_armel.deb user/network extra
+vicar_0.6-1_armel.deb user/network extra
index b43a23e..d451c35 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
index 314e9ca..51cfb1e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
@@ -8,6 +8,7 @@
 #include "ui_profilesettingsdialog.h"
 #include "vicarprofiletypes.h"
 #include <QMessageBox>
+#include <QDebug>
 
 ProfileSettingsDialog::ProfileSettingsDialog(QWidget *parent, org::maemo::vicar::Profile *profile) :
     QDialog(parent),
@@ -18,6 +19,12 @@ ProfileSettingsDialog::ProfileSettingsDialog(QWidget *parent, org::maemo::vicar:
 
     if (profile != 0){
         //Load Profile values
+
+        if (profile->phoneNumberPattern == "%"){
+            ui->labelNumberStartsWith->setText("-- Default Profile --");
+            ui->lineEditNumberStartsWith->setVisible(false);
+        }
+
         ui->lineEditNumberStartsWith->setText(profile->phoneNumberPattern);
         ui->lineEditCallingCardNumber->setText(profile->gatewayNumber);
         int intIndex = ui->comboBoxDTMFFormat->findText(profile->dtmfFormat);
index e73aad4..afbabc5 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
index 78785a8..88fdfdd 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
@@ -39,7 +39,7 @@ public:
     TelepathyUtility *tpUtility;
     DatabaseUtility *databaseUtility;
     org::maemo::vicar::Profile *profile;
-    ProfilesWindow * const parent;
+    ProfilesWindow * const parent;    
 };
 
 // ---------------------------------------------------------------------------
@@ -72,13 +72,20 @@ void ProfilesWindow::loadProfilesList(){
         qDebug() << "Error fetching profiles list. "<< d->databaseUtility->lastError();
     }
     else{
-        //ui->profilesListWidget->clear();
         org::maemo::vicar::Profile currentProfile;
-        foreach (currentProfile,profileList){
-            QString strProfileDetails = QString("Number starts with %1 then call via %2")
-                                        .arg(currentProfile.phoneNumberPattern)
-                                        .arg(currentProfile.gatewayNumber);
-            QListWidgetItem *item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget);
+        QString strProfileDetails;
+        QListWidgetItem *item;
+        foreach (currentProfile,profileList){            
+            if (currentProfile.phoneNumberPattern != "%"){
+                strProfileDetails = QString("Number starts with %1, then call via %2")
+                                            .arg(currentProfile.phoneNumberPattern)
+                                            .arg(currentProfile.gatewayNumber);
+            }
+            else{
+                strProfileDetails = QString("No profile found, then call via %1")
+                                            .arg(currentProfile.gatewayNumber);
+            }
+            item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget);
             item->setData(Qt::UserRole,currentProfile.profileID);
         }
     }
@@ -97,7 +104,7 @@ void ProfilesWindow::on_addButton_clicked()
             qDebug() << "Error inserting new profile record. "<< d->databaseUtility->lastError();
         }
         else{
-            QString strProfileDetails = QString("Number starts with %1 then call via %2")
+            QString strProfileDetails = QString("Number starts with %1, then call via %2")
                                         .arg(newProfile.phoneNumberPattern)
                                         .arg(newProfile.gatewayNumber);
             QListWidgetItem *item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget);
@@ -129,11 +136,18 @@ void ProfilesWindow::on_editButton_clicked(){
                             <<". "<< d->databaseUtility->lastError();
                 }
                 else{
-                    QString strProfileDetails = QString("Number starts with %1 then \n call via %2")
-                                                .arg(profile.phoneNumberPattern)
-                                                .arg(profile.gatewayNumber);
+                    QString strProfileDetails;
+                    if (profile.phoneNumberPattern != "%"){
+                        strProfileDetails = QString("Number starts with %1, then call via %2")
+                                                    .arg(profile.phoneNumberPattern)
+                                                    .arg(profile.gatewayNumber);
+                    }
+                    else{
+                        strProfileDetails = QString("No profile found, then call via %1")
+                                                    .arg(profile.gatewayNumber);
+                    }
                     item->setText(strProfileDetails);
-                    item->setData(Qt::UserRole,result);
+                    item->setData(Qt::UserRole,profile.profileID);
                 }
             }
         }
@@ -146,6 +160,7 @@ void ProfilesWindow::on_editButton_clicked(){
 void ProfilesWindow::on_removeButton_clicked(){
     QListWidgetItem *item = ui->profilesListWidget->currentItem();
     if (item != 0){
+        qDebug() << "Selected item data is " << item->data(Qt::UserRole).toInt();
         int intProfileID = item->data(Qt::UserRole).toInt();
         bool result = d->databaseUtility->deleteProfile(intProfileID);
         if (!result){
@@ -193,3 +208,46 @@ void ProfilesWindow::on_actionRoutingEnabled_triggered(bool checked){
 void ProfilesWindow::on_actionRouteOnDefault_triggered(bool checked){
     d->gconfUtility->setGconfValueBoolean("route_on_default",checked);
 }
+
+void ProfilesWindow::on_actionEditDefaultProfile_triggered(){
+    org::maemo::vicar::Profile profile;
+    bool result = d->databaseUtility->getDefaultProfile(&profile);
+    qDebug() << "Default profile exits? " <<result;
+    if (result){
+        //Default profile does not exist - edit it
+        ProfileSettingsDialog *dialog = new ProfileSettingsDialog(this,&profile);
+        int response = dialog->exec();
+        if (response == QDialog::Accepted){
+            qDebug() << "Updating default profile record";
+            bool result = d->databaseUtility->updateProfile(profile);
+            if (!result){
+                d->dbusUtility->displayNotification("Unable to update default profile.");
+                qDebug() << "Error updating default profile."<< d->databaseUtility->lastError();
+            }
+            else{
+                ui->profilesListWidget->clear();
+                this->loadProfilesList();
+            }
+        }
+    }
+    else{
+       //Create new default profile
+        profile.phoneNumberPattern = "%";
+        ProfileSettingsDialog *dialog = new ProfileSettingsDialog(this,&profile);
+        int result = dialog->exec();
+        if (result == QDialog::Accepted){
+            qDebug() << "Inserting new default profile record";
+            int result = d->databaseUtility->insertProfile(profile);
+            if (result == -1){
+                d->dbusUtility->displayNotification("Unable to create default profile.");
+                qDebug() << "Error inserting new default profile record. "<< d->databaseUtility->lastError();
+            }
+            else{
+                QString strProfileDetails = QString("No profile found, then call via %1")
+                                            .arg(profile.gatewayNumber);
+                QListWidgetItem *item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget);
+                item->setData(Qt::UserRole,result);
+            }
+        }
+    }
+}
index 3075ac7..e2981da 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
@@ -33,6 +33,7 @@ private slots:
     void on_removeButton_clicked();
     void on_actionRoutingEnabled_triggered(bool checked);
     void on_actionRouteOnDefault_triggered(bool checked);
+    void on_actionEditDefaultProfile_triggered();
 };
 
 #endif // PROFILESWINDOW_H
index 9ccfba8..1f2aff4 100644 (file)
@@ -36,8 +36,8 @@
      <rect>
       <x>0</x>
       <y>0</y>
-      <width>679</width>
-      <height>369</height>
+      <width>677</width>
+      <height>367</height>
      </rect>
     </property>
     <widget class="QWidget" name="formLayoutWidget">
       <item row="1" column="0">
        <widget class="QLabel" name="labelCallingCardNumber">
         <property name="text">
-         <string>Calling Card Number:</string>
+         <string>Calling card number:</string>
         </property>
        </widget>
       </item>
       <item row="3" column="0">
        <widget class="QLabel" name="labelDTMFPrefix">
         <property name="text">
-         <string>Prefix before DTMF tone:</string>
+         <string>DTMF tone prefix: </string>
         </property>
        </widget>
       </item>
       <item row="4" column="0">
        <widget class="QLabel" name="labelDTMFSuffix">
         <property name="text">
-         <string>Suffix after DTMF tone:</string>
+         <string>DTMF tone suffix:</string>
         </property>
        </widget>
       </item>
index 8a76e4f..afe4974 100644 (file)
         </widget>
        </item>
        <item>
-        <spacer name="horizontalSpacer1">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>58</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
         <widget class="QPushButton" name="editButton">
          <property name="text">
           <string>Edit</string>
         </widget>
        </item>
        <item>
-        <spacer name="horizontalSpacer2">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>58</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
         <widget class="QPushButton" name="removeButton">
          <property name="text">
           <string>Remove</string>
      <x>0</x>
      <y>0</y>
      <width>800</width>
-     <height>23</height>
+     <height>27</height>
     </rect>
    </property>
    <widget class="QMenu" name="menuVicarProfiles">
     </property>
     <addaction name="actionRoutingEnabled"/>
     <addaction name="actionRouteOnDefault"/>
+    <addaction name="actionEditDefaultProfile"/>
    </widget>
    <addaction name="menuVicarProfiles"/>
   </widget>
     <string>Call directly if no match found?</string>
    </property>
   </action>
+  <action name="actionEditDefaultProfile">
+   <property name="text">
+    <string>Edit Default Profile</string>
+   </property>
+   <property name="toolTip">
+    <string>Create/Edit profile to be used when no other profile is found for a number</string>
+   </property>
+  </action>
  </widget>
  <resources/>
  <connections/>
index edc0067..50cf1dd 100644 (file)
@@ -1,7 +1,7 @@
 /********************************************************************************
 ** Form generated from reading UI file 'profilesettingsdialog.ui'
 **
-** Created: Tue Sep 7 04:21:07 2010
+** Created: Sat Feb 26 17:43:30 2011
 **      by: Qt User Interface Compiler version 4.6.2
 **
 ** WARNING! All changes made in this file will be lost when recompiling UI file!
@@ -64,7 +64,7 @@ public:
         scrollArea->setWidgetResizable(true);
         scrollAreaWidgetContents = new QWidget();
         scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
-        scrollAreaWidgetContents->setGeometry(QRect(0, 0, 679, 369));
+        scrollAreaWidgetContents->setGeometry(QRect(0, 0, 677, 367));
         formLayoutWidget = new QWidget(scrollAreaWidgetContents);
         formLayoutWidget->setObjectName(QString::fromUtf8("formLayoutWidget"));
         formLayoutWidget->setGeometry(QRect(10, 10, 661, 351));
@@ -93,7 +93,7 @@ public:
         sizePolicy1.setHeightForWidth(lineEditNumberStartsWith->sizePolicy().hasHeightForWidth());
         lineEditNumberStartsWith->setSizePolicy(sizePolicy1);
         lineEditNumberStartsWith->setMinimumSize(QSize(0, 60));
-        lineEditNumberStartsWith->setInputMethodHints(Qt::ImhDigitsOnly);
+        lineEditNumberStartsWith->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoPredictiveText|Qt::ImhPreferNumbers);
 
         formLayoutBasic->setWidget(0, QFormLayout::FieldRole, lineEditNumberStartsWith);
 
@@ -107,7 +107,7 @@ public:
         sizePolicy1.setHeightForWidth(lineEditCallingCardNumber->sizePolicy().hasHeightForWidth());
         lineEditCallingCardNumber->setSizePolicy(sizePolicy1);
         lineEditCallingCardNumber->setMinimumSize(QSize(0, 60));
-        lineEditCallingCardNumber->setInputMethodHints(Qt::ImhDigitsOnly);
+        lineEditCallingCardNumber->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoPredictiveText|Qt::ImhPreferNumbers);
 
         formLayoutBasic->setWidget(1, QFormLayout::FieldRole, lineEditCallingCardNumber);
 
@@ -142,7 +142,7 @@ public:
         sizePolicy1.setHeightForWidth(lineEditDTMFPrefix->sizePolicy().hasHeightForWidth());
         lineEditDTMFPrefix->setSizePolicy(sizePolicy1);
         lineEditDTMFPrefix->setMinimumSize(QSize(0, 60));
-        lineEditDTMFPrefix->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhPreferLowercase|Qt::ImhPreferNumbers);
+        lineEditDTMFPrefix->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoPredictiveText|Qt::ImhPreferNumbers);
 
         formLayoutBasic->setWidget(3, QFormLayout::FieldRole, lineEditDTMFPrefix);
 
@@ -156,7 +156,7 @@ public:
         sizePolicy1.setHeightForWidth(lineEditDTMFSuffix->sizePolicy().hasHeightForWidth());
         lineEditDTMFSuffix->setSizePolicy(sizePolicy1);
         lineEditDTMFSuffix->setMinimumSize(QSize(0, 60));
-        lineEditDTMFSuffix->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhPreferLowercase|Qt::ImhPreferNumbers);
+        lineEditDTMFSuffix->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoPredictiveText|Qt::ImhPreferNumbers);
 
         formLayoutBasic->setWidget(4, QFormLayout::FieldRole, lineEditDTMFSuffix);
 
@@ -198,7 +198,7 @@ public:
     {
         ProfileSettingsDialog->setWindowTitle(QApplication::translate("ProfileSettingsDialog", "Edit Profile", 0, QApplication::UnicodeUTF8));
         labelNumberStartsWith->setText(QApplication::translate("ProfileSettingsDialog", "Number starts with:", 0, QApplication::UnicodeUTF8));
-        labelCallingCardNumber->setText(QApplication::translate("ProfileSettingsDialog", "Calling Card Number:", 0, QApplication::UnicodeUTF8));
+        labelCallingCardNumber->setText(QApplication::translate("ProfileSettingsDialog", "Calling card number:", 0, QApplication::UnicodeUTF8));
         labelDTMFFormat->setText(QApplication::translate("ProfileSettingsDialog", "Format required for DTMF tone:", 0, QApplication::UnicodeUTF8));
         comboBoxDTMFFormat->clear();
         comboBoxDTMFFormat->insertItems(0, QStringList()
@@ -207,8 +207,8 @@ public:
          << QApplication::translate("ProfileSettingsDialog", "00<Country Code><Area Code><Phone Number>", 0, QApplication::UnicodeUTF8)
          << QApplication::translate("ProfileSettingsDialog", "011<Country Code><Area Code><Phone Number>", 0, QApplication::UnicodeUTF8)
         );
-        labelDTMFPrefix->setText(QApplication::translate("ProfileSettingsDialog", "Prefix before DTMF tone:", 0, QApplication::UnicodeUTF8));
-        labelDTMFSuffix->setText(QApplication::translate("ProfileSettingsDialog", "Suffix after DTMF tone:", 0, QApplication::UnicodeUTF8));
+        labelDTMFPrefix->setText(QApplication::translate("ProfileSettingsDialog", "DTMF tone prefix: ", 0, QApplication::UnicodeUTF8));
+        labelDTMFSuffix->setText(QApplication::translate("ProfileSettingsDialog", "DTMF tone suffix:", 0, QApplication::UnicodeUTF8));
         saveButton->setText(QApplication::translate("ProfileSettingsDialog", "Save", 0, QApplication::UnicodeUTF8));
         closeButton->setText(QApplication::translate("ProfileSettingsDialog", "Close", 0, QApplication::UnicodeUTF8));
     } // retranslateUi
index 289dcdf..047d0f6 100644 (file)
@@ -1,7 +1,7 @@
 /********************************************************************************
 ** Form generated from reading UI file 'profileswindow.ui'
 **
-** Created: Tue Sep 7 04:21:07 2010
+** Created: Sat Feb 26 17:43:29 2011
 **      by: Qt User Interface Compiler version 4.6.2
 **
 ** WARNING! All changes made in this file will be lost when recompiling UI file!
@@ -32,14 +32,13 @@ class Ui_ProfilesWindow
 public:
     QAction *actionRoutingEnabled;
     QAction *actionRouteOnDefault;
+    QAction *actionEditDefaultProfile;
     QWidget *centralwidget;
     QWidget *layoutWidget;
     QVBoxLayout *verticalLayout;
     QHBoxLayout *horizontalLayout;
     QPushButton *addButton;
-    QSpacerItem *horizontalSpacer1;
     QPushButton *editButton;
-    QSpacerItem *horizontalSpacer2;
     QPushButton *removeButton;
     QSpacerItem *verticalSpacer;
     QListWidget *profilesListWidget;
@@ -57,6 +56,8 @@ public:
         actionRouteOnDefault = new QAction(ProfilesWindow);
         actionRouteOnDefault->setObjectName(QString::fromUtf8("actionRouteOnDefault"));
         actionRouteOnDefault->setCheckable(true);
+        actionEditDefaultProfile = new QAction(ProfilesWindow);
+        actionEditDefaultProfile->setObjectName(QString::fromUtf8("actionEditDefaultProfile"));
         centralwidget = new QWidget(ProfilesWindow);
         centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
         layoutWidget = new QWidget(centralwidget);
@@ -72,19 +73,11 @@ public:
 
         horizontalLayout->addWidget(addButton);
 
-        horizontalSpacer1 = new QSpacerItem(58, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
-        horizontalLayout->addItem(horizontalSpacer1);
-
         editButton = new QPushButton(layoutWidget);
         editButton->setObjectName(QString::fromUtf8("editButton"));
 
         horizontalLayout->addWidget(editButton);
 
-        horizontalSpacer2 = new QSpacerItem(58, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
-        horizontalLayout->addItem(horizontalSpacer2);
-
         removeButton = new QPushButton(layoutWidget);
         removeButton->setObjectName(QString::fromUtf8("removeButton"));
 
@@ -106,7 +99,7 @@ public:
         ProfilesWindow->setCentralWidget(centralwidget);
         menubar = new QMenuBar(ProfilesWindow);
         menubar->setObjectName(QString::fromUtf8("menubar"));
-        menubar->setGeometry(QRect(0, 0, 800, 23));
+        menubar->setGeometry(QRect(0, 0, 800, 27));
         menuVicarProfiles = new QMenu(menubar);
         menuVicarProfiles->setObjectName(QString::fromUtf8("menuVicarProfiles"));
         ProfilesWindow->setMenuBar(menubar);
@@ -114,6 +107,7 @@ public:
         menubar->addAction(menuVicarProfiles->menuAction());
         menuVicarProfiles->addAction(actionRoutingEnabled);
         menuVicarProfiles->addAction(actionRouteOnDefault);
+        menuVicarProfiles->addAction(actionEditDefaultProfile);
 
         retranslateUi(ProfilesWindow);
 
@@ -131,6 +125,10 @@ public:
 #ifndef QT_NO_TOOLTIP
         actionRouteOnDefault->setToolTip(QApplication::translate("ProfilesWindow", "Call directly if no match found?", 0, QApplication::UnicodeUTF8));
 #endif // QT_NO_TOOLTIP
+        actionEditDefaultProfile->setText(QApplication::translate("ProfilesWindow", "Edit Default Profile", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+        actionEditDefaultProfile->setToolTip(QApplication::translate("ProfilesWindow", "Create/Edit profile to be used when no other profile is found for a number", 0, QApplication::UnicodeUTF8));
+#endif // QT_NO_TOOLTIP
         addButton->setText(QApplication::translate("ProfilesWindow", "Add", 0, QApplication::UnicodeUTF8));
         editButton->setText(QApplication::translate("ProfilesWindow", "Edit", 0, QApplication::UnicodeUTF8));
         removeButton->setText(QApplication::translate("ProfilesWindow", "Remove", 0, QApplication::UnicodeUTF8));
index 71b1fa7..7a5d8ed 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
 #include <QDBusMessage>
 #include <QStringListIterator>
 
-
-//static QString strLastDialedNumber = QString();
-//static org::maemo::vicar::Profile currentProfile;
-
 class CallRouterPrivate
 {
 public:
@@ -48,6 +44,7 @@ public:
     GConfUtility * gconfUtility;
     TelepathyUtility *tpUtility;
     QString strLastDialedNumber;
+    QString strLastDTMFCode;
     org::maemo::vicar::Profile *currentProfile;
     CallRouter * const parent;
 };
@@ -187,6 +184,25 @@ void CallRouter::startCallStatusMonitors(){
         qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
     }
 
+
+    /* Declare the slot to be executed when the DTMF code is sent.
+    */
+
+    success = connection.connect(QString(""),
+                               CSD_CALL_INSTANCE_PATH,
+                               CSD_CALL_INSTANCE_INTERFACE,
+                               QString("StoppedDTMF"),this,
+                               SLOT(displayDTMFConfirmation()));
+
+    if (success){
+        qDebug() << "Vicar-Daemon: Successfully connected to Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+    }
+    else{
+        qDebug() << "Vicar-Daemon: Failed to connect to Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+        qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+    }
+
+
     /* Declare the slot to be executed when the call is terminated (due to connection errors etc).
        We need this to avoid sending DTMF code on wrong calls.
     */
@@ -231,6 +247,7 @@ void CallRouter::startCallStatusMonitors(){
 
 void CallRouter::stopCallStatusMonitors(){
 
+    d->strLastDTMFCode.clear();
     d->strLastDialedNumber.clear();
     delete d->currentProfile;
     d->currentProfile = 0;
@@ -252,6 +269,22 @@ void CallRouter::stopCallStatusMonitors(){
         qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
     }
 
+    // Disconnect the slot for monitoring DTMF completion
+    status = connection.disconnect(QString(""),
+                                   CSD_CALL_INSTANCE_PATH,
+                                   CSD_CALL_INSTANCE_INTERFACE,
+                                   QString("StoppedDTMF"),this,
+                                   SLOT(displayDTMFConfirmation()));
+
+    if (status){
+        qDebug() << "Vicar-Daemon: Successfully disconnected from Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+    }
+    else{
+        qDebug() << "Vicar-Daemon: Failed to disconnect from Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+        qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+    }
+
+
     // Disconnect the slot for monitoring terminated calls
     status = connection.disconnect(QString(""),
                                    CSD_CALL_INSTANCE_PATH,
@@ -297,36 +330,21 @@ void CallRouter::sendNumberAsDTMFCode(const QDBusMessage& dbusMessage){
 
             qDebug() << "Vicar-Daemon: Audio connection established. Sending DTMF code "<< strDTMFCode;
 
+
             QList<QVariant> argsToSend;
             argsToSend.append(strDTMFCode);
-
             bool status = d->dbusUtility->sendMethodCall(CSD_SERVICE,
                                                      CSD_CALL_PATH,
                                                  CSD_CALL_INTERFACE,
                                                  QString("SendDTMF"),argsToSend);
 
             if (status){
-                QString strMessage = strDTMFCode.append(" sent as DTMF code");
-                qDebug() << strMessage;
-                d->dbusUtility->displayNotification(strMessage);
+                qDebug() << "Vicar-Daemon: Sending " << strDTMFCode << " as DTMF code.";
+                d->strLastDTMFCode = strDTMFCode;
             }
             else{
                 qDebug() << "Vicar-Daemon: Unable to send DTMF code.";
             }
-
-
-            /*
-              Connecting and Disconnecting from/to DBus signal for each international call
-              may not be the most efficient way of handling this. But we need to make sure
-              that the DTMF codes are sent only for the calls placed by this app (i.e calls to Calling card number).
-             */
-
-            qDebug() << "Vicar-Daemon: Now disconnecting from call status monitors..";
-            stopCallStatusMonitors();
-
-            d->strLastDialedNumber.clear();
-            delete d->currentProfile;
-            d->currentProfile = 0;
         }
         else{
             qDebug() << "Vicar-Daemon: Audio not yet connected.";
@@ -338,14 +356,36 @@ void CallRouter::sendNumberAsDTMFCode(const QDBusMessage& dbusMessage){
     }
 }
 
+void CallRouter::displayDTMFConfirmation(){
+ //This slot is called when the all the DTMF tones are sent (i.e StoppedDTMF signal is emitted)
+ //Just display confirmation message and cleanup
+
+
+    if (!d->strLastDTMFCode.isEmpty()){
+      QString strMessage = d->strLastDTMFCode.append(" sent as DTMF code");
+      d->dbusUtility->displayNotification(strMessage);
+      qDebug() << "Vicar-Daemon: "<< d->strLastDTMFCode << " sent as DTMF code.";
+    }
+
+    /*
+      Connecting and Disconnecting from/to DBus signal for each international call
+      may not be the most efficient way of handling this. But we need to make sure
+      that the DTMF codes are sent only for the calls placed by this app (i.e calls to Calling card number).
+     */
+
+    qDebug() << "Vicar-Daemon: Now disconnecting from call status monitors..";
+    stopCallStatusMonitors();
+}
+
 QString CallRouter::convertToDTMFCode(QString strNumber){
     QString strDTMFCode;
 
     if (!strNumber.isEmpty()){
-        int intDTMFDelay = 1;
+        //int intDTMFDelay = 1;
 
         //Add the prefix p so that there is some delay after the call is picked up by the automated system to send DTMF tones.
-        strDTMFCode = QString("").fill('p',intDTMFDelay);        
+        //strDTMFCode = QString("").fill('p',intDTMFDelay);
+        strDTMFCode = "";
 
         //Now check whether we need a prefix
         QString strDTMFPrefix = d->currentProfile->dtmfPrefix;
@@ -414,10 +454,16 @@ QString CallRouter::callInternationalNumber(const QString& strDestinationNumber)
 
     if (isValidPhoneNumber(strDestinationNumber)){
 
-        strErrorMessage = this->callViaCallingCard(strDestinationNumber);
+        //Remove spaces in the phone number before using
+        QString numberWithoutSpaces = QString(strDestinationNumber).remove(" ");
+
+        strErrorMessage = this->callViaCallingCard(numberWithoutSpaces);
     }
     else{
         strErrorMessage = QString("Vicar-Daemon: %1 is not a valid number").arg(strDestinationNumber);
+        if (strDestinationNumber != "publish" && strDestinationNumber != "subscribe"){
+            d->dbusUtility->displayNotification(QString("Vicar: %1 is not a valid number").arg(strDestinationNumber));
+        }
     }
 
     qDebug() << strErrorMessage;
@@ -433,9 +479,8 @@ QString CallRouter::callInternationalNumber(const QString& strDestinationNumber)
 //Check whether a string is valid phone number
 bool CallRouter::isValidPhoneNumber(QString strPhoneNumber){
 
-
-/* Remove all dialble characters. The resulting string should be a valid number */    
-    QRegExp regexp = QRegExp("[p+*#]");
+/* Remove all dialble characters and space. The resulting string should be a valid number */
+    QRegExp regexp = QRegExp("[p+*# ]");
 
     strPhoneNumber = strPhoneNumber.replace(regexp,"");
 
index b200270..65288b1 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
@@ -51,6 +51,7 @@ protected:
 protected slots:
     QString callViaCallingCard(QString);
     void sendNumberAsDTMFCode(const QDBusMessage& dbusMessage);
+    void displayDTMFConfirmation();
     void stopCallStatusMonitors();
 
     //D-Bus Interface Methods
index 1874fbd..2bc7754 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
index 33ea4a6..d0546a5 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index 2b6c884..8f1fab9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index 638b6f0..e2df72b 100644 (file)
@@ -127,6 +127,25 @@ bool DatabaseUtility::findProfileByNumber(QString number,org::maemo::vicar::Prof
     return result;
 }
 
+bool DatabaseUtility::getDefaultProfile(org::maemo::vicar::Profile *profile){
+    bool result = false;
+    if (profilesDB.isOpen()){
+        QString strQuery = QString("select * from profiles where numberpattern = '%' order by id");
+        qDebug() << "SQL>"<<strQuery;
+        QSqlQuery query(strQuery);
+        if (query.next()){
+            profile->profileID = query.value(0).toInt();
+            profile->phoneNumberPattern = query.value(1).toString();
+            profile->gatewayNumber = query.value(2).toString();
+            profile->dtmfFormat = query.value(3).toString();
+            profile->dtmfPrefix = query.value(4).toString();
+            profile->dtmfSuffix = query.value(5).toString();
+            result = true;
+        }
+    }
+    return result;
+}
+
 int DatabaseUtility::insertProfile(org::maemo::vicar::Profile profile){
     int newId   = -1;
     bool result = false;    
@@ -172,7 +191,9 @@ bool DatabaseUtility::deleteProfile(int id){
     bool result = false;
     if (profilesDB.isOpen()){
         QSqlQuery query;
-        result = query.exec(QString("delete from profiles where id=%1").arg(id));
+        QString strQuery = QString("delete from profiles where id=%1").arg(id);
+        qDebug() << "SQL>"<<strQuery;
+        result = query.exec(strQuery);
     }
     return result;
 }
index 941ec2f..716e4ab 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
@@ -28,6 +28,7 @@ public:
     bool selectProfile(int id,org::maemo::vicar::Profile* profile);
     bool getAllProfiles(org::maemo::vicar::ProfileList* profileList);
     bool findProfileByNumber(QString number,org::maemo::vicar::Profile* profile);
+    bool getDefaultProfile(org::maemo::vicar::Profile* profile);
     bool deleteProfile(int id);
     QSqlError lastError();
 
index 0065648..ae8458f 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
index 87a991e..99077a0 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
index aa6a296..231a716 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
index 84879ac..8106833 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
index 8aca28a..f75681b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
index 2410ad9..56f0147 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */
index c4dbfb4..c45810d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
@@ -440,6 +440,14 @@ QDBusObjectPath Connection::processChannel(const QVariantMap &request){
                        "VICaR - Invalid request. Phone Number is empty.");
         return channel_path;
     }
+    else if (strNumber == "publish" || strNumber == "subscribe"){
+    //Deny the persistent Mission control requests to publish and subscribe
+        QString strError = "VICaR - Invalid request. " + strNumber + " is not supported.";
+        sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
+                       strError);
+        return channel_path;
+
+    }
 
     //Only allow requests with handle type as contact
     QVariant vTargetHandleType = request.value("org.freedesktop.Telepathy.Channel.TargetHandleType");
@@ -451,8 +459,10 @@ QDBusObjectPath Connection::processChannel(const QVariantMap &request){
 
         sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
                        strMessage);
+        return channel_path;
     }
 
+
     /*
         Send an error reply to Tp Client (Mission Control) to force it to close the active channel.
         Once it recieves the reply, the client does not bother what we return.
index ea214f4..5ec7df0 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index c3a2410..edcfe08 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index 21243eb..d104ffe 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index 33ea4a6..d0546a5 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index 2b6c884..8f1fab9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index 1a89778..635fa76 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index bdb5049..789aab6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index 481c7f1..7777941 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index f1e1b8d..88764bc 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index 9632489..4e90932 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index 9901510..854544f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index d81fc54..a1d59de 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index 6a4f560..8e2c141 100644 (file)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 
index bc2f3ab..6bf01a7 100755 (executable)
@@ -1,5 +1,5 @@
 /*
-@version: 0.5
+@version: 0.6
 @author: Sudheer K. <scifi1947 at gmail.com>
 @license: GNU General Public License
 */