[Pkg-owncloud-commits] [owncloud-client] 171/470: Notifications: Give feedback if notifcation request succeeded.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu May 12 16:24:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 0a590b7cbed90eb71a2ba7e70aed77bdb6cba884
Author: Klaas Freitag <freitag at owncloud.com>
Date: Fri Mar 18 10:02:11 2016 +0100
Notifications: Give feedback if notifcation request succeeded.
Also display a time stamp.
---
src/gui/notificationwidget.cpp | 13 +++++++++++++
src/gui/notificationwidget.h | 1 +
2 files changed, 14 insertions(+)
diff --git a/src/gui/notificationwidget.cpp b/src/gui/notificationwidget.cpp
index 1ef0f8c..afba083 100644
--- a/src/gui/notificationwidget.cpp
+++ b/src/gui/notificationwidget.cpp
@@ -82,6 +82,7 @@ void NotificationWidget::slotButtonClicked()
// if the button was found, the link must be called
if( index > -1 && index < _myActivity._links.count() ) {
ActivityLink triggeredLink = _myActivity._links.at(index);
+ _actionLabel = triggeredLink._label;
qDebug() << Q_FUNC_INFO << "Notification Link: "<< triggeredLink._verb << triggeredLink._link;
_progressIndi->startAnimation();
emit sendNotificationRequest( _accountName, triggeredLink._link, triggeredLink._verb );
@@ -92,16 +93,28 @@ void NotificationWidget::slotButtonClicked()
void NotificationWidget::slotNotificationRequestFinished(int statusCode)
{
int i = 0;
+ QString doneText;
+ QLocale locale;
+
+ QString timeStr = locale.toString(QTime::currentTime());
+
// the ocs API returns stat code 100 if it succeeded.
if( statusCode != OCS_SUCCESS_STATUS_CODE ) {
qDebug() << Q_FUNC_INFO << "Notification Request to Server failed, leave button visible.";
for( i = 0; i < _buttons.count(); i++ ) {
_buttons.at(i)->setEnabled(true);
}
+ //* The second parameter is a time, such as 'failed at 09:58pm'
+ doneText = tr("%1 request failed at %2").arg(_actionLabel).arg(timeStr);
} else {
// the call to the ocs API succeeded.
_ui._buttonBox->hide();
+
+ //* The second parameter is a time, such as 'selected at 09:58pm'
+ doneText = tr("'%1' selected at %2").arg(_actionLabel).arg(timeStr);
}
+ _ui._timeLabel->setText( doneText );
+
_progressIndi->stopAnimation();
}
diff --git a/src/gui/notificationwidget.h b/src/gui/notificationwidget.h
index 9abcd8b..fceb2d9 100644
--- a/src/gui/notificationwidget.h
+++ b/src/gui/notificationwidget.h
@@ -46,6 +46,7 @@ private:
QList<QPushButton*> _buttons;
QString _accountName;
QProgressIndicator *_progressIndi;
+ QString _actionLabel;
};
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list