Commit Graph

645 Commits

Author SHA1 Message Date
Benjamin Otte
6ab681c094 filechooserentry: Remove _gtk_file_chooser_entry_set_file_part()
gtk_entry_set_text() is fine.
2011-12-16 20:09:13 +01:00
Benjamin Otte
e2105c2bef filechooserentry: Modify _gtk_file_chooser_entry_get_current_folder()
The new version does not need to muck with the entry, it just extracts
the required information. It returns a reference to the folder though,
as we extract the information now instead of returning something stored.
2011-12-16 20:09:12 +01:00
Benjamin Otte
9ee577d5ee filechooserentry: Remove file_system argument
It's not needed anymore.
2011-12-16 20:09:12 +01:00
Benjamin Otte
05398b8f1a filechooserentry: Make the filesystem a construct-only argument
This allows simplifications in the code.
2011-12-16 20:09:11 +01:00
Federico Mena Quintero
830bc4304c [GtkFileChooserDefault] Don't destroy and re-create the filename entry
This is a leftover from the big rework to remove the expanded/collapsed mode
in Save mode.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-11-29 15:11:56 -06:00
Federico Mena Quintero
463c98a9d7 [GtkPathBar] Remove unused error argument
It used to be that _gtk_path_bar_set_file() would return an error if
it wasn't able to switch to the specified file, but that hasn't been
the case for a long while now, since the file chooser became async.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-11-29 15:11:54 -06:00
Benjamin Otte
5317cb1263 filechooserdefault: Don't unref value twice
Double unref was introduced in eb02dacb37

https://bugzilla.gnome.org/show_bug.cgi?id=646461
https://bugzilla.gnome.org/show_bug.cgi?id=664137
2011-11-29 20:44:57 +01:00
Alexander Larsson
c002c83ec5 Make sure we only show icons in the file selector bookmarks toolbar
This looked really bad in non-gnome settings where default is to
show text too.
2011-11-02 14:46:53 +01:00
Michael Natterer
2d3db3421f Bug 659406 - Abstract what triggers a context menu
Add gdk_event_triggers_context_menu(), using the new modifier
abstraction API. Remove _gtk_button_event_triggers_context_menu()
and port all callers.
2011-09-27 15:45:18 +02:00
Michael Natterer
0abe8ce27b gtk: remove the private GTK_NO_TEXT_INPUT_MOD_MASK
and use the new public modifier abstraction API.
2011-09-27 11:34:19 +02:00
Michael Natterer
b663f3a00b Bug 659406 - Abstract what triggers a context menu
Add _gtk_button_event_triggers_context_menu() and use it instead
of checking for event->button == 3, so context menus are invoked
correctly on the Mac.
2011-09-26 16:01:50 +02:00
Michael Natterer
286fff4e5f gtk: use GTK_NO_TEXT_INPUT_MOD_MASK also in gtkfilechooserdefault.c
(cherry picked from commit b057a311e7)
2011-09-26 16:01:50 +02:00
Federico Mena Quintero
432b7ee2bc Merge branch 'bgo593793-filechooser-recent-folders-master' 2011-09-13 15:24:37 -05:00
Federico Mena Quintero
c132b6cfc7 bgo#658600 - Don't try to focus the location entry in Recent-files mode
We don't ever start up in Search mode, so we don't need an extra check for that mode, yet.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-09-13 15:24:29 -05:00
Benjamin Otte
3d0a2d50f0 filechooser: Fix compile warning 2011-09-10 16:11:27 +02:00
Federico Mena Quintero
2476d35142 Menu item to visit the selected files in recent-files mode
This will take you to the file's folder and select the file in question.
The menu item is only available in Recently-used and Search modes, so that
you can go from files in them to the 'normal' browsing mode.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-09-05 13:31:57 -05:00
Federico Mena Quintero
668287b940 Factor out functions to create contextual menu items for the file list
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-09-05 13:22:01 -05:00
Matthias Clasen
676316bbd3 Avoid warnings when widgets are not created yet
This widget is created on-demand, so we can not unconditionally
set its sensitivity in some other place.
2011-08-28 22:30:24 -04:00
Matthias Clasen
5b97a58230 GtkFileChooserDefault: Replace GtkTable by GtkGrid 2011-08-28 00:47:24 -04:00
Federico Mena Quintero
52711beba5 Merge branch 'bgo593793-filechooser-recent-folders-master' 2011-08-26 12:44:40 -05:00
Federico Mena Quintero
a265fb763b bgo#657186 - Sort the recent-files list in newest-to-oldest order
Otherwise it's not very useful... :)

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-08-26 12:44:24 -05:00
Federico Mena Quintero
3bd037b7d9 Load and populate the recent-items in a single pass
There's no real asynchronicity going on, anyway, so let's do both within
a single iteration of the idle handler.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-08-26 12:44:22 -05:00
Federico Mena Quintero
e9c0faba42 Don't sort the recent-items by hand
The mtime from GtkRecentManager may not the same as the file's actual
mtime, so the final result could appear unsorted to the user.  Instead,
we will let the view do the sorting.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-08-26 12:44:21 -05:00
Arx Cruz
c9023cadbf [filechooser] bgo#349502: Context menu option to copy selected files to the clipboard 2011-08-23 17:10:03 -05:00
Federico Mena Quintero
af00ca81e1 Merge branch 'bgo593793-filechooser-recent-folders-master' 2011-07-27 18:56:39 -05:00
Federico Mena Quintero
9112cb4dfa Set the location mode when changing the operation mode
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:56:27 -05:00
Federico Mena Quintero
80d0efd94a Switch to OPERATION_MODE_BROWSE when switching to volume or file shortcuts
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:56:22 -05:00
Federico Mena Quintero
ff95a79d98 Remove the unused, initial-text logic from the location entry
Years ago, when the location entry only appeared in a popup window, it used to appear
populated with the current folder's path.  We had some logic to do this, but since now
the location entry appears in the main dialog, we can do away with that old code.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:56:18 -05:00
Federico Mena Quintero
fa2e287687 Create the location_entry in a single function
We had duplicated code to create the entry in two cases, for Open and for Save modes.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:56:15 -05:00
Federico Mena Quintero
9ed65c5620 Only unset the entry's contents if the entry exists
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:56:11 -05:00
Federico Mena Quintero
6c31de64b3 Discard the search widgets in a separate function
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:56:06 -05:00
Federico Mena Quintero
3de864cfff Move the widgets above the hpaned to their own box
This way we can re-create the contents of that box easily without disrupting
the rest of the file chooser.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:56:02 -05:00
Federico Mena Quintero
c1fbdb4fd0 Make operation_mode_set() handle SEARCH and RECENT modes as well
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:55:58 -05:00
Federico Mena Quintero
cccf35f862 Centralize changing the operation mode in operation_mode_set()
This will be the central function to switch operation modes:  stop searches or the recent-files
process; switch widgets, etc.

