Added date in X axis when time frame is greather that one day. Added 10min, 12h,...
authorMarco Incalcaterra <marco.incalcaterra@thinksoft.it>
Thu, 1 Jan 2015 20:01:59 +0000 (21:01 +0100)
committerMarco Incalcaterra <marco.incalcaterra@thinksoft.it>
Thu, 1 Jan 2015 20:01:59 +0000 (21:01 +0100)
18 files changed:
ChangeLog
android/src/agent/libs/android-support-v4.jar
android/src/console/libs/android-support-v4.jar
android/src/console/res/drawable/status_resolve.png [new file with mode: 0644]
android/src/console/res/drawable/status_terminate.png [new file with mode: 0644]
android/src/console/res/menu-v11/last_values_actions.xml
android/src/console/res/menu/last_values_actions.xml
android/src/console/res/values/strings.xml
android/src/console/res/xml-v14/preference_notifications.xml
android/src/console/res/xml/preference_notifications.xml
android/src/console/src/org/netxms/ui/android/helpers/CustomLabel.java
android/src/console/src/org/netxms/ui/android/main/activities/DrawGraph.java
android/src/console/src/org/netxms/ui/android/main/activities/NodeBrowser.java
android/src/console/src/org/netxms/ui/android/main/adapters/AlarmListAdapter.java
android/src/console/src/org/netxms/ui/android/main/dashboards/elements/LineChartElement.java
android/src/console/src/org/netxms/ui/android/main/fragments/LastValuesFragment.java
android/src/console/src/org/netxms/ui/android/service/ClientConnectorService.java
android/src/console/src/org/netxms/ui/android/tools/BarcodeScannerIntegrator.java

index f2ab377..a32924e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
     - New dashboard element "DCI summary table"
     - Cluster objects shown on status maps
 - Android console:
-    - Support for KitKat Wear and Lollipop
+    - Added date in X axis (graphs) when the time frame is greather that one day
+    - Added 10 minutes, 12 hours, 5 days, 30 days options in draw graph for last values tab (5, 7, and 30 days asks for confirmation of long task execution)
+    - Fixed graphical problem (checkbox) in last values tab
+    - Support for KitKat Wear and Lollipop, updated support library v4
 - Fixed issues: #61, #306, #381, #488, #565, #628, #634, #667, #672, #673, #674, #675, #677, #678, #679, #682, #684, #686, #688, #689, #691, #700, #704, #705
 
 
index ac4181f..4ebdaa9 100644 (file)
Binary files a/android/src/agent/libs/android-support-v4.jar and b/android/src/agent/libs/android-support-v4.jar differ
index ac4181f..4ebdaa9 100644 (file)
Binary files a/android/src/console/libs/android-support-v4.jar and b/android/src/console/libs/android-support-v4.jar differ
diff --git a/android/src/console/res/drawable/status_resolve.png b/android/src/console/res/drawable/status_resolve.png
new file mode 100644 (file)
index 0000000..89c8129
Binary files /dev/null and b/android/src/console/res/drawable/status_resolve.png differ
diff --git a/android/src/console/res/drawable/status_terminate.png b/android/src/console/res/drawable/status_terminate.png
new file mode 100644 (file)
index 0000000..1514d51
Binary files /dev/null and b/android/src/console/res/drawable/status_terminate.png differ
index 9587f89..d4c0089 100644 (file)
@@ -1,11 +1,15 @@
 
     <menu xmlns:android="http://schemas.android.com/apk/res/android">
-        <item android:id="@+id/graph_half_hour" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_half_hour"></item>
-        <item android:id="@+id/graph_one_hour" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_hour" android:icon="@drawable/ic_menu_line_chart" android:showAsAction="always"></item>
+        <item android:id="@+id/graph_ten_minutes" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_ten_minutes"></item>
+        <item android:id="@+id/graph_thirty_minutes" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_thirty_minutes"></item>
+        <item android:id="@+id/graph_one_hour" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_hour" android:icon="@drawable/ic_menu_line_chart" android:showAsAction="ifRoom"></item>
         <item android:id="@+id/graph_two_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_two_hours"></item>
         <item android:id="@+id/graph_four_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_four_hours"></item>
