Logo Search packages:      
Sourcecode: kcmpureftpd version File versions  Download package

KPureftpdScript::KPureftpdScript ( QWidget *  parent = 0L,
const char *  name = 0L 
)

Construct KcmPureftpdScript GUI, connect slots and load configuration from configuration file.

Parameters:
parent is the widget parent
name of this widget (optional)

Definition at line 55 of file kcmpureftpdscript.cpp.

References config, load(), modifiedIcon, script, slotAuthAdd(), slotAuthDelete(), slotAuthListChanged(), slotAuthMethodChanged(), slotAuthModify(), slotAuthType(), slotConfigChanged(), slotScriptListChanged(), slotScriptListDClicked(), slotScriptSave(), slotTabChanged(), and ui.

        : KCModule(parent, name)  {

  config = new KConfig("kcmpureftpdscriptrc", false, false);
  scriptTemplate = new ScriptTemplate();
  script = new Script();

  QVBoxLayout *layout = new QVBoxLayout(this,0,0);
  ui = new KPureftpdScriptUI(this);
  layout->add(ui);

  itemStandalone = new KListViewItem(ui->scriptList,i18n("Standalone"),
                                    i18n("PureFTPd run as a standalone server"));
  itemStandalone->setOpen(true);
  itemSuperserver = new KListViewItem(ui->scriptList,i18n("Superserver"),
                                      i18n("PureFTPd run from xinetd or inetd-like superserver"));
  itemSuperserver->setOpen(true);
  itemOrphans = 0L;

  debug=0;
  isSettingGui=false;
  guiDataChanged=false;
  modifiedIcon = KGlobal::iconLoader()->loadIcon("filesave",KIcon::Small);

  facilitylist  << "auth"   << "authpriv" << "cron"   << "daemon" << "ftp"   << "kern"
                << "lpr"    << "mail"     << "news"   << "syslog" << "user"
                << "uucp"   << "local0"   << "local1" << "local2" << "local3"
                << "local4" << "local5"   << "local6" << "local7";
  logfmtlist    << "clf"    << "stats"    << "w3c";

  ui->facility->insertStringList(facilitylist);
  ui->facility->setCurrentItem(4);
  ui->authMethod->insertStringList(script->authMethods().keys());
  ui->authMethod->setCurrentItem(0);
  ui->logFormat->insertStringList(logfmtlist);
  ui->logFormat->setCurrentItem(0);
  ui->outputView->setFont(KGlobalSettings::fixedFont());
  ui->scriptList->setSorting(-1);
  ui->authList->setSorting(-1);


  connect(ui,SIGNAL(changed()),this,SLOT(slotConfigChanged()));
  connect(ui->authAdd,SIGNAL(clicked()),this,SLOT(slotAuthAdd()));
  connect(ui->authModify,SIGNAL(clicked()),this,SLOT(slotAuthModify()));
  connect(ui->authDelete,SIGNAL(clicked()),this,SLOT(slotAuthDelete()));
  connect(ui->authMoveUp,SIGNAL(clicked()),this,SLOT(slotAuthMoveUp()));
  connect(ui->authMoveDown,SIGNAL(clicked()),this,SLOT(slotAuthMoveDown()));
  connect(ui->authMethod,SIGNAL(activated(int)),this,SLOT(slotAuthMethodChanged(int)));

  connect(ui->authList,SIGNAL(executed(QListViewItem*)),this,SLOT(slotAuthListChanged(QListViewItem*)));
  connect(ui->authList,SIGNAL(currentChanged(QListViewItem*)),this,SLOT(slotAuthListChanged(QListViewItem*)));
  connect(ui->grpAuth,SIGNAL(clicked(int)),this,SLOT(slotAuthType(int)));

  connect(ui->scriptList,SIGNAL(currentChanged(QListViewItem*)),this,SLOT(slotScriptListChanged(QListViewItem*)));
  connect(ui->scriptList,SIGNAL(doubleClicked(QListViewItem*)),this,SLOT(slotScriptListDClicked(QListViewItem*)));
  connect(ui->scriptList,SIGNAL(contextMenuRequested(QListViewItem*, const QPoint &, int)),this,SLOT(slotScriptListRMB(QListViewItem*, const QPoint &, int)));
  connect(ui->outputSave,SIGNAL(clicked()),this,SLOT(slotOutputSave()));
  connect(ui->tab,SIGNAL(currentChanged(QWidget*)),this,SLOT(slotTabChanged(QWidget*)));

  connect(ui->scriptAdd,SIGNAL(clicked()),this,SLOT(slotScriptAdd()));
  connect(ui->scriptEdit,SIGNAL(clicked()),this,SLOT(slotScriptEdit()));
  connect(ui->scriptSave,SIGNAL(clicked()),this,SLOT(slotScriptSave()));
  connect(ui->scriptRevert,SIGNAL(clicked()),this,SLOT(slotScriptRevert()));
  connect(ui->scriptDelete,SIGNAL(clicked()),this,SLOT(slotScriptDelete()));

  loadTemplates();
  loadScripts();
  load();
  setScriptEditButtons();
}


Generated by  Doxygen 1.6.0   Back to index