[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

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


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=a331e63

The following commit has been merged in the master branch:
commit a331e63e77b03c2e239509ce84351a0637f01c54
Author: Jan Stourac <stourac.jan at gmail.com>
Date:   Wed Apr 2 16:46:55 2014 +0200

    Contact info button in Actions menu for regular chat
    
    button which shows info dialog about active contact in chat
    
    works only for regular chat (no group), due to problem with real user ID in group chat
    
    is compatible with kpeople
    
    REVIEW: 115842
---
 CMakeLists.txt      | 11 +++++++++++
 app/CMakeLists.txt  | 41 ++++++++++++++++++++++++++--------------
 app/chat-window.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 app/chat-window.h   |  2 ++
 app/chatwindow.rc   |  2 ++
 5 files changed, 96 insertions(+), 14 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 27f2dcd..eabecd9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,17 @@ set(KDE_MIN_VERSION "4.4.75")
 find_package (KDE4 ${KDE_MIN_VERSION} REQUIRED)
 find_package (TelepathyQt4 0.9.1 REQUIRED)
 find_package (KTp REQUIRED)
+find_package (KPeople 0.2)
+
+
+macro_log_feature(KPEOPLE_FOUND "KPeople" "Support for KDE Contact Aggregation" "https://projects.kde.org/libkpeople" FALSE "" "")
+macro_display_feature_log()
+
+if (KPEOPLE_FOUND)
+    add_definitions(-DHAVE_KPEOPLE)
+    find_package (KdepimLibs REQUIRED)
+    include_directories(${KPEOPLE_INCLUDES} ${KDEPIMLIBS_INCLUDE_DIRS})
+endif (KPEOPLE_FOUND)
 
 # FUTURE: When we can depend on KDE 4.10, use emoticoncontexteditaction from here
 # find_package(KdepimLibs 4.10 REQUIRED)
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 39f009d..984356d 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -7,25 +7,38 @@ set(ktp-text-ui_SRCS
         chat-tab.cpp
         emoticon-text-edit-action.cpp
         emoticon-text-edit-selector.cpp
-        invite-contact-dialog.cpp       
+        invite-contact-dialog.cpp
 )
 
+set (ktp-text-ui_LIBS
+        ${KDE4_KDECORE_LIBS}
+        ${KDE4_KDEUI_LIBS}
+        ${KDE4_KIO_LIBS}
+        ${KDE4_KEMOTICONS_LIBS}
+        ${TELEPATHY_QT4_LIBRARIES}
+        ${KTP_LIBRARIES}
+        ${KTP_MODELS_LIBRARIES}
+        ${KTP_WIDGETS_LIBRARIES}
+        ${QT_QTWEBKIT_LIBRARY}
+        ${KDE4_KNOTIFYCONFIG_LIBS}
+        ${KDE4_KCMUTILS_LIBS}
+        ${KDEPIMLIBS_KPIMTEXTEDIT_LIBS}
+        ktpchat
+)
+
+if(KPEOPLE_FOUND)
+set (ktp-text-ui_LIBS
+    ${ktp-text-ui_LIBS}
+    ${KPEOPLE_LIBRARY}
+    ${KDEPIMLIBS_KABC_LIBS}
+    ${KPEOPLEWIDGETS_LIBRARY}
+)
+endif(KPEOPLE_FOUND)
+
 kde4_add_executable(ktp-text-ui ${ktp-text-ui_SRCS})
 
 target_link_libraries(ktp-text-ui
-            ${KDE4_KDECORE_LIBS}
-            ${KDE4_KDEUI_LIBS}
-            ${KDE4_KIO_LIBS}
-            ${KDE4_KEMOTICONS_LIBS}
-            ${TELEPATHY_QT4_LIBRARIES}
-            ${KTP_LIBRARIES}
-            ${KTP_MODELS_LIBRARIES}
-            ${KTP_WIDGETS_LIBRARIES}
-            ${QT_QTWEBKIT_LIBRARY}
-            ${KDE4_KNOTIFYCONFIG_LIBS}
-            ${KDE4_KCMUTILS_LIBS}
-            ${KDEPIMLIBS_KPIMTEXTEDIT_LIBS}
-            ktpchat)
+            ${ktp-text-ui_LIBS})
 
 configure_file(org.freedesktop.Telepathy.Client.KTp.TextUi.service.in
                ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Telepathy.Client.KTp.TextUi.service)
diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 4a55238..a18731b 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -65,6 +65,14 @@
 #include "telepathy-chat-ui.h"
 #include "text-chat-config.h"
 
+#ifdef HAVE_KPEOPLE
+#include <kpeople/widgets/persondetailsdialog.h>
+#include <kpeople/global.h>
+#include <kpeople/persondata.h>
+#endif
+
+#include <KTp/contact-info-dialog.h>
+
 #define PREFERRED_RFB_HANDLER "org.freedesktop.Telepathy.Client.krfb_rfb_handler"
 
 K_GLOBAL_STATIC_WITH_ARGS(KTp::ServiceAvailabilityChecker, s_krfbAvailableChecker,
@@ -359,6 +367,7 @@ void ChatWindow::onCurrentIndexChanged(int index)
         setVideoCallEnabled(targetContact->videoCallCapability());
         setShareDesktopEnabled(targetContact->streamTubeServicesCapability().contains(QLatin1String("rfb")));
         setInviteToChatEnabled(true);
+        setShowInfoEnabled(true);
         toggleBlockButton(targetContact->isBlocked());
     } else {
         setAudioCallEnabled(false);
@@ -367,6 +376,7 @@ void ChatWindow::onCurrentIndexChanged(int index)
         setShareDesktopEnabled(false);
         setInviteToChatEnabled(true);
         setBlockEnabled(false);
+        setShowInfoEnabled(false);
     }
 
     if ( currentChatTab->account()->connection() ) {
@@ -617,6 +627,37 @@ void ChatWindow::onShareDesktopTriggered()
     startShareDesktop(currChat->account(), currChat->textChannel()->targetContact());
 }
 
