Delete option in log menu should be removed if there is no logs in logs list. 32/64832/3
authorIryna Ferenchak <i.ferenchak@samsung.com>
Thu, 7 Apr 2016 07:39:25 +0000 (10:39 +0300)
committerIryna Ferenchak <i.ferenchak@samsung.com>
Fri, 8 Apr 2016 06:47:00 +0000 (23:47 -0700)
Change-Id: I4b20faa11d0ba3beb01b682e9f38d33032b79890
Signed-off-by: Iryna Ferenchak <i.ferenchak@samsung.com>
lib-logs/src/Logs/List/LogsView.cpp

index 014a2b6..9932086 100644 (file)
@@ -78,27 +78,31 @@ void LogsView::onMenuPressed()
        Ui::Menu *menu = new Ui::Menu();
        menu->create(getEvasObject());
 
-       menu->addItem("IDS_CLOG_OPT_VIEW_BY", [this] {
-               onSelectViewBy();
-       });
-
-       menu->addItem("IDS_LOGS_OPT_DELETE", [this] {
-               auto strings = Common::getSelectViewStrings();
-               strings.buttonDone = "IDS_LOGS_OPT_DELETE";
-
-               LogsView *view = new LogsView(m_FilterType);
-               view->setStrings(strings);
-               view->setSelectMode(SelectMulti);
-               view->setSelectCallback([](SelectResults results) {
-                       for (auto &&result : results) {
-                               LogGroup *group = (LogGroup *) result.value.data;
-                               group->remove();
-                       }
+       if (!m_LogProvider.getLogGroupList().empty()) {
+               menu->addItem("IDS_CLOG_OPT_VIEW_BY", [this] {
+                       onSelectViewBy();
+               });
+       }
 
-                       return true;
+       if (m_Genlist && elm_genlist_items_count(m_Genlist->getEvasObject())) {
+               menu->addItem("IDS_LOGS_OPT_DELETE", [this] {
+                       auto strings = Common::getSelectViewStrings();
+                       strings.buttonDone = "IDS_LOGS_OPT_DELETE";
+
+                       LogsView *view = new LogsView(m_FilterType);
+                       view->setStrings(strings);
+                       view->setSelectMode(SelectMulti);
+                       view->setSelectCallback([](SelectResults results) {
+                                               for (auto &&result : results) {
+                                                       LogGroup *group = (LogGroup *) result.value.data;
+                                                       group->remove();
+                                               }
+
+                                               return true;
+                                       });
+                       getNavigator()->navigateTo(view);
                });
-               getNavigator()->navigateTo(view);
-       });
+       }
 
        menu->addItem("IDS_KPD_OPT_CALL_SETTINGS_ABB", [this] {
                m_AppControl = App::requestCallSettings();