Bookmark plugin: tweak post-upload success message to distinguish between "already done" (UnQueueManager) and "started, should finish eventually" (other queue manager)

This commit is contained in:
Brion Vibber 2010-12-31 12:42:26 -08:00
parent 3368c33be7
commit ae59046b1e

View File

@ -48,6 +48,7 @@ if (!defined('STATUSNET')) {
class ImportdeliciousAction extends Action class ImportdeliciousAction extends Action
{ {
protected $success = false; protected $success = false;
private $inprogress = false;
/** /**
* Return the title of the page * Return the title of the page
@ -191,7 +192,13 @@ class ImportdeliciousAction extends Action
$qm = QueueManager::get(); $qm = QueueManager::get();
$qm->enqueue(array(common_current_user(), $html), 'dlcsback'); $qm->enqueue(array(common_current_user(), $html), 'dlcsback');
if ($qm instanceof UnQueueManager) {
// No active queuing means we've actually just completed the job!
$this->success = true; $this->success = true;
} else {
// We've fed data into background queues, and it's probably still running.
$this->inprogress = true;
}
$this->showPage(); $this->showPage();
@ -212,8 +219,10 @@ class ImportdeliciousAction extends Action
{ {
if ($this->success) { if ($this->success) {
$this->element('p', null, $this->element('p', null,
_('Feed will be restored. '. _('Bookmarks have been imported. Your bookmarks should now appear in search and your profile page.'));
'Please wait a few minutes for results.')); } else if ($this->inprogress) {
$this->element('p', null,
_('Bookmarks are being imported. Please wait a few minutes for results.'));
} else { } else {
$form = new ImportDeliciousForm($this); $form = new ImportDeliciousForm($this);
$form->show(); $form->show();