+        <item android:id="@+id/graph_twelve_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_twelve_hours"></item>
         <item android:id="@+id/graph_one_day" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_day"></item>
+        <item android:id="@+id/graph_five_days" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_five_days"></item>
         <item android:id="@+id/graph_one_week" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_week"></item>
+        <item android:id="@+id/graph_one_month" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_month"></item>
         <item android:id="@+id/bar_chart" android:title="@string/last_values_bar_chart" android:enabled="true" android:visible="true" android:checkable="false" android:checked="false" android:icon="@drawable/ic_menu_bar_chart" android:showAsAction="always"></item>
         <item android:id="@+id/pie_chart" android:enabled="true" android:visible="true" android:checkable="false" android:checked="false" android:title="@string/last_values_pie_chart" android:icon="@drawable/ic_menu_pie_chart" android:showAsAction="always"></item>
     </menu>
index f75261d..426fb31 100644 (file)
@@ -1,11 +1,15 @@
 
     <menu xmlns:android="http://schemas.android.com/apk/res/android">
-        <item android:id="@+id/graph_half_hour" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_half_hour"></item>
+        <item android:id="@+id/graph_ten_minutes" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_ten_minutes"></item>
+        <item android:id="@+id/graph_thirty_minutes" android:checkable="false" android:visible="true" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_thirty_minutes"></item>
         <item android:id="@+id/graph_one_hour" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_hour"></item>
         <item android:id="@+id/graph_two_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_two_hours"></item>
         <item android:id="@+id/graph_four_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_four_hours"></item>
+        <item android:id="@+id/graph_twelve_hours" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_twelve_hours"></item>
         <item android:id="@+id/graph_one_day" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_day"></item>
+        <item android:id="@+id/graph_five_days" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_five_days"></item>
         <item android:id="@+id/graph_one_week" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_week"></item>
+        <item android:id="@+id/graph_one_month" android:visible="true" android:checkable="false" android:enabled="true" android:checked="false" android:title="@string/last_values_graph_one_month"></item>
         <item android:id="@+id/bar_chart" android:title="@string/last_values_bar_chart" android:enabled="true" android:visible="true" android:checkable="false" android:checked="false"></item>
         <item android:id="@+id/pie_chart" android:enabled="true" android:visible="true" android:checkable="false" android:checked="false" android:title="@string/last_values_pie_chart"></item>
     </menu>
index 1812289..8b76203 100644 (file)
@@ -13,7 +13,9 @@
        <string name="tools">Tools</string>
        <string name="confirm_tool_execution">Confirm execution</string>
        <string name="no_items">No items to show&#8230;</string>
-                                       
+       <string name="warning">Warning</string>
+       <string name="long_time_execution">This task could take a long time to execute. Would you like to proceed anyway?</string>
+                                               
        <string name="progress_gathering_data">Gathering data&#8230;</string>
        <string name="progress_processing_data">Processing data&#8230;</string>
                                
@@ -72,6 +74,9 @@
        <string name="pref_alarm_sound_minor">Minor alarm sound</string>
        <string name="pref_alarm_sound_major">Major alarm sound</string>
        <string name="pref_alarm_sound_critical">Critical alarm sound</string>
+       <string name="pref_alarm_sound_unknown">Unknown alarm sound</string>
+       <string name="pref_alarm_sound_terminate">Terminate alarm sound</string>
+       <string name="pref_alarm_sound_resolve">Resolve alarm sound</string>
        <string name="pref_global_notification_toast">Toast notification</string>
        <string name="pref_global_notification_toast_enabled">Toast is enabled</string>
        <string name="pref_global_notification_toast_disabled">Toast is disabled</string>
        <string name="last_values_na">N/A</string>
        <string name="last_values_pie_chart">Pie Chart</string>
        <string name="last_values_bar_chart">Bar Chart</string>
-       <string name="last_values_graph_half_hour">Graph last half hour</string>
+       <string name="last_values_graph_ten_minutes">Graph last 10 minutes</string>
+       <string name="last_values_graph_thirty_minutes">Graph last 30 minutes</string>
        <string name="last_values_graph_one_hour">Graph last hour</string>
