Commit 174c0dda authored by Murray Cumming's avatar Murray Cumming
Browse files

ImageGlom: Allow the user to choose any file.

* glom/utility_widgets/imageglom.cc: However, we are still restricted to
what GdkPixbuf can load.
parent e1cbe6f1
2011-07-12 Murray Cumming <murrayc@murrayc.com>
ImageGlom: Allow the user to choose any file.
* glom/utility_widgets/imageglom.cc: However, we are still restricted to
what GdkPixbuf can load.
2011-07-12 Murray Cumming <murrayc@murrayc.com>
ImageGlom: Do not transform to PNG output when saving.
......
......@@ -394,14 +394,18 @@ void ImageGlom::open_with(const Glib::RefPtr<Gio::AppInfo>& app_info)
}
static Glib::RefPtr<Gtk::FileFilter> get_file_filter_images()
static void set_file_filter_images(Gtk::FileChooser& file_chooser)
{
//Get image formats only:
Glib::RefPtr<Gtk::FileFilter> filter = Gtk::FileFilter::create();
filter->set_name(_("Images"));
filter->add_pixbuf_formats();
file_chooser.add_filter(filter);
return filter;
filter = Gtk::FileFilter::create();
filter->set_name(_("All Files"));
filter->add_pattern("*");
file_chooser.add_filter(filter);
}
void ImageGlom::on_menupopup_activate_save_file()
......@@ -412,7 +416,7 @@ void ImageGlom::on_menupopup_activate_save_file()
if(pApp)
dialog.set_transient_for(*pApp);
dialog.add_filter( get_file_filter_images() );
set_file_filter_images(dialog);
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK);
......@@ -466,7 +470,7 @@ void ImageGlom::on_menupopup_activate_select_file()
if(pApp)
dialog.set_transient_for(*pApp);
dialog.add_filter( get_file_filter_images() );
set_file_filter_images(dialog);
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
dialog.add_button(_("Select"), Gtk::RESPONSE_OK);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment