Commit Graph

10515 Commits

Author SHA1 Message Date
Matthias Clasen
469c9a4da3 Emit row-changed notification
Emit row-changed when the filteredness of a visible row
changes in GtkFileSystemModel.
2016-03-10 15:15:39 -06:00
Federico Mena Quintero
5c78a27a8b Make computing and setting the visibility/filters atomic operations
This way we remove paired function calls (compute/set pairs), and also make
it possible to avoid computing a filter twice, as setting the visibility
depends on filteredness.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2016-03-10 15:15:39 -06:00
Federico Mena Quintero
2d1c7e1258 Make it clear that 'filtered' means 'filtered_out'
It bothers me that we call gtk_file_filter_filter(), then negate the result,
and the return *that* from node_should_be_filtered().  So, rename 'filtered'
throughout GtkFileSystemModel to 'filtered_out' to mean things that didn't
pass the filter.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2016-03-10 15:15:39 -06:00
Federico Mena Quintero
400f7ec194 Remove superfluous check in node_set_filtered()
This was a copy-paste leftover from node_set_visible().  Filters are not
concerned with model freezes, so node_set_filtered() does not
need to handle freezes, either.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2016-03-10 15:15:39 -06:00
William Jon McCann
5c03d6a943 Desensitize filtered folders when in folder selection mode
https://bugzilla.gnome.org/show_bug.cgi?id=679333
2016-03-10 15:15:39 -06:00
Benjamin Otte
545df1a742 filesystemmodel: Add a toggle for whether directories are filtered 2016-03-10 15:15:38 -06:00
Benjamin Otte
0f4e67df68 filesystemmodel: Add a missing check
Paths with depth > 1 should return FALSE instead of pretending the depth
is 1.
2016-03-10 15:15:38 -06:00
Federico Mena Quintero
55764dddcf Make _gtk_entry_completion_compute_prefix() public-internal 2016-03-10 15:15:38 -06:00
Federico Mena Quintero
c1f8305622 Sync missing comment 2016-03-10 15:15:38 -06:00
Matthias Clasen
05adbbbc01 Remove debug spew 2016-03-10 15:15:38 -06:00
Matthias Clasen
a17e23b8ca file chooser entry: Special-case ., .. and ~
Make sure entering the three special strings ".", ".." or "~" in
the location entry works as expected. They already worked correctly
if you append a '/' to force them to be recognized as the 'folder'
part, but that should not be necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=752707
2016-03-10 15:15:38 -06:00
Matthias Clasen
2f9ea1c444 Formatting fix 2016-03-10 15:15:38 -06:00
Matthias Clasen
b7fa0f2193 Avoid a critical in the file chooser
Hiding the location entry was causing criticals, because
the completion was updated after the widget has already
been disposed.
https://bugzilla.gnome.org/show_bug.cgi?id=720330
2016-03-10 15:15:38 -06:00
Federico Mena Quintero
f27c1f45b7 GtkFileChooserEntry: don't inline-complete if the entry doesn't have the focus
When the file chooser changes directories, it tells the GtkFileChooserEntry to
change its base folder (i.e. the folder from which relative pathnames are resolved).
GtkFileChooserEntry then starts loading a GtkFileSystemModel asynchronously.
In the finished_loading_cb(), however, it would always ask the GtkEntryCompletion
to insert the completion prefix, since that finished_loading_cb() is what is also used
while the user is typing *in the entry*.

But when the entry doesn't have the focus (e.g. the user changed directories by double-clicking
on the file list in the file chooser), there's no reason to insert completions at all.

https://bugzilla.gnome.org/show_bug.cgi?id=672271
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2016-03-10 15:15:38 -06:00
Timothy Arceri
616172d133 filechooser: Show FUSE mounted locations in shortcuts
Since FUSE locations can be handled safely by applications show these mounted locations regardless of whether gtk_file_chooser_set_local_only()
is set to TRUE

https://bugzilla.gnome.org/show_bug.cgi?id=586367

Conflicts:
	gtk/gtkfilechooser.c
	gtk/gtkfilechooserdefault.c
	gtk/gtkfilesystem.c
	gtk/gtkfilesystem.h
2016-03-10 15:15:38 -06:00
Matthias Clasen
5fe689ace8 filechooser: Fix entry completion
Inserting the selected completion did not actually work. Oops.

https://bugzilla.gnome.org/show_bug.cgi?id=673090
2016-03-10 15:15:38 -06:00
Benjamin Otte
b65de86fe8 filechooserentry: Catch tab key earlier
Instead of in the key_press handler, use a signal handler. The signal
handler runs before the default handler, and before other signal
handlers. In particular it runs before the signal handler installed via
gtk_entry_set_completion() which pops down the entry completion, and we
don't want that to happen.

The code does not change the code of the handler in any significant way,
it just refacotrs it to not call the parent anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=663573

Conflicts:
	gtk/gtkfilechooserentry.c
2016-03-10 15:15:38 -06:00
Benjamin Otte
dd255913f3 filechooserentry: Do inline completion only when opening files
When saving files, using <tab> is required. We don't want the UI
randomly changing filenames from below us.

