Supported cancelation of sim contacts import 65/88765/2 submit/tizen/20160921.072552
authorAleksandr Sapozhnik <a.sapozhnik@samsung.com>
Tue, 20 Sep 2016 12:31:51 +0000 (15:31 +0300)
committerAleksandr Sapozhnik <a.sapozhnik@samsung.com>
Wed, 21 Sep 2016 06:41:48 +0000 (09:41 +0300)
Change-Id: I153f893009ffeaae21508fb67cfc53750c39515c
Signed-off-by: Aleksandr Sapozhnik <a.sapozhnik@samsung.com>
lib-contacts/inc/Contacts/Settings/ImportFromSimController.h
lib-contacts/src/Contacts/Settings/ImportFromSimController.cpp

index 99924bd..99a5011 100644 (file)
@@ -44,7 +44,8 @@ namespace Contacts
 
                private:
                        virtual void onStart() override;
-                       void onSimContactImport(int totalCount, int importedCount);
+                       virtual void onCanceled() override;
+                       bool onSimContactImport(int totalCount, int importedCount);
 
                        size_t m_TotalCount;
                };
index f6df7e7..5637920 100644 (file)
@@ -20,6 +20,7 @@
 #include "Utils/Logger.h"
 
 #include <contacts.h>
+#include <notification.h>
 
 using namespace Contacts::Settings;
 
@@ -45,12 +46,18 @@ void ImportFromSimController::onStart()
        contacts_disconnect_on_thread();
 }
 
+void ImportFromSimController::onCanceled()
+{
+       int err = notification_status_message_post(_("IDS_PB_SBODY_IMPORTING_CANCELLED_M_STATUS_ABB"));
+       WARN_IF_ERR(err, "notification_status_message_post() failed.");
+}
 
-void ImportFromSimController::onSimContactImport(int totalCount, int importedCount)
+bool ImportFromSimController::onSimContactImport(int totalCount, int importedCount)
 {
        if (!m_TotalCount) {
                m_TotalCount = totalCount;
                setTotalCount(totalCount);
        }
-       onProgress(importedCount);
+
+       return onProgress(importedCount);
 }