summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserdefault.c
Commit message (Collapse)AuthorAgeFilesLines
* Simplify cleanup codeBenjamin Otte2009-11-021-10/+12
| | | | | The patch ensures that the file browse model can only get removed in one place, so it's easier to clean up.
* Fix build on WindowsTor Lillqvist2009-10-161-1/+6
|
* Fix a g_strdup_printf()Federico Mena Quintero2009-10-151-1/+1
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Put the list of column types in a macroFederico Mena Quintero2009-10-151-38/+20
| | | | | | | Every call to _gtk_file_system_model_new*() gets the same list of column types, so we now keep the list in a macro instead of having duplicated copies all around. Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Clarify the arguments of g_file_query_info_async()Federico Mena Quintero2009-10-151-1/+1
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Make copy_attribute() a function instead of a macroFederico Mena Quintero2009-10-151-7/+9
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Don't leak a treepath if the treeview is not populated yetFederico Mena Quintero2009-10-151-1/+2
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Factor out function to set a fixed size for the icon cell renderersFederico Mena Quintero2009-10-151-6/+10
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Comment that the column order needs to be kept in sync across two functionsFederico Mena Quintero2009-10-151-0/+4
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Fix typo in a commentFederico Mena Quintero2009-10-151-1/+1
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Make get_selected_file() return a ref'ed fileFederico Mena Quintero2009-10-151-3/+10
| | | | | | | The old semantics was to return a GFile* owned by the file system model; the new semantics is to hand out new references whenever possible. Signed-off-by: Federico Mena Quintero <federico@novell.com>
* s/get_is_visible/iter_is_visible for clarityFederico Mena Quintero2009-10-151-2/+2
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Show an error dialog when we can't read the folder's contentsFederico Mena Quintero2009-10-151-0/+26
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Improve show_and_select_files() functionBenjamin Otte2009-10-151-206/+42
| | | | | | | The previous function enumerated the whole directory and used a lot of outdated API to decide how to show files. The new code queries the filesystem model to decide about this. The now unused old functions were removed.
* Remove unused error argument from show_and_select_files()Benjamin Otte2009-10-151-5/+3
|
* Enable the size column in recent files/searchBenjamin Otte2009-10-151-8/+3
| | | | | | | Previously information about file sizes was not available for search results and recent files, so the column was always hidden. As this information is now available, we can stop the special handling and use the same setting as in browse mode.
* Use the faster accessor function in the sort functionsBenjamin Otte2009-10-151-15/+13
| | | | | | | | | | | | | | | Use the faster _gtk_file_system_model_get_value() function instead of gtk_tree_model_get() inside the sort functions. This gives a significant speed-up when sorting large lists. In a test case with 40.000 files, the sorting time went from ~5 seconds to less than 0.5 seconds for my test case. There is 2 significant problems with gtk_tree_model_get() that cause this: 1) The value is copied, which takes quite a bit of time for strings. ~25% of excessive time or ~1 second in my test 2) The tree model functions need to lookup the interface vfunc. And gtk_tree_model_get() doesn't do that only once, but multiple times (verifying column id, getting the actual value, ...) ~75% of excessive time or ~3 seconds in my test
* Convert recent files to a GtkFileSystemModelBenjamin Otte2009-10-151-427/+37
| | | | | This does to the recent files what the last commit did to the search. It uses a GtkFileSystemModel and its API niceties to show the recent files.
* Convert search to use a GtkFileSystemModelBenjamin Otte2009-10-151-430/+29
| | | | | | | | Replace the list model code with the file system model and use all the file system model API niceties we get from that. Also adds the function _gtk_file_system_model_add_and_query_file() which g_file_query_info()'s the file before adding it, so it gets added with the right information.
* Don't count the "enter directory name" line as a selected fileBenjamin Otte2009-10-151-3/+10
|
* Add a constructor to filesystem model that does not monitor a directoryBenjamin Otte2009-10-151-1/+1
| | | | | This is in preparation for switching search and recent models to use GtkFileSystemModel
* Make the filesystem model filter API use a GtkFileFilterBenjamin Otte2009-10-151-35/+1
| | | | | This gets rid of the vfunc API and does exactly what the file chooser wants.
* Only query the absolutely necessary attributesBenjamin Otte2009-10-151-1/+4
| | | | | | | | | Since the time taken by g_file_enumerate_children() depends a lot on the attributes that are queried, we query the minimum attributes that need to be queired to display the file chooser. In particular, the attributes for loading the icon are ignored, as icons are loaded on demand (see previous commit).
* Load icons on-demandBenjamin Otte2009-10-151-2/+100
| | | | | | | | | | Because loading icons takes a noticable performance, this code loads the pixbuf on demand and only loads icons for rows that are visible. There is a few caveats to this: - The pixbuf cell renderer must report the proer size even if the icon is not yet loaded. This is achieved by setting a fixed size. - On theme changes the cahced pixbufs and the cell renderer must be updated to conform to the new theme.
* Use the GtkTreeSortable of the filesystem modelBenjamin Otte2009-10-151-66/+34
| | | | | | Previously, there was a GtkTreeSortModel wrapped around the filesystem model to make it sortable. As the new implementation implements the GtkTreeSortable interface, we can use this instead.
* Clean up code to use the model directlyBenjamin Otte2009-10-151-208/+44
| | | | | | | A lot of code special cases accesses to the tree view for the different browse modes, which was previously necessary, because the models were different. Now that they are identical in the first columns, there is no such need anymore, and the functions don't need to be special cased.
* Replace the cell data computationsBenjamin Otte2009-10-151-375/+53
| | | | | | | | | | | Previously custom functions were used to compute the data passed to the cell renderers. Now that all this data is saved by the tree models with compatible nodes, the usual default attribute-to-column mapping can be used. With this, caching of the values can happen in the tree model, which avoids costly lookups of icons or computation of strings. Last but not least it avoids spurious bugs that could happen when strings changed without anyone noticing, like the mtime when a new day begins.
* Consolidate tree models for different browse modesBenjamin Otte2009-10-151-690/+397
| | | | | | | | All tree models in browse mode now share the first 10 column types containing all the necessary information to display the model on screen. Therefor it is now easy to just operate on the tree model associated with the file tree view and in most cases it isn't necessary anymore to special case the browse modes.
* Simplify gtk_file_chooser_default_unselect_file()Benjamin Otte2009-10-151-26/+11
|
* Creating the model no longer failsBenjamin Otte2009-10-151-7/+0
| | | | So remove the code that checked for failure, as it's not needed anymore.
* Implement new GtkFileSystemModelBenjamin Otte2009-10-151-8/+60
| | | | | | | | | | | | | | | | | | | | The new model is mostly API-compatible with the old model (minimal changes were required), but is a lot faster and has a lot of very desirable features. - the model does no longer support a tree, just a list of files in a given directory - the storage has been moved to a GArray as opposed to a tree - no more dependency on GtkFileSystem - columns are managed by the creator of the model, so any number of nodes can be added as needed. This also makes the API more similar to GtkListStore. - Values are filled on demand using a function given when creating the model. - The function can decide to let the model cache returned values or decide to be called again the next time the value is queried. - implements GtkTreeSortable - _gtk_file_system_model_get_value() was added to significantly speed up value access, which is necessary when sorting large models.
* Plug a mem leakChristian Persch2009-08-291-0/+1
| | | | The filechooser was leaking tooltips. Reported in bug bug 593080.
* Update tooltip if no removable one is selectedPascal Terjan2009-08-061-11/+14
|
* Allow disabling New Folder button in File ChoserPascal Terjan2009-07-301-3/+16
| | | | | | Bug #570516. Add a new property "create-folders" meaning that the "New Folder" button should be displayed in the modes where it used to be.
* Bug #514260 – Better filtering for "Recently Used" filesEmmanuele Bassi2009-07-301-3/+7
| | | | | | | | | | | Instead of refiltering the recently used files we should rebuild the list altogether when the current GtkFileFilter changes; this allows us to keep showing the maximum amount of recently used files. Fixes bug: http://bugzilla.gnome.org/show_bug.cgi?id=514260
* bgo#161489 - In the file chooser, let the left/right arrow keys switch focus ↵Federico Mena Quintero2009-07-271-4/+30
| | | | | | | | between the file list and shortcuts Based on a patch by Christian Neumair <cneumair@gnome.org> Signed-off-by: Federico Mena Quintero <federico@novell.com>
* From the shortcuts pane, focus the GtkEntry and redirect unhandled ↵Federico Mena Quintero2009-07-271-18/+42
| | | | | | | | | | | | | | | | | | keystrokes to it This lets us do this: 1. click on a folder in the shortcuts pane 2. start typing a filename Then, the typed filename will actually go to the filename entry, like the user expects. (Or to the search entry, in case the user clicked on the Search shortcut.) Also, removed the obsolete callback that made "/" and "~" typed in the shortcuts pane bring up the location entry. Signed-off-by: Federico Mena Quintero <federico@novell.com>
* bgo#534462: Disable interactive search in the file chooser's shortcuts paneFederico Mena Quintero2009-07-271-0/+1
| | | | | | | | | | | | | People often do this: 1. Bring up a SAVE dialog 2. Click on a folder in the shortcuts pane 3. Start typing a filename 4. Oops! The interactive-search entry in the shortcuts pane appears. With this, the shortcuts pane will not bring up the interactive-search entry. Then it will be clear that you are not typing in the right place. Signed-off-by: Federico Mena Quintero <federico@novell.com>
* g_strdup_print does not exist, the function is g_strdup_printf.Xan Lopez2009-07-201-1/+1
|
* Remove markup from translatable stringsMatthias Clasen2009-07-201-2/+8
| | | | Pointed out in bug 588964. String change !
* Add a tooltip to the save folder comboMatthias Clasen2009-07-151-0/+36
| | | | | | Add a tooltip that shows the full path of the current folder, to avoid ambiguity. We only show the tooltip when the expander is collapsed to avoid cluttering the full file chooser.
* make the size column resizableBenjamin Otte2009-06-271-0/+1
|
* make sure the "Create folder" button doesn't get shown accidentallyBenjamin Otte2009-06-271-4/+9
| | | | | Switching to search or recent files mode and back to browse mode made the button visible previously
* unconditionally set right alignment for the size columnBenjamin Otte2009-06-271-1/+3
|
* Fix 'Add to bookmarks' initial sensitivityMatthias Clasen2009-06-211-1/+2
| | | | | Make sure that we always call bookmarks_check_add_sensitivity() at least once before popping up a newly created menu. Fixes bug 585858.
* Show the size column by default in the file chooserFederico Mena Quintero2009-06-181-1/+1
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Don't set the sort column when there is no modelFederico Mena Quintero2009-06-171-1/+4
| | | | | | | | We can't set the sort column when we load the GtkFileChooser's settings, as the file models may not have been created yet. Wait until the models are actually present; then we can set the sort column. Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Don't use deprecated api internallyMatthias Clasen2009-06-161-1/+1
|
* bgo#484922 - Remember the sort column and order in the file chooserBenjamin Gramlich2009-06-121-32/+107
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* Add load/save functions for the sort column order in GtkFileChooserSettingsBenjamin Gramlich2009-06-121-8/+0
| | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>