Logo Search packages:      
Sourcecode: inkscape version File versions

void Inkscape::UI::Dialogs::FileOpenDialogImpl::createFilterMenu (  )  [private]

Create a filter menu for this type of dialog

Definition at line 758 of file filedialog.cpp.

References extensionMap.

Referenced by FileOpenDialogImpl().

{
    //patterns added dynamically below
    Gtk::FileFilter allImageFilter;
    allImageFilter.set_name(_("All Images"));
    extensionMap[Glib::ustring(_("All Images"))]=NULL;
    add_filter(allImageFilter);

    Gtk::FileFilter allFilter;
    allFilter.set_name(_("All Files"));
    extensionMap[Glib::ustring(_("All Files"))]=NULL;
    allFilter.add_pattern("*");
    add_filter(allFilter);

    //patterns added dynamically below
    Gtk::FileFilter allInkscapeFilter;
    allInkscapeFilter.set_name(_("All Inkscape Files"));
    extensionMap[Glib::ustring(_("All Inkscape Files"))]=NULL;
    add_filter(allInkscapeFilter);

    Inkscape::Extension::DB::InputList extension_list;
    Inkscape::Extension::db.get_input_list(extension_list);

    for (Inkscape::Extension::DB::InputList::iterator current_item = extension_list.begin();
         current_item != extension_list.end(); current_item++)
    {
        Inkscape::Extension::Input * imod = *current_item;

        // FIXME: would be nice to grey them out instead of not listing them
        if (imod->deactivated()) continue;

        Glib::ustring upattern("*");
        FileDialogExtensionToPattern (upattern, imod->get_extension());

        Gtk::FileFilter filter;
        Glib::ustring uname(_(imod->get_filetypename()));
        filter.set_name(uname);
        filter.add_pattern(upattern);
        add_filter(filter);
        extensionMap[uname] = imod;

        //g_message("ext %s:%s '%s'\n", ioext->name, ioext->mimetype, upattern.c_str());
        allInkscapeFilter.add_pattern(upattern);
        if ( strncmp("image", imod->get_mimetype(), 5)==0 )
            allImageFilter.add_pattern(upattern);
    }

    return;
}


Generated by  Doxygen 1.6.0   Back to index