[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bbluedevil=5D_src/kcmodule=3A_Added_base_of_the_Shar?=
From: Alex Fiestas <alex () eyeos ! org>
Date: 2011-02-14 13:20:25
Message-ID: 20110214132025.BA907A60E1 () git ! kde ! org
[Download RAW message or body]
Git commit e4e17ab84051e06e9103e7ab6780251610d864ce by Alex Fiestas.
Committed on 04/02/2011 at 05:51.
Pushed by afiestas into branch 'master'.
Added base of the Share Files Dialog, which will handle shared files.
M +7 -3 src/kcmodule/CMakeLists.txt
M +9 -0 src/kcmodule/bluedeviltransfer.cpp
M +1 -0 src/kcmodule/bluedeviltransfer.h
A +58 -0 src/kcmodule/sharedfiles.ui [License: UNKNOWN] *
A +59 -0 src/kcmodule/sharedfilesdialog/sharedfilesdialog.cpp [License: \
GPL (v2+)] A +36 -0 src/kcmodule/sharedfilesdialog/sharedfilesdialog.h \
[License: GPL (v2+)] M +1 -1 src/kcmodule/transfer.ui
The files marked with a * at the end have a non valid license. Please read: \
http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are \
listed at that page.
http://commits.kde.org/bluedevil/e4e17ab84051e06e9103e7ab6780251610d864ce
diff --git a/src/kcmodule/CMakeLists.txt b/src/kcmodule/CMakeLists.txt
index f599ae8..4c45c0f 100644
--- a/src/kcmodule/CMakeLists.txt
+++ b/src/kcmodule/CMakeLists.txt
@@ -1,8 +1,12 @@
set(kcm_bluedevildevices_PART_SRCS bluedevildevices.cpp systemcheck.cpp kded.cpp)
set(kcm_bluedeviladapters_PART_SRCS bluedeviladapters.cpp systemcheck.cpp kded.cpp)
-set(kcm_bluedeviltransfer_PART_SRCS bluedeviltransfer.cpp systemcheck.cpp kded.cpp)
+set(kcm_bluedeviltransfer_PART_SRCS
+ bluedeviltransfer.cpp
+ systemcheck.cpp
+ kded.cpp
+ sharedfilesdialog/sharedfilesdialog.cpp)
-kde4_add_ui_files(kcm_bluedeviltransfer_PART_SRCS_UI transfer.ui)
+kde4_add_ui_files(kcm_bluedeviltransfer_PART_SRCS_UI transfer.ui sharedfiles.ui)
kde4_add_kcfg_files(kcm_bluedeviltransfer_PART_SRCS
../settings/filereceiversettings.kcfgc
@@ -30,4 +34,4 @@ install(TARGETS kcm_bluedevildevices
install(FILES bluedevildevices.desktop
bluedeviladapters.desktop
- bluedeviltransfer.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+ bluedeviltransfer.desktop DESTINATION ${SERVICES_INSTALL_DIR})
\ No newline at end of file
diff --git a/src/kcmodule/bluedeviltransfer.cpp b/src/kcmodule/bluedeviltransfer.cpp
index df2576e..2d2a92f 100644
--- a/src/kcmodule/bluedeviltransfer.cpp
+++ b/src/kcmodule/bluedeviltransfer.cpp
@@ -22,6 +22,7 @@
#include "systemcheck.h"
#include "ui_transfer.h"
#include "filereceiversettings.h"
+#include "sharedfilesdialog/sharedfilesdialog.h"
#include <QtCore/QTimer>
@@ -79,6 +80,7 @@ KCMBlueDevilTransfer::KCMBlueDevilTransfer(QWidget *parent, const \
QVariantList&)
addConfig(FileReceiverSettings::self(), transfer);
+ connect(m_uiTransfer->sharedFiles, SIGNAL(clicked(bool)), this, \
SLOT(showSharedFilesDialog()));
connect(BlueDevil::Manager::self(), SIGNAL(defaultAdapterChanged(Adapter*)),
this, SLOT(defaultAdapterChanged(Adapter*)));
@@ -88,6 +90,7 @@ KCMBlueDevilTransfer::KCMBlueDevilTransfer(QWidget *parent, const \
QVariantList&) this, SLOT(adapterDiscoverableChanged()));
}
+
updateInformationState();
}
@@ -113,3 +116,9 @@ void KCMBlueDevilTransfer::updateInformationState()
{
m_systemCheck->updateInformationState();
}
+
+void KCMBlueDevilTransfer::showSharedFilesDialog()
+{
+ SharedFilesDialog *d = new SharedFilesDialog();
+ d->exec();
+}
diff --git a/src/kcmodule/bluedeviltransfer.h b/src/kcmodule/bluedeviltransfer.h
index 9f6631d..a3e5836 100644
--- a/src/kcmodule/bluedeviltransfer.h
+++ b/src/kcmodule/bluedeviltransfer.h
@@ -46,6 +46,7 @@ private Q_SLOTS:
void defaultAdapterChanged(Adapter *adapter);
void adapterDiscoverableChanged();
void updateInformationState();
+ void showSharedFilesDialog();
private:
SystemCheck *m_systemCheck;
diff --git a/src/kcmodule/sharedfiles.ui b/src/kcmodule/sharedfiles.ui
new file mode 100644
index 0000000..d868e16
--- /dev/null
+++ b/src/kcmodule/sharedfiles.ui
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>sharedFiles</class>
+ <widget class="QWidget" name="sharedFiles">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QListView" name="listView"/>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="KPushButton" name="addBtn">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="KPushButton" name="removeBtn"/>
+ </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>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>KPushButton</class>
+ <extends>QPushButton</extends>
+ <header>kpushbutton.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/kcmodule/sharedfilesdialog/sharedfilesdialog.cpp \
b/src/kcmodule/sharedfilesdialog/sharedfilesdialog.cpp new file mode 100644
index 0000000..d2fecc4
--- /dev/null
+++ b/src/kcmodule/sharedfilesdialog/sharedfilesdialog.cpp
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2010-2011 Alejandro Fiestas Olivares <afiestas@kde.org> *
+ * Copyright (C) 2010-2011 UFO Coders <info@ufocoders.com> *
+ * *
+ * 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 "sharedfilesdialog.h"
+#include "ui_sharedfiles.h"
+
+#include <QDebug>
+#include <QFileSystemModel>
+#include <QDesktopServices>
+
+#include <KFileDialog>
+#include <kstandarddirs.h>
+
+SharedFilesDialog::SharedFilesDialog(QWidget* parent, Qt::WFlags flags): \
KDialog(parent, flags) +{
+ QWidget *sharedFiles = new QWidget(this);
+ Ui_sharedFiles *ui = new Ui::sharedFiles();
+ ui->setupUi(sharedFiles);
+ setMainWidget(sharedFiles);
+
+ QFileSystemModel *model = new QFileSystemModel();
+ qDebug() << KStandardDirs().saveLocation("data", "bluedevil/shared_files/");
+ QModelIndex in = model->setRootPath(KStandardDirs().saveLocation("data", \
"bluedevil/shared_files/")); +
+ ui->listView->setModel(model);
+ ui->listView->setRootIndex(in);
+
+ ui->addBtn->setIcon(KIcon("list-add"));
+ ui->removeBtn->setIcon(KIcon("list-remove"));
+
+ connect(ui->addBtn, SIGNAL(clicked(bool)), this, SLOT(addFles()));
+}
+
+void SharedFilesDialog::addFles()
+{
+ KFileDialog *dialog = new \
KFileDialog(QDesktopServices::storageLocation(QDesktopServices::HomeLocation), "*", \
this); + dialog->setMode(KFile::Directory | KFile::Files | KFile::LocalOnly);
+ dialog->exec();
+
+ qDebug() << dialog->selectedFiles();
+}
+
diff --git a/src/kcmodule/sharedfilesdialog/sharedfilesdialog.h \
b/src/kcmodule/sharedfilesdialog/sharedfilesdialog.h new file mode 100644
index 0000000..7d14178
--- /dev/null
+++ b/src/kcmodule/sharedfilesdialog/sharedfilesdialog.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2010-2011 Alejandro Fiestas Olivares <afiestas@kde.org> *
+ * Copyright (C) 2010-2011 UFO Coders <info@ufocoders.com> *
+ * *
+ * 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 SHAREDFILESDIALOG_H
+#define SHAREDFILESDIALOG_H
+
+#include <kdialog.h>
+
+class SharedFilesDialog : public KDialog
+{
+ Q_OBJECT
+public:
+ SharedFilesDialog(QWidget* parent = 0, Qt::WFlags flags = 0);
+
+private Q_SLOTS:
+ void addFles();
+};
+
+#endif // SHAREDFILESDIALOG_H
diff --git a/src/kcmodule/transfer.ui b/src/kcmodule/transfer.ui
index 9fa6e3c..170dc89 100644
--- a/src/kcmodule/transfer.ui
+++ b/src/kcmodule/transfer.ui
@@ -181,7 +181,7 @@ p, li { white-space: pre-wrap; }
</spacer>
</item>
<item>
- <widget class="KPushButton" name="kpushbutton">
+ <widget class="KPushButton" name="sharedFiles">
<property name="text">
<string>Shared Files</string>
</property>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic