Commit Graph

549 Commits

Author SHA1 Message Date
Benjamin Otte
6bdaaea3a4 Remove unused error argument from show_and_select_files() 2009-10-15 22:01:40 +02:00
Benjamin Otte
682a3c8c75 Enable the size column in recent files/search
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.
2009-10-15 22:01:40 +02:00
Benjamin Otte
d68bca1771 Use the faster accessor function in the sort functions
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
2009-10-15 22:01:39 +02:00
Benjamin Otte
53a00e3cc3 Convert recent files to a GtkFileSystemModel
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.
2009-10-15 22:01:39 +02:00
Benjamin Otte
5a31dfd66b Convert search to use a GtkFileSystemModel
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.
2009-10-15 22:01:09 +02:00
Benjamin Otte
390a3910f5 Don't count the "enter directory name" line as a selected file 2009-10-15 22:00:09 +02:00
Benjamin Otte
affa8c8459 Add a constructor to filesystem model that does not monitor a directory
This is in preparation for switching search and recent models to use
GtkFileSystemModel
2009-10-15 22:00:09 +02:00
Benjamin Otte
10e8d6abca Make the filesystem model filter API use a GtkFileFilter
This gets rid of the vfunc API and does exactly what the file chooser
wants.
2009-10-15 22:00:09 +02:00
Benjamin Otte
cd337e2a95 Only query the absolutely necessary attributes
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).
2009-10-15 22:00:08 +02:00
Benjamin Otte
4a1ff32325 Load icons on-demand
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.
2009-10-15 22:00:08 +02:00
Benjamin Otte
105e6fbc11 Use the GtkTreeSortable of the filesystem model
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.
2009-10-15 22:00:08 +02:00
Benjamin Otte
3e385ffd07 Clean up code to use the model directly
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.
2009-10-15 22:00:08 +02:00
Benjamin Otte
30c1a1ee2c Replace the cell data computations
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.
2009-10-15 22:00:08 +02:00
Benjamin Otte
a5390ad49e Consolidate tree models for different browse modes
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.
2009-10-15 22:00:07 +02:00
Benjamin Otte
d6f3d0e7eb Simplify gtk_file_chooser_default_unselect_file() 2009-10-15 22:00:07 +02:00
Benjamin Otte
0ccb2f2427 Creating the model no longer fails
So remove the code that checked for failure, as it's not needed anymore.
2009-10-15 22:00:07 +02:00
Benjamin Otte
18b56b9970 Implement new GtkFileSystemModel
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.
2009-10-15 22:00:06 +02:00
Christian Persch
a2420c7db5 Plug a mem leak
The filechooser was leaking tooltips. Reported in bug bug 593080.
2009-08-29 20:40:50 -04:00
Pascal Terjan
f8171ce092 Update tooltip if no removable one is selected 2009-08-06 23:28:49 +02:00
Pascal Terjan
a4514f993e Allow disabling New Folder button in File Choser
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.
2009-07-30 16:58:42 +02:00
Emmanuele Bassi
2d79405118 Bug #514260 – Better filtering for "Recently Used" files
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
2009-07-30 11:16:29 +01:00
Federico Mena Quintero
d55ff39ad0 bgo#161489 - In the file chooser, let the left/right arrow keys switch focus 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>
2009-07-27 19:24:42 -05:00
Federico Mena Quintero
b50548e350 From the shortcuts pane, focus the GtkEntry and redirect unhandled 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>
2009-07-27 19:12:41 -05:00
Federico Mena Quintero
0f5f7539f3 bgo#534462: Disable interactive search in the file chooser's shortcuts pane
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>
2009-07-27 19:12:41 -05:00
Xan Lopez
3484246dc3 g_strdup_print does not exist, the function is g_strdup_printf. 2009-07-20 09:58:22 +03:00
Matthias Clasen
267d209441 Remove markup from translatable strings
Pointed out in bug 588964. String change !
2009-07-20 01:10:52 -04:00
Matthias Clasen
143b55c3cb Add a tooltip to the save folder combo
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.
2009-07-15 19:17:36 -04:00
Benjamin Otte
271a635a2f make the size column resizable 2009-06-27 11:33:23 +02:00
Benjamin Otte
02ac8ea3af make sure the "Create folder" button doesn't get shown accidentally
Switching to search or recent files mode and back to browse mode made
the button visible previously
2009-06-27 11:32:57 +02:00
Benjamin Otte
655e0d8ddc unconditionally set right alignment for the size column 2009-06-27 11:29:36 +02:00
Matthias Clasen
823151ba8c Fix 'Add to bookmarks' initial sensitivity
Make sure that we always call bookmarks_check_add_sensitivity() at
least once before popping up a newly created menu. Fixes bug 585858.
2009-06-21 23:30:27 -04:00
Federico Mena Quintero
68171b506f Show the size column by default in the file chooser
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-18 19:48:38 -05:00
Federico Mena Quintero
3c75004474 Don't set the sort column when there is no model
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>
2009-06-17 20:33:57 -05:00
Matthias Clasen
d51132e584 Don't use deprecated api internally 2009-06-16 11:27:06 -04:00
Benjamin Gramlich
1d4cba6876 bgo#484922 - Remember the sort column and order in the file chooser
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 17:31:28 -05:00
Benjamin Gramlich
69a0611391 Add load/save functions for the sort column order in GtkFileChooserSettings
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 16:40:25 -05:00
Federico Mena Quintero
2accf2fd21 Fix compiler warnings
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 13:59:29 -05:00
Milan Bouchet-Valat
67632a578b bgo#562579 - Don't show errors when the initial folder does not exist
The previous patch for this bug was about the initial *file* not existing,
but this also handles the initial *folder* not existing
(such as /usr/nonexistent/nonexistent.txt).

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 13:25:26 -05:00
Milan Bouchet-Valat
d87dbd66d6 bgo#171416 - Don't create a folder with the default name 'Type name of new folder'
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-12 11:45:43 -05:00
Milan Bouchet-Valat
a27e748586 bgo#355851 - Hide backup files in the file chooser
Backup files are hidden along with dotfiles, just like Nautilus.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-11 19:58:51 -05:00
Milan Bouchet-Valat
de280cc5c8 bgo#486839 - The path bar's area shouldn't change vertical size to avoid the browse widgets jumping
We now use a GtkSizeGroup to control the vertical size of the various widgets
that get put in the path bar's area:  the location bar, the search entry,
the recently-used title label.

