[Pkg-owncloud-commits] [owncloud-client] 168/470: Notifications: Display timestamp of the notification in the widget

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:24:58 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 05de710b672f91cbc5bfe57d86ff429092b05487
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Fri Mar 18 08:21:54 2016 +0100

    Notifications: Display timestamp of the notification in the widget
---
 src/gui/notificationwidget.cpp |  6 +++++-
 src/gui/notificationwidget.ui  | 33 ++++++++++++++++++++++++++-------
 2 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/src/gui/notificationwidget.cpp b/src/gui/notificationwidget.cpp
index ac65aaa..1ef0f8c 100644
--- a/src/gui/notificationwidget.cpp
+++ b/src/gui/notificationwidget.cpp
@@ -13,6 +13,7 @@
 
 #include "notificationwidget.h"
 #include "QProgressIndicator.h"
+#include "utility.h"
 
 #include <QPushButton>
 
@@ -30,6 +31,7 @@ NotificationWidget::NotificationWidget(QWidget *parent) : QWidget(parent)
 void NotificationWidget::setActivity(const Activity& activity)
 {
     _myActivity = activity;
+    QLocale locale;
 
     Q_ASSERT( !activity._accName.isEmpty() );
     _accountName = activity._accName;
@@ -46,6 +48,9 @@ void NotificationWidget::setActivity(const Activity& activity)
     _ui._notifIcon->setMinimumHeight(64);
     _ui._notifIcon->show();
 
+    QString tText = tr("Created at %1").arg(Utility::timeAgoInWords(activity._dateTime));
+    _ui._timeLabel->setText(tText);
+
     // always remove the buttons
     foreach( auto button, _ui._buttonBox->buttons() ) {
         _ui._buttonBox->removeButton(button);
@@ -96,7 +101,6 @@ void NotificationWidget::slotNotificationRequestFinished(int statusCode)
     } else {
         // the call to the ocs API succeeded.
         _ui._buttonBox->hide();
-
     }
     _progressIndi->stopAnimation();
 }
diff --git a/src/gui/notificationwidget.ui b/src/gui/notificationwidget.ui
index 8867772..c8d3401 100644
--- a/src/gui/notificationwidget.ui
+++ b/src/gui/notificationwidget.ui
@@ -15,7 +15,7 @@
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0">
-    <layout class="QHBoxLayout" name="horizontalLayout">
+    <layout class="QHBoxLayout" name="horizontalLayout_2">
      <item>
       <widget class="QLabel" name="_notifIcon">
        <property name="sizePolicy">
@@ -28,7 +28,7 @@
         <string/>
        </property>
        <property name="pixmap">
-        <pixmap>../../resources/bell.png</pixmap>
+        <pixmap>../../../../resources/bell.png</pixmap>
        </property>
       </widget>
      </item>
@@ -58,11 +58,30 @@
         </widget>
        </item>
        <item>
-        <widget class="QDialogButtonBox" name="_buttonBox">
-         <property name="standardButtons">
-          <set>QDialogButtonBox::Ok</set>
-         </property>
-        </widget>
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+          <widget class="QLabel" name="_timeLabel">
+           <property name="font">
+            <font>
+             <pointsize>8</pointsize>
+            </font>
+           </property>
+           <property name="text">
+            <string>TextLabel</string>
+           </property>
+           <property name="alignment">
+            <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QDialogButtonBox" name="_buttonBox">
+           <property name="standardButtons">
+            <set>QDialogButtonBox::Ok</set>
+           </property>
+          </widget>
+         </item>
+        </layout>
        </item>
       </layout>
      </item>

-- 
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