https://bugzilla.gnome.org/show_bug.cgi?id=663573
2016-03-10 15:15:38 -06:00
Benjamin Otte
fae77435e5 filechooserentry: Remove unused enum 2016-03-10 15:15:38 -06:00
Benjamin Otte
7e65600118 filechooserentry: Allow NULL as base folder again
This was removed previously, but is necessary to support the case where
no base folder is in use, which should cause an error. This can be
experienced in save mode in the recent files list.

https://bugzilla.gnome.org/show_bug.cgi?id=663573
2016-03-10 15:15:38 -06:00
Benjamin Otte
ca22beb670 filechooserentry: Don't show files when selecting directory
We don't want to complete on files when they're not supposed to be
selectable.
2016-03-10 15:15:37 -06:00
Benjamin Otte
4d33adc132 filechooserentry: Remove beep function
There's only 2 places left where we potentially beep. We can call
gtk_widget_error_bell() directly there.
2016-03-10 15:15:37 -06:00
Benjamin Otte
4d59042b68 filechooserentry: Simplify load completion
Most importantly, consistently trigger a beep when we abort a pending
completion.
2016-03-10 15:15:37 -06:00
Benjamin Otte
6a94cedee3 filechooserentry: Use a GtkFileFilter for filtering
That way, we can use the regular filtering features of the
filesystemmodel instead of having our own filtering function that
duplicates much of the matching code.

This also removes the broken-on-windows feature where files strting with
a dot were not autocompleted.

Conflicts:
	gtk/gtkfilechooserentry.c
2016-03-10 15:15:37 -06:00
Benjamin Otte
ea2129fda1 filechooserentry: Remove the file column
It is not needed anymore.
2016-03-10 15:15:37 -06:00
Benjamin Otte
af39ce608b filechooserentry: Simplify code
Use all the clever functions we invented in recent refactorings to
compute the file and dir part and the current folder.

This also fixes the bug where "./" was not taken as the current
directory but interpreted as a file named "./".
2016-03-10 15:15:37 -06:00
Benjamin Otte
c351227a9d filechooserentry: Refactor function
Name the function set_completion_folder() and make it accept NULL, so it
behaves like a regular setter function.
2016-03-10 15:15:37 -06:00
Benjamin Otte
1945577a61 filechooserentry: Set minimum key length to 0
We want the empty chooser to show possible completions, too.
2016-03-10 15:15:37 -06:00
Benjamin Otte
83dd275d21 filechooserentry: Simplify refresh_current_folder_and_file_part()
The function can get the text it's refreshing from itself, as there is
only one possible value. And it doesn't need to return a value anymore.
2016-03-10 15:15:37 -06:00
Benjamin Otte
dbb59f3dc4 filechooserentry: Get rid of unused member variable
in_change isn't set anymore.
2016-03-10 15:15:37 -06:00
Benjamin Otte
33fffa727a filechooserentry: Remove _gtk_file_chooser_entry_set_file_part()
gtk_entry_set_text() is fine.
2016-03-10 15:15:37 -06:00
Benjamin Otte
ef5088f879 filechooserentry: Use completion for completion
Reduce the amount of code even more by using the entry completion to
query the prefix.
2016-03-10 15:15:37 -06:00
Benjamin Otte
87a67aa0e3 filechooserentry: Add gtk_file_chooser_entry_get_completion_text()
This returns the text that should be completed on. As this is somewhat
tricky to compute (and in fact one place did it wrong), let's make it a
function.
2016-03-10 15:15:37 -06:00
Benjamin Otte
8a4dda06fe filechooserentry: Don't update the folder when completing
The folder is always up to date, there's no need to update it. (If the
folder is not up to date, that is a bug and needs to be fixed
elsewhere.)
2016-03-10 15:15:37 -06:00
Benjamin Otte
6ae5aa7429 filechooserentry: Don't override activate
The code is no longer necessary, because the relevant parts for inline
completion are now handled by GtkEntry.
2016-03-10 15:15:37 -06:00
Benjamin Otte
310b484eee filechooserentry: Simplify append_common_prefix()
Now that we don't need to know anymore why insertion failed, we can
simplify the append function quite a lot.

A simple rule now: If we did not insert anything, beep.
2016-03-10 15:15:37 -06:00
Benjamin Otte
75be2cca58 filechooserentry: Remove completion feedback
Too much special code for no gain.

I did a totally unscientific questionnaire on GNOME IRC (assuming
autocompletion is for advanced users) and nobody even knew what this is.
So I suspect it's useless. Also, it's positioned completely wrong anyway
and nobody noticed so far. Last but not least, I'm trying to imitate
bash here and bash doesn't show feedback.

Conflicts:
	gtk/gtkfilechooserentry.c
2016-03-10 15:15:37 -06:00
Benjamin Otte
8a9a377527 filechooserentry: Redo completion popup trigger
Use dispatch_properties_changed() instead of GtkEditable to watch for
changes to the to-be-completed text. This is necessary because various
functions in GtkEntry don't use the interface vfuncs and one only
becomes aware of them via notifications. I'm not sure this is intended
behavior, but it's how it works today.
Also, use the same code for triggering in all situations.

What the code does is this: It looks at the part of the text in front of
the cursor (or selection) and completes for it. Once the directory has
been enumerated, inline completion is activated. Note that popping up of
the completion popup is completely handled by GtkEntry.

