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

void sp_file_import_from_ocal ( Gtk::Window &  parentWindow )

Display an Export dialog, export as the selected type if OK pressed Export the current document to OCAL Display an ImportToOcal Dialog, and the selected document from OCAL

Definition at line 1457 of file file.cpp.

References file_import(), Inkscape::UI::Dialog::FileImportFromOCALDialog::getFilename(), Inkscape::UI::Dialog::FileImportFromOCALDialog::getSelectionType(), and Inkscape::UI::Dialog::FileImportFromOCALDialog::show().

Referenced by Inkscape::FileVerb::perform().

{
    static Glib::ustring import_path;

    SPDocument *doc = SP_ACTIVE_DOCUMENT;
    if (!doc)
        return;

    Inkscape::UI::Dialog::FileImportFromOCALDialog *importDialogInstance = NULL;

    if (!importDialogInstance) {
        importDialogInstance = new
             Inkscape::UI::Dialog::FileImportFromOCALDialog(
                 parentWindow,
                 import_path,
                 Inkscape::UI::Dialog::IMPORT_TYPES,
                 (char const *)_("Import From Open Clip Art Library"));
    }

    bool success = importDialogInstance->show();
    if (!success) {
        delete importDialogInstance;
        return;
    }

    // Get file name and extension type
    Glib::ustring fileName = importDialogInstance->getFilename();
    Inkscape::Extension::Extension *selection = importDialogInstance->getSelectionType();

    delete importDialogInstance;
    importDialogInstance = NULL;

    if (fileName.size() > 0) {

        Glib::ustring newFileName = Glib::filename_to_utf8(fileName);

        if ( newFileName.size() > 0)
            fileName = newFileName;
        else
            g_warning( "ERROR CONVERTING OPEN FILENAME TO UTF-8" );

        import_path = fileName;
        if (import_path.size()>0)
            import_path.append(G_DIR_SEPARATOR_S);

        file_import(doc, fileName, selection);
    }

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index