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 @@ -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 @@ + + + sharedFiles + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + KPushButton + QPushButton +
kpushbutton.h
+
+
+ + +
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 * + * Copyright (C) 2010-2011 UFO Coders * + * * + * 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 +#include +#include + +#include +#include + +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 * + * Copyright (C) 2010-2011 UFO Coders * + * * + * 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 + +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; } - + Shared Files