Conflicts:
	gtk/gtkfilechooserentry.c
2016-03-10 15:15:37 -06:00
Benjamin Otte
7570e54212 filechooserentry: Get rid of RefreshMode
Instead, pass the text to use to refresh_current_folder_and_file_part().
This also gets rid of the problem introduced earlier that the position
is not properly updated in do_insert_text() and therefor the completion
is wrong.
2016-03-10 15:15:37 -06:00
Benjamin Otte
46adc18c1d filechooserentry: Use inline completion
... from GtkEntryCompletion instead of implementing a poor copy
ourselves. This also makes the file chooser entry behave a lot closer to
normal entries.

Conflicts:
	gtk/gtkfilechooserentry.c
2016-03-10 15:15:36 -06:00
Benjamin Otte
ad88e6d5c6 filechooserentry: Merge function 2016-03-10 15:15:36 -06:00
Benjamin Otte
3bf9b56234 filechooserentry: Set the text column of the entry completion
I want to use it in the next commits, but am doing this in a separate
commit so we can find side effects causing bugs easier when bisecting.
2016-03-10 15:15:36 -06:00
Benjamin Otte
755d8163ea filechooserentry: Simplify match_selected function
Conflicts:
	gtk/gtkfilechooserentry.c
2016-03-10 15:15:36 -06:00
Benjamin Otte
83421a5f8e filechooserentry: Keep an extra column for the full path
This is identical to the display name when not having a path that
changes the folder. Otherwise it will have the full path that was
entered in the entry. Say when from your home dir, you type
"../../usr/li", the full path for "lib" and "lib64" will be
"../../usr/lib" and "../../usr/lib64" respectively. This value isn't
used yet, but will be soon.
2016-03-10 15:15:36 -06:00
Benjamin Otte
a0ee779cc2 filechooserentry: Redo _gtk_file_chooser_entry_get_file_part()
The new version does not need to update any text, it just strips the
last part of the existing entry.
2016-03-10 15:15:36 -06:00
Benjamin Otte
877e238133 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.
2016-03-10 15:15:36 -06:00
Benjamin Otte
143306a515 filechooserentry: Split out function
I want to use that function elsewhere, so split it out.
2016-03-10 15:15:36 -06:00
Benjamin Otte
623c3a6aec filechooserentry: Simplify code
Now that the base folder is always != NULL, we can remove the parts of
the code that check for NULL.
2016-03-10 15:15:36 -06:00
Benjamin Otte
39dbcbab97 filechooserentry: Ensure the base folder is always valid
If the base folder is set to NULL, then we just assume the home dir.
FIXME: Should we disallow a NULL folder?
2016-03-10 15:15:36 -06:00
Benjamin Otte
02705bce36 filechooserentry: Don't complain about incomplete hostnames
First of all, those hostnames may very well be complete, second of all,
smb:// is a valid uri to enter.
2016-03-10 15:15:36 -06:00
Benjamin Otte
f0573f8b42 filechooserentry: Start autocomplete immediately
Don't do idle handlers for this.

Conflicts:
	gtk/gtkfilechooserentry.c
2016-03-10 15:15:36 -06:00
Benjamin Otte
a8c766991a filechooserentry: Remove file_system argument
It's not needed anymore.
2016-03-10 15:15:36 -06:00
Benjamin Otte
ce8d0599dc filechooserentry: Simplify code
Now that we've imported the function in the last commit, rename it and
omit useless arguments by instead passing in the entry directly.
2016-03-10 15:15:36 -06:00
Benjamin Otte
c2978cc394 filechooserentry: Move _gtk_file_system_parse()
It's very specific to the file chooser entry, so it's better kept there.
It's also not used anywhere else in the code.

Also, remove _gtk_file_system_get_folder() as it's no longer used.

Conflicts:
	gtk/gtkfilesystem.h
2016-03-10 15:15:36 -06:00
Benjamin Otte
85563ccd35 filechooserentry: Use a GtkFileSystemModel
Replace the usage of a list store and a GtkFolder with a
GtkFileSystemModel. This improves performance and reduces code size.

Conflicts:
	gtk/gtkfilechooserentry.c
2016-03-10 15:15:30 -06:00
Benjamin Otte
88810509ca filechooserentry: Store the liststore as a treemodel
Just changes the type of the member variable. This way we can avoid a
lot of casts.
2016-03-08 20:45:31 -06:00
Benjamin Otte
c94e902894 filechooserentry: Make appending / to directories simpler 2016-03-08 20:45:17 -06:00
Benjamin Otte
5280da05ee filechooserentry: Only append / to directory names once
Since 069d78ed31 the / is appended to
directories upon constructing the display name, so there is no need to
do it later.
2016-03-08 20:45:13 -06:00
Benjamin Otte
29d7464922 filechooserentry: Don't trim away the slash after directories
It's not necessary as the code appending the slashes checks for a slash
these days.
2016-03-08 20:45:04 -06:00
Benjamin Otte
fc84c3e02e filechooserentry: Fold in start_loading_current_folder()
The function just did one thing, we can just fold it into the only
caller.

Conflicts:
	gtk/gtkfilechooserentry.c