-       <string name="last_values_graph_two_hours">Graph last two hours</string>
-       <string name="last_values_graph_four_hours">Graph last four hours</string>
+       <string name="last_values_graph_two_hours">Graph last 2 hours</string>
+       <string name="last_values_graph_four_hours">Graph last 4 hours</string>
+       <string name="last_values_graph_twelve_hours">Graph last 12 hours</string>
        <string name="last_values_graph_one_day">Graph last day</string>
+       <string name="last_values_graph_two_day">Graph last 2 days</string>
+       <string name="last_values_graph_five_days">Graph last 5 days</string>
        <string name="last_values_graph_one_week">Graph last week</string>
-       <string name="table_value_placeholder">&lt;&lt; TABLE &gt;&gt;</string>
+       <string name="last_values_graph_one_month">Graph last month</string>
+               <string name="table_value_placeholder">&lt;&lt; TABLE &gt;&gt;</string>
        <string name="table_last_values">Table last values</string>
 
        <string name="if_manage">Manage</string>
index c5afe0e..c719193 100644 (file)
                <RingtonePreference android:key="alarm.sound.minor" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_minor" android:icon="@drawable/status_minor" />
                <RingtonePreference android:key="alarm.sound.major" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_major" android:icon="@drawable/status_major" />
                <RingtonePreference android:key="alarm.sound.critical" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_critical" android:icon="@drawable/status_critical" />
+<!-- Not really useful 
+               <RingtonePreference android:key="alarm.sound.unknown" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_unknown" android:icon="@drawable/status_unknown" />
+               <RingtonePreference android:key="alarm.sound.terminate" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_terminate" android:icon="@drawable/status_terminate" />
+               <RingtonePreference android:key="alarm.sound.resolve" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_resolve" android:icon="@drawable/status_resolve" />
+ -->
        </PreferenceCategory>
 </PreferenceScreen>
index 768864c..ed0a956 100644 (file)
                <RingtonePreference android:key="alarm.sound.minor" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_minor" android:icon="@drawable/status_minor" />
                <RingtonePreference android:key="alarm.sound.major" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_major" android:icon="@drawable/status_major" />
                <RingtonePreference android:key="alarm.sound.critical" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_critical" android:icon="@drawable/status_critical" />
-       </PreferenceCategory>
+<!-- Not really useful 
+               <RingtonePreference android:key="alarm.sound.unknown" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_unknown" android:icon="@drawable/status_unknown" />
+               <RingtonePreference android:key="alarm.sound.terminate" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_terminate" android:icon="@drawable/status_terminate" />
+               <RingtonePreference android:key="alarm.sound.resolve" android:showDefault="true" android:showSilent="true" android:ringtoneType="all" android:title="@string/pref_alarm_sound_resolve" android:icon="@drawable/status_resolve" />
+ -->
+       </PreferenceCategory>
 </PreferenceScreen>
