Skip to content
This repository
Browse code

Sigh - hotfix

- forgot the user story of no events
  • Loading branch information...
commit c9b139fe8df3d23c6f25b7e23d2b05c55422a453 1 parent 267a62b
Gareth Llewellyn authored
2  AndroidManifest.xml
... ... @@ -1,7 +1,7 @@
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 3 package="net.networksaremadeofstring.rhybudd"
4   - android:installLocation="auto" android:versionCode="12" android:versionName="3.0">
  4 + android:installLocation="auto" android:versionCode="13" android:versionName="3.0">
5 5 <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="16"/>
6 6 <uses-permission android:name="android.permission.INTERNET"></uses-permission>
7 7 <uses-permission android:name="android.permission.VIBRATE"></uses-permission>
BIN  originals/feature_graphic.png
BIN  originals/feature_graphic.psd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
95 src/net/networksaremadeofstring/rhybudd/RhybuddHome.java
@@ -374,6 +374,10 @@ public void run()
374 374 listOfZenossEvents = tempZenossEvents;
375 375 handler.sendEmptyMessage(1);
376 376 }
  377 + else if(tempZenossEvents!= null && tempZenossEvents.size() == 0)
  378 + {
  379 + handler.sendEmptyMessage(50);
  380 + }
377 381 else
378 382 {
379 383 // TODO Send a proper message
@@ -407,6 +411,7 @@ public void run()
407 411 catch(Exception e)
408 412 {
409 413 // TODO Send a proper message
  414 + e.printStackTrace();
410 415 handler.sendEmptyMessage(999);
411 416 }
412 417 }
@@ -565,6 +570,26 @@ else if(msg.what == 2)
565 570 dialog.show();
566 571 }
567 572 }
  573 + else if(msg.what == 50)
  574 + {
  575 + if(dialog != null && dialog.isShowing())
  576 + dialog.dismiss();
  577 +
  578 + try
  579 + {
  580 + if(listOfZenossEvents != null)
  581 + listOfZenossEvents.clear();
  582 +
  583 + if(adapter != null)
  584 + adapter.notifyDataSetChanged();
  585 + }
  586 + catch(Exception e)
  587 + {
  588 + //TODO Bugsense
  589 + }
  590 +
  591 + Toast.makeText(RhybuddHome.this, "There are no events to display", Toast.LENGTH_LONG).show();
  592 + }
568 593 else if(msg.what == 3 || msg.what == 999)
569 594 {
570 595 if(dialog != null && dialog.isShowing())
@@ -615,56 +640,56 @@ public void onClick(DialogInterface dialog, int id)
615 640 {
616 641 public void handleMessage(Message msg)
617 642 {
618   - if(msg.what == 0)
619   - {
620   - adapter.notifyDataSetChanged();
621   - }
622   - else if(msg.what == 1)
  643 + try
623 644 {
624   - for (ZenossEvent evt : listOfZenossEvents)
  645 + if(msg.what == 0)
  646 + {
  647 +
  648 + adapter.notifyDataSetChanged();
  649 +
  650 + }
  651 + else if(msg.what == 1)
625 652 {
626   - if(!evt.getEventState().equals("Acknowledged"))
  653 + for (ZenossEvent evt : listOfZenossEvents)
627 654 {
628   - evt.setProgress(false);
629   - evt.setAcknowledged();
  655 + if(!evt.getEventState().equals("Acknowledged"))
  656 + {
  657 + evt.setProgress(false);
  658 + evt.setAcknowledged();
  659 + }
630 660 }
  661 + adapter.notifyDataSetChanged();
631 662 }
632   - adapter.notifyDataSetChanged();
633   - }
634   - else if(msg.what == 2)
635   - {
636   - /*for (ZenossEvent evt : listOfZenossEvents)
  663 + else if(msg.what == 2)
637 664 {
638   - if(!evt.getEventState().equals("Acknowledged"))
  665 + for (Integer i : selectedEvents)
639 666 {
640   - evt.setProgress(false);
641   - evt.setAcknowledged();
  667 + listOfZenossEvents.get(i).setProgress(false);
  668 + listOfZenossEvents.get(i).setAcknowledged();
642 669 }
643   - }*/
644   -
645   - for (Integer i : selectedEvents)
646   - {
647   - listOfZenossEvents.get(i).setProgress(false);
648   - listOfZenossEvents.get(i).setAcknowledged();
  670 + adapter.notifyDataSetChanged();
649 671 }
650   - adapter.notifyDataSetChanged();
651   - }
652   - else if(msg.what == 99)
653   - {
654   - for (ZenossEvent evt : listOfZenossEvents)
  672 + else if(msg.what == 99)
655 673 {
656   - if(!evt.getEventState().equals("Acknowledged"))
  674 + for (ZenossEvent evt : listOfZenossEvents)
657 675 {
658   - evt.setProgress(false);
  676 + if(!evt.getEventState().equals("Acknowledged"))
  677 + {
  678 + evt.setProgress(false);
  679 + }
659 680 }
  681 + adapter.notifyDataSetChanged();
  682 + Toast.makeText(getApplicationContext(), "There was an error trying to ACK those events.", Toast.LENGTH_SHORT).show();
  683 + }
  684 + else
  685 + {
  686 +
  687 + Toast.makeText(getApplicationContext(), "There was an error trying to ACK that event.", Toast.LENGTH_SHORT).show();
660 688 }
661   - adapter.notifyDataSetChanged();
662   - Toast.makeText(getApplicationContext(), "There was an error trying to ACK those events.", Toast.LENGTH_SHORT).show();
663 689 }
664   - else
  690 + catch(Exception e)
665 691 {
666   -
667   - Toast.makeText(getApplicationContext(), "There was an error trying to ACK that event.", Toast.LENGTH_SHORT).show();
  692 + BugSenseHandler.log("AckEventHandler", e);
668 693 }
669 694 }
670 695 };
5 src/net/networksaremadeofstring/rhybudd/ZenossAPIv2.java
@@ -518,7 +518,7 @@ public JSONObject AcknowledgeEvents(List<String> EventIDs) throws JSONException,
518 518 catch(Exception e)
519 519 {
520 520 //TODO Do something
521   - return null;
  521 + //return null;
522 522 }
523 523 }
524 524
@@ -528,7 +528,8 @@ public JSONObject AcknowledgeEvents(List<String> EventIDs) throws JSONException,
528 528 }
529 529 else
530 530 {
531   - return null;
  531 + listofZenossEvents = new ArrayList<ZenossEvent>();
  532 + return listofZenossEvents;
532 533 }
533 534 }
534 535

0 comments on commit c9b139f

Please sign in to comment.
Something went wrong with that request. Please try again.