From 28a07e35293ce3ee730b72de527e9d145fa47129 Mon Sep 17 00:00:00 2001 From: eshe Date: Fri, 11 Jun 2010 15:29:35 +0100 Subject: [PATCH] Some error banner delays fixed. --- debian/control | 2 ++ src/common/settings.cpp | 1 - src/daemon/calllistener.cpp | 14 +++++++++++--- src/daemon/calllistener.h | 4 ++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/debian/control b/debian/control index fa1e74a..5e19a27 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,8 @@ Description: Searches unknown callers' details using Eniro person search. Jenirok finds unknown callers' details automatically using Eniro person search. Person search can also be done by using a gui application. + Jenirok is currently mainly usable for Finnish, Swedish + and Danish users. XB-Description-fi_FI: Hakee tuntemattoman soittajan tiedot Eniron henkilöhaulla. Jenirok hakee tuntemattoman soittajan tiedot automaattisesti Eniron henkilöhakua käyttämällä. diff --git a/src/common/settings.cpp b/src/common/settings.cpp index c0296cd..956173e 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -208,7 +208,6 @@ Settings::ConnectionType Settings::getConnectionType() values.push_back((char *)list->data); list = list->next; } - } g_object_unref(gcClient); diff --git a/src/daemon/calllistener.cpp b/src/daemon/calllistener.cpp index 6c25bfc..4307347 100644 --- a/src/daemon/calllistener.cpp +++ b/src/daemon/calllistener.cpp @@ -374,7 +374,7 @@ bool CallListener::handleConnection() if(configType == Settings::ALWAYS_ASK) { - showError(tr("Automatic connecting is not allowed by settings.")); + showError(tr("Automatic connecting is not allowed by settings."), BANNER_DELAY); return false; } @@ -460,11 +460,19 @@ bool CallListener::handleConnection() return initialized_; } -void CallListener::showError(QString const& msg) +void CallListener::showError(QString const& msg, int timeout) { qDebug() << "Error: " << msg; box_->setTimeout(ERROR_BANNER_TIMEOUT); - showResult(msg); + + if(timeout) + { + showDelayedResult(msg, timeout); + } + else + { + showResult(msg); + } } void CallListener::timerEvent(QTimerEvent* event) diff --git a/src/daemon/calllistener.h b/src/daemon/calllistener.h index 6395048..0cd70ed 100644 --- a/src/daemon/calllistener.h +++ b/src/daemon/calllistener.h @@ -42,7 +42,7 @@ public: static const int CONNECT_RETRIES = 3; static const int CONNECTION_LOOKUP_RETRIES = 15; static const int WAIT_BETWEEN_RETRIES = 1000; - static const int ERROR_BANNER_TIMEOUT = 4000; + static const int ERROR_BANNER_TIMEOUT = 4500; protected: virtual void timerEvent(QTimerEvent* event); @@ -62,7 +62,7 @@ private: void searchInit(); void searchClose(); bool handleConnection(); - void showError(QString const& msg); + void showError(QString const& msg, int delay = 0); void sleep(int ms); QString createResult(QString const& name, QString const& street, QString const& city); QString timedMessage_; -- 1.7.9.5