summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2009-02-06 23:16:40 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2009-02-06 23:16:40 +0000
commita41a8a09d6d652f3c4554b6b192d524a85d8ee25 (patch)
treeebcab1c8a6615346fd46e1d79b22869736e3f797 /src
parentextensions/dots.py : Now dots are circles and not a multi-path to correct the... (diff)
downloadinkscape-a41a8a09d6d652f3c4554b6b192d524a85d8ee25.tar.gz
inkscape-a41a8a09d6d652f3c4554b6b192d524a85d8ee25.zip
add All Vectors and All Bitmaps filters (todo: port this to the win32 dialog)
(bzr r7238)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/filedialogimpl-gtkmm.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp
index 379d43fbf..70f2f2ae5 100644
--- a/src/ui/dialog/filedialogimpl-gtkmm.cpp
+++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp
@@ -723,6 +723,16 @@ void FileOpenDialogImplGtk::createFilterMenu()
extensionMap[Glib::ustring(_("All Images"))]=NULL;
add_filter(allImageFilter);
+ Gtk::FileFilter allVectorFilter;
+ allVectorFilter.set_name(_("All Vectors"));
+ extensionMap[Glib::ustring(_("All Vectors"))]=NULL;
+ add_filter(allVectorFilter);
+
+ Gtk::FileFilter allBitmapFilter;
+ allBitmapFilter.set_name(_("All Bitmaps"));
+ extensionMap[Glib::ustring(_("All Bitmaps"))]=NULL;
+ add_filter(allBitmapFilter);
+
//patterns added dynamically below
Inkscape::Extension::DB::InputList extension_list;
Inkscape::Extension::db.get_input_list(extension_list);
@@ -750,6 +760,29 @@ void FileOpenDialogImplGtk::createFilterMenu()
allInkscapeFilter.add_pattern(upattern);
if ( strncmp("image", imod->get_mimetype(), 5)==0 )
allImageFilter.add_pattern(upattern);
+
+ // uncomment this to find out all mime types supported by Inkscape import/open
+ // g_print ("%s\n", imod->get_mimetype());
+
+ // I don't know of any other way to define "bitmap" formats other than by listing them
+ if (
+ strncmp("image/png", imod->get_mimetype(), 9)==0 ||
+ strncmp("image/jpeg", imod->get_mimetype(), 10)==0 ||
+ strncmp("image/gif", imod->get_mimetype(), 9)==0 ||
+ strncmp("image/x-icon", imod->get_mimetype(), 12)==0 ||
+ strncmp("image/x-navi-animation", imod->get_mimetype(), 22)==0 ||
+ strncmp("image/x-cmu-raster", imod->get_mimetype(), 18)==0 ||
+ strncmp("image/x-xpixmap", imod->get_mimetype(), 15)==0 ||
+ strncmp("image/bmp", imod->get_mimetype(), 9)==0 ||
+ strncmp("image/vnd.wap.wbmp", imod->get_mimetype(), 18)==0 ||
+ strncmp("image/tiff", imod->get_mimetype(), 10)==0 ||
+ strncmp("image/x-xbitmap", imod->get_mimetype(), 15)==0 ||
+ strncmp("image/x-tga", imod->get_mimetype(), 11)==0 ||
+ strncmp("image/x-pcx", imod->get_mimetype(), 11)==0
+ )
+ allBitmapFilter.add_pattern(upattern);
+ else
+ allVectorFilter.add_pattern(upattern);
}
return;