Show correct message for a print job that is being canceled.

1. If a print job is being canceled we now show appropriate
   message that matches what the notification shows.

2. If a print job is being canceled we do not show the cancel
   button.

bug:11696928

Change-Id: I0fc4f8226c4aa9acd6a4b65811f4228e56018315
This commit is contained in:
Svetoslav
2013-11-14 18:15:15 -08:00
parent 9b28d5a0c3
commit 97e962cd36
3 changed files with 40 additions and 14 deletions

View File

@@ -376,9 +376,15 @@ public class PrintSettingsFragment extends SettingsPreferenceFragment implements
switch (printJob.getState()) {
case PrintJobInfo.STATE_QUEUED:
case PrintJobInfo.STATE_STARTED: {
preference.setTitle(getString(
R.string.print_printing_state_title_template,
printJob.getLabel()));
if (!printJob.isCancelling()) {
preference.setTitle(getString(
R.string.print_printing_state_title_template,
printJob.getLabel()));
} else {
preference.setTitle(getString(
R.string.print_cancelling_state_title_template,
printJob.getLabel()));
}
} break;
case PrintJobInfo.STATE_FAILED: {
@@ -388,9 +394,15 @@ public class PrintSettingsFragment extends SettingsPreferenceFragment implements
} break;
case PrintJobInfo.STATE_BLOCKED: {
preference.setTitle(getString(
R.string.print_blocked_state_title_template,
printJob.getLabel()));
if (!printJob.isCancelling()) {
preference.setTitle(getString(
R.string.print_blocked_state_title_template,
printJob.getLabel()));
} else {
preference.setTitle(getString(
R.string.print_cancelling_state_title_template,
printJob.getLabel()));
}
} break;
}