This keeps the shortcuts pane and the file list from jumping up and down
when one switches between operation modes (browse/search/recently-used).

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-11 18:50:05 -05:00
Denis Chertykov
4d7bbd058e bgo#327152 - Ellipsize long directory names in GtkPathBar, and better layout for the pathbar
Ellipsize labels in the Save folder's combo so they don't grow too wide.

Ellipsize labels in normal directory buttons in the pathbar, and make
their requisition's width reasonably small.  Use a tooltip for buttons
that got ellipsized.

Instead of placing the down-slider directly beside the last button in
the pathbar, use the remaining space in the pathbar for the last
button.  Use a different method to find the first visible button.
Walk down from the end, adding buttons until we use all free space.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-06-05 14:13:03 -05:00
Martin Nordholts
f253b6927c Avoid memory corruption on complicated confirm-overwrite logic
Dup the file chooser entry string because the string may be modified
depending on what clients do in the confirm-overwrite signal and this
corrupts the pointer.
2009-05-15 22:20:30 +02:00
Matthias Clasen
1291ab4a18 Switch to the newly created folder on success.
* gtk/gtkfilechooserdefault.c (edited_idle_cb): Switch to the newly
        created folder on success.


svn path=/trunk/; revision=22432
2009-03-01 07:33:11 +00:00
Matthias Clasen
7d8930fdcc Never scroll the places horizontally. Instead, ellipsize the text.
* gtk/gtkfilechooserdefault.c (shortcuts_list_create): Never scroll
        the places horizontally. Instead, ellipsize the text.



svn path=/trunk/; revision=22397
2009-02-24 02:20:15 +00:00
Matthias Clasen
a220373a55 Skip Desktop if it equals the home folder
svn path=/trunk/; revision=22192
2009-01-23 06:00:44 +00:00
Federico Mena Quintero
c6f4b327e6 GtkFileChooser: only set local_only on the location entry if it exists
2009-01-21  Federico Mena Quintero  <federico@novell.com>

	* gtk/gtkfilechooserdefault.c (save_widgets_create): Set
	local_only on the location entry when we create it...
	(set_local_only): ... and set it here only if the location entry
	exists.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=22163
