You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
4.5 KiB
104 lines
4.5 KiB
15 years ago
|
/*
|
||
12 years ago
|
* kcmtdeiolan.cpp
|
||
15 years ago
|
*
|
||
|
* Copyright (c) 2000 Alexander Neundorf <neundorf@kde.org>
|
||
|
*
|
||
|
* 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
|
||
15 years ago
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
15 years ago
|
*/
|
||
|
|
||
12 years ago
|
#include "kcmtdeiolan.h"
|
||
15 years ago
|
|
||
14 years ago
|
#include <tqcheckbox.h>
|
||
13 years ago
|
#include <tqlayout.h>
|
||
14 years ago
|
#include <tqlineedit.h>
|
||
|
#include <tqhbox.h>
|
||
|
#include <tqlabel.h>
|
||
|
#include <tqgroupbox.h>
|
||
15 years ago
|
|
||
|
#include <klocale.h>
|
||
|
#include <kdebug.h>
|
||
|
#include <kdialog.h>
|
||
|
|
||
13 years ago
|
IOSlaveSettings::IOSlaveSettings(const TQString& config, TQWidget *parent)
|
||
12 years ago
|
:TDECModule(parent)
|
||
15 years ago
|
,m_config(config,false,true)
|
||
|
{
|
||
13 years ago
|
TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
|
||
|
layout->setAutoAdd(true);
|
||
15 years ago
|
|
||
14 years ago
|
TQGroupBox* group=new TQGroupBox(1,Qt::Horizontal, i18n("Show Links for Following Services"), this);
|
||
15 years ago
|
|
||
|
m_ftpSettings=new PortSettingsBar(i18n("FTP (TCP, port 21): "), group);
|
||
|
m_httpSettings=new PortSettingsBar(i18n("HTTP (TCP, port 80): "),group);
|
||
|
m_nfsSettings=new PortSettingsBar(i18n("NFS (TCP, port 2049): "),group);
|
||
|
m_smbSettings=new PortSettingsBar(i18n("Windows shares (TCP, ports 445 and 139):"),group);
|
||
|
m_fishSettings=new PortSettingsBar(i18n("Secure Shell/Fish (TCP, port 22): "),group);
|
||
14 years ago
|
m_shortHostnames = new TQCheckBox(i18n("Show &short hostnames (without domain suffix)"),this);
|
||
15 years ago
|
|
||
14 years ago
|
TQHBox *hbox=new TQHBox(this);
|
||
|
TQLabel *label=new TQLabel(i18n("Default LISa server host: "), hbox);
|
||
|
m_defaultLisaHostLe=new TQLineEdit(hbox);
|
||
15 years ago
|
label->setBuddy(m_defaultLisaHostLe);
|
||
|
|
||
14 years ago
|
TQWidget *w=new TQWidget(this);
|
||
13 years ago
|
layout->setStretchFactor(m_ftpSettings,0);
|
||
|
layout->setStretchFactor(m_httpSettings,0);
|
||
|
layout->setStretchFactor(m_nfsSettings,0);
|
||
|
layout->setStretchFactor(m_smbSettings,0);
|
||
|
layout->setStretchFactor(m_shortHostnames,0);
|
||
|
layout->setStretchFactor(hbox,0);
|
||
|
layout->setStretchFactor(w,1);
|
||
15 years ago
|
|
||
14 years ago
|
connect(m_ftpSettings,TQT_SIGNAL(changed()),this,TQT_SIGNAL(changed()));
|
||
|
connect(m_httpSettings,TQT_SIGNAL(changed()),this,TQT_SIGNAL(changed()));
|
||
|
connect(m_nfsSettings,TQT_SIGNAL(changed()),this,TQT_SIGNAL(changed()));
|
||
|
connect(m_smbSettings,TQT_SIGNAL(changed()),this,TQT_SIGNAL(changed()));
|
||
|
connect(m_fishSettings,TQT_SIGNAL(changed()),this,TQT_SIGNAL(changed()));
|
||
|
connect(m_shortHostnames,TQT_SIGNAL(clicked()),this,TQT_SIGNAL(changed()));
|
||
|
connect(m_defaultLisaHostLe, TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SIGNAL(changed()));
|
||
15 years ago
|
}
|
||
|
|
||
|
void IOSlaveSettings::load()
|
||
|
{
|
||
|
kdDebug()<<"IOSlaveSettings::load()"<<endl;
|
||
|
m_ftpSettings->setChecked(m_config.readNumEntry("Support_FTP", PORTSETTINGS_CHECK));
|
||
|
m_httpSettings->setChecked(m_config.readNumEntry("Support_HTTP", PORTSETTINGS_CHECK));
|
||
|
m_nfsSettings->setChecked(m_config.readNumEntry("Support_NFS", PORTSETTINGS_CHECK));
|
||
|
m_smbSettings->setChecked(m_config.readNumEntry("Support_SMB", PORTSETTINGS_CHECK));
|
||
|
m_fishSettings->setChecked(m_config.readNumEntry("Support_FISH", PORTSETTINGS_CHECK));
|
||
|
m_shortHostnames->setChecked(m_config.readBoolEntry("ShowShortHostnames",false));
|
||
|
// m_rlanSidebar->setChecked(m_config.readEntry("sidebarURL", "lan:/") == "rlan:/" ? true : false );
|
||
|
m_defaultLisaHostLe->setText(m_config.readEntry("DefaultLisaHost", "localhost"));
|
||
|
}
|
||
|
|
||
|
void IOSlaveSettings::save()
|
||
|
{
|
||
|
kdDebug()<<"IOSlaveSettings::save()"<<endl;
|
||
|
m_config.writeEntry("AlreadyConfigured",true);
|
||
|
m_config.writeEntry("Support_FTP", m_ftpSettings->selected());
|
||
|
m_config.writeEntry("Support_HTTP", m_httpSettings->selected());
|
||
|
m_config.writeEntry("Support_NFS", m_nfsSettings->selected());
|
||
|
m_config.writeEntry("Support_SMB", m_smbSettings->selected());
|
||
|
m_config.writeEntry("Support_FISH", m_fishSettings->selected());
|
||
|
m_config.writeEntry("ShowShortHostnames",m_shortHostnames->isChecked());
|
||
|
// m_config.writeEntry("sidebarURL", m_rlanSidebar->isChecked() ? "rlan:/" : "lan:/");
|
||
|
m_config.writeEntry("DefaultLisaHost", m_defaultLisaHostLe->text());
|
||
|
|
||
|
m_config.sync();
|
||
|
}
|
||
|
|
||
12 years ago
|
#include "kcmtdeiolan.moc"
|
||
15 years ago
|
|