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

void KPureftpdScript::slotTabChanged ( QWidget *  widget  )  [protected, slot]

Processed right before the tab will be shown. It's main purpose is to save data from widgets (pureftpd configuration) to current script item data structure and mark the item as changed.

Definition at line 596 of file kcmpureftpdscript.cpp.

References script, and ui.

Referenced by KPureftpdScript(), and save().

                                                    {
  KListViewItem *item = (KListViewItem *)ui->scriptList->currentItem();

  if (listMap.contains(item)) {
    QString id = listMap[item];
    if (id.find("/") == -1) {
      QString tid = script->map()[id].templateid();

      if (scriptTemplate->map().contains(tid)) {
        // item is normal script
        if (widget == ui->tabScripts) {
          if (guiDataChanged) {
            GuiData g;
            getGui(g);
            script->map()[id].setGuiData(g);
            guiDataChanged=false;
            setScriptChanged(true);
            setScriptEditButtons();
            ui->outputView->setText(parseOptions(script->map()[id]));
          }
        } else if (widget == ui->tabRun) {
          ScriptPref::RunMode r = scriptTemplate->map()[tid].runmode();
          switch (r) {
            case ScriptPref::Standalone:
              ui->grpStandalone->setEnabled(true);
              QToolTip::remove(ui->grpStandalone);
            break;
            case ScriptPref::Superserver:
              ui->grpStandalone->setEnabled(false);
              QToolTip::add(ui->grpStandalone,i18n(
                "<qt><p>In the list of scripts from \"Scripts\" tab "
                "you choosed to run <b>pure-ftpd</b> from a superserver "
                "like <b>xinetd</b> or <b>inetd</b>.</p></qt>"
                ));
            break;
            default:
              kdFatal() << "slotTabChanged: unknown runmode=" << r << endl;
          }
        } else {
          // the other QTabs
          guiDataChanged=false;
        }
      } else {
        // item is orphaned script
        // nothing know about it's associated script template
        guiDataChanged=false;
      }
    } else {
      // item is script template
      guiDataChanged=false;
    }
  } else {
    // item is toplevel item
    guiDataChanged=false;
  }
}


Generated by  Doxygen 1.6.0   Back to index