Commit Graph

21621 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
ad88e6d5c6 filechooserentry: Merge function 2016-03-10 15:15:36 -06:00
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
755d8163ea filechooserentry: Simplify match_selected function
Conflicts:
	gtk/gtkfilechooserentry.c
2016-03-10 15:15:36 -06:00
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
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
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
143306a515 filechooserentry: Split out function
I want to use that function elsewhere, so split it out.
2016-03-10 15:15:36 -06:00
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
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
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
f0573f8b42 filechooserentry: Start autocomplete immediately
Don't do idle handlers for this.

Conflicts:
	gtk/gtkfilechooserentry.c
2016-03-10 15:15:36 -06:00
a8c766991a filechooserentry: Remove file_system argument
It's not needed anymore.
2016-03-10 15:15:36 -06:00
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
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
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
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
c94e902894 filechooserentry: Make appending / to directories simpler 2016-03-08 20:45:17 -06:00
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
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
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
82a1d9fb18 filechooserentry: The file system cannot be NULL
Remove code that checked this.
2016-03-08 20:43:02 -06:00
707aadf6b1 filechooserentry: Make the filesystem a construct-only argument
This allows simplifications in the code.
2016-03-08 20:42:30 -06:00
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
0e6d18eaef filechooserentry: force_reload is never TRUE
.. so remove it.
2016-03-08 20:42:03 -06:00
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
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
a82a166700 filechooserentry: Use the actual discarding function to discard a folder 2016-03-08 20:41:42 -06:00
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
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
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
407c89863d Avoid integer overflow
Use g_malloc_n in gdk_cairo_set_source_pixbuf when allocating
a large block of memory, to avoid integer overflow.

Pointed out by Bert Massop in
https://bugzilla.gnome.org/show_bug.cgi?id=703220

(cherry picked from commit 894b1ae76a32720f4bb3d39cf460402e3ce331d6)
2016-03-07 17:38:33 +01:00
ba91ab6604 2.34.30 2016-03-05 12:30:46 -05:00
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
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
4db659552b gdk: Fix build of gdkkeyuni.c
In commit 4bf5290, there isn't a prototype for
_gdk_win32_keymap_get_decimal_mark(), causing a C4013 (implicit
declaration of...) warning/error.  Fix that by including the right
header for it.
2016-02-27 20:20:32 +08:00
4bf5290a25 W32: Fix for commit 1f74f12d9, re-enabling decimal separator key
1f74f12d9 rendered entry of keypad decimal mark unuseable for
several national keyboard layouts, this commit amends that, at
least for W32, and makes GTK+ behave more or less the same way
W32 behaves.

The patch works like this:
- When typing the first character at the keyboard or when switching
  keyboard layouts, the decimal mark character will be cached in the
  static variable "decimal_mark" within gdkkeys-win32.c

- in case of WIN32, gdk_keyval_to_unicode() asks gdkkeys-win32.c for the
  current decimal_mark when converting GDK_KEY_KP_Decimal.
2016-02-26 19:40:20 +00:00
dd90d178cc Fix Quartz Full Screen Crash. 2016-02-23 10:01:24 -08:00
bbb8ac1caa Updated Thai translation 2016-02-23 14:58:01 +07:00
ce05d6608c Fix typo. 2016-02-21 16:25:12 -08:00
1ac15824c7 Revert "Translate GDK_KEY_KP_Decimal according to locale"
This reverts commit 3b65a6a42e.

Too much controversy for this minor improvement.
See https://bugzilla.gnome.org/show_bug.cgi?id=756751
2016-02-16 17:12:17 +01:00
0517063d76 win32: properly handle show and focus
The first time a window is shown we should always call SW_SHOWNORMAL.
Understand whether to call SW_SHOW or SW_SHOWNORMAL and the specific
ones for the temporary windows depending on IsWindowVisible.
This also fixes the problem when calling gtk_window_present and
the window is snapped to the left or right of the screen.

This patch is based on the patches provided by Yevgen Muntyan
and Aleksander Morgado.

https://bugzilla.gnome.org/show_bug.cgi?id=698652
2016-02-15 09:00:03 +01:00
2299a98a5d win32: on focus restore the window if iconified
If the window is iconified we want to restore the window
to get the proper size instead of showing it normal which
would change the size of the window.

https://bugzilla.gnome.org/show_bug.cgi?id=698652
2016-02-15 09:00:03 +01:00
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