2016-03-08 20:44:43 -06:00
Benjamin Otte
82a1d9fb18 filechooserentry: The file system cannot be NULL
Remove code that checked this.
2016-03-08 20:43:02 -06:00
Benjamin Otte
707aadf6b1 filechooserentry: Make the filesystem a construct-only argument
This allows simplifications in the code.
2016-03-08 20:42:30 -06:00
Benjamin Otte
bdb4727f7f filechooserentry: Keep finished_loading variable ourselves
This will be useful in the next commits when the GtkFolder code
previously keeping that variable gets repalced.
2016-03-08 20:42:09 -06:00
Benjamin Otte
0e6d18eaef filechooserentry: force_reload is never TRUE
.. so remove it.
2016-03-08 20:42:03 -06:00
Benjamin Otte
9c5b7b7892 filechooserentry: Fold function into other
There's no need to discard the current folder's file without also
discarding the folder object.
2016-03-08 20:41:57 -06:00
Benjamin Otte
aff9158d41 filechooserentry: Reorganize function
Setter functions the way I code it look like this (in order):
1) Figure out if the value changed. If not, exit early.
2) Clear the old value (ie unref stuff, disconnect signals
3) Copy the new value
4) Set up things about the new value

This reorganization does that.

And by doing that, it even reduces the amount of code and the amount of
branches (and with it, nesting) needed.
2016-03-08 20:41:49 -06:00
Benjamin Otte
a82a166700 filechooserentry: Use the actual discarding function to discard a folder 2016-03-08 20:41:42 -06:00
Benjamin Otte
6d184e9707 filechooserentry: Don't use a magic number
... when we have a proper enum value for a column.
2016-03-08 20:41:34 -06:00
Ken VanDine
5fb443d236 Include <package/> tag in generated GIR
Specify pkg-config name when generating GIR files, used for mapping GIR
name to pkg-config names

https://bugzilla.gnome.org/show_bug.cgi?id=635287
2016-03-07 18:09:49 +01:00
Dariusz Gadomski
674d0eb7e9 printing: Properly initialize auth_info in gtkprintbackend.c
auth_info should be a NULL-terminated array as it is used in
e.g. g_strdupv invocations iterating over its elements until
a NULL element is encountered.

https://bugzilla.gnome.org/show_bug.cgi?id=737777

(cherry picked from commit 15dbadf38992aa09364f0dd06a71a51b99b6e800)
2016-03-07 17:56:41 +01:00
Matthias Clasen
2289695b69 status icon: Prevent size dithering
We're seeing loops where the size of some status icons constantly
dithers between 24 and 25. Since I couldn't track down exactly
where the one extra pixel comes from, just stop reacting
to single-pixel size changes.

https://bugzilla.gnome.org/show_bug.cgi?id=758893
2016-03-05 12:16:08 -05:00
Matthias Clasen
e7a1afc74d Fix the build against current gdk-pixbuf
The GdkPixdata APIs have been deprecated, lets not fail the build
due to that.
2016-03-05 10:59:55 -05:00
John Ralls
ce05d6608c Fix typo. 2016-02-21 16:25:12 -08:00
John Ralls
99db4164bc Fix Quartz clipboard image retrieval.
It does no good to iterate through a series of mime types to call a
function when the eventually-called function,
_gtk_quartz_get_selection_data_from_pasteboard() in this case, gives the
wrong answer and stops the iteration on all but one especially if that
one isn't first.

The one is "image/tiff" and the quartz pasteboard function will return
any image type Quartz knows about for it, so lose the iteration and use
only "image/tiff".
2016-02-11 13:49:07 -08:00
Emmanuele Bassi
383673643b Avoid a false positive deprecation notice
The comment on the #endif is tripping the deprecation state inside
the gtk-doc parser for gtk_container_get_children().
2016-01-25 10:43:30 +00:00
Matthias Clasen
748900071e Fix interaction between scrolling menus and automatic mnemonics
https://bugzilla.gnome.org/show_bug.cgi?id=612611
2016-01-19 23:51:03 +01:00
Chun-wei Fan
339fd3d3f6 Clean Up MSVC Project Generation
Use the common autotools module that was added in the last commit so that
we can clean up the various Makefile.am's in gdk/ and gtk/, and also
make more Visual Studio projects completed during 'make dist', by adding
minimal items to those other Makefile.am's.  This also allows us to make
the property sheets that does the copying of headers and built items
completed at 'make dist', so that we won't have to worry too much about
headers being added (although it would be unlikely for GTK+-2.x).
2015-12-15 16:44:47 +08:00
Matthias Clasen
c4d8fba455 Annotate GtkColorButton get_color
This is a backport of the corresponding change in gtk+ 3.

http://bugzilla.gnome.org/show_bug.cgi?id=754046
2015-08-25 23:46:58 -04:00
Ting-Wei Lan
46c28bd54d Makefiles: Fix parallel installation for MinGW
Make sure that the destination exists before installing files.

https://bugzilla.gnome.org/show_bug.cgi?id=753691
2015-08-19 10:38:39 +08:00
Paolo Borelli
783afbd64f print operation: let subclasses use a custom paginate
GtkPrintOperation was emitting paginate only if a signal was
connected, this meant that subclassing and overriding the
paginate vfunc lead to the unexpected result that paginate did
not run.
Instead we always emit the signal and use a custom accumulator:
if there is a signal we just run that and avoid the default
handler, otherwise we run the default handler which can be the
one by the subclass or the default handler that just skips
pagination.

