tristate KexiReportDesignView::storeData(bool dontAsk)
{
    Q_UNUSED(dontAsk);

    QDomDocument doc("kexireport");
    QDomElement root = doc.createElement("kexireport");
    QDomElement conndata = m_sourceSelector->connectionData();

    if (conndata.isNull())
        kDebug() << "Null conn data!";

    root.appendChild(m_reportDesigner->document());
    root.appendChild(conndata);
    doc.appendChild(root);

    QString src  = doc.toString();
    kDebug() << src;

    if (storeDataBlock(src, "layout")) {
        kDebug() << "Saved OK";
        setDirty(false);
        return true;
    }

    kDebug() << "NOT Saved OK";
    return false;
}
Exemple #2
0
tristate ReportDesignView::storeData ( bool dontAsk ) {

    QDomDocument doc ( "pgz_kexireport" );
    QDomElement root = doc.createElement ( "report" );
    QDomElement conndata = srcsel->connectionData();

    if (conndata.isNull())
        kDebug(planDbg()) << "Null conn data!";
    
    root.appendChild ( _rd->document() );
    root.appendChild(conndata);
    doc.appendChild ( root );

    QString src  = doc.toString();
    kDebug(planDbg()) << src;

    DB::Connection *conn = MainWindowIface::global()->project()->dbConnection();

    if ( storeDataBlock ( src, "pgzreport_layout" ) ) {
        kDebug(planDbg()) << "Saved OK";
        setDirty ( false );
        return true;
    } else {
        kDebug(planDbg()) << "NOT Saved OK";
    }

    return false;
}
tristate KexiReportDesignView::storeData(bool dontAsk)
{
    QString src  = _rd->document().toString();
    KexiDB::Connection *conn = KexiMainWindowIface::global()->project()->dbConnection();

    if (storeDataBlock(src, "pgzreport_layout")) {
        kDebug() << "Saved OK";
        setDirty(false);
        return true;
    } else {
        kDebug() << "NOT Saved OK";
    }


    return false;
}
KexiDB::SchemaData* KexiReportDesignView::storeNewData(const KexiDB::SchemaData& sdata, bool &cancel)
{
    KexiDB::SchemaData *s = KexiView::storeNewData(sdata, cancel);
    kexipluginsdbg << "new id:" << s->id();

    if (!s || cancel) {
        delete s;
        return 0;
    }
    if (!storeData()) {
        //failure: remove object's schema data to avoid garbage
        KexiDB::Connection *conn = KexiMainWindowIface::global()->project()->dbConnection();
        conn->removeObject(s->id());
        delete s;
        return 0;
    }
    return s;
    
    
    
    
    #if 0
    
    
    KexiDB::SchemaData *rpt = new KexiDB::SchemaData();
    *rpt = sdata;
    //sdata.setName ( name );
    //sdata.setDescription ( _rd->reportTitle() );
    KexiDB::Connection *conn = KexiMainWindowIface::global()->project()->dbConnection();

    if (conn->storeObjectSchemaData(*rpt, true /*newObject*/)) {
        window()->setId(rpt->id());

        if (rpt->id() > 0 && storeDataBlock(_rd->document().toString(), "pgzreport_layout")) {
            kDebug() << "Saved OK " << rpt->id();
        } else {
            kDebug() << "NOT Saved OK";
            return 0;
        }
    } else {
        kDebug() << "Unable to store schema data";
        return 0;
    }
    return rpt;
    #endif
}
Exemple #5
0
tristate KexiMacroTextView::storeData(bool /*dontAsk*/)
{
    kexipluginsdbg << QString("KexiMacroTextView::storeData() %1 [%2]\n%3").arg(parentDialog()->partItem()->name()).arg(parentDialog()->id()).arg(d->editor->text()) << endl;
    return storeDataBlock( d->editor->text() );
}