From: ishmal Date: Fri, 17 Nov 2006 09:27:26 +0000 (+0000) Subject: Remove our "fake" location field from the open dialog. Gtk's FileChooser has evolved... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=254d3c02009cf461c14183dcd1d3eeded815a4df;p=inkscape.git Remove our "fake" location field from the open dialog. Gtk's FileChooser has evolved enough that we don't need it any more. --- diff --git a/src/ui/dialog/filedialog.cpp b/src/ui/dialog/filedialog.cpp index cf816033a..78f6efaf8 100644 --- a/src/ui/dialog/filedialog.cpp +++ b/src/ui/dialog/filedialog.cpp @@ -770,27 +770,11 @@ private: */ void updatePreviewCallback(); - /** - * Fix to allow the user to type the file name - */ - Gtk::Entry fileNameEntry; - /** * Create a filter menu for this type of dialog */ void createFilterMenu(); - /** - * Callback for user input into fileNameEntry - */ - void fileNameEntryChangedCallback(); - - /** - * Callback for user changing which item is selected on the list - */ - void fileSelectedCallback(); - - /** * Filter name->extension lookup */ @@ -827,60 +811,6 @@ void FileOpenDialogImpl::updatePreviewCallback() -/** - * Callback for fileNameEntry widget - */ -void FileOpenDialogImpl::fileNameEntryChangedCallback() -{ - Glib::ustring rawFileName = fileNameEntry.get_text(); - - Glib::ustring fileName = Glib::filename_from_utf8(rawFileName); - - //g_message("User hit return. Text is '%s'\n", fileName.c_str()); - - if (!Glib::path_is_absolute(fileName)) { - //try appending to the current path - // not this way: fileName = get_current_folder() + "/" + fName; - std::vector pathSegments; - pathSegments.push_back( get_current_folder() ); - pathSegments.push_back( fileName ); - fileName = Glib::build_filename(pathSegments); - } - - //g_message("path:'%s'\n", fName.c_str()); - - if (Glib::file_test(fileName, Glib::FILE_TEST_IS_DIR)) { - set_current_folder(fileName); - } else if (Glib::file_test(fileName, Glib::FILE_TEST_IS_REGULAR)) { - //dialog with either (1) select a regular file or (2) cd to dir - //simulate an 'OK' - set_filename(fileName); - response(Gtk::RESPONSE_OK); - } -} - - - - - -/** - * Callback for fileNameEntry widget - */ -void FileOpenDialogImpl::fileSelectedCallback() -{ - Glib::ustring fileName = get_filename(); - if (!Glib::get_charset()) //If we are not utf8 - fileName = Glib::filename_to_utf8(fileName); - //g_message("User selected '%s'\n", - // filename().c_str()); - -#ifdef INK_DUMP_FILENAME_CONV - ::dump_ustr( get_filename() ); -#endif - fileNameEntry.set_text(fileName); -} - - void FileOpenDialogImpl::createFilterMenu() @@ -982,20 +912,6 @@ FileOpenDialogImpl::FileOpenDialogImpl(const Glib::ustring &dir, signal_update_preview().connect( sigc::mem_fun(*this, &FileOpenDialogImpl::updatePreviewCallback) ); - - //###### Add a text entry bar, and tie it to file chooser events - fileNameEntry.set_text(get_current_folder()); - set_extra_widget(fileNameEntry); - fileNameEntry.grab_focus(); - - //Catch when user hits [return] on the text field - fileNameEntry.signal_activate().connect( - sigc::mem_fun(*this, &FileOpenDialogImpl::fileNameEntryChangedCallback) ); - - //Catch selection-changed events, so we can adjust the text widget - signal_selection_changed().connect( - sigc::mem_fun(*this, &FileOpenDialogImpl::fileSelectedCallback) ); - add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);