We factor out the common code from recent_switch_to_browse_mode() and search_switch_to_browse_mode(),
and remove those functions.  All the code that switched modes by hand now calls
the central operation_mode_set().

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:55:54 -05:00
Federico Mena Quintero
7726276fe9 Remove duplicated code from *_switch_to_browse_mode()
That code indeed lives in operation_mode_stop(), so use it instead of
having inlined duplicates.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:55:50 -05:00
Federico Mena Quintero
9e6e6575de Rename stop_operation() to operation_mode_stop()
We'll now prefix functions to change the impl->operation_mode with 'operation_mode',
for clarity.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:55:45 -05:00
Federico Mena Quintero
8962e0383f Save selection to recent-files in the asynchronous Save cases
Various paths in SAVE or CREATE_FOLDER return from ::should_respond() but
leave an asynchronous process running.  This process checks some things
in the user's selection, for example, 'does the file exist, and if so
do we need to bring up an overwrite-confirmation dialog?'.  When these
async processes complete *and* it is indeed time for the dialog to
be terminated (via the response-requested signal), we also need to
save the selection to the recently-used list - as ::should_respond() does
by itself in the cases when it can request a response immediately.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:54:52 -05:00
Federico Mena Quintero
7985ab786d Log to recent-files when confirming the file chooser
To make life easier for users, when apps don't properly update the recently-used list
after choosing a file, we now do that directly from the file chooser.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-27 18:54:42 -05:00
Ryan Lortie
4ead7b69ea Switch to g_format_size()
g_format_size_for_display() has been deprecated in GLib and replaced with
g_format_size().  Follow that change.
2011-07-20 20:22:26 +02:00
Federico Mena Quintero
b53f602891 Save selection to recent-files in the asynchronous Save cases
Various paths in SAVE or CREATE_FOLDER return from ::should_respond() but
leave an asynchronous process running.  This process checks some things
in the user's selection, for example, 'does the file exist, and if so
do we need to bring up an overwrite-confirmation dialog?'.  When these
async processes complete *and* it is indeed time for the dialog to
be terminated (via the response-requested signal), we also need to
save the selection to the recently-used list - as ::should_respond() does
by itself in the cases when it can request a response immediately.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-13 16:39:12 -05:00
Federico Mena Quintero
f1ca0eebc6 Log to recent-files when confirming the file chooser
To make life easier for users, when apps don't properly update the recently-used list
after choosing a file, we now do that directly from the file chooser.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-12 11:36:19 -05:00
Benjamin Otte
ccaa0af7d0 filechooser: Fix set-but-not-used warning from gcc 2011-07-09 21:24:41 +02:00
Federico Mena Quintero
894be790bf Hide the Create Folder button in recent-files mode when the pathbar is on
The create-folder machinery doesn't handle that case yet; we may enable it later
once we figure out the implications for the GUI.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:12 -05:00
Federico Mena Quintero
6bb34d7dd4 Centralize the setting of the pathbar's widgets
It used to be that every part of the file chooser's code would show/hide the widgets
near the pathbar as needed.  Now we have two central functions:

  path_bar_update()
  path_bar_set_mode()

These take care of all the widget shuffling;  setting the visibility of the
pathbar, info bar, and Create Folder button as appropriate; setting the contents
of the info bar, etc. - based on the current operation_mode and action.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:12 -05:00
Federico Mena Quintero
18ebec28c9 Create the recently-used widgets and infobar from the pathbar widgets as well
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:12 -05:00
Federico Mena Quintero
3b2e4623f3 Move the pathbar creation to its own function
We will centralize the place where all the pathbar-related widgets are created:
the location button, the pathbar itself, the Create Folder button, and in
subsequent commits, the info bar as well.  We will deal with the pathbar/infobar
as a unit, instead of swapping them in and out in an ad-hoc fashion.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:12 -05:00
Federico Mena Quintero
4d9fdb1c1b Warn the user when he still needs to type a filename or choose a folder
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:11 -05:00
Federico Mena Quintero
b442a3a4ea Return the recent-folder plus filename in Save mode from get_files()
Since the GtkFileChooserEntry already gets the recent-folder set upon it when a recent-folder
is selected, it already can give us the correct fully-formed path.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:11 -05:00
Federico Mena Quintero
1af579b1a2 Set the filename entry's base folder when a recent-folder is selected
This lets the filename entry do completion relative to the selected recent-folder.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:11 -05:00
Federico Mena Quintero
064ff39ad7 Instruct the user to pick a folder when nothing is selected in the recent-folders list
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2011-07-01 19:07:11 -05:00