index 71b2246..b85f772 100644 (file)
@@ -8,18 +8,19 @@ import com.jjoe64.graphview.CustomLabelFormatter;
 public class CustomLabel implements CustomLabelFormatter
 {
        private int m = 1;
+       private boolean drawDate = false;
 
-       public CustomLabel(int m)
+       public CustomLabel(int m, boolean drawDate)
        {
                this.m = m;
+               this.drawDate = drawDate;
        }
-
        @Override
        public String formatLabel(double value, boolean isValueX)
        {
                if (isValueX)
                {
-                       SimpleDateFormat s = new SimpleDateFormat("HH:mm:ss");
+                       SimpleDateFormat s = new SimpleDateFormat(drawDate ? "yyyy.MM.dd HH:mm:ss" : "HH:mm:ss");
                        return s.format(new Date((long)value));
                }
                else
index 93b44e1..d18db31 100644 (file)
@@ -91,7 +91,7 @@ public class DrawGraph extends AbstractClientActivity
                graphView.getGraphViewStyle().setHorizontalLabelsColor(Color.WHITE);
                graphView.getGraphViewStyle().setTextSize(Integer.parseInt(sp.getString("global.graph.textsize", "10")));
                graphView.getGraphViewStyle().setLegendWidth(240);
-               graphView.setCustomLabelFormatter(new CustomLabel(Integer.parseInt(sp.getString("global.multipliers", "1"))));
+               graphView.setCustomLabelFormatter(new CustomLabel(Integer.parseInt(sp.getString("global.multipliers", "1")), (timeTo - timeFrom) > 86400 * 1000));
                // TOOD: 2014May25 Find a best way to handle this setting
                //graphView.setShowLegend(showLegend);
                graphView.setShowLegend(sp.getBoolean("global.graph.legend", true));
index a0e9fde..c064951 100644 (file)
@@ -83,7 +83,8 @@ public class NodeBrowser extends AbstractClientActivity
 
                listView = (ListView)findViewById(R.id.NodeList);
                listView.setAdapter(adapter);
-               listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+               listView.setOnItemClickListener(new AdapterView.OnItemClickListener()
+               {
                        @Override
                        @SuppressWarnings("rawtypes")
                        public void onItemClick(AdapterView parent, View v, int position, long id)
@@ -174,7 +175,7 @@ public class NodeBrowser extends AbstractClientActivity
 
                AdapterView.AdapterContextMenuInfo info = (AdapterContextMenuInfo)menuInfo;
                selectedObject = (AbstractObject)adapter.getItem(info.position);
-               
+
                GeoLocation gl = selectedObject.getGeolocation();
                if ((gl == null) || (gl.getType() == GeoLocation.UNSET))
                {
@@ -221,13 +222,14 @@ public class NodeBrowser extends AbstractClientActivity
        /* (non-Javadoc)
         * @see android.app.Activity#onContextItemSelected(android.view.MenuItem)
         */
+       @SuppressWarnings("deprecation")
        @Override
        public boolean onContextItemSelected(MenuItem item)
        {
                if (selectedObject == null)
                        return super.onContextItemSelected(item);
 
-               switch(item.getItemId())
+               switch (item.getItemId())
                {
                        case R.id.find_switch_port:
                                Intent fspIntent = new Intent(this, ConnectionPointBrowser.class);
@@ -278,7 +280,7 @@ public class NodeBrowser extends AbstractClientActivity
                                {
                                        startActivity(intent);
                                }
-                               catch(ActivityNotFoundException e)
+                               catch (ActivityNotFoundException e)
                                {
                                        Toast.makeText(getApplicationContext(), "Navigation unavailable", Toast.LENGTH_LONG);
                                }
@@ -321,7 +323,7 @@ public class NodeBrowser extends AbstractClientActivity
                                }
                                break;
                }
-               
+
                return super.onContextItemSelected(item);
        }
 
index 51fd679..3a2edf6 100644 (file)
@@ -16,6 +16,7 @@ import org.netxms.ui.android.R;
 import org.netxms.ui.android.main.views.CheckableLinearLayout;
 import org.netxms.ui.android.service.ClientConnectorService;
 
+import android.annotation.SuppressLint;
 import android.app.ProgressDialog;
 import android.content.Context;
 import android.content.res.Resources;
@@ -280,6 +281,7 @@ public class AlarmListAdapter extends BaseAdapter
         * @see android.widget.Adapter#getView(int, android.view.View,
         * android.view.ViewGroup)
         */
+       @SuppressLint("RtlHardcoded")
        @Override
        public View getView(int position, View convertView, ViewGroup parent)
        {
index d925ccd..ac3f462 100644 (file)
@@ -58,7 +58,6 @@ public class LineChartElement extends AbstractDashboardElement
                graphView = new LineGraphView(context, config.getTitle());
                graphView.getGraphViewStyle().setTextSize(Integer.parseInt(sp.getString("global.graph.textsize", "10")));
                graphView.getGraphViewStyle().setLegendWidth(240);
-               graphView.setCustomLabelFormatter(new CustomLabel(Integer.parseInt(sp.getString("global.multipliers", "1"))));
                // TODO: 2014May25 Find a best way to handle this setting
                //graphView.setShowLegend(config.isShowLegend());
                graphView.setShowLegend(sp.getBoolean("global.graph.legend", true));
@@ -90,6 +89,7 @@ public class LineChartElement extends AbstractDashboardElement
 
                final long endTime = System.currentTimeMillis();
                final long startTime = endTime - config.getTimeRangeMillis();
+               graphView.setCustomLabelFormatter(new CustomLabel(Integer.parseInt(sp.getString("global.multipliers", "1")), (endTime - startTime) > 86400 * 1000));
 
                try
                {
index 82a1ce1..49c67e1 100644 (file)
@@ -15,6 +15,8 @@ import org.netxms.ui.android.main.activities.DrawPieChart;
 import org.netxms.ui.android.main.activities.TableLastValues;
 import org.netxms.ui.android.main.adapters.LastValuesAdapter;
 
+import android.app.AlertDialog;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.v4.app.LoaderManager;
@@ -41,13 +43,16 @@ import android.widget.ListView;
 
 public class LastValuesFragment extends AbstractListFragment implements LoaderManager.LoaderCallbacks<DciValue[]>
 {
-       private LastValuesAdapter adapter = null;
-       private DciValueLoader loader = null;
-       private ListView lv = null;
        private static final Integer[] DEFAULT_COLORS = { 0x40699C, 0x9E413E, 0x7F9A48, 0x695185, 0x3C8DA3, 0xCC7B38, 0x4F81BD, 0xC0504D,
                        0x9BBB59, 0x8064A2, 0x4BACC6, 0xF79646, 0xAABAD7, 0xD9AAA9, 0xC6D6AC, 0xBAB0C9 };
        private static final int MAX_COLORS = DEFAULT_COLORS.length;
 
+       private LastValuesAdapter adapter = null;
+       private DciValueLoader loader = null;
+       private ListView lv = null;
+       private long timeFrame = 0;
+       private ArrayList<Long> items = null;
+
        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                        Bundle savedInstanceState)
@@ -61,7 +66,7 @@ public class LastValuesFragment extends AbstractListFragment implements LoaderMa
        public void onActivityCreated(Bundle savedInstanceState)
        {
                super.onActivityCreated(savedInstanceState);
-               adapter = new LastValuesAdapter(getActivity().getApplicationContext());
+               adapter = new LastValuesAdapter(getActivity());
                setListAdapter(adapter);
                setListShown(false, true);
                loader = (DciValueLoader)getActivity().getSupportLoaderManager().initLoader(R.layout.lastvalues_fragment, null, this);
@@ -88,7 +93,7 @@ public class LastValuesFragment extends AbstractListFragment implements LoaderMa
        @Override
        public Loader<DciValue[]> onCreateLoader(int arg0, Bundle arg1)
        {
-               return new DciValueLoader(getActivity().getApplicationContext());
+               return new DciValueLoader(getActivity());
        }
 
        @Override
@@ -162,22 +167,31 @@ public class LastValuesFragment extends AbstractListFragment implements LoaderMa
         */
        private boolean handleItemSelection(MenuItem item)
        {
+               ArrayList<Long> idList = getLastValuesSelection(item);
                switch (item.getItemId())
                {
                        case R.id.table_last_value:
-                               return showTableLastValue(getLastValuesSelection(item));
-                       case R.id.graph_half_hour:
-                               return drawGraph(1800, getLastValuesSelection(item));
+                               return showTableLastValue(idList);
+                       case R.id.graph_ten_minutes:
+                               return drawGraph(10 * 60, idList);
+                       case R.id.graph_thirty_minutes:
+                               return drawGraph(30 * 60, idList);
                        case R.id.graph_one_hour:
-                               return drawGraph(3600, getLastValuesSelection(item));
+                               return drawGraph(3600, idList);
                        case R.id.graph_two_hours:
-                               return drawGraph(7200, getLastValuesSelection(item));
+                               return drawGraph(2 * 3600, idList);
                        case R.id.graph_four_hours:
-                               return drawGraph(14400, getLastValuesSelection(item));
+                               return drawGraph(4 * 3600, idList);
+                       case R.id.graph_twelve_hours:
+                               return drawGraph(12 * 3600, idList);
                        case R.id.graph_one_day:
-                               return drawGraph(86400, getLastValuesSelection(item));
+                               return drawGraph(86400, idList);
+                       case R.id.graph_five_days:
+                               return longExecutionDrawGraph(5 * 86400, idList);
                        case R.id.graph_one_week:
-                               return drawGraph(604800, getLastValuesSelection(item));
+                               return longExecutionDrawGraph(7 * 86400, idList);
+                       case R.id.graph_one_month:
+                               return longExecutionDrawGraph(30 * 86400, idList);
                        case R.id.bar_chart:
                                return drawComparisonChart(DrawBarChart.class);
                        case R.id.pie_chart:
@@ -208,7 +222,7 @@ public class LastValuesFragment extends AbstractListFragment implements LoaderMa
        /**
         * Show last value for table DCI
         * 
-        * @param position
+        * @param idList        list of DCI to graph
         * @return
         */
        private boolean showTableLastValue(ArrayList<Long> idList)
@@ -226,9 +240,42 @@ public class LastValuesFragment extends AbstractListFragment implements LoaderMa
        }
 
        /**
-        * @param secsBack
-        * @param val
-        * @return
+        * Draw graph for the specified time slot after confirmation of long task execution
+        * 
+        * @param secsBack      seconds back since current time
+        * @param idList        list of DCI to graph
+        * @return      Always true
+        */
+       private boolean longExecutionDrawGraph(long secsBack, ArrayList<Long> idList)
+       {
+               timeFrame = secsBack;
+               items = idList;
+
+               new AlertDialog.Builder(getActivity())
+                               .setIcon(android.R.drawable.ic_dialog_alert)
+                               .setTitle(R.string.warning)
+                               .setMessage(R.string.long_time_execution)
+                               .setCancelable(true)
+                               .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener()
+                               {
+                                       @Override
+                                       public void onClick(DialogInterface dialog, int which)
+                                       {
+                                               if (items != null)
+                                                       drawGraph(timeFrame, items);
+                                       }
+                               })
+                               .setNegativeButton(R.string.no, null)
+                               .show();
+               return true;
+       }
+
+       /**
+        * Draw graph for the specified time slot
+        * 
+        * @param secsBack      seconds back since current time
+        * @param idList        list of DCI to graph
+        * @return      Always true
         */
        private boolean drawGraph(long secsBack, ArrayList<Long> idList)
        {
index 3f05b8c..dc43f50 100644 (file)
@@ -909,11 +909,11 @@ public class ClientConnectorService extends Service implements SessionListener
                        case CRITICAL: // Critical
                                return sp.getString("alarm.sound.critical", "");
                        case UNKNOWN: // Unknown
-                               return sp.getString("alarm.sound.unknown", ""); // TODO: 2014Oct10 Implement corresponding settings section
+                               return sp.getString("alarm.sound.unknown", "");
                        case TERMINATE: // Terminate
-                               return sp.getString("alarm.sound.terminate", "");       // TODO: 2014Oct10 Implement corresponding settings section
+                               return sp.getString("alarm.sound.terminate", "");
                        case RESOLVE: // Resolve
-                               return sp.getString("alarm.sound.resolve", ""); // TODO: 2014Oct10 Implement corresponding settings section
+                               return sp.getString("alarm.sound.resolve", "");
                }
                return "";
        }
@@ -938,9 +938,11 @@ public class ClientConnectorService extends Service implements SessionListener
                        case CRITICAL: // Critical
                                return R.drawable.status_critical;
                        case UNKNOWN: // Unknown
+                               return R.drawable.status_unknown;
                        case TERMINATE: // Terminate
+                               return R.drawable.status_terminate;
                        case RESOLVE: // Resolve
-                               return android.R.drawable.stat_notify_sdcard;   // TODO: 2014Oct10 Implement corresponding icon
+                               return R.drawable.status_resolve;
                }
                return android.R.drawable.stat_notify_sdcard;
        }
index 92c8985..3b57238 100644 (file)
@@ -255,6 +255,7 @@ public class BarcodeScannerIntegrator
         * Initiates a scan only for a certain set of barcode types, given as strings corresponding to their names in ZXing's
         * {@code BarcodeFormat} class like "UPC_A". You can supply constants like {@link #PRODUCT_CODE_TYPES} for example.
         */
+       @SuppressWarnings("deprecation")
        public AlertDialog initiateScan(Collection<String> desiredBarcodeFormats)
        {
                Intent intentScan = new Intent(BS_PACKAGE + ".SCAN");
@@ -388,6 +389,7 @@ public class BarcodeScannerIntegrator
         * 
         * @param text the text string to encode as a barcode
         */
+       @SuppressWarnings("deprecation")
        public void shareText(CharSequence text)
        {
                Intent intent = new Intent();