Commit Graph

21308 Commits

Author SHA1 Message Date
Federico Mena Quintero
c7cae86568 filechooser: Fix cast 2013-02-13 11:14:36 -06:00
Federico Mena Quintero
97aaba8343 filechooserbutton: Remove unused function prototypes 2013-02-13 11:14:17 -06:00
Federico Mena Quintero
bfcaa4228c filechooserbutton: Restore to an empty previous selection properly
If no file was originally selected in the GtkFileChooserButton, then its
internal dialog is brought up and cancelled, then we need to restore the
selection back to none.  GtkFileChooser, though, doesn't like to
select a NULL file, so call _unselect_all() in that condition.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-13 11:01:50 -06:00
Michael Natterer
5de08612dc gtk: reliably stop spinning when a GtkSpinButton is hidden
Call stop_spinning() also in unrealize() because unmap() is not
reliably called in GTK+ 2.x. This is not an issue in GTK+ 3.x.
2013-02-13 14:37:11 +01:00
Federico Mena Quintero
30a2f8edcc filechooserbutton: Add test for setting/getting the current folder; currently fails
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 23:12:20 -06:00
Federico Mena Quintero
1cfd1f372a filechooserbutton: Fix preserving the selection after cancelling the dialog
The button's underlying file chooser dialog should not be used to store the file selection
while the dialog is unmapped.  Instead, the file chooser button now stores the
selection itself.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 23:11:10 -06:00
Federico Mena Quintero
e6f629f2bb filechooser: Remove some unused code
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 20:12:32 -06:00
Federico Mena Quintero
69bf331c98 filechooserbutton: Simplify the code to preserve the selection while the dialog is running
It used to fetch a possibly multiple selection from the GtkFileChooserDialog, and then
pick just the first item from the selection list.  But since GtkFileChooserButton
operates in single-selection mode only, it can simply use gtk_file_chooser_get_file()
instead.

Also, the right way to reset the selection for GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
is with gtk_file_chooser_select_file(), not with _set_current_folder_file().

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 19:33:17 -06:00
Federico Mena Quintero
0e79a04b66 filechooserbutton: Don't set a starting folder in the underlying dialog
Let the dialog decide by itself.
2013-02-11 19:13:38 -06:00
Federico Mena Quintero
2900fa9b62 filechooser: Test canceling the dialog inside a GtkFileChooserButton
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 19:13:38 -06:00
Federico Mena Quintero
1130a7c6f2 Remove unused variable 2013-02-11 19:13:38 -06:00
Sebastian Geiger
71505d982b [GtkFileChooserButton] bgo#645065 - Restore the previously-selected file when the button's GtkFileChooserDialog is canceled
The file chooser is asynchronous, so doing 'select_file (old_file)' and subsequently querying
the file for updating the labels is not going to work.  However, the underlying file chooser
will emit 'selection-changed' as appropriate when it finishes restoring the old file.  So,
we only need to update the labels when the file chooser dialog is confirmed, not cancelled.
2013-02-11 19:13:37 -06:00
Federico Mena Quintero
e0cfc911fd filechooser: Add a couple of tests for GtkFileChooserButton; they fail now
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 19:13:37 -06:00
Federico Mena Quintero
5807a19031 filechooser: Do tests with g_assert_cmpstr(), not g_assert(passed)
This lets us see exactly what failed, instead of just seeing a boolean error value.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 19:13:37 -06:00
Federico Mena Quintero
96602b29e2 filechooser: Move some of the tests to GTestDataFunc
This code came from a home-grown testing mechanism, which didn't aggregate tests
into a test suite; it just ran them one by one.  Here we move some of that machinery
to GTestDataFunc for more flexibility in running tests.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-11 19:13:37 -06:00
Federico Mena Quintero
e14808fdd3 filechooser: Get the filechooser tests to build
Some are ifdef-ed out with BROKEN_TESTS, but at least the tests will compile for now.
2013-02-11 19:13:16 -06:00
Matthias Clasen
2ffaa468e5 post-release version bump 2013-02-09 18:33:04 -05:00
Matthias Clasen
84e1e80839 Updates for 2.24.15 2013-02-06 07:46:34 -05:00
Emanuele Aina
65ea14d421 build: Fix building with the gold linker by referencing gmodule-2.0
With the binutils-gold linker the '--no-copy-dt-needed-entries' flag is
active by default and using any symbol from indirectly loaded libraries
will result in undefined reference errors.