Patch by Yevgen Muntyan, fixes #345345
2015-08-18 15:46:21 -04:00
Matthias Clasen
b2a79ef73c File chooser: Fix a crash on dnd in sidebar
We were crashing when reordering the sidebar by dnd.

https://bugzilla.gnome.org/show_bug.cgi?id=745127
2015-07-30 21:58:07 -04:00
Matthias Clasen
5c92821ace quartz: Implement NO_TARGET drag result
This is necessary to make notebook tab DND work.

https://bugzilla.gnome.org/show_bug.cgi?id=752638
2015-07-26 02:17:44 -04:00
Matthias Clasen
dd882f5b80 Fix a sporadic segfault in treeview keynav
If a a treeview has frequent periodic additions and removals of
rows, it is possible that a page down keypress moves the cursor
out of the height of the treeview. In some of these cases, we
can be tricked into dereferencing a  NULL pointer.

Bug 612919.

https://bugzilla.gnome.org/show_bug.cgi?id=746269
2015-03-16 12:34:44 -04:00
Daniel Drake
c5afe319ad icontheme: allow directories with mtime 0
In order to provide a constant mtime between OS build and deploy time,
while also maintaining a hardlink content-addressed model independent of
timestamps, ostree sets all mtimes to 0.

The icon cache code currently ignores directories with mtime 0, assuming
they don't exist.

Track directory existence in a more precise way.

https://bugzilla.gnome.org/show_bug.cgi?id=745052
2015-02-23 16:51:23 -06:00
Arnav Singh
e01cc5bf5f statusicon: fix crash storing pointer in UINT
https://bugzilla.gnome.org/show_bug.cgi?id=696505
2015-02-21 15:58:41 +01:00
Matthias Clasen
6931981114 label: Avoid a possible NULL dereference
We were setting attr->start before checking attr for being NULL.

Pointed out by Sami Farin,
https://bugzilla.redhat.com/show_bug.cgi?id=1140414
2015-02-13 13:39:47 -05:00
Lars Uebernickel
436fe38cae Add support for loading gtk2-only modules
Introduce GTK2_MODULES environment variable for modules that don't work
in gtk3. The list of modules is now $GTK2_MODULES:$GTK_MODULES.

https://bugzilla.gnome.org/show_bug.cgi?id=743917
2015-02-04 13:43:49 +01:00
Matthias Clasen
43ece862f3 Disable deprecation warnings for tests
This is a change in newer GLib which breaks make check if we
don't disable it.
2014-10-10 11:46:36 -04:00
Sebastian Gerhardt
d9164e9c60 gdk_drawable_get_screen() used for mask, which is a pixmap, not a window
The function gtk_drag_set_icon_pixmap() triggered failing assertions. This was because it called the function gdk_window_get_screen(mask), where "mask" is a pixmap, but not a window.

https://bugzilla.gnome.org/show_bug.cgi?id=735005
2014-08-20 21:46:08 -04:00
Руслан Ижбулатов
d0c0d657b4 Embed manifest into gtk-update-icon-cache.exe
https://bugzilla.gnome.org/show_bug.cgi?id=705054
2014-08-02 10:51:57 +00:00
Matthias Clasen
3c8f0c44e1 GtkEntry: Properly remove the completion timeout
There were some code paths where we removed the source, but
failed to reset the id to zero.

Pointed out by John Coppens in
https://bugzilla.gnome.org/show_bug.cgi?id=733689
2014-07-29 12:23:13 +02:00
Andreas Müller
0b5b2779a2 GtkButton: do not prelight in touchscreen mode
Code was copied from GtkToggleButton.

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=689138
2014-07-20 02:33:22 -04:00
Matthias Clasen
72c472287b Include image data in the builtin icon cache 2014-06-23 11:08:14 -04:00
Matthias Clasen
30f2428671 gtk-update-icon-cache: Add an --include-image-data option
Now that we don't include the image data by default anymore,
lets add an option that  does it.

Conflicts:
	docs/reference/gtk/gtk-update-icon-cache.xml
2014-06-17 12:59:37 -04:00
Jasper St. Pierre
85fe78ed21 updateiconcache: Don't include image data by default anymore
Since large images are in the icon cache, and apps don't tend to use that
many icons anymore, simply don't include image data and instead make apps
load files from disk. Additionally, since they're stored in GdkPixbuf data,
that means that we have to first convert them either to a cairo_surface_t,
which requires converting pixel data to be premulitplied, or an OpenGL
texture, which requires a whole GPU upload anyway.

So, even with the icon cache, the goal of icons through zero-copy, mmap()'d
data from disk just isn't doable with the icon cache format we have. The
icon cache on my disk is nearing 100MB, since we include a bunch of
high-resolution application icons, that I doubt would be used by apps at all.
Removing this inefficient pixel data makes memory usage for all applications
go down, with no speed loss.

The icon cache also, however, has an index of what icons are in each folder,
which prevents a readdir() and allows GTK+ to know what icon is where without
having to do a bunch of stat(); calls. Keeping this data is good for GTK+,
so we should still keep the index.

