[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:19:44 UTC 2016


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

The following commit has been merged in the master branch:
commit 0fe5ab0ba79a828474d0351808b2b810841e7fad
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Mon Sep 12 18:06:53 2011 +0100

    Added review comments
    
    REVIEW: 120561
    
    REVIEW: 101886
---
 app/chat-window.cpp                                |   3 +-
 app/telepathy-chat-ui.h                            |  12 +-
 config/appearance-config.cpp                       |   4 +-
 config/appearance-config.h                         |   9 +-
 config/behavior-config.h                           |   4 +-
 config/chatwindowconfig.ui                         | 191 ------------------
 .../kcm_telepathy_chat_appearance_config.desktop   |   2 +-
 config/main-window.cpp                             | 220 ---------------------
 config/main-window.h                               |  65 ------
 9 files changed, 19 insertions(+), 491 deletions(-)

diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 95e0e66..adac3a9 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -413,7 +413,8 @@ void ChatWindow::showSettingsDialog()
 
     KSettings::Dialog *dialog = new KSettings::Dialog(this);
 
-    dialog->addModule("kcm_telepathy_chat_config");
+    dialog->addModule("kcm_telepathy_chat_appearance_config");
+    dialog->addModule("kcm_telepathy_chat_behavior_config");
 
     dialog->setAttribute(Qt::WA_DeleteOnClose);
     dialog->show();
diff --git a/app/telepathy-chat-ui.h b/app/telepathy-chat-ui.h
index f3cab67..34075bb 100644
--- a/app/telepathy-chat-ui.h
+++ b/app/telepathy-chat-ui.h
@@ -34,6 +34,13 @@ public:
     TelepathyChatUi();
     ~TelepathyChatUi();
 
+    enum TabOpenMode {
+        NewWindow,
+        FirstWindow,
+        LastWindow
+    };
+
+
     virtual void handleChannels(const Tp::MethodInvocationContextPtr<> & context,
             const Tp::AccountPtr & account,
             const Tp::ConnectionPtr & connection,
@@ -49,11 +56,6 @@ private slots:
     void dettachTab(ChatTab *tab);
 
 private:
-    enum TabOpenMode {
-        NewWindow,
-        FirstWindow,
-        LastWindow
-    };
 
     ChatWindow* createWindow();
 
diff --git a/config/appearance-config.cpp b/config/appearance-config.cpp
index 4df5fad..94f8687 100644
--- a/config/appearance-config.cpp
+++ b/config/appearance-config.cpp
@@ -39,7 +39,7 @@ AppearanceConfig::AppearanceConfig(QWidget *parent, const QVariantList& args)
 {
     ui->setupUi(this);
 
-    ChatWindowStyleManager* manager = ChatWindowStyleManager::self();
+    ChatWindowStyleManager *manager = ChatWindowStyleManager::self();
     manager->loadStyles();
     connect(manager, SIGNAL(loadStylesFinished()), SLOT(onStylesLoaded()));
 
@@ -122,7 +122,7 @@ void AppearanceConfig::onStyleSelected(int index)
     //load the style.
     QString styleId = ui->styleComboBox->itemData(index).toString();
 
-    ChatWindowStyle* style = ChatWindowStyleManager::self()->getValidStyleFromPool(styleId);
+    ChatWindowStyle *style = ChatWindowStyleManager::self()->getValidStyleFromPool(styleId);
 
     if (style) {
         ui->chatView->setChatStyle(style);
diff --git a/config/appearance-config.h b/config/appearance-config.h
index efe9706..6402955 100644
--- a/config/appearance-config.h
+++ b/config/appearance-config.h
@@ -45,10 +45,6 @@ public slots:
 protected:
     void changeEvent(QEvent *e);
 
-private:
-    Ui::ChatWindowConfig *ui;
-    AdiumThemeHeaderInfo m_demoChatHeader;
-
 private slots:
     void sendDemoMessages();
     void onStylesLoaded();
@@ -60,6 +56,11 @@ private slots:
     void onFontGroupChanged(bool);
     void onFontFamilyChanged(QFont);
     void onFontSizeChanged(int);
+
+private:
+    Ui::ChatWindowConfig *ui;
+    AdiumThemeHeaderInfo m_demoChatHeader;
+    
 };
 
 #endif // MAINWINDOW_H
diff --git a/config/behavior-config.h b/config/behavior-config.h
index ff205b4..dd8cc3d 100644
--- a/config/behavior-config.h
+++ b/config/behavior-config.h
@@ -1,6 +1,6 @@
 /***************************************************************************
  *   Copyright (C) 2011 by Lasath Fernando <kde at lasath.org>
- *   Copyright (C) 2011 by David Edmundson <kde at lasath.org>
+ *   Copyright (C) 2011 by David Edmundson <kde at davidedmundson.co.uk>
  *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -50,7 +50,7 @@ private slots:
 
 private:
     int m_openMode;
-    Ui::BehaviorConfigUi* ui;
+    Ui::BehaviorConfigUi *ui;
 };
 
 #endif // BEHAVIOR_CONFIG_H
diff --git a/config/chatwindowconfig.ui b/config/chatwindowconfig.ui
deleted file mode 100644
index a783e92..0000000
--- a/config/chatwindowconfig.ui
+++ /dev/null
@@ -1,191 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ChatWindowConfig</class>
- <widget class="QWidget" name="ChatWindowConfig">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>500</width>
-    <height>400</height>
-   </rect>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <item>
-    <widget class="AdiumThemeView" name="chatView" native="true">
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>130</height>
-      </size>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QGridLayout" name="gridLayout">
-     <item row="0" column="1">
-      <widget class="QGroupBox" name="customFontBox">
-       <property name="title">
-        <string>Use Custom Font Settings</string>
-       </property>
-       <property name="checkable">
-        <bool>true</bool>
-       </property>
-       <layout class="QFormLayout" name="formLayout">
-        <property name="fieldGrowthPolicy">
-         <enum>QFormLayout::ExpandingFieldsGrow</enum>
-        </property>
-        <item row="1" column="0">
-         <widget class="QLabel" name="fontFamilyLabel">
-          <property name="text">
-           <string>Select Font: </string>
-          </property>
-          <property name="alignment">
-           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="1">
-         <widget class="KFontComboBox" name="fontFamily"/>
-        </item>
-        <item row="2" column="0">
-         <widget class="QLabel" name="fontSizeLabel">
-          <property name="text">
-           <string>Select Size: </string>
-          </property>
-          <property name="alignment">
-           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-          </property>
-         </widget>
-        </item>
-        <item row="2" column="1">
-         <widget class="KIntNumInput" name="fontSize">
-          <property name="minimum">
-           <number>1</number>
-          </property>
-          <property name="maximum">
-           <number>128</number>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </widget>
-     </item>
-     <item row="0" column="2">
-      <spacer name="horizontalSpacer">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>0</width>
-         <height>0</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item row="0" column="0">
-      <widget class="QGroupBox" name="groupBox">
-       <property name="title">
-        <string>Style</string>
-       </property>
-       <layout class="QFormLayout" name="formLayout_3">
-        <item row="0" column="0">
-         <widget class="QLabel" name="styleLabel">
-          <property name="text">
-           <string>Message Style:</string>
-          </property>
-          <property name="alignment">
-           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-          </property>
-          <property name="buddy">
-           <cstring>styleComboBox</cstring>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="1">
-         <widget class="KComboBox" name="styleComboBox">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="sizeAdjustPolicy">
-           <enum>QComboBox::AdjustToContents</enum>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="0">
-         <widget class="QLabel" name="variantLabel">
-          <property name="text">
-           <string>Variant:</string>
-          </property>
-          <property name="alignment">
-           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-          </property>
-          <property name="buddy">
-           <cstring>variantComboBox</cstring>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="1">
-         <widget class="KComboBox" name="variantComboBox">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-          <property name="sizeAdjustPolicy">
-           <enum>QComboBox::AdjustToContents</enum>
-          </property>
-         </widget>
-        </item>
-        <item row="2" column="1">
-         <widget class="QCheckBox" name="showUserIcons">
-          <property name="text">
-           <string>Show User Icons</string>
-          </property>
-         </widget>
-        </item>
-        <item row="3" column="1">
-         <widget class="QCheckBox" name="showHeader">
-          <property name="text">
-           <string>Show Header</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KFontComboBox</class>
-   <extends>KComboBox</extends>
-   <header>kfontcombobox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>KComboBox</class>
-   <extends>QComboBox</extends>
-   <header>kcombobox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>KIntNumInput</class>
-   <extends>QWidget</extends>
-   <header>knuminput.h</header>
-  </customwidget>
-  <customwidget>
-   <class>AdiumThemeView</class>
-   <extends>QWidget</extends>
-   <header>adium-theme-view.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
diff --git a/config/kcm_telepathy_chat_appearance_config.desktop b/config/kcm_telepathy_chat_appearance_config.desktop
index eb5e578..dce7d77 100644
--- a/config/kcm_telepathy_chat_appearance_config.desktop
+++ b/config/kcm_telepathy_chat_appearance_config.desktop
@@ -6,7 +6,7 @@ Type=Service
 X-KDE-ServiceTypes=KCModule
 X-DBUS-StartupType=
 X-KDE-HasReadOnlyMode=false
-X-KDE-Library=kcm_telepathy_chat_config
+X-KDE-Library=kcm_telepathy_chat_appearance_config
 X-KDE-SubstituteUID=false
 X-KDE-RootOnly=false
 Categories=Qt;KDE;X-KDE-settings-network;
diff --git a/config/main-window.cpp b/config/main-window.cpp
deleted file mode 100644
index 3a79da4..0000000
--- a/config/main-window.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by David Edmundson <kde at davidedmundson.co.uk>      *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
-
-#include "main-window.h"
-#include "ui_chatwindowconfig.h"
-
-#include <KDETelepathy/ChatWindowStyleManager>
-#include <KDETelepathy/ChatWindowStyle>
-#include <KDETelepathy/AdiumThemeHeaderInfo>
-#include <KDETelepathy/AdiumThemeContentInfo>
-#include <KDETelepathy/AdiumThemeStatusInfo>
-
-#include <KDebug>
-#include <KLocalizedString>
-
-K_PLUGIN_FACTORY(KCMTelepathyChatConfigFactory, registerPlugin<MainWindow>();)
-K_EXPORT_PLUGIN(KCMTelepathyChatConfigFactory("telepathy_chat_config", "kcm_telepathy_chat_config"))
-
-MainWindow::MainWindow(QWidget *parent, const QVariantList& args)
-    : KCModule(KCMTelepathyChatConfigFactory::componentData(), parent, args),
-      ui(new Ui::ChatWindowConfig)
-{
-    ui->setupUi(this);
-
-    ChatWindowStyleManager* manager = ChatWindowStyleManager::self();
-    manager->loadStyles();
-    connect(manager, SIGNAL(loadStylesFinished()), SLOT(onStylesLoaded()));
-
-    m_demoChatHeader.setChatName(i18n("A demo chat"));
-    m_demoChatHeader.setSourceName(i18n("Jabber"));
-    m_demoChatHeader.setTimeOpened(QDateTime::currentDateTime());
-    m_demoChatHeader.setDestinationName(i18n("BobMarley at yahoo.com"));
-    m_demoChatHeader.setDestinationDisplayName(i18n("Bob Marley"));
-
-    ui->chatView->initialise(m_demoChatHeader);
-
-    ui->showHeader->setChecked(ui->chatView->isHeaderDisplayed());
-    ui->customFontBox->setChecked(ui->chatView->isCustomFont());
-    ui->fontFamily->setCurrentFont(QFont(ui->chatView->fontFamily()));
-    ui->fontSize->setValue(ui->chatView->fontSize());
-
-    connect(ui->chatView, SIGNAL(loadFinished(bool)), SLOT(sendDemoMessages()));
-    connect(ui->styleComboBox, SIGNAL(activated(int)), SLOT(onStyleSelected(int)));
-    connect(ui->variantComboBox, SIGNAL(activated(QString)), SLOT(onVariantSelected(QString)));
-    connect(ui->showHeader, SIGNAL(clicked(bool)), SLOT(onShowHeaderChanged(bool)));
-    connect(ui->customFontBox, SIGNAL(clicked(bool)), SLOT(onFontGroupChanged(bool)));
-    connect(ui->fontFamily, SIGNAL(currentFontChanged(QFont)), SLOT(onFontFamilyChanged(QFont)));
-    connect(ui->fontSize, SIGNAL(valueChanged(int)), SLOT(onFontSizeChanged(int)));
-}
-
-MainWindow::~MainWindow()
-{
-    delete ui;
-}
-
-void MainWindow::changeEvent(QEvent *e)
-{
-    QWidget::changeEvent(e);
-    switch (e->type()) {
-    case QEvent::LanguageChange:
-        ui->retranslateUi(this);
-        break;
-    default:
-        break;
-    }
-}
-
-void MainWindow::onStylesLoaded()
-{
-    kDebug();
-
-    QMap<QString, QString> styles = ChatWindowStyleManager::self()->getAvailableStyles();
-    ChatWindowStyle *currentStyle = ui->chatView->chatStyle();
-
-    ui->styleComboBox->clear();
-    QMap<QString, QString>::const_iterator i = styles.constBegin();
-    while (i != styles.constEnd()) {
-        ui->styleComboBox->addItem(i.value(), i.key());
-
-        if (i.key() == currentStyle->id()) {
-            ui->styleComboBox->setCurrentItem(i.value());
-        }
-
-        ++i;
-    }
-
-    //ui->styleComboBox->setCurrentItem(currentStyle->getStyleName());
-
-    updateVariantsList();
-    //FIXME call onStyleSelected
-}
-
-void MainWindow::updateVariantsList()
-{
-    kDebug();
-    QHash<QString, QString> variants = ui->chatView->chatStyle()->getVariants();
-    ui->variantComboBox->clear();
-    ui->variantComboBox->addItems(variants.keys());
-    ui->variantComboBox->setCurrentItem(ui->chatView->variantName());
-}
-
-void MainWindow::onStyleSelected(int index)
-{
-    kDebug();
-    //load the style.
-    QString styleId = ui->styleComboBox->itemData(index).toString();
-
-    ChatWindowStyle* style = ChatWindowStyleManager::self()->getValidStyleFromPool(styleId);
-
-    if (style) {
-        ui->chatView->setChatStyle(style);
-        updateVariantsList();
-        ui->showHeader->setEnabled(style->hasHeader());
-        ui->chatView->initialise(m_demoChatHeader);
-    }
-    changed();
-}
-
-void MainWindow::onVariantSelected(const QString &variant)
-{
-    kDebug();
-    ui->chatView->setVariant(variant);
-    ui->chatView->initialise(m_demoChatHeader);
-    changed();
-}
-
-void MainWindow::onShowHeaderChanged(bool showHeader)
-{
-    ui->chatView->setHeaderDisplayed(showHeader);
-    ui->chatView->initialise(m_demoChatHeader);
-    changed();
-}
-
-void MainWindow::onFontGroupChanged(bool useCustomFont)
-{
-    kDebug();
-    ui->chatView->setUseCustomFont(useCustomFont);
-    ui->chatView->initialise(m_demoChatHeader);
-    changed();
-}
-
-void MainWindow::onFontFamilyChanged(QFont fontFamily)
-{
-    kDebug() << fontFamily.family();
-    ui->chatView->setFontFamily(fontFamily.family());
-    ui->chatView->initialise(m_demoChatHeader);
-    changed();
-}
-
-void MainWindow::onFontSizeChanged(int fontSize)
-{
-    kDebug() << fontSize;
-    ui->chatView->setFontSize(fontSize);
-    ui->chatView->initialise(m_demoChatHeader);
-    changed();
-}
-
-void MainWindow::sendDemoMessages()
-{
-    //add a fake message
-
-    AdiumThemeContentInfo message(AdiumThemeMessageInfo::RemoteToLocal);
-    message.setMessage(i18n("Hello"));
-    message.setSenderDisplayName(i18n("larry at example.com"));
-    message.setSenderScreenName(i18n("Larry Demo"));
-    message.setService(i18n("Jabber"));
-    message.setTime(QDateTime::currentDateTime());
-    ui->chatView->addContentMessage(message);
-
-    message = AdiumThemeContentInfo(AdiumThemeMessageInfo::LocalToRemote);
-    message.setMessage(i18n("A different example message"));
-    message.setSenderDisplayName(i18n("ted at example.com"));
-    message.setSenderScreenName(i18n("Ted Example"));
-    message.setService(i18n("Jabber"));
-    message.setTime(QDateTime::currentDateTime());
-    ui->chatView->addContentMessage(message);
-
-    AdiumThemeStatusInfo  statusMessage;
-    statusMessage.setMessage(i18n("Ted Example has left the chat.")); //FIXME sync this with chat text logic.
-    statusMessage.setTime(QDateTime::currentDateTime());
-    statusMessage.setService(i18n("Jabber"));
-    statusMessage.setStatus("away");
-    ui->chatView->addStatusMessage(statusMessage);
-}
-
-void MainWindow::save()
-{
-    kDebug();
-
-    KSharedConfigPtr config = KSharedConfig::openConfig("ktelepathyrc");
-    KConfigGroup appearanceConfig = config->group("Appearance");
-
-    appearanceConfig.writeEntry("styleName", ui->styleComboBox->itemData(ui->styleComboBox->currentIndex()).toString());
-    appearanceConfig.writeEntry("styleVariant", ui->variantComboBox->currentText());
-    appearanceConfig.writeEntry("displayHeader", ui->showHeader->isChecked());
-    appearanceConfig.writeEntry("useCustomFont", ui->customFontBox->isChecked());
-    appearanceConfig.writeEntry("fontFamily", ui->fontFamily->currentFont().family());
-    appearanceConfig.writeEntry("fontSize", ui->fontSize->value());
-
-    appearanceConfig.sync();
-    config->sync();
-
-    KCModule::save();
-}
diff --git a/config/main-window.h b/config/main-window.h
deleted file mode 100644
index e95bf93..0000000
--- a/config/main-window.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2011 by David Edmundson <kde at davidedmundson.co.uk>      *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include "adium-theme-header-info.h"
-
-#include <KCModule>
-
-namespace Ui
-{
-  class ChatWindowConfig;
-}
-
-
-class MainWindow : public KCModule
-{
-    Q_OBJECT
-
-public:
-    explicit MainWindow(QWidget *parent = 0,
-				const QVariantList& args = QVariantList());
-    ~MainWindow();
-
-public slots:
-    void save();
-
-protected:
-    void changeEvent(QEvent *e);
-
-private:
-    Ui::ChatWindowConfig *ui;
-    AdiumThemeHeaderInfo m_demoChatHeader;
-
-private slots:
-    void sendDemoMessages();
-    void onStylesLoaded();
-    void updateVariantsList();
-
-    void onStyleSelected(int index);
-    void onVariantSelected(const QString&);
-    void onShowHeaderChanged(bool);
-    void onFontGroupChanged(bool);
-    void onFontFamilyChanged(QFont);
-    void onFontSizeChanged(int);
-};
-
-#endif // MAINWINDOW_H

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list