#include "browser_config.h"
#include "BrowserLogger.h"
#include "EflTools.h"
+#include "Elementary.h"
namespace tizen_browser {
return (px >= x && px <= x + w && py >= y && py <= y + h);
}
+Evas_Object* createToastPopup(Evas_Object* parent, double timeout, const char* text)
+{
+ auto toast(elm_popup_add(parent));
+ elm_object_style_set(toast, "toast");
+ elm_popup_timeout_set(toast, timeout);
+ elm_object_text_set(toast, text);
+ return toast;
+}
+
} /* end of EflTools */
} /* end of namespace tools */
} /* end of namespace tizen_browser */
*/
bool pointInObject(Evas_Object* object, int x, int y);
+ Evas_Object* createToastPopup(Evas_Object* parent, double timeout, const char* text);
} /* end of namespace EflTools */
} /* end of namespace tools */
} /* end of namespace tizen_browser */
bool BookmarkService::deleteBookmark(const std::string & url)
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
- int id = getBookmarkId(url);
- if (id!=0)
- bp_bookmark_adaptor_delete(id);
- bookmarkDeleted(url);
- return true;
+ int id(getBookmarkId(url));
+ int ret(0);
+
+ if (id != 0)
+ ret = bp_bookmark_adaptor_delete(id);
+
+ return static_cast<bool>(ret);
}
std::shared_ptr<BookmarkItem> BookmarkService::addFolder(const std::string &title, int parent)
}
}
-//TODO: Add toast popup informing that delete was success.
-//http://suprem.sec.samsung.net/jira/browse/TWF-1839
void SimpleUI::deleteBookmark()
{
- std::string uri = m_webEngine->getURI();
+ std::string uri(m_webEngine->getURI());
+ bool ret(true);
if (m_favoriteService->bookmarkExists(uri))
- m_favoriteService->deleteBookmark(uri);
+ ret = m_favoriteService->deleteBookmark(uri);
+ // TODO add translations
+ auto text(
+ ret ?
+ "Bookmark deletion has failed!" :
+ "Bookmark has been deleted successfully.");
+ auto toast(tools::EflTools::createToastPopup(
+ m_viewManager.getContent(),
+ 3.0,
+ text));
+ evas_object_show(toast);
}
}
}