Commit cb4fc5f5 authored by Rodrigo Belem's avatar Rodrigo Belem
Browse files

GUI: Removing nfs filesharing and old samba filesharing code.

svn path=/trunk/KDE/kdenetwork/filesharing/; revision=1221565
parent baa6b34d
include_directories(
${CMAKE_SOURCE_DIR}/filesharing/advanced/propsdlgplugin/
${CMAKE_SOURCE_DIR}/filesharing/advanced/nfs/
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/
${CMAKE_BINARY_DIR}/filesharing/simple/
${CMAKE_BINARY_DIR}/advanced/propsdlgplugin/
)
set(libfilesharesamba_SRCS
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/sambafile.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/sharedlgimpl.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/sambashare.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/common.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/usertabimpl.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/filemodedlgimpl.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/smbpasswdfile.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/passwd.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/hiddenfileview.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/dictmanager.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/qmultichecklistitem.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/smbconfconfigwidget.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/kcm_sambaconf/linuxpermissionchecker.cpp
)
set(libfilesharenfs_SRCS
${CMAKE_SOURCE_DIR}/filesharing/advanced/nfs/nfsdialog.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/nfs/nfshostdlg.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/nfs/nfsfile.cpp
${CMAKE_SOURCE_DIR}/filesharing/advanced/nfs/nfsentry.cpp
)
add_subdirectory(advanced)
add_subdirectory(simple)
add_subdirectory(kcm_sambaconf)
add_subdirectory(propsdlgplugin)
set(kcm_kcmsambaconf_PART_SRCS kcmsambaconf.cpp kcminterface.cpp ${libfilesharesamba_SRCS})
add_definitions(-D_KDEPRINT_COMPILE -DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS)
kde4_add_ui3_files(kcm_kcmsambaconf_PART_SRCS socketoptionsdlg.ui userselectdlg.ui
groupselectdlg.ui usertab.ui filemodedlg.ui
joindomaindlg.ui
)
kde4_add_ui_files(kcm_kcmsambaconf_PART_SRCS share.ui kcminterface.ui expertuserdlg.ui)
kde4_add_plugin(kcm_kcmsambaconf ${kcm_kcmsambaconf_PART_SRCS})
target_link_libraries(kcm_kcmsambaconf ${KDE4_KDEUI_LIBS} ${KDE4_KDE3SUPPORT_LIBS})
install(TARGETS kcm_kcmsambaconf DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
install(FILES kcmsambaconf.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
kde4_install_icons(${ICON_INSTALL_DIR})
- 0.5
* New features :
- Added new options of Samba 3.0.2
* Bugfixes :
- Fixed a crash if files are deleted from a directory
that is configured by KSambaPlugin at the same time.
- 0.5 Beta 2
* New features :
- Support of Samba 3.0.1
* Bugfixes :
- Should now be compileable with Qt 3.0
- 0.5 Beta
* New features :
- Works with Samba 3.x
- Supports all options of Samba 3.0 and Samba 2.x
- Supports loading and saving of remote Samba configuration files
with KIO slaves (e.g. fish)
- Complete rewrite of the user permission tab
- Accelerator keys added where possible
- Tab ordering fixed everywhere
- Redesigned big parts of the interface
* Bugfixes :
- Fixed crash, when smb.conf wasn't found
- Some other bugs fixed
- 0.4.1
* Bugfixes :
- "user only" changed to "only user"
- Changings in the advanced tab will enable the apply button
* New options :
- Many new options have been added to the Share dialog
- The layout of the Share dialog has been changed
* Automake :
- Doesn't depend on automake 1.7, but on version 1.5.x
- 0.4b
* Bugfixes :
- General :
* adding a blank line between two sections in the smb.conf
- Konqueror Plugin :
* availabe changed to available
* when changing a share to be not shared the entry is removed from the smb.conf
- KControl Center Module :
* Changing of the socket options works now
* New layout :
- The KControl Center module layout has changed much
- The Konqueror plugin layout has been changed a little
* New options :
- Many new options have been added to the KControl Center module
/***************************************************************************
common.cpp - description
-------------------
begin : Tue June 6 2002
copyright : (C) 2002 by Jan Schäfer
email : janschaefer@users.sourceforge.net
***************************************************************************/
/******************************************************************************
* *
* This file is part of KSambaPlugin. *
* *
* KSambaPlugin 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. *
* *
* KSambaPlugin 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 KSambaPlugin; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
* *
******************************************************************************/
#include <qstring.h>
#include <kcombobox.h>
#include <q3listbox.h>
#include "common.h"
void setComboToString(QComboBox* combo,const QString & s)
{
int i = /*combo->model()->index(*/combo->findText( s )/*)*/;//model()->findItem(s,Qt::ExactMatch));
combo->setCurrentItem(i);
}
bool boolFromText(const QString & value, bool testTrue)
{
QString lower = value.toLower();
if (testTrue) {
if (lower=="yes" ||
lower=="1" ||
lower=="true" ||
lower=="on")
return true;
else
return false;
} else {
if (lower=="no" ||
lower=="0" ||
lower=="false" ||
lower=="off" ||
lower=="disabled")
return false;
else
return true;
}
}
QString textFromBool(bool value)
{
if (value)
return "yes";
else
return "no";
}
/***************************************************************************
common.h - description
-------------------
begin : Tue June 6 2002
copyright : (C) 2002 by Jan Schäfer
email : janschaefer@users.sourceforge.net
***************************************************************************/
/******************************************************************************
* *
* This file is part of KSambaPlugin. *
* *
* KSambaPlugin 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. *
* *
* KSambaPlugin 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 KSambaPlugin; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
* *
******************************************************************************/
#ifndef COMMON_H
#define COMMON_H
class QString;
class QComboBox;
void setComboToString(QComboBox*,const QString &);
bool boolFromText(const QString & value,bool testTrue=true);
QString textFromBool(bool value);
#endif
/***************************************************************************
dictmanager.cpp - description
-------------------
begin : Wed Jan 1 2003
copyright : (C) 2003 by Jan Schäfer
email : janschaefer@users.sourceforge.net
***************************************************************************/
/******************************************************************************
* *
* This file is part of KSambaPlugin. *
* *
* KSambaPlugin 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. *
* *
* KSambaPlugin 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 KSambaPlugin; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
* *
******************************************************************************/
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qspinbox.h>
#include <qcombobox.h>
#include <qstringlist.h>
#include <kurlrequester.h>
#include <klocale.h>
#include <kdebug.h>
#include "sambashare.h"
#include "dictmanager.h"
#include "common.h"
#define DEBUG 5009
DictManager::DictManager(SambaShare* share):
lineEditDict(40,false),
checkBoxDict(40,false),
urlRequesterDict(40,false),
spinBoxDict(40,false),
comboBoxDict(20,false),
comboBoxValuesDict(20,false)
{
_share = share;
}
DictManager::~DictManager() {
}
void DictManager::handleUnsupportedWidget(const QString & s, QWidget* w) {
kDebug(DEBUG) << s << endl;
Q_ASSERT(w);
w->setEnabled(false);
w->setToolTip(i18n("The option <em>%1</em> is not supported by your Samba version", s));
}
void DictManager::add(const QString & key, QLineEdit* lineEdit) {
kDebug(DEBUG) << key << " : QLineEdit" << endl;
if (_share->optionSupported(key)) {
lineEditDict.insert(key,lineEdit);
connect(lineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(changedSlot()));
} else
handleUnsupportedWidget(key,lineEdit);
}
void DictManager::add(const QString & key, QCheckBox* checkBox){
kDebug(DEBUG) << key << " : QCheckBox " << endl;
if (_share->optionSupported(key)) {
checkBoxDict.insert(key,checkBox);
connect(checkBox, SIGNAL(clicked()), this, SLOT(changedSlot()));
} else
handleUnsupportedWidget(key,checkBox);
}
void DictManager::add(const QString & key, KUrlRequester* urlRq){
kDebug(DEBUG) << key << " : KUrlRequester " << endl;
if (_share->optionSupported(key)) {
urlRequesterDict.insert(key,urlRq);
connect(urlRq, SIGNAL(textChanged(const QString &)), this, SLOT(changedSlot()));
} else
handleUnsupportedWidget(key,urlRq);
}
void DictManager::add(const QString & key, QSpinBox* spinBox){
kDebug(DEBUG) << key << " : QSpinBox " << endl;
if (_share->optionSupported(key)) {
spinBoxDict.insert(key,spinBox);
connect(spinBox, SIGNAL(valueChanged(int)), this, SLOT(changedSlot()));
} else
handleUnsupportedWidget(key,spinBox);
}
void DictManager::add(const QString & key, QComboBox* comboBox, QStringList* values){
kDebug(DEBUG) << key << endl;
if (_share->optionSupported(key)) {
comboBoxDict.insert(key,comboBox);
comboBoxValuesDict.insert(key,values);
connect(comboBox, SIGNAL(activated(int)), this, SLOT(changedSlot()));
} else
handleUnsupportedWidget(key,comboBox);
}
void DictManager::load(SambaShare* share, bool globalValue, bool defaultValue){
Q3DictIterator<QCheckBox> checkBoxIt( checkBoxDict );
for( ; checkBoxIt.current(); ++checkBoxIt ) {
checkBoxIt.current()->setChecked(share->getBoolValue(checkBoxIt.currentKey(),globalValue,defaultValue));
}
Q3DictIterator<QLineEdit> lineEditIt( lineEditDict );
for( ; lineEditIt.current(); ++lineEditIt ) {
lineEditIt.current()->setText(share->getValue(lineEditIt.currentKey(),globalValue,defaultValue));
}
Q3DictIterator<KUrlRequester> urlRequesterIt( urlRequesterDict );
for( ; urlRequesterIt.current(); ++urlRequesterIt ) {
urlRequesterIt.current()->setUrl(share->getValue(urlRequesterIt.currentKey(),globalValue,defaultValue));
}
Q3DictIterator<QSpinBox> spinBoxIt( spinBoxDict );
for( ; spinBoxIt.current(); ++spinBoxIt ) {
spinBoxIt.current()->setValue(share->getValue(spinBoxIt.currentKey(),globalValue,defaultValue).toInt());
}
loadComboBoxes(share,globalValue,defaultValue);
}
void DictManager::loadComboBoxes(SambaShare* share, bool globalValue, bool defaultValue) {
Q3DictIterator<QComboBox> comboBoxIt( comboBoxDict );
for( ; comboBoxIt.current(); ++comboBoxIt ) {
QStringList *v = comboBoxValuesDict[comboBoxIt.currentKey()];
QString value = share->getValue(comboBoxIt.currentKey(),globalValue,defaultValue);
if (value.isNull())
continue;
value = value.toLower();
int comboIndex = 0;
QStringList::iterator it;
for ( it = v->begin(); it != v->end(); ++it ) {
QString lower = (*it).toLower();
if ( lower == "yes" &&
boolFromText(value))
break;
if ( lower == "no" &&
! boolFromText(value,false))
break;
if ( lower == value )
break;
comboIndex++;
}
comboBoxIt.current()->setCurrentItem(comboIndex);
}
}
void DictManager::save(SambaShare* share, bool globalValue, bool defaultValue){
Q3DictIterator<QCheckBox> checkBoxIt( checkBoxDict );
for( ; checkBoxIt.current(); ++checkBoxIt ) {
share->setValue(checkBoxIt.currentKey(),checkBoxIt.current()->isChecked(), globalValue, defaultValue );
}
Q3DictIterator<QLineEdit> lineEditIt( lineEditDict );
for( ; lineEditIt.current(); ++lineEditIt ) {
share->setValue(lineEditIt.currentKey(),lineEditIt.current()->text(), globalValue, defaultValue );
}
Q3DictIterator<KUrlRequester> urlRequesterIt( urlRequesterDict );
for( ; urlRequesterIt.current(); ++urlRequesterIt ) {
share->setValue(urlRequesterIt.currentKey(),urlRequesterIt.current()->url().pathOrUrl(), globalValue, defaultValue );
}
Q3DictIterator<QSpinBox> spinBoxIt( spinBoxDict );
for( ; spinBoxIt.current(); ++spinBoxIt ) {
share->setValue(spinBoxIt.currentKey(),spinBoxIt.current()->value(), globalValue, defaultValue );
}
Q3DictIterator<QComboBox> comboBoxIt( comboBoxDict );
for( ; comboBoxIt.current(); ++comboBoxIt ) {
QStringList* values = comboBoxValuesDict[comboBoxIt.currentKey()];
int i = comboBoxIt.current()->currentItem();
if (i >= 0) {
share->setValue(comboBoxIt.currentKey(),(*values)[i], globalValue, defaultValue );
} else {
kDebug(DEBUG) << comboBoxIt.currentKey() << " not set! " << endl;
}
}
}
void DictManager::changedSlot() {
emit changed();
}
#include "dictmanager.moc"
/***************************************************************************
dictmanager.h - description
-------------------
begin : Wed Jan 1 2003
copyright : (C) 2003 by Jan Schäfer
email : janschaefer@users.sourceforge.net
***************************************************************************/
/******************************************************************************
* *
* This file is part of KSambaPlugin. *
* *
* KSambaPlugin 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. *
* *
* KSambaPlugin 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 KSambaPlugin; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
* *
******************************************************************************/
#ifndef _DICTMANAGER_H_
#define _DICTMANAGER_H_
class SambaShare;
class QLineEdit;
class QCheckBox;
class QSpinBox;
class QComboBox;
class QString;
class SambaShare;
class QStringList;
/**
* @author Jan Schäfer
**/
class DictManager : public QObject
{
Q_OBJECT
public :
DictManager(SambaShare *share);
virtual ~DictManager();
void add(const QString &, QLineEdit*);
void add(const QString &, QCheckBox*);
void add(const QString &, KUrlRequester*);
void add(const QString &, QSpinBox*);
void add(const QString &, QComboBox*, QStringList*);
void load(SambaShare* share, bool globalValue=true, bool defaultValue=true);
void save(SambaShare* share, bool globalValue=true, bool defaultValue=true);
protected :
Q3Dict<QLineEdit> lineEditDict;
Q3Dict<QCheckBox> checkBoxDict;
Q3Dict<KUrlRequester> urlRequesterDict;
Q3Dict<QSpinBox> spinBoxDict;
Q3Dict<QComboBox> comboBoxDict;
Q3Dict<QStringList> comboBoxValuesDict;
SambaShare* _share;
void handleUnsupportedWidget(const QString &, QWidget*);
void loadComboBoxes(SambaShare*, bool, bool);
protected slots:
void changedSlot();
signals:
void changed();
};
#endif
<ui version="4.0" stdsetdef="1" >
<class>ExpertUserDlg</class>
<widget class="QDialog" name="ExpertUserDlg" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>463</width>
<height>221</height>
</rect>
</property>
<property name="windowTitle" >
<string>User Settings</string>
</property>
<property name="sizeGripEnabled" >
<bool>true</bool>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="TextLabel12" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Valid users:</string>
</property>
<property name="buddy" stdset="0" >
<cstring>validUsersEdit</cstring>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="validUsersEdit" />
</item>
<item row="3" column="0" >
<widget class="QLabel" name="TextLabel12_2_2_2" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Admin users:</string>
</property>
<property name="buddy" stdset="0" >
<cstring>adminUsersEdit</cstring>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QLineEdit" name="adminUsersEdit" />
</item>
<item row="4" column="0" >
<widget class="QLabel" name="TextLabel12_2_2_2_2" >
<property name="sizePolicy" >