https://bugzilla.gnome.org/show_bug.cgi?id=692810
2013-02-03 15:54:15 -05:00
William Hua
5ada51d3c7 Signalify (already existing) GtkMenuShell.insert()
gtk_menu_shell_insert() is a virtual function that was being directly
invoked from the class vtable.

Turn it into a proper signal and emit it in the usual way.

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

This is a backport of Ryan Lortie's commit
05aeaeef9e from the GTK+ 3 branch.
2013-01-28 18:23:08 -05:00
Cosimo Cecchi
55642822fe spinbutton: paint an additional slice of background
Normally, the xthickness in the style maps to the space on the sides of
the widget, to accommodate for its border - GtkEntry's text area
background width is calculated as (allocation->width - 2 * xthickness),
and the border is rendered in that area.
GtkSpinButton has an additional panel for the buttons though, which will
render the right-side (left-side for RTL) border itself, taking
xthickness into account. This results in the xthickness for that side
being applied twice, both to the spinbutton panel and to the entry's
text area.
Visually, a slice with no painted background can be seen in spinbuttons
on the right side (left side when RTL) of the text area, where the
border would be rendered by the entry, which looks bad.

This patch makes GtkSpinButton render the same background of the entry
in that slice, to compensate for the xthickness being allocated to the
button panel instead.

https://bugzilla.gnome.org/show_bug.cgi?id=683511
2013-01-25 17:19:52 -05:00
Cosimo Cecchi
87115e00a8 entry: never use GTK_STATE_ACTIVE to paint the background
When state-hint is TRUE, GTK_STATE_ACTIVE was used to paint the entry
background and frame, since commit
207f3f8685.

Given that everywhere else in GTK2 - including GtkEntry itself in
draw_text_with_color() - GTK_STATE_ACTIVE is used for non-toggleable
widgets to indicate selected but not focused text, this leads to the
entry painting itself with the wrong background color when focused.
This is unsolvable from the theme, as changing the ACTIVE background
color to be the same as NORMAL would give a wrong background to selected
but not focused text as per above.

This patch avoids using GTK_STATE_ACTIVE to paint GtkEntry's background,
changing the code so that the widget state is always used instead.

https://bugzilla.gnome.org/show_bug.cgi?id=692554
2013-01-25 15:02:42 -05:00
Federico Mena Quintero
cfb09e5654 GtkFileChooserButton: return correct selection for SELECT_FOLDER mode
The old code to load the last_folder_uri state from the settings was not actually
ensuring that the settings were read from disk.  The result was this:

1. user chooses a folder in SELECT_FOLDER mode
2. user dismisses the file chooser dialog inside a GtkFileChooserButton
3. The dialog unmaps itself and saves the last_folder_uri with the user's selection
4. The file chooser button gets queried for the selection
5. GtkFileChooserDefault sees that it is unmapped, and falls back to the last_folder_uri
6. But since that key is not ensured as read by the temporary instance of GtkFileChooserSettings,
   it returns nothing.
7. The file chooser falls back to returning the user's home directory.