2009-01-21 19:12:58 +00:00
Federico Mena Quintero
2c07a59e54 Add a local_only property to GtkFileChooserEntry
Patch by Carlos Garnacho <carlos@imendio.com> - add a local_only
	property to GtkFileChooserEntry:

	* gtk/gtkfilechooserentry.c (struct _GtkFileChooserEntry): Add a
	local_only field.
	(_gtk_file_chooser_entry_init): Default to local_only being true.
	(start_explicit_completion): Don't allow completion of non-native
	files if local_only is turned on.
	(start_loading_current_folder): Don't start loading non-native
	folders if local_only is turned on.
	(_gtk_file_chooser_entry_set_local_only): New function.
	(_gtk_file_chooser_entry_get_local_only): New function.

	* gtk/gtkfilechooserentry.h (_gtk_file_chooser_entry_set_local_only,
	_gtk_file_chooser_entry_get_local_only): New prototypes.

	* gtk/gtkfilechooserdefault.c (set_local_only): Set the local_only
	property on the entry.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=22156
2009-01-21 03:16:46 +00:00
Federico Mena Quintero
d00b5cd3ee Load/save the file chooser's size
* gtk/gtkfilechooserdefault.c (save_dialog_geometry): New function.
	(settings_save): Save the dialog's geometry.
	(gtk_file_chooser_default_get_default_size): Load the geometry
	from the settings.  If it was already saved, return that instead
	of computing an ad-hoc size.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=22119
2009-01-14 20:19:10 +00:00
Federico Mena Quintero
1d4694ec79 Avoid visibly resizing the file chooser at startup
* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_map):
	Don't change the default size in ::map() so we don't flicker...
	(gtk_file_chooser_default_realize): ... so do it in ::realize()
	instead, when the window is not yet visible.  This avoids a
	dialog-that-resizes when you first pop up the file chooser.
	(emit_default_size_changed): Just emit the signal; don't check for
	the widget's state so we can be emitted during the initial
	::realize() when we are not mapped yet.
	(update_preview_widget_visibility): Only emit default_size_changed
	if the widget is not mapped, to avoid resizing the dialog while it
	is visible.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=22117
