Browse Source

Prevent crash when labels are not yet loaded yet the label dialog is somehow started (race condition?).

pull/148/merge
Eric Kok 11 years ago
parent
commit
07d169c532
  1. 4
      core/res/layout/actionbar_serverstatus.xml
  2. 5
      core/src/org/transdroid/core/gui/DetailsFragment.java
  3. 3
      core/src/org/transdroid/core/gui/TorrentsFragment.java

4
core/res/layout/actionbar_serverstatus.xml

@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
<TextView
android:id="@+id/upspeed_text"
android:layout_width="wrap_content"
android:layout_width="@dimen/ui_serverstatus_width"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/upcount_text"
android:layout_alignParentRight="true"
@ -94,7 +94,7 @@ @@ -94,7 +94,7 @@
<TextView
android:id="@+id/downspeed_text"
android:layout_width="wrap_content"
android:layout_width="@dimen/ui_serverstatus_width"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/downcount_text"
android:layout_alignRight="@id/downcount_sign"

5
core/src/org/transdroid/core/gui/DetailsFragment.java

@ -320,8 +320,9 @@ public class DetailsFragment extends SherlockFragment implements OnTrackersUpdat @@ -320,8 +320,9 @@ public class DetailsFragment extends SherlockFragment implements OnTrackersUpdat
@OptionsItem(resName = "action_setlabel")
protected void setLabel() {
new SetLabelDialog().setOnLabelPickedListener(this).setCurrentLabels(currentLabels)
.show(getFragmentManager(), "SetLabelDialog");
if (currentLabels == null)
new SetLabelDialog().setOnLabelPickedListener(this).setCurrentLabels(currentLabels)
.show(getFragmentManager(), "SetLabelDialog");
}
@OptionsItem(resName = "action_forcerecheck")

3
core/src/org/transdroid/core/gui/TorrentsFragment.java

@ -318,7 +318,8 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL @@ -318,7 +318,8 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL
return true;
} else if (itemId == R.id.action_setlabel) {
lastMultiSelectedTorrents = checked;
new SetLabelDialog().setOnLabelPickedListener(TorrentsFragment.this).setCurrentLabels(currentLabels)
if (currentLabels != null)
new SetLabelDialog().setOnLabelPickedListener(TorrentsFragment.this).setCurrentLabels(currentLabels)
.show(getFragmentManager(), "SetLabelDialog");
mode.finish();
return true;

Loading…
Cancel
Save