[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:14:28 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=ea3fbd1

The following commit has been merged in the master branch:
commit ea3fbd1e816a62b9b31c87e90763087e6229dda8
Author: Dan Vrátil <dvratil at redhat.com>
Date:   Sat Mar 29 00:06:47 2014 +0100

    Show a KMessageWidget when KTp::ContactsListModel fails to initialize properly
    
    Show a warning that contact list might be incomplete, when some of the
    KPeople's PersonDataSources fails to initialize properly.
    
    This can happen for example when Akonadi is broken and won't start.
    
    REVIEW: 117143
---
 contact-list-widget.cpp |  5 +++++
 contact-list-widget.h   |  3 ++-
 main-widget.cpp         | 17 +++++++++++++++++
 main-widget.h           |  1 +
 main-widget.ui          | 16 ++++++++++++++++
 5 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/contact-list-widget.cpp b/contact-list-widget.cpp
index e59fff0..ffae7bf 100644
--- a/contact-list-widget.cpp
+++ b/contact-list-widget.cpp
@@ -172,6 +172,11 @@ ContactListWidget::~ContactListWidget()
     delete d_ptr;
 }
 
+KTp::ContactsModel* ContactListWidget::contactsModel() const
+{
+    return d_ptr->model;
+}
+
 void ContactListWidget::setAccountManager(const Tp::AccountManagerPtr &accountManager)
 {
     Q_D(ContactListWidget);
diff --git a/contact-list-widget.h b/contact-list-widget.h
index c5b5328..7919738 100644
--- a/contact-list-widget.h
+++ b/contact-list-widget.h
@@ -44,6 +44,8 @@ public:
     void setAccountManager(const Tp::AccountManagerPtr &accountManager);
     void toggleGroups(bool show);
 
+    KTp::ContactsModel* contactsModel() const;
+
 public Q_SLOTS:
     void toggleOfflineContacts(bool show);
     void showGrouped();
@@ -76,7 +78,6 @@ private Q_SLOTS:
     void startLogViewer(const Tp::AccountPtr &account, const Tp::ContactPtr &contact);
     void accountEnablingFinished(Tp::PendingOperation *op);
 
-
 Q_SIGNALS:
     void enableOverlays(bool);
     void accountManagerReady(Tp::PendingOperation* op);
diff --git a/main-widget.cpp b/main-widget.cpp
index 27a941d..3e3950d 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -111,8 +111,14 @@ MainWidget::MainWidget(QWidget *parent)
     m_contextMenu = new ContextMenu(m_contactsListView);
     new ToolTipManager(m_contactsListView);
 
+    m_messageWidget->setWordWrap(true);
+    m_messageWidget->setCloseButtonVisible(true);
+    m_messageWidget->hide();
+
     connect(m_contactsListView, SIGNAL(customContextMenuRequested(QPoint)),
             this, SLOT(onCustomContextMenuRequested(QPoint)));
+    connect(m_contactsListView->contactsModel(), SIGNAL(modelInitialized(bool)),
+            this, SLOT(onModelInitialized(bool)));
 
     connect(m_showOfflineAction, SIGNAL(toggled(bool)),
             m_contactsListView, SLOT(toggleOfflineContacts(bool)));
@@ -753,4 +759,15 @@ void MainWidget::onMetacontactToggleTriggered()
 #endif
 }
 
+void MainWidget::onModelInitialized(bool success)
+{
+    if (!success) {
+        m_messageWidget->setMessageType(KMessageWidget::Warning);
+        m_messageWidget->setText(i18n("Some data sources failed to initialize properly, your contact list might be incomplete."));
+        m_messageWidget->setIcon(KIcon::fromTheme(QLatin1String("dialog-warning")));
+        m_messageWidget->animatedShow();
+    }
+}
+
+
 #include "main-widget.moc"
diff --git a/main-widget.h b/main-widget.h
index aa69daa..11efbeb 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -94,6 +94,7 @@ private Q_SLOTS:
     void onGenericOperationFinished(Tp::PendingOperation *operation);   /** called when a Tp::PendingOperation finishes. Used to check for errors */
     void onContactSelectionChanged();
     void onMetacontactToggleTriggered();
+    void onModelInitialized(bool success);
 
 private:
     QStringList extractLinksFromIndex(const QModelIndex &index);    /** extract links from a QModelIndex pointing to a contact */
diff --git a/main-widget.ui b/main-widget.ui
index b453060..1d75931 100644
--- a/main-widget.ui
+++ b/main-widget.ui
@@ -58,6 +58,16 @@
      </widget>
     </item>
     <item>
+     <widget class="KMessageWidget" name="m_messageWidget">
+      <property name="frameShape">
+       <enum>QFrame::StyledPanel</enum>
+      </property>
+      <property name="frameShadow">
+       <enum>QFrame::Raised</enum>
+      </property>
+     </widget>
+    </item>
+    <item>
      <widget class="ContactListWidget" name="m_contactsListView">
       <property name="animated">
        <bool>true</bool>
@@ -93,6 +103,12 @@
    <extends>QTreeView</extends>
    <header>contact-list-widget.h</header>
   </customwidget>
+  <customwidget>
+   <class>KMessageWidget</class>
+   <extends>QFrame</extends>
+   <header>kmessagewidget.h</header>
+   <container>1</container>
+  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list