It doesn't make sense to remove any code for mapping pixel data from the icon
cache. There's a plan in the works to have a symbolic icon cache that does
pixel math on 16x16 icons to prevent slow SVG rendering. 16x16 pixels are
fairly small, and such images are flat colors, which should compress easily,
so the icon cache would be worthwhile here. So let's keep the code around
in preparation for that case.

https://bugzilla.gnome.org/show_bug.cgi?id=721895
2014-06-17 12:58:33 -04:00
Matthias Clasen
c9da8bddca GtkMountOperation: Clean up a dangling signal handler
Based on a patch by Eugene Shatokhin,
https://bugzilla.gnome.org/show_bug.cgi?id=723366
2014-05-06 13:38:50 -04:00
Michael Natterer
1f8d021d30 treeview: properly remove the timeout in expand_collapse_timeout()
or it will later warn about removing a source that doesn't exist.
2014-04-02 00:04:50 +02:00
Mike Gorse
60189143a4 Print to a file in the current directory by default
When printing to a file, the filename was not being propagated if a
directory was not specified.

https://bugzilla.gnome.org/show_bug.cgi?id=711177
2014-03-18 10:34:21 -05:00
Marek Kasik
378ea9029f printing: Fail nicely when /tmp is not writable
Don't crash when /tmp is not writable when printing to file.
Show that getting of printer details failed for CUPS printers.

https://bugzilla.gnome.org/show_bug.cgi?id=693200
2014-03-18 16:02:04 +01:00
Hans Breuer
82310d48a8 Bug 634146 - Check g_win32_get_package_installation_directory_of_module() return value
Remaining part of patch from Joshua Element Green.

https://bugzilla.gnome.org/show_bug.cgi?id=634146
2014-03-16 13:59:06 +01:00
Matthias Clasen
ba2dc98760 Update docs for GtkEntry::activate
Remove the 'you shall not connect' message from this signal.
While it is a keybinding signal, using it from applications is
fine and, in fact, expected.
2014-01-22 01:39:27 -05:00
Giovanni Campagna
b7c6954f6f GtkFileChooser: fix documentation
https://bugzilla.gnome.org/show_bug.cgi?id=722496
2014-01-18 16:14:17 +01:00
Federico Mena Quintero
a0a005def7 filechooser: Document the settings keys
This is so people can modify gnome-tweak-tool or whatever without directly diving into
the source.
2014-01-06 15:05:44 -06:00
John Ralls
2c01e7e78d Bug 651224 - Potential NULL display ptr from quartz gtk_clipboard_wait_for_contents 2013-12-09 11:38:51 -06:00
Benjamin Otte
b7ab0ed129 iconfactory: Initialize varibale to NULL in failure path
Otherwise we use random memory and that is not good.
2013-12-06 12:02:22 -05:00
Matthias Clasen
4f47aa6ef5 GtkFileChooser: avoid a memory leak
The directory enumeration code was leaking references to
GtkFolder objects.

https://bugzilla.gnome.org/show_bug.cgi?id=705367
2013-12-01 17:13:01 -05:00
Matthias Clasen
3d0abd5cb0 Remove an unused struct member
AsyncFuncData.folder was entirely unused. Drop it.
2013-12-01 16:56:54 -05:00
Matthias Clasen
e09719b12d Prevent a possible warning
When doing updates, gtk_progress_bar_real_update can calculate
compute a negative value for activity_pos.

If the allocation width is smaller than (xthickness + size),
pbar->activity_pos will be set to a negative value and this will
cause the drawing code to emit a warning about coordinates being
out of bounds.

Prevent this by keeping the value at least 0.

