[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:08:07 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=b8b7f68
The following commit has been merged in the master branch:
commit b8b7f6817a189af7b75965456579e9620d13573a
Author: Siddhartha Sahu <sh.siddhartha at gmail.com>
Date: Sun Mar 30 13:09:26 2014 +0530
Add SettingsKCMDialog Widget for opening KTp Settings Dialog
Ported from ktp-contact-list's contact-list-widget.cpp
REVIEW: 117179
---
KTp/Widgets/CMakeLists.txt | 3 +
KTp/Widgets/settings-kcm-dialog.cpp | 69 ++++++++++++++++++++++
.../settings-kcm-dialog.h} | 34 +++++------
3 files changed, 89 insertions(+), 17 deletions(-)
diff --git a/KTp/Widgets/CMakeLists.txt b/KTp/Widgets/CMakeLists.txt
index f6b8176..ff74193 100644
--- a/KTp/Widgets/CMakeLists.txt
+++ b/KTp/Widgets/CMakeLists.txt
@@ -12,6 +12,7 @@ set (ktp_widgets_private_SRCS
notification-config-dialog.cpp
accounts-combo-box.cpp
start-chat-dialog.cpp
+ settings-kcm-dialog.cpp
)
set (ktp_widgets_private_HDRS
@@ -23,6 +24,7 @@ set (ktp_widgets_private_HDRS
notification-config-dialog.h
accounts-combo-box.h
start-chat-dialog.h
+ settings-kcm-dialog.h
)
kde4_add_ui_files (ktp_widgets_private_SRCS
@@ -46,6 +48,7 @@ target_link_libraries (ktpwidgetsprivate
${TELEPATHY_QT4_LIBRARIES}
${KDE4_KDEUI_LIBS}
${KDE4_KNOTIFYCONFIG_LIBRARY}
+ ${KDE4_KCMUTILS_LIBS}
ktpcommoninternalsprivate
ktpmodelsprivate
)
diff --git a/KTp/Widgets/settings-kcm-dialog.cpp b/KTp/Widgets/settings-kcm-dialog.cpp
new file mode 100644
index 0000000..036b80c
--- /dev/null
+++ b/KTp/Widgets/settings-kcm-dialog.cpp
@@ -0,0 +1,69 @@
+/*
+ * Settings KCM Dialog
+ *
+ * Copyright (C) 2011 Martin Klapetek <martin.klapetek at gmail.com>
+ * Copyright (C) 2014 Siddhartha Sahu <sh.siddhartha at gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "settings-kcm-dialog.h"
+
+#include <KNotifyConfigWidget>
+#include <KMessageBox>
+
+namespace KTp
+{
+
+SettingsKcmDialog::SettingsKcmDialog(QWidget *parent) :
+ KSettings::Dialog(parent)
+{
+ setAttribute(Qt::WA_DeleteOnClose);
+ resize(700, 640);
+
+ KService::Ptr tpAccKcm = KService::serviceByDesktopName(QLatin1String("kcm_ktp_accounts"));
+ if (!tpAccKcm) {
+ KMessageBox::error(this,
+ i18n("It appears you do not have the IM Accounts control module installed. Please install ktp-accounts-kcm package."),
+ i18n("IM Accounts KCM Plugin Is Not Installed"));
+ }
+
+ addModule(QLatin1String("kcm_ktp_accounts"));
+}
+
+void SettingsKcmDialog::addGeneralSettingsModule()
+{
+ addModule(QLatin1String("kcm_ktp_integration_module"));
+}
+
+void SettingsKcmDialog::addNotificationsModule()
+{
+ KNotifyConfigWidget *notificationWidget = new KNotifyConfigWidget(this);
+ notificationWidget->setApplication(QLatin1String("ktelepathy"));
+ connect(this, SIGNAL(accepted()),
+ notificationWidget, SLOT(save()));
+
+ connect(notificationWidget, SIGNAL(changed(bool)),
+ this, SLOT(enableButtonApply(bool)));
+
+ connect(this, SIGNAL(applyClicked()),
+ notificationWidget, SLOT(save()));
+
+ KPageWidgetItem *notificationPage = new KPageWidgetItem(notificationWidget, i18n("Notifications"));
+ notificationPage->setIcon(KIcon(QLatin1String("preferences-desktop-notification")));
+ addPage(notificationPage);
+}
+
+}
\ No newline at end of file
diff --git a/KTp/pending-wallet.h b/KTp/Widgets/settings-kcm-dialog.h
similarity index 60%
copy from KTp/pending-wallet.h
copy to KTp/Widgets/settings-kcm-dialog.h
index 9ef86d7..ea32039 100644
--- a/KTp/pending-wallet.h
+++ b/KTp/Widgets/settings-kcm-dialog.h
@@ -1,5 +1,8 @@
/*
- * Copyright (C) 2012 David Edmundson <kde at davidedmundson.co.uk>
+ * Settings KCM Dialog
+ *
+ * Copyright (C) 2011 Martin Klapetek <martin.klapetek at gmail.com>
+ * Copyright (C) 2014 Siddhartha Sahu <sh.siddhartha at gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -16,30 +19,27 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#ifndef SETTINGS_KCM_DIALOG_H
+#define SETTINGS_KCM_DIALOG_H
-#ifndef PENDINGWALLETOPERATION_H
-#define PENDINGWALLETOPERATION_H
-
-#include <TelepathyQt/PendingOperation>
-
-#include "wallet-interface.h"
+#include <KSettings/Dialog>
#include <KTp/ktp-export.h>
namespace KTp
{
-class PendingWalletPrivate;
-class KTP_EXPORT PendingWallet : public Tp::PendingOperation
+class KTP_EXPORT SettingsKcmDialog : public KSettings::Dialog
{
Q_OBJECT
public:
- friend class WalletInterface;
- KTp::WalletInterface *walletInterface() const;
-private:
- PendingWallet(KTp::WalletInterface *wallet);
- virtual ~PendingWallet();
- KTp::PendingWalletPrivate *d;
+ SettingsKcmDialog(QWidget *parent = 0);
+
+ // Add the General Settings tab
+ void addGeneralSettingsModule();
+ // Add the Notifications tab
+ void addNotificationsModule();
};
-}
-#endif // PENDINGWALLETOPERATION_H
+} // namespace KTp
+
+#endif // SETTINGS_KCM_DIALOG_H
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list