[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:11:23 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=5a0b9b3
The following commit has been merged in the master branch:
commit 5a0b9b319b687133b4434bbca539adf01c3267d4
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date: Wed Aug 17 11:22:39 2011 +0200
ADD: custom config dialog
---
CMakeLists.txt | 5 +++
src/{declarative/main.qml => config.cpp} | 22 ++++++------
src/{declarative/main.qml => config.h} | 31 +++++++++++------
src/config.ui | 58 ++++++++++++++++++++++++++++++++
src/telepathyContact.cpp | 8 +++--
src/telepathyContact.h | 6 ++++
6 files changed, 107 insertions(+), 23 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3739277..ae70b3c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,11 @@ include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
set(telepathy_contact_applet_SRCS
src/telepathyContact.cpp
+ src/config.cpp
+)
+
+kde4_add_ui_files(telepathy_contact_applet_SRCS
+ src/config.ui
)
kde4_add_plugin(plasma_applet_telepathy_contact ${telepathy_contact_applet_SRCS})
diff --git a/src/declarative/main.qml b/src/config.cpp
similarity index 86%
copy from src/declarative/main.qml
copy to src/config.cpp
index 45a0828..dbbbcb4 100644
--- a/src/declarative/main.qml
+++ b/src/config.cpp
@@ -17,17 +17,17 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-import Qt 4.7
+#include "config.h"
-Item {
- id: mainWidget;
-
- // default contact size (also ni metadata file) just to be sure
- width: 128;
- height: 128;
+Config::Config(QWidget* parent)
+ : KDialog(parent)
+{
+ QWidget *widget = new QWidget(this);
+ ui.setupUi(widget);
+ setMainWidget(widget);
+}
- Contact {
- id: contact;
- anchors.centerIn: parent;
- }
+Config::~Config()
+{
}
+
diff --git a/src/declarative/main.qml b/src/config.h
similarity index 83%
copy from src/declarative/main.qml
copy to src/config.h
index 45a0828..aa51c7d 100644
--- a/src/declarative/main.qml
+++ b/src/config.h
@@ -17,17 +17,28 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-import Qt 4.7
+#ifndef CONFIG_H
+#define CONFIG_H
-Item {
- id: mainWidget;
+#include "ui_config.h"
- // default contact size (also ni metadata file) just to be sure
- width: 128;
- height: 128;
+#include <KDialog>
- Contact {
- id: contact;
- anchors.centerIn: parent;
- }
+namespace Ui {
+ class Config;
}
+
+class Config : public KDialog
+{
+ Q_OBJECT
+
+public:
+ Config(QWidget *parent = 0);
+ ~Config();
+
+private:
+ Ui::Config ui;
+};
+
+
+#endif // CONFIG_H
diff --git a/src/config.ui b/src/config.ui
new file mode 100644
index 0000000..2def05e
--- /dev/null
+++ b/src/config.ui
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Config</class>
+ <widget class="QWidget" name="Config">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>517</width>
+ <height>371</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Select a contact</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QListView" name="contactListView"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/telepathyContact.cpp b/src/telepathyContact.cpp
index 1755b3f..567fad2 100644
--- a/src/telepathyContact.cpp
+++ b/src/telepathyContact.cpp
@@ -17,13 +17,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
+#include "config.h"
#include "telepathyContact.h"
#include <QtGui/QPainter>
-#include <QDebug>
TelepathyContact::TelepathyContact(QObject* parent, const QVariantList& args)
: Plasma::Applet(parent, args)
+ , m_config(new Config())
, m_declarative(new Plasma::DeclarativeWidget(this))
{
setBackgroundHints(NoBackground);
@@ -43,7 +44,6 @@ void TelepathyContact::init()
Plasma::Applet::init();
if (m_declarative) {
- qDebug("setting declarative widget");
m_declarative->setQmlPath("../src/declarative/main.qml");
}
}
@@ -53,6 +53,10 @@ void TelepathyContact::paintInterface(QPainter* p, const QStyleOptionGraphicsIte
Plasma::Applet::paintInterface(p, option, contentsRect);
}
+void TelepathyContact::showConfigurationInterface()
+{
+ m_config->show();
+}
// This is the command that links your applet to the .desktop file
K_EXPORT_PLASMA_APPLET(telepathy-contact, TelepathyContact)
\ No newline at end of file
diff --git a/src/telepathyContact.h b/src/telepathyContact.h
index 895681a..1bcda12 100644
--- a/src/telepathyContact.h
+++ b/src/telepathyContact.h
@@ -25,6 +25,8 @@
#include <Plasma/Applet>
#include <Plasma/DeclarativeWidget>
+class Config;
+
class TelepathyContact: public Plasma::Applet
{
Q_OBJECT
@@ -35,7 +37,11 @@ public:
void init();
void paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect& contentsRect);
+ /** overide of config signal */
+ void showConfigurationInterface();
+
private:
+ Config *m_config;
Plasma::DeclarativeWidget *m_declarative;
};
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list