Exemplo n.º 1
0
KXmlCommand* KMSpecialManager::loadCommand(KMPrinter *pr)
{
	KXmlCommand	*xmlCmd = loadCommand(pr->option("kde-special-command"));
	if (xmlCmd && xmlCmd->driver())
		xmlCmd->driver()->set("text", pr->printerName());
	return xmlCmd;
}
Exemplo n.º 2
0
void KXmlCommandSelector::slotEditCommand()
{
    QString xmlId = m_cmdlist[m_cmd->currentItem()];
    KXmlCommand *xmlCmd = KXmlCommandManager::self()->loadCommand(xmlId);
    if(xmlCmd)
    {
        if(KXmlCommandDlg::editCommand(xmlCmd, this))
        {
            // force to load the driver if not already done
            xmlCmd->driver();
            KXmlCommandManager::self()->saveCommand(xmlCmd);
        }
        m_cmd->changeItem(xmlCmd->description(), m_cmd->currentItem());
        delete xmlCmd;
        slotCommandSelected(m_cmd->currentItem());
    }
    else
        KMessageBox::error(this, i18n("Internal error. The XML driver for the command %1 could not be found.").arg(xmlId));
}