However, *we don't use the last_folder_uri* anymore, for anything!  So, removed
that code and now everything falls back to ->current_folder correctly.  This
is the correct selection value for SELECT_FOLDER mode anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=674556
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-01-24 17:57:03 -06:00
Matthias Clasen
0c5877215b Fix a critical warning in notebook dnd with rgba colormaps
Pointed out by Nick Schermer in
https://bugzilla.gnome.org/show_bug.cgi?id=690788
2013-01-20 22:07:14 -05:00
Nuno Araujo
adf68f977c Enable support for automake 1.13 in autogen.sh
https://bugzilla.gnome.org/show_bug.cgi?id=692099
2013-01-21 00:25:08 +01:00
Jan Rękorajski
85825ebaf2 print dialog: Fix authentication logic
Reset state of CUPS requests correctly during authentization and
check CUPS requests for errors.
Don't initialize variables holding password and username with empty
string (#664640).
2013-01-18 14:29:53 +01:00
Matthias Clasen
f9e2130765 Rename configure.in to configure.ac
Its the new thing...
2013-01-15 18:24:54 -05:00
Michael Natterer
bc3f1893aa quartz: really don't call a NULL function in gtk_clipboard_store()
Need to check targets and get_func in each loop iteration because
calling get_func the fist time might do whatever to the clipboard.
Re-fixes bug #626499. Also free the target table after we're done.
2013-01-15 11:56:22 +01:00
Kjartan Maraas
f895cd44af Updated Norwegian bokmål translation 2013-01-10 13:39:33 +01:00
Marko Lindqvist
3bfc67f1c1 configure.in: fix autoreconf with automake-1.13
Replace long obsolete AM_CONFIG_HEADER with proper AC_CONFIG_HEADERS.
automake-1.13 errors out upon seeing former.
Similarly remove AM_PROG_CC_STDC. It's proper replacement, AC_PROG_CC,
is already present.

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
2013-01-07 15:20:22 +00:00
Kristian Rietveld
184407309f quartz: retain content view when switching over toplevel. 2012-12-28 22:12:18 +01:00
Kristian Rietveld
30deba453a quartz: Make sure the old toplevel is closed on recreation 2012-12-28 22:12:18 +01:00
Kristian Rietveld
a8008b796f quartz: make sure all old properties are set on the new toplevel
Apply patch by Paul Davies; part of bug 669808.
2012-12-28 22:12:18 +01:00
Kristian Rietveld
62f1d871b7 quartz: ensure window being (un)fullscreened is visible
Patch by Paul Davis; part of bug 669808.
2012-12-28 22:12:18 +01:00
Matthias Clasen
1f0f399469 Move single-include guards inside include guards
gcc has optimizations for include guards that only work
if they are outermost in the the header.
https://bugzilla.gnome.org/show_bug.cgi?id=689810
2012-12-28 11:26:46 -05:00
Chun-wei Fan
44402df7dd Fix gailutil Visual C++ projects
...so that we will include the correct gdkconfig.h, which would be
in $(srcroot)\gdk\ during the Visual C++ build.

Also prepare support for Visual Studio 2012 in this project, so it would
be easy to use a script to copy and replace the necessary items in the
Visual Studio 2010 project set to make it a Visual Studio 2012 set.
2012-12-28 15:10:34 +08:00
Michael Natterer
f1c105b94f quartz: don't call a NULL get_func() in gtk_clipboard_store()
Assume the clipboard is not set and bail out silently (bug #626499).
2012-12-20 23:37:06 +01:00
Michael Natterer
e3e055f855 quartz: make setting_same_owner member of GtkClipboardOwner @public
to fix the build, thanks to parafin for the patch.
2012-12-17 22:20:40 +01:00
Marek Kasik
d9f9925878 printing: Add "Custom." prefix only once to paper size
Check whether "Custom." prefix is already present in the name
of selected paper size. (#679883)
(cherry picked from commit be7752183e)
2012-12-16 19:17:45 +01:00
Michael Natterer
31ae1a0b5b gtk: fix scrolling in modal dialogs when event_widget is insensitive
When checking for modal grabs in gtk_main_do_event(), forward
GDK_SCROLL events to event_widget, even if it is insensitive.
2012-12-14 14:30:31 +01:00
John Ralls
e8535149e4 Bug 689982: Random Crash
Update Cairo_Win32 error handling to respond correctly to
cairo_win32_foo_create() functions returning a "nil" surface.
2012-12-10 09:32:00 -08:00
Michael Natterer
4a8df7a33c quartz: fix crash in the recent clipboard "fix", and really fix it
We must not release the GtkClipboardOwner in pasteboardChangedOwner
becaue we don't own a reference to ourselves (NSPasteboard does).
Instead, release the owner right after setting it, transferring
ownership to NSPasteboard

Also, fix repeated setting of the same owner by keeping the
owner around in GtkCLipboard, and re-use it if "user_data"
doesn't change. To avoid clipboard_unset()ting our own contents
in the process, add an ugly "setting_same_owner" boolean to
GtkClipboardOwner, set it during re-setting the same owner,
and avoid calling clipboard_unset() from pasteboardChangedOwner
if it's TRUE.
2012-12-07 12:28:05 +01:00
Chun-wei Fan
b7c30152d0 Bug 687575: Update Visual C++ 2010 projects
The Visual C++ project files for GTK+-2.24.x need to be updated as the
Windows theme engine (libwimp) currently has to be built as a DLL.

This adds the Visual C++ 2010 project file to build libwimp as a
standalone module/DLL, and the property sheets, .sln file and
gtk.vcxprojin/gtk.vcxproj.filtersin/install.vcxproj are updated
accordingly so that the needed stuff get built properly and go
to the proper places for the Windows Themes to work correctly
with the Visual C++ builds.

Thanks to nus for pointing this out.
2012-12-06 12:20:26 +08:00
Matthias Clasen
ad5a0dbb9d Post-release version bump 2012-12-05 23:10:22 -05:00
Matthias Clasen
8e4742cb00 2.24.14 2012-12-05 22:46:07 -05:00
Chun-wei Fan
bad6675d74 gtk-demo.vcproj: Remove unneeded macros
We don't actually need the GtkPrefixDefine when building the gtk-demo demo
program on Windows.
2012-12-06 11:34:44 +08:00
Chun-wei Fan
a441107979 Bug 687575: Update Visual C++ 2008 projects
The Visual C++ project files for GTK+-2.24.x need to be updated as the
Windows theme engine (libwimp) currently has to be built as a DLL.

This adds the Visual C++ 2008 project file to build libwimp as a standalone
module/DLL, and the property sheets, .sln file and gtk.vcprojin are updated
accordingly so that the needed stuff get built properly and go to the
proper places for the Windows Themes to work correctly with the Visual C++
builds.

Thanks to nus for pointing this out.  Visual C++ 2010 projects files will
be updated in the next 1-2 days.
2012-12-05 23:53:53 +08:00
Michael Natterer
f2b74db5dc Bug 626499 - GtkClipboard unnotified on change of OS X pasteboard owner
pasteboardChangedOwner is not called as reliably as we'd want to get it,
so keep track of [pasteboard changeCount] and drop clipboard ownership
when a change happened. Also better unset the clipboard content redundantly
in a few places rather than missing one, and reorder the code in
gtk_clipboard_set_contents() so that the new aggressive unsetting
won't unset the clipboard under our feet when we call
[pasteboard declareTypes].
2012-12-04 14:31:13 +01:00
Federico Mena Quintero
6056f1855b Merge branch 'bgo658280-filechooser-recently-used-2-24' into gtk-2-24 2012-12-03 14:24:43 -06:00
Federico Mena Quintero
f52befa7e7 Revert "Add items to the shortcuts bar's popup menu to configure the startup mode"
Per the gtk-devel meeting on 2012/11/29, we'll not have a UI in the file chooser dialog
to select between those modes.  Instead, we'll show that key in gtweaktool.

This reverts commit 7860500bc6.
2012-12-03 14:23:17 -06:00