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

void KPureftpdScript::slotScriptListChanged ( QListViewItem *  item  )  [protected, slot]

Set the editor buttons (Add, Save, Revert, Delete etc.) such that only relevant buttons will be enabled.

Parameters:
item is the selected element in the "scriptList" list view

Definition at line 653 of file kcmpureftpdscript.cpp.

References script, and ui.

Referenced by KPureftpdScript().

                                                               {
    if (item == 0L) {
        // no item in the ListView?
    } else {
        if (listMap.contains((KListViewItem*)item)) {
            QString id=listMap[(KListViewItem*)item];
            if (id.left(1) == "/") {
                // it's script template
                ui->outputView->clear();
                ui->outputFile->setText(scriptTemplate->map()[id.mid(1)].outputfile());
            } else {
                // it's script
                if (scriptTemplate->map().contains(script->map()[id].templateid())) {
                    // it's normal script
                    ui->outputView->setText(parseOptions(script->map()[id]));
                } else {
                    // it's orphaned script, so clear the UI
                    ui->outputView->clear();
                }
                ui->outputFile->setText(script->map()[id].outputfile());
                setGui(script->map()[id].guidata());
            }
        } else {
            // the item is a toplevel item
            ui->outputView->clear();
            ui->outputFile->clear();
        }
    }
    setScriptEditButtons();
}


Generated by  Doxygen 1.6.0   Back to index