Permalink
Browse files

återse presentation för aktuellt möte.

  • Loading branch information...
1 parent a3fa4af commit f0283ba456fe2876a60ddc524d7c9181d4e2c794 @jonasgit jonasgit committed May 13, 2011
@@ -50,6 +50,9 @@
<item android:title="@string/seetextagain_label"
android:alphabeticShortcut="@string/seetextagain_shortcut"
android:id="@+id/menu_seetextagain_id"/>
+ <item android:title="@string/seepresentation_label"
+ android:alphabeticShortcut="@string/seepresentation_shortcut"
+ android:id="@+id/menu_seepresentation_id"/>
</menu>
</item>
@@ -20,6 +20,7 @@
<string name="anonymous">anonym</string>
<string name="person">"Person "</string>
<string name="does_not_exist">" finns inte"</string>
+ <string name="no_presentation_error">Presentation saknas</string>
<string name="login_name">Användarnamn:</string>
<string name="login_id">AnvändarID: (vid behov)</string>
@@ -85,6 +86,8 @@
<string name="title_submenu_seeagain">Återse...</string>
<string name="seetextagain_label">Återse text</string>
+ <string name="seepresentation_label">Återse presentation</string>
+ <string name="seepresentation_shortcut">P</string>
<string name="seetextagain_shortcut">T</string>
<string name="alert_dialog_text_entry">Textnummer</string>
<string name="alert_dialog_ok">OK</string>
@@ -20,6 +20,7 @@
<string name="anonymous">anonymous</string>
<string name="person">"Person "</string>
<string name="does_not_exist">" does not exist"</string>
+ <string name="no_presentation_error">Presentation missing</string>
<string name="login_name">Username:</string>
<string name="login_id">UserID: (optional)</string>
@@ -88,6 +89,8 @@
<string name="title_submenu_seeagain">See again...</string>
<string name="seetextagain_label">See text</string>
<string name="seetextagain_shortcut">T</string>
+ <string name="seepresentation_label">See presentation</string>
+ <string name="seepresentation_shortcut">P</string>
<string name="alert_dialog_text_entry">Enter text number</string>
<string name="alert_dialog_ok">OK</string>
<string name="alert_dialog_cancel">Cancel</string>
@@ -548,6 +548,10 @@ public boolean onOptionsItemSelected(MenuItem item)
seetextagain();
return true;
+ case R.id.menu_seepresentation_id:
+ seepresentation();
+ return true;
+
default:
return super.onOptionsItemSelected(item);
}
@@ -580,6 +584,17 @@ protected void seetextagain() {
showDialog(DIALOG_NUMBER_ENTRY);
}
+ protected void seepresentation() {
+ int textNo = getApp().getKom().getConferencePres();
+ if (textNo > 0) {
+ Log.i(TAG, "fetching text " + textNo);
+ new LoadMessageTask().execute(MESSAGE_TYPE_TEXTNO, textNo);
+ } else {
+ Toast.makeText(getApplicationContext(), getString(R.string.no_presentation_error),
+ Toast.LENGTH_SHORT).show();
+ }
+ }
+
protected Dialog onCreateDialog(int id) {
AlertDialog.Builder alert = new AlertDialog.Builder(this);
@@ -329,6 +329,26 @@ public String getConferenceName()
{
return getConferenceName(s.getCurrentConference());
}
+
+ /**
+ * Return presentation text number for current conference.
+ */
+ public int getConferencePres() {
+ int confNo = s.getCurrentConference();
+ if (confNo > 0) {
+ try {
+ return s.getConfStat(confNo).getPresentation();
+ } catch (RpcFailure e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return 0;
+ }
+
/**
* Set currently active conference.
*/

0 comments on commit f0283ba

Please sign in to comment.