2009-01-14 20:18:40 +00:00
Tomas Bzatek
d1a0239a18 Mask G_FILE_TYPE_SHORTCUT as a directory (#561494)
2008-12-15  Tomas Bzatek  <tbzatek@redhat.com> 

        * gtk/gtkfilechooserdefault.c: (list_row_activated):
        * gtk/gtkfilesystem.c: (_gtk_file_info_consider_as_directory):
        Mask G_FILE_TYPE_SHORTCUT as a directory (#561494)


svn path=/trunk/; revision=21906
2008-12-15 16:12:09 +00:00
Matthias Clasen
083967b3b8 Mount the enclosing volume if the folder we're switching to is not
* gtk/gtkfilechooserdefault.c (update_current_folder_get_info_cb):
        Mount the enclosing volume if the folder we're switching to is not
        mounted. Patch by Tomas Bzatek, based on work by Carlos Garnacho


svn path=/trunk/; revision=21899
2008-12-14 03:33:41 +00:00
Matthias Clasen
50329fa7c0 Privately export this method. It classifies directories and mountables the
* gtk/gtkfilesystem.[hc] (_gtk_file_info_consider_as_directory):
        Privately export this method. It classifies directories and mountables
        the same.

        * gtk/gtkfilesystem.c (enclosing_volume_mount_cb): Silently drop
        G_IO_ERROR_ALREADY_MOUNTED error for gvfs backends without visible
        mounts.

        * gtk/gtkfilesystemmodel.c:
        * gtk/gtkfilechooserbutton.c:
        * gtk/gtkfilechooserentry.c:
        * gtk/gtkfilechooserdefault.c: Use the new function instead of
        direct checks for G_FILE_TYPE_DIRECTORY throughout.


svn path=/trunk/; revision=21898
2008-12-14 02:14:19 +00:00
Matthias Clasen
d68d9790df fix the build
svn path=/trunk/; revision=21896
2008-12-14 01:16:05 +00:00
Matthias Clasen
2ebb72e82a Don't show an error dialog when changing to a non-existing folder, since
* gtk/gtkfilechooserdefault.c (update_current_folder_get_info_cb):
        Don't show an error dialog when changing to a non-existing folder,
        since this is ususally just an annoyance. 


svn path=/trunk/; revision=21894
2008-12-14 00:43:09 +00:00
Matthias Clasen
3a20f54bbe Avoid a warning in tests. Patch by Christian Dywan
* gtk/gktfilechooserdefault.c (set_local_only): Avoid a warning
        in tests. Patch by Christian Dywan

svn path=/trunk/; revision=21892
2008-12-14 00:32:32 +00:00
Matthias Clasen
67d94ca553 Don't forget to reset reload_state when current_folder is already correct.
2008-10-08  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c (update_current_folder_get_info_cb):
        Don't forget to reset reload_state when current_folder is already
        correct. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=465992


svn path=/trunk/; revision=21608
2008-10-08 15:32:23 +00:00
Christian Persch
96b8743e95 Bug 554698 – mem leak in filechooser
svn path=/trunk/; revision=21570
2008-10-02 19:47:52 +00:00
Christian Persch
ab7aa3e113 Bug 554690 – mem leak in filechooser
svn path=/trunk/; revision=21567
2008-10-02 19:47:35 +00:00
Matthias Clasen
bc48caa272 Bug 553133 – GtkFileChooser won't ask to mount a volume
2008-09-26  Matthias Clasen  <mclasen@redhat.com>

        Bug 553133 – GtkFileChooser won't ask to mount a volume

        * gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Use
        a GtkMountOperation when mounting, so that we get a password
        dialog when required.

svn path=/trunk/; revision=21523
2008-09-26 19:25:35 +00:00
Michael Natterer
23bcd6df88 don't unref the file system backend, the newly added
2008-09-25  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkfilechooserdefault.c (gtk_file_chooser_default_finalize):
	don't unref the file system backend, the newly added
	unset_file_system_backend() already does this (bug #553135).


svn path=/trunk/; revision=21514
2008-09-25 11:22:34 +00:00
Matthias Clasen
235480bd9c Bug 553135 – eog crash: assertion failed. Gtk error:
2008-09-22  Matthias Clasen  <mclasen@redhat.com>

        Bug 553135 – eog crash: assertion failed. Gtk error:
        shortcuts_remove_rows: code should not be reached

        * gtk/gtkfilechooserdefault.c: Disconnect from GtkFileSystem
        signals when we are destroyed, in order to avoid nasty surprises.
        Patch by Claudio Saavedra


svn path=/trunk/; revision=21492
2008-09-22 18:32:31 +00:00
Emmanuele Bassi
e27c3c1939 Bug 552789 – Show size column in the search and recently used files
2008-09-22  Emmanuele Bassi  <ebassi@linux.intel.com>

	Bug 552789 – Show size column in the search and recently used
	files modes

	* gtk/gtkfilechooserdefault.c: Display the file size column
	when in OPERATION_MODE_SEARCH. This removes a stat() call
	and simplifies the code a little bit by changing the query
	for file informations for each search engine hit.

svn path=/trunk/; revision=21491
2008-09-22 14:25:45 +00:00
Emmanuele Bassi
d5a173b4ed Save the size column visibility state with the rest of the FileChooser
2008-09-18  Emmanuele Bassi  <ebassi@linux.intel.com>

	* gtk/gtkfilechooserdefault.c (settings_save): Save the size column
	visibility state with the rest of the FileChooser settings.

svn path=/trunk/; revision=21437
2008-09-18 22:00:53 +00:00
Emmanuele Bassi
555ef89dc3 Bug 325095 – show a 'size' column
2008-09-18  Emmanuele Bassi  <ebassi@linux.intel.com>

	Bug 325095 – show a 'size' column

	* gtk/gtkfilechooserdefault.c:
	* gtk/gtkfilechooserprivate.h: Add a context menu item controlling
	the visibility of the file size column. This works only for the
	browse mode, and the column is not visible by default.

	* gtk/gtkfilechoosersettings.[ch]: Add a ShowSizeColumn key to the
	settings file.

svn path=/trunk/; revision=21431
2008-09-18 15:29:33 +00:00
Matthias Clasen
8ee6ecbeed Fix content type handling
svn path=/trunk/; revision=21318
2008-09-08 03:07:40 +00:00
Matthias Clasen
d69788f070 Don't leak all search results
svn path=/trunk/; revision=21317
2008-09-08 02:49:20 +00:00
Matthias Clasen
f2c0fa2ce9 Don't unref the GFile we just put into the search_model. This adds a new
2008-09-07  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserdefault.c (search_add_hit): Don't unref the
        GFile we just put into the search_model. This adds a new memory
        leak...



svn path=/trunk/; revision=21315
2008-09-08 01:05:50 +00:00
Matthias Clasen
4b97ecb8f9 plug a memory leak
svn path=/trunk/; revision=21314
2008-09-07 22:18:37 +00:00
Michael Natterer
e936ba0f5a stop the emission of the signal also when we bail out early because we
2008-09-05  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkfilechooserdefault.c (file_list_drag_data_received_cb):
	stop the emission of the signal also when we bail out early
	because we don't accept drops from ourselves. Keeps the code from
	running into a warning in gtktreeview.c.


svn path=/trunk/; revision=21302
2008-09-05 19:53:30 +00:00
Matthias Clasen
4c6577fb8b Bug 549354 – Crash trying to open a file on a remote folder
2008-08-26  Matthias Clasen  <mclasen@redhat.com>

        Bug 549354 – Crash trying to open a file on a remote folder

        * gtk/gtkfilechooserdefault.c (error_message_with_parent): Handle
        the fact that parent may be NULL without crashing.


svn path=/trunk/; revision=21206
2008-08-27 04:01:53 +00:00
Federico Mena Quintero
b4b74a3c6c [PATCH 7/7] bgo543308 - Remove the default_width/height stuff, since we are not using it anymore
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=21168
2008-08-20 01:13:17 +00:00
Federico Mena Quintero
967a68008f [PATCH 6/7] bgo543308 - Only compute a font-based size if we are in expanded mode or one of the OPEN modes
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=21167
2008-08-20 01:12:54 +00:00
Federico Mena Quintero
8a8915e0fd [PATCH 5/7] bgo543308 - Unconditionally compute a size based on font size
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=21166
2008-08-20 01:12:35 +00:00
Federico Mena Quintero
73fa2005fc [PATCH 4/7] bgo543308 - Emit default-size-changed when the file chooser is mapped
Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=21165
2008-08-20 01:12:13 +00:00
Federico Mena Quintero
0e386e9324 [PATCH 3/7] bgo543308 - Factor out the code to emit default-size-changed.
Only emit default-size-changed if the file chooser widget is mapped.
It only makes sense to do this once we know our final configuration,
which is actually when we are mapped.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=21164
2008-08-20 01:11:45 +00:00
Sven Neumann
b699ac5853 gtk/gtkaccellabel.c gtk/gtkaction.c gtk/gtkclist.c gtk/gtkcolorbutton.c
2008-08-12  Sven Neumann  <sven@gimp.org>

	* gtk/gtkaccellabel.c
	* gtk/gtkaction.c
	* gtk/gtkclist.c
	* gtk/gtkcolorbutton.c
	* gtk/gtkctree.c
	* gtk/gtkdialog.c
	* gtk/gtkdnd-quartz.c
	* gtk/gtkdnd.c
	* gtk/gtkentry.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkfilesel.c
	* gtk/gtkgamma.c
	* gtk/gtkiconview.c
	* gtk/gtkkeyhash.c
	* gtk/gtklabel.c
	* gtk/gtkmenu.c
	* gtk/gtkmenubar.c
	* gtk/gtkpaned.c
	* gtk/gtkrecentchooserdialog.c
	* gtk/gtkrecentchooserutils.c
	* gtk/gtkselection.c
	* gtk/gtksizegroup.c
	* gtk/gtktextbtree.c
	* gtk/gtktextbuffer.c
	* gtk/gtktextview.c
	* gtk/gtktoolbar.c
	* gtk/gtktreemodel.c
	* gtk/gtkuimanager.c
	* gtk/gtkwindow-decorate.c
	* gtk/gtkwindow.c: use canonical signal names in some more places
	that I missed earlier. Also changed this in the documentation and
	comments.


svn path=/trunk/; revision=21094
2008-08-12 14:37:03 +00:00
Michael Natterer
d9d3379698 gtk/gtkaccellabel.c gtk/gtkcalendar.c gtk/gtkclist.c gtk/gtkentry.c
2008-08-12  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkaccellabel.c
	* gtk/gtkcalendar.c
	* gtk/gtkclist.c
	* gtk/gtkentry.c
	* gtk/gtkeventbox.c
	* gtk/gtkfilechooserbutton.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkhandlebox.c
	* gtk/gtkhsv.c
	* gtk/gtkiconview.c
	* gtk/gtkimage.c
	* gtk/gtklayout.c
	* gtk/gtklistitem.c
	* gtk/gtkmenuitem.c
	* gtk/gtkmessagedialog.c
	* gtk/gtknotebook.c
	* gtk/gtkpaned.c
	* gtk/gtkpathbar.c
	* gtk/gtkplug.c
	* gtk/gtkprintunixdialog.c
	* gtk/gtkrange.c
	* gtk/gtkrecentchooserdefault.c
	* gtk/gtkruler.c
	* gtk/gtksocket.c
	* gtk/gtktext.c
	* gtk/gtktextview.c
	* gtk/gtktoolbar.c
	* gtk/gtktreeitem.c
	* gtk/gtktreeview.c
	* gtk/gtkviewport.c
	* gtk/gtkwin32embedwidget.c: chain up unconditionally in
	realize(), unrealize(), map(), unmap(), style_set(),
	key_press_event() and size_request()


svn path=/trunk/; revision=21088
2008-08-12 09:44:32 +00:00
Sven Neumann
2a95978506 gtk/gtkaboutdialog.c gtk/gtkcellrendereraccel.c gtk/gtkcellrenderercombo.c
2008-08-11  Sven Neumann  <sven@gimp.org>

	* gtk/gtkaboutdialog.c
	* gtk/gtkcellrendereraccel.c
	* gtk/gtkcellrenderercombo.c
	* gtk/gtkcellrendererspin.c
	* gtk/gtkcellrenderertext.c
	* gtk/gtkclipboard.c
	* gtk/gtkcolorsel.c
	* gtk/gtkcombo.c
	* gtk/gtkcombobox.c
	* gtk/gtkdnd-quartz.c
	* gtk/gtkdnd.c
	* gtk/gtkentry.c
	* gtk/gtkentrycompletion.c
	* gtk/gtkfilechooserbutton.c
	* gtk/gtkfilechooserdefault.c
	* gtk/gtkfilechooserentry.c
	* gtk/gtkfontsel.c
	* gtk/gtkinputdialog.c
	* gtk/gtkmenutoolbutton.c
	* gtk/gtkpathbar.c
	* gtk/gtktooltip.c: use canonical signal names in 
g_signal_connect().


svn path=/trunk/; revision=21060
2008-08-11 09:17:49 +00:00
Carlos Garnacho
7e439efc92 Deprecate gtk_file_chooser_*_new_with_backend(), since GIO is already used
2008-08-04  Carlos Garnacho  <carlos@imendio.com>

        * gtk/gtk.symbols:
        * gtk/gtkfilechooserbutton.[ch]:
        * gtk/gtkfilechooserdefault.[ch]:
        * gtk/gtkfilechooserdialog.[ch]:
        * gtk/gtkfilechooserwidget.[ch]: Deprecate
        gtk_file_chooser_*_new_with_backend(), since GIO is already used
        directly. Fixes #545976.

svn path=/trunk/; revision=20972
2008-08-04 14:43:53 +00:00
Carlos Garnacho
02c65db5c0 Make GFile-oriented API public. Fixes #545978.
2008-08-04  Carlos Garnacho  <carlos@imendio.com>

        * gtk/gtk.symbols:
        * gtk/gtkfilechooser.[ch]: Make GFile-oriented API public. Fixes
        #545978.
        * gtk/gtkfilechooserbutton.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtkfilechooserutils.c: Update to use public GFile API.

svn path=/trunk/; revision=20971
2008-08-04 14:43:05 +00:00
Michael Natterer
7f00695920 remove _gtk_binding_signal_new().
2008-07-21  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkbindings.[ch]: remove _gtk_binding_signal_new().

	* gtk/gtkfilechooserdefault.c
	* gtk/gtkmenu.c
	* gtk/gtkmenushell.c
	* gtk/gtkscalebutton.c
	* gtk/gtktextview.c
	* gtk/gtktoolbar.c
	* gtk/gtkwidget.c: use g_signal_new_class_handler() instead. Add
	some missing I_() to the signal names.


svn path=/trunk/; revision=20874
2008-07-21 09:48:20 +00:00
Matthias Clasen
ba3b08bc7b Fix a problem with context menu sensitivity
svn path=/trunk/; revision=20834
2008-07-15 05:57:39 +00:00
Matthias Clasen
128585147f Bug 541645 – gtkfilechooserdefault segfaults when bookmark does not
2008-07-06  Matthias Clasen  <mclasen@redhat.com>

        Bug 541645 – gtkfilechooserdefault segfaults when bookmark does not
        contain ://

        * gtk/gtkfilechooserdefault.c (_gtk_file_chooser_label_for_file):
        Be more robust. Reported by  Jelte van der Hoek


svn path=/trunk/; revision=20787
2008-07-06 05:34:03 +00:00
Matthias Clasen
2f1ef69fb7 Don't select the first row if the folder is empty. Patch by Olle
* gtk/gtkfilechooserdefault.c (browse_files_select_first_row): Don't
        select the first row if the folder is empty.
        Patch by Olle Bergkvist.


svn path=/trunk/; revision=20751
2008-07-03 22:40:33 +00:00
Michael Natterer
1b291602bd remove some of the million includes.
2008-07-02  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkfilechooserdefault.c: remove some of the million includes.


svn path=/trunk/; revision=20732
2008-07-02 10:14:45 +00:00
Cody Russell
57223c9a05 Revert name change
svn path=/trunk/; revision=20724
2008-07-01 22:57:50 +00:00
Cody Russell
fce9c8b7d4 Practically everything changed.
2008-06-30  Cody Russell  <bratsche@gnome.org>

        * Practically everything changed.

        Change	all references	of GIMP	Toolkit	(and variations	of it)
        to GTK+	Toolkit, showing no mercy at all to our	beloved
	ancestry. (#540529)


svn path=/trunk/; revision=20709
2008-06-30 23:01:56 +00:00
Carlos Garnacho
1732652e71 current_folder can be NULL here, do not try to reference it (Bug #540235)
2008-06-26  Carlos Garnacho  <carlos@imendio.com>

        * gtk/gtkfilechooserdefault.c
        (gtk_file_chooser_default_get_current_folder): current_folder can be
        NULL here, do not try to reference it (Bug #540235)
        (gtk_file_chooser_default_get_files): Deal better with
        gtk_file_chooser_default_get_current_folder() being able to return
        NULL.

svn path=/trunk/; revision=20687
2008-06-26 09:41:13 +00:00
Johan Dahlin
d97cdbdf53 Include "config.h" instead of <config.h> Command used: find -name
2008-06-21  Johan Dahlin  <jdahlin@async.com.br>

    * *.[ch]: Include "config.h" instead of <config.h>
    Command used:
    find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g'
    Rubberstamped by Mitch and Tim


svn path=/trunk/; revision=20669
2008-06-22 14:28:52 +00:00
Christian Persch
a58a173b48 Use gtk_drag_[dest|source]_add_[text|uri]_targets(), and simplify code. Bug #516092.
svn path=/trunk/; revision=20464
2008-06-19 12:52:40 +00:00
Christian Persch
446f41757b Use g_set_error_literal where appropriate. Bug #538640.
svn path=/trunk/; revision=20463
2008-06-19 12:47:48 +00:00
Olle Bergkvist
ad54e22fc7 bgo538784 - Don't change the filename entry in CREATE_FOLDER mode
2008-06-18  Olle Bergkvist <olle.bergkvist@yahoo.se>

	http://bugzilla.gnome.org/show_bug.cgi?id=538784 - Don't change
	the filename in the name entry in CREATE_FOLDER mode when changing
	folders, so that you can enter a new subfolder name, double-click on a
	folder to change to it, and close the dialog.

	* gtk/gtkfilechooserdefault.c (update_chooser_entry): Don't change
	the filename in the entry in CREATE_FOLDER mode, either.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=20457
2008-06-18 22:35:32 +00:00
Olle Bergkvist
666b544ddd bgo419737 - Don't clear filename entry in SAVE/CREATE_FOLDER modes
2008-06-18  Olle Bergkvist <olle.bergkvist@yahoo.se>

	http://bugzilla.gnome.org/show_bug.cgi?id=419737#c59 - The file
	chooser clears the filename entry in SAVE/CREATE_FOLDER modes when
	it shouldn't.

	* gtk/gtkfilechooserdefault.c (shortcuts_activate_iter): Don't
	clear the entry for CREATE_FOLDER either; this needs the same
	behavior as SAVE mode.
	(update_chooser_entry): Only clear the entry in OPEN/SELECT_FOLDER
	modes.

Signed-off-by: Federico Mena Quintero <federico@novell.com>

svn path=/trunk/; revision=20455
2008-06-18 22:23:39 +00:00
Matthias Clasen
d217ec4f90 Use standard icon names.
2008-06-18  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilesystem.c (_gtk_file_system_volume_render_icon):
        * gtk/gtkfilechooserbutton.c (change_icon_theme):
        (model_add_bookmarks):
        (model_update_current_folder):
        * gtk/gtkfilechooserdefault.c (shortcuts_insert_file):
        (shortcuts_reload_icons): Use standard icon names.


svn path=/trunk/; revision=20454
2008-06-18 16:22:42 +00:00
Michael Natterer
40b6173aa3 remove static integer variables which hold the number of members in
2008-06-17  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkfilechooserdefault.c: remove static integer variables
	which hold the number of members in GtkTargetEntry arrays and use
	G_N_ELEMENTS() directly instead.


svn path=/trunk/; revision=20421
2008-06-17 12:54:16 +00:00
Emmanuele Bassi
ea51ac13f8 Remove the GtkRecentManager screen dance, as it has been deprecated since
2008-06-17  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkfilechooserdefault.c:
	(gtk_file_chooser_default_init),
	(gtk_file_chooser_default_constructor),
	(gtk_file_chooser_default_screen_changed),
	(recent_start_loading): Remove the GtkRecentManager screen
	dance, as it has been deprecated since 2.12. Now we get the
	GtkRecentManager singleton whewn we create the FileChooserDefault
	instance. (Michael Natterer)

svn path=/trunk/; revision=20419
2008-06-17 12:46:12 +00:00
Michael Natterer
5337cdbb10 remove GtkTooltips member from the GtkFileChooserDefault struct.
2008-06-16  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkfilechooserprivate.h: remove GtkTooltips member from the
	GtkFileChooserDefault struct.

	* gtk/gtkfilechooserdefault.c: don't allocate and free the
	GtkTooltips.


svn path=/trunk/; revision=20396
2008-06-16 11:49:23 +00:00
Carlos Garnacho
bfe00f9b9b Return full path here as expected, not just the basename.
2008-06-15  Carlos Garnacho  <carlos@imendio.com>

        * gtk/gtkfilechooser.c (gtk_file_chooser_get_filename): Return full
        path here as expected, not just the basename.

        * gtk/gtkfilechooserdefault.c
        (gtk_file_chooser_default_update_current_folder): Ensure that we keep
        a reference to file, since it can be destroyed when switching back to
        browse mode.

        * gtk/gtkfilesystem.c (get_icon_for_special_directory): Removed, home
        and desktop directories are dealt by the filechooser as normal files,
        not volumes, so the icon for these is handled directly by GIO.
        (_gtk_file_system_volume_render_icon): Update caller.

svn path=/trunk/; revision=20393
2008-06-15 23:32:11 +00:00
Matthias Clasen
f9c7a4bbd0 Really make GtkFileSystem private by _-prefixing all functions.
* gtk/gtkfilechooserbutton.c:
        * gtk/gtkfilechooserdefault.c:
        * gtk/gtkfilechooserentry.c:
        * gtk/gtkfilesystem.c:
        * gtk/gtkfilesystem.h:
        * gtk/gtkfilesystemmodel.c:
        * gtk/gtkpathbar.c: Really make GtkFileSystem private
        by _-prefixing all functions.


svn path=/trunk/; revision=20378
2008-06-13 16:47:41 +00:00