+void ChatWindow::onShowInfoTriggered()
+{
+    ChatWidget *currChat =  qobject_cast<ChatWidget*>(m_tabWidget->currentWidget());
+    const Tp::ContactPtr contact = currChat->textChannel()->targetContact();
+
+    if(!currChat || !currChat->account() || !contact) {
+        return;
+    }
+
+    if (KTp::kpeopleEnabled()) {
+        #ifdef HAVE_KPEOPLE
+        QString personId(QLatin1String("ktp://"));
+        personId.append(currChat->account()->uniqueIdentifier());
+        personId.append(QLatin1String("?"));
+        personId.append(contact->id());
+
+        if (!personId.isEmpty()) {
+            KPeople::PersonDetailsDialog *view = new KPeople::PersonDetailsDialog(currChat);
+            KPeople::PersonData *person = new KPeople::PersonData(personId, view);
+            view->setPerson(person);
+            view->setAttribute(Qt::WA_DeleteOnClose);
+            view->show();
+        }
+        #endif
+    } else {
+        KTp::ContactInfoDialog* contactInfoDialog = new KTp::ContactInfoDialog(currChat->account(), contact, currChat);
+        contactInfoDialog->setAttribute(Qt::WA_DeleteOnClose);
+        contactInfoDialog->show();
+    }
+}
+
 void ChatWindow::onOpenLogTriggered()
 {
     int index = m_tabWidget->currentIndex();
@@ -748,6 +789,9 @@ void ChatWindow::setupCustomActions()
     KAction* collaborateDocumentAction = new KAction(KIcon(QLatin1String("document-share")), i18n("&Collaboratively edit a document"), this);
     connect(collaborateDocumentAction, SIGNAL(triggered()), this, SLOT(onCollaborateDocumentTriggered()));
 
+    KAction* showInfoAction = new KAction(KIcon(QLatin1String("")), i18n("&Contact info"), this);
+    connect(showInfoAction, SIGNAL(triggered()), this, SLOT(onShowInfoTriggered()));
+
     m_spellDictCombo = new Sonnet::DictionaryComboBox();
     connect(m_spellDictCombo, SIGNAL(dictionaryChanged(QString)),
             this, SLOT(setTabSpellDictionary(QString)));
@@ -796,6 +840,7 @@ void ChatWindow::setupCustomActions()
     actionCollection()->addAction(QLatin1String("emoticons"), addEmoticonAction);
     actionCollection()->addAction(QLatin1String("send-message"), m_sendMessage);
     actionCollection()->addAction(QLatin1String("collaborate-document"), collaborateDocumentAction);
+    actionCollection()->addAction(QLatin1String("contact-info"), showInfoAction);
 }
 
 void ChatWindow::setCollaborateDocumentEnabled(bool enable)
@@ -878,6 +923,15 @@ void ChatWindow::setPreviousConversationsEnabled ( bool enable )
     }
 }
 
+void ChatWindow::setShowInfoEnabled ( bool enable )
+{
+    QAction *action = actionCollection()->action(QLatin1String("contact-info"));
+
+    if (action) {
+        action->setEnabled(enable);
+    }
+}
+
 void ChatWindow::updateAccountIcon()
 {
     int index = m_tabWidget->currentIndex();
diff --git a/app/chat-window.h b/app/chat-window.h
index 9896606..cab8cf0 100644
--- a/app/chat-window.h
+++ b/app/chat-window.h
@@ -101,6 +101,7 @@ private Q_SLOTS:
     void onVideoCallTriggered();                                /** start a video call */
     void onUnblockContactTriggered();                           /** Unblocks contact when already blocked */
     void onShareDesktopTriggered();                             /** start a desktop share */
+    void onShowInfoTriggered();                                 /** show contact info */
     void onOpenLogTriggered();                                  /** Starts ktp-log-viewer accountId contactId */
     void onClearViewTriggered();                                /** Clears current view */
     void setTabSpellDictionary(const QString &dict);            /** set the spelling language for the current chat tab*/
@@ -147,6 +148,7 @@ private:
     void setShareDesktopEnabled(bool enable);
     void setPreviousConversationsEnabled(bool enable);
     void setCollaborateDocumentEnabled(bool enable);
+    void setShowInfoEnabled(bool enable);
 
     /** starts audio call with given contact
      * @param account account sending the audio call request
diff --git a/app/chatwindow.rc b/app/chatwindow.rc
index 0d0f6a8..c8fa144 100644
--- a/app/chatwindow.rc
+++ b/app/chatwindow.rc
@@ -22,6 +22,8 @@
    <Action name="block-contact"/>
    <Separator />
    <Action name="clear-chat-view"/>
+   <Separator />
+   <Action name="contact-info"/>
   </Menu>
   <Menu name="settings"/>
   <Menu name="help"/>

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list