https://bugzilla.gnome.org/show_bug.cgi?id=701751
2013-11-09 23:51:50 -05:00
Matthias Clasen
1b8d3b9210 Actually look in /usr/share/gtk-2.0 for default rc files
I managed to forget the 'share' component of the path.
2013-09-30 12:51:39 -04:00
Matthias Clasen
c915afe98c Disable filechooser test
It does't work in make distcheck.
2013-09-17 10:45:29 -04:00
Matthias Clasen
b81e8de3ff Make filechooser test pass 2013-09-17 10:21:58 -04:00
Matthias Clasen
956f5e3f6b Fix config dir <> data dir confusion
We added code to look for gtkrc in system config dirs,
and then proceeded to move it to /usr/share/gtk-2.0 :-(.
So, look in that location as well.
2013-09-06 09:49:54 -04:00
David King
eb3d9dc3dd combobox: Add missing Since tags for entry constructors 2013-08-22 20:26:39 +01:00
Matthias Clasen
d33c1cf412 Limit includes in gtksignal.h
https://bugzilla.gnome.org/show_bug.cgi?id=536767
2013-07-29 22:34:53 -04:00
John Ralls
12fe6a9a1a Bug Bug 703789 - gtk.immodules still referenced
After switch to immodules.cache
2013-07-28 13:59:55 -07:00
Jehan
561d1c6358 gtkdialog - more informative warning when ordering unexisting response_id
(cherry picked from commit 0e4d9b7793c16fd98b396ffe6b8db48b8e09f1d2)
2013-07-21 21:59:03 +09:00
Matthias Clasen
54c020204f Let query utilities update the cache file directly
This is much more convenient for packagers than having to
redirect the output into the cache file, and much less error-prone.
2013-07-04 09:34:25 -04:00
Matthias Clasen
c884904686 Move the module cache files below libdir
These files contain architecture-dependent paths, and thus placing
them into sysconfdir causes unnecessary hassle. Now the immodule cache
file is looked for in libdir/gtk-2.0/2.10.0/immodules.cache.

Belated backport of a change that was done in the run-up to 3.0.
2013-07-04 09:34:18 -04:00
Matthias Clasen
602b44020a Look for rc files in system config dirs as well
This will allow us to ship package defaults in /usr instead
of /etc.
2013-07-04 09:06:29 -04:00
Emmanuele Bassi
162430fe5a settings: Move setting property registration in gtksettings.c
Some GtkSettings property are registered by other classes. This leads
to the "interesting" issue that setting GtkSettings:gtk-button-images
requires that the GtkButton class is referenced first - or that a
GtkButton is created.

https://bugzilla.gnome.org/show_bug.cgi?id=632538

This commit is a cherry-pick from master which (sadly) fixed the issue
only after we started the 2.9x work, and I completely forgot to backport
it. This is needed because GTK 2.x started tripping the warning added in
GObject by this bug:

https://bugzilla.gnome.org/show_bug.cgi?id=698614

Cherry-picked-from: 9f9edb662eb0f282e98f988b1658972303390036
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
2013-06-10 16:05:27 +01:00
Michael Natterer
1a4132a72e gtk: queue_resize() the GtkCellView when its cells change
in pack_start(), pack_end(), clear(), also queue_resize() in
set_model().  Remove calls to queue_draw() in other functions that
already call queue_resize().
2013-06-03 16:33:57 +02:00
Tilman Sauerbek
3b82c12d3e filechooser: Fix leak when a shortcut disappears from the filesystem
https://bugzilla.gnome.org/show_bug.cgi?id=432386
2013-05-30 10:21:55 -05:00
Matthias Clasen
1e96603577 Fix drawing of treeview grid lines
In the presence of invisible columns, the grid line drawing
code was malfunctioning.

https://bugzilla.gnome.org/show_bug.cgi?id=700578
2013-05-18 19:09:39 -04:00
Michael Natterer
ba5ac33cdc entry: unset the completion in dispose() not finalize()
Most likely fixes whatever evil gail interaction causing a crash I
could never reproduce but has been reported several times against GIMP.
The same fix is in GTK+ 3.x already (bug #683983).
2013-04-21 05:09:52 +02:00
Carlos Garnacho
d7e3f6f9f8 quartz: Fix call to missing symbol
This patch can be considered a leftover of commit a269c2f8d2 ,
replace the no longer existing function with the GDK function
meant to replace it.

This was noticeable on regular clipboard operations in quartz
2013-04-09 12:33:13 +02:00
Kristian Rietveld
a269c2f8d2 quartz: move atom/pasteboard type conversions functions to GDK 2013-03-28 13:00:33 +01:00
Federico Mena Quintero
e11b1943c7 filechooserbutton: Duh, remove all the timeouts after tests
Otherwise tests may start failing if they start after an old timeout triggers.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:29:30 -06:00
Federico Mena Quintero
1dee58ba87 filechooserbutton: Add a description string to assertions about emitted signals
On failed tests, this lets us more easily see see which assertion failed.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:29:26 -06:00
Federico Mena Quintero
ca7fe8417a filechooserbutton: Give proper names to the SELECT_FOLDER tests with cancelled dialog
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:29:22 -06:00
Federico Mena Quintero
852c2f06f0 filechooserbutton: Don't duplicate tests for GTK_RESPONSE_DELETE_EVENT
Instead, re-run tests made for GTK_RESPONSE_CANCEL with the delete-event response.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:29:18 -06:00
Federico Mena Quintero
aaa922bedb filechooserbutton: Do not propagate state from the dialog unless it is active
Change of plans to match the tests from the previous commit.

The state of the underlying dialog is never reflected by GtkFileChooserButton's API,
as the dialog is a transient thing.  The file chooser button only updates its state from the dialog,
and reflects the dialog's state, when the dialog has been confirmed and dismissed by the user.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:29:15 -06:00
Federico Mena Quintero
aa958f089d filechooserbutton: whitespace fixes 2013-03-12 18:29:11 -06:00
Federico Mena Quintero
29ed8d781e filechooserbutton: For the open-dialog-cancel-* tests, add a real nomenclature and test all the combinations
We used to have numeric names, which are a pain to maintain when new tests are added.
Now we have a real nomenclature (see the comment at the beginning of the open-dialog-cancel-* tests),
which lets us see easily if we have tested all the combinations.

Also, added all the combinations that were missing and removed redundant tests.
Not all the tests pass currently.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:29:06 -06:00
Federico Mena Quintero
9cfec7d3db filechooserbutton: Update the button's state only on programmatic changes to the filechooser's state
The idea is that the button will only update its state of the selection and current folder
when changes to those are done either by the calling program (with the filechooser's API)
or when the user actually confirms and dismisses the underlying GtkFileChooserDialog.

If the user makes changes to the dialog but has not dismissed it yet, those changes
will not be reflected in the button (as one would expect).

This commit also makes sure the current-folder-changed and selection-changed signals
are emitted at the right times.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:29:02 -06:00
Federico Mena Quintero
f9f76a3a0f filechooserbutton: Emit 'selection-changed' when changing the selection programmatically
We only emitted that signal when the selection changed through the underlying GtkFileChooserDialog.

To do this when the dialog is not active and the selection is changed by the calling program
(instead of by the user), we need to wait until the GtkFileChooserButton's UI has been updated
via an async callback from GIO.  So, we keep track of whether an entry point into the
button's API caused a programmatic change in the selection.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:28:59 -06:00
Federico Mena Quintero
2b6db9fb31 filechooserbutton: For tests, wait for signals instead of just sleeping
This should let tests complete faster.  Also, this will let us test
that the correct signals are actually being emitted.

The tests now fail, as the signals are not being emitted when they
should.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:28:55 -06:00
Federico Mena Quintero
bc604fe9f0 filechooserbutton: whitespace fixes 2013-03-12 18:28:50 -06:00
Federico Mena Quintero
d09b75b9ed filechooserbutton: During unselect_all(), update the widgets in all situations
Not just if we thought we had a selection.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:28:41 -06:00
Federico Mena Quintero
2368a31984 filechooserbutton: Add tests for unselect_all()
These all pass except one.
2013-03-12 18:28:37 -06:00
Federico Mena Quintero
15f9422adf filechooserbutton: HACK: Set a reasonable size for the dialog in the tests' second iteration
Something is causing the GtkFileChooserDialog to be resized really small on the second time it is run
during each test for GtkFileChooserButton.  So as a temporary hack we set it to 500x500 pixels on
the second run, so the size allocation code doesn't bomb on us.
2013-03-12 18:28:29 -06:00
Federico Mena Quintero
a37a8158bb gtkfilechooserbutton: In tests, allow the possibility of doing unselect_all 2013-03-12 18:28:23 -06:00
Federico Mena Quintero
82a5a0240c filechooserbutton: When the combo box changes, set the *file*, not the current folder
The currently-selected file *is* the selection even in SELECT_FOLDER mode.  Do not confuse this
with the current folder.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-12 18:28:13 -06:00
Aleksander Morgado
b994bcd4f2 combobox: popdown the combobox when on 'grab-broken-event'
And also explicitly remove pointer/keyboard grabs from the display.

Whenever the grab is reported lost, we should popdown the combobox, so that the
GDK_WINDOW_TEMP window is hidden and removed from the toplevel, as done with
the menu for example.

Leaving the GDK_WINDOW_TEMP window open when re-activating the application
triggers several issues in the win32 backend, due to restacking windows of the
non-toplevel group into the toplevel group:

https://bugzilla.gnome.org/show_bug.cgi?id=695200
2013-03-12 12:42:21 +01:00
Federico Mena Quintero
979e8bd9ec filechooserbutton: Update the combo box even after the dialog is cancelled
We assumed that we didn't have to update the combo box if the dialog got cancelled,
as it should simply retain its previous contents.  But this assumption doesn't work
as the dialog is brought up with the 'Other...' item - we don't want the
combo box to keep showing 'Other...' if the dialog is cancelled.

The test from the previous commit now passes.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 12:58:02 -06:00
Federico Mena Quintero
e16591780d filechooserbutton: New test for opening the Other item in the combo box and then canceling the dialog
There is this bug:

1. Start with a file chooser button in SELECT_FOLDER mode, and select a folder from the combo box.

2. Click on the button's combo box, select 'Other...'

3. You get the file chooser dialog. Cancel the dialog.

4. The file chooser button's combo box still shows 'Other...' instead of
   showing the selection from (1).

This is a test to ensure that the original selection is restored.
The test fails right now.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 12:57:58 -06:00
Federico Mena Quintero
dc5c12b437 filechooserbutton: Sync the tests a bit with the master branch
The tests fail right now in gtk-2-24 because accessibility is not available out of the box.
2013-03-08 11:13:12 -06:00
Federico Mena Quintero
6dc11c26a8 filechooserbutton: Don't show the (None) item when the combo box is popped up
This is surprisingly tricky, since the (None) item *has* to be a visible item while
the combo box is *not* popped up, so that it can show its contents.  But the item
has to be *not* visible when the combo box is popped up.

Also, update the whole button's selection, not just the underlying dialog's, when
the combo box changes its selection - based on a patch by Paul Davis in
https://bugzilla.gnome.org/show_bug.cgi?id=691040#c20

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 10:56:49 -06:00
Federico Mena Quintero
b714446fd8 filechooserbutton: In SELECT_FOLDER, when the selection is empty, show (None) in the combo box
We do this by adding a new row type, ROW_TYPE_EMPTY_SELECTION.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 10:54:43 -06:00
Federico Mena Quintero
a72b31bac1 filechooserbutton: Update the button/combo at construction time
This way the internal labels will show the correct selection even if nothing
has been selected programmatically.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 10:54:39 -06:00
Federico Mena Quintero
6fb7087758 filechooserbutton: Update the button/combo whenever the selection is changed programmatically
We didn't change it when the file chooser button's dialog was inactive, and so
the actual file chooser button would not visually reflect the current selection.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-03-08 10:54:32 -06:00