Commit Graph

5016 Commits

Author SHA1 Message Date
luz.paz 7fdb963e01 Bug 794996 - Misc. typo fixes in comments in app/
Found via `codespell -q 3 --skip="./po*"`
2018-04-08 21:25:56 +02:00
Ell 6ebc3f1b09 Makefiles: don't use -xobjective-c when linking files on Mac
Last commit caused -xobjective-c to be passed during linking on
Mac, causing object files to be treated as source files.  Add a
-xnone flag to AM_LDFLAGS, canceling the effect of -xobjective-c.

Additinally, add a -xobjective-c++ flag to AM_CXXFLAGS, so that we
can use Objective-C in C++ files on Mac, if we ever need to.
2018-04-08 04:03:55 -04:00
Ell 06950be7f0 Makefiles: don't use -xobjective-c when compiling C++ files on Mac
On Mac, pass -xobjective-c to the compiler through AM_CFLAGS, not
AM_CPPFLAGS, so that it's only used for C sources, and not C++
sources.  In the latter case, it clashes with the -std=... flag,
spewing an error.  Thanks, Partha :)
2018-04-07 16:57:52 -04:00
Ell 394c930fbe app: avoid potential division by 0 in dashboard CPU usage sampler 2018-04-04 17:49:46 -04:00
Ell bbd79f9d62 app: fix Wilber's eyes
Commit fd6d4931c8 accidentally
introduced a bug that caused Wilber's eyes to misbehave.  This
commit is an attempt to fix this issue.  Unfortunately, it seems
like the bug can still be triggered through a certain sequence of
actions...
2018-04-03 03:32:32 -04:00
Michael Natterer b46b9d8921 Bug 772126 - Make GimpColorFrame handle very long numbers
Add "ellipsize" property to GimpColorFrame and set it to
PANGO_ELLIPSIZE_END in the the pointer information dockable.

Better cut off long numbers than make them expand the dock.
2018-04-03 01:47:53 +02:00
Ell da3c96f541 app: add "misc" group to the dashboard
... which currently has a single "mipmapped" field, which shows the
total size of processed mipmapped data.
2018-04-02 16:47:45 -04:00
Ell 4c041b2e8a app: allow hiding groups in the dashboard
Add a "groups" submenu to the dashboard popup menu, which can be
used to control which groups are shown in the dashboard.
2018-04-02 16:47:41 -04:00
Ell fd6d4931c8 It's alive! 2018-04-01 01:19:41 +00:00
Ell c3efb1b0de app: don't show invisible actions in search dialog 2018-03-29 05:26:02 -04:00
Michael Natterer 2c417801fc app: fix error message in gimp_text_buffer_save() 2018-03-23 14:47:14 +01:00
Michael Natterer 822a7228c4 Bug 794221 - Recently used colors on text don't get added to the color history
Add signal GimpTextBuffer::color-applied which is emitted when text is
inserted or when color is applied to a span of text.

In GimpTextTool, connect to the signal and update the global color
history.

Unrelated: rename gimp_text_tag_get_color() to get_fg_color() and add
boolean return values to get_fg_color() and get_fg_color() which
indicates if a color is set on the tag at all. This ended up unneeded
in the fix but is an improvement regardless.
2018-03-23 14:19:01 +01:00
Ell 8d9580fd2b app: update layers-dialog floating-sel attrs/highlight when image changes
Move the button-highlight update to its own function, and call it
when the active image changes, as well as when its floating
selection changes.

Call the floating-selection-changed signal handler when the active
image changes, so that we correctly update its row's attributes.
2018-03-07 10:58:25 -05:00
Ell b1266b2c3f app: #include <string.h> in GimpHighlightableButton
Needed for memcmp().
2018-03-07 09:53:31 -05:00
Ell 378c5d3b87 app: don't highlight layers dialog "new" button when pasting to channel
We disallow creating a new layer from a floating selection when its
associated drawable is a channel, so there's no point in
highlighting the "new layer" button in this case.  Note that the
"layers-new" action remains sensitive, showing an error message if
activated.  Not sure if it's a good thing or not, but whatever.
2018-03-07 09:40:19 -05:00
Ell 7dd373293c app: reduce opacity of GimpHighlightableButton when insensitive 2018-03-07 09:40:19 -05:00
Ell e4c79cb2d6 app: use gimp_cairo_rounded_rectangle() in GimpOverlayFrame
... instead of drawing it the hard way.
2018-03-07 09:40:19 -05:00
Ell 2c6ee43e84 app: highlight "new", "anchor", and "delete" buttons in layers dialog ...
... when there's a floating selection

Layer-dialog interaction is restricted while the image has a
floating selection, which often causes confusion.  Highlight the
three layers-dialog buttons that "finalize" a floating selection --
the "new layer" button, the "anchor layer" button, and the "delete
layer" button -- to indicate that these buttons are used to finish
the paste operation.  The "new" and "anchor" buttons use a green
highlight color, while the "delete" button uses a red highlight
color.
2018-03-07 06:18:21 -05:00
Ell 15883c7be0 app: add gimp_item_tree_view_get_delete_button()
... which returns the editor button associated with the "delete"
action.
2018-03-07 06:18:21 -05:00
Ell 1253964c80 app: use GimpHighlightableButton for GimpEditor buttons
... instead of plain GimpButton.
2018-03-07 06:18:21 -05:00
Ell a12a2344bc app: add GimpHighlightableButton
GimpHighlightableButton is a subclass of GimpButton, which can be
"highlighted" by changing its color to draw attention to it.
2018-03-07 06:18:21 -05:00
Ell efa8040780 app: rename gimp_cairo_foo() functions to follow cairo naming scheme
Really pedantic stuff :)  Rename the functions in gimp-cairo.h to
follow the naming scheme employed by cairo, so that they don't feel
out of place.
2018-03-07 06:18:20 -05:00
Michael Natterer 0c6441619e app: default to GIMP_COLOR_SELECTOR_RED in GimpColorEditor
instead of HSV hue, HSV is not supposed to be the default model any
longer. Bigger color selector cleanup to follow...
2018-03-04 15:44:02 +01:00
Ell b8aeed4774 app: make the GimpSearchPopup entry icon non-activatable
... it doesn't actually do anything.
2018-02-27 03:55:34 -05:00
Jehan b671a43a31 Bug 793815 - segmentation fault on a handler using finalized user data.
The bug is very hard to reproduce, probably because it requires specific
timing conditions but this looks like this commit would prevent it.
Apparently the signal handler gimp_container_view_name_changed() may
have been run while the container view (set as user data) was most
likely already finalized, hence leaving an invalid dangling pointer.
Let's just make sure we disconnect this handler (and another) when we
finalize the container view and its private data.
2018-02-26 19:12:50 +01:00
Jehan 1a8edbed51 app: replace GimpHistogramEditor's "valid" by "recompute" flag.
Having to sync the "valid" flag with the presence of a histogram is
error-prone (cf. previous commit).
Instead gimp_histogram_editor_validate() return value will just depend
on the presence of the histogram. And "valid" becomes "recompute", i.e.
a flag to request for "recomputation" of the histogram.
2018-02-21 19:31:25 +01:00
Jehan 3535251979 Bug 793669 - histogram-related bug report.
When the histogram is freed, we need to set valid to FALSE, in order to
force recreation as soon as needed. Otherwise we may hit some race
condition of trying to work with a NULL histogram. For instance this
happened when starting painting fast enough after switching the active
image.
2018-02-21 16:45:13 +01:00
Ell bdab2829ef app: more action history sorting logic improvements/fixes
Simplify the action history sorting logic introduced in the
previous commit, and fix a few issues in its implementation.
2018-02-17 10:07:02 -05:00
Ell 2e54483361 app: improve action history sorting
The current sorting logic of actions in the history is essentially
linear, so that when an action is activated it moves up one place
in the history.  This has the undesirable effect that actions take
very long to climb up the history list, as well as that actions at
the top of the list can change their relative order too frequently.

Improve the sorting logic, such that items climb up the list
faster, while top items retain their relative position longer.  See
the comment at the top of the diff for the actual logic.
2018-02-17 08:08:00 -05:00
Ell 9653cdfc40 app: exclude undo/redo actions from history
The undo/redo actions' label changes based on context, and may
interfere with the labels of more relevant, but less frequent,
actions.

For example, after applying filter Foo, the label of edit-undo
becomes "Undo Foo", so searching for "Foo" results in both
edit-undo, and the action referring to the filter, with edit-undo
most likely appearing at the top of the list due to its frequency.

Excluding the undo/redo actions from the history is a simple, if
suboptimal, way to fix this.
2018-02-17 04:57:28 -05:00
Ell 2816695eda app: add gimp_action_history_is_blacklisted_action()
... and rename gimp_action_history_excluded_action() to
gimp_action_history_is_excluded_action().

is_blacklisted_action() determines whether an action should be
excluded from *both* the history and the search results, while
is_excluded_action() determines if an action should be excluded
only from the history.  This eliminates some redundancy across
gimpaction-history and action-search-dialog.
2018-02-17 04:57:28 -05:00
Ell dba39b13ad app: add missing comma in gimp_action_is_gui_blacklisted() 2018-02-17 04:57:28 -05:00
Jehan 77ed476113 app: add GIMP_MESSAGE_BUG_WARNING + GIMP_MESSAGE_BUG_CRITICAL severity.
Since a few commits, I don't generate the traces anymore in errors.c but
delay this to gui-message.c and rely on the message severity to decide
whether or not generating traces.
Unfortunately none of the current severities are properly describing
this new type of messages. Even GIMP_MESSAGE_ERROR is used everywhere in
our code NOT for actual programming bug, but often for data errors
(which are not bugs but proper messages and should obviously not prompt
a debug trace).
2018-02-12 18:22:15 +01:00
Jehan b0cd4412e0 app: make backtrace processed in the thread where error happens.
Slight back step from commit 34fe992f44. I don't keep track anymore of
the number of errors inside GimpCriticalDialog. The problem is that GTK+
calls must happen in the main thread, and errors in another thread will
be delayed into the main thread through gdk_threads_add_idle_full().
This makes any backtrace generated as a consequence of a threaded error
useless (in particular any error happening in GEGL since we always
process these as multi-threaded, whether they are or not).
Instead I now keep track of the number of errors in gui-message.c, which
still allows to reset the counters when the unique debug dialog is
closed. Therefore I can now generate backtraces conditionally to the
error counters inside the problematic thread (and right when the error
happened), without any GTK+ call.
This finally makes GEGL backtraces useful in the debug dialog! :-)
2018-02-12 05:28:12 +01:00
Jehan 34fe992f44 app: keep track of number of errors and traces in GimpCriticalDialog.
We don't want an infinite number of traces because it takes some time to
get. Until now I was keeping track of traces in app/errors.c, but that
was very sucky because then I was limiting traces per session. Instead
save them as a variable of a GimpCriticalDialog instance. Therefore only
generate the traces for WARNING/CRITICAL at the last second, when
calling the dialog.
When too many traces are displayed, just fallback to just add error
messages only. But then even errors without traces can be time-consuming
(if you have dozens of thousands of errors in a few seconds, as I had
the other day, updating the dialog for all of them would just freeze the
whole application for a long time).
So also keep track of errors as well and as last fallback, just send the
remaining errors to the stderr.
2018-02-12 02:09:15 +01:00
Michael Natterer 539927ebfa app: replace all g_assert() by the newly added gimp_assert()
which is just a #define to g_assert for now, but can now easily be
turned into something that does some nicer debugging using our new
stack trace infrastructure. This commit also reverts all constructed()
functions to use assert again.
2018-02-11 22:23:10 +01:00
Michael Natterer 4be9f84ed5 app: pass the GdkWindow to gimp_spin_scale_update,clear_target()
Another small thing to make maintaining gtk3-port easier.
2018-02-11 15:45:51 +01:00
Ell 7bfab7150c Bug 792991 - Crash when undoing a paste while naming pasted layer
When removing a GimpContainerTreeStore item, make sure that editing
of corresponding tree-view rows is canceled first, by emitting a
"row-changed" signal.  Otherwise, we can run into trouble when
removing an item that is being edited.
2018-02-11 08:54:51 -05:00
Michael Natterer 0613bc948f app: remove one level of indentation from gimp_meter_expose_event()
Makes maintaining the gtk3-port branch easier.
2018-02-09 18:56:00 +01:00
Michael Natterer 9ca36a40a4 app: same fix/optimization for the propwidgets in app/widgets/ 2018-02-04 20:06:07 +01:00
Partha d0ede35379 Bug 793169 - Current Makefile.am not working on Mac. 2018-02-04 18:50:37 +01:00
Michael Natterer 614b81ffb4 app, tools: rename "gimpdebug" to "gimp-debug-tool"
and use GIMP_TOOL_VERSION instead of hardcoding "2.0" in both
tools/Makefile.am and app/errors.c
2018-02-04 14:09:22 +01:00
Jehan 110779eba3 app: update a GimpMessageBox repeated in a idle function.
I was directed by Massimo to some bug which was repeatedly generating
dozens of thousands of GEGL WARNINGs and that was completely taking over
the GUI if redirected to GimpErrorDialog. Currently GEGL warnings are
not redirected there, but the problem is still there, and we don't want
GIMP warnings to freeze the whole GUI either.
So only increment the repeat variable upon gimp_message_box_repeat() and
delay actual GUI update to a later low-priority idle function.
2018-02-03 22:46:04 +01:00
Jehan 536c65afa0 app: vbox doesn't need to be an object variable.
Probably a remnant from an earlier code. It's only used within the scope
of the init(), so let's simplify code.
2018-01-31 14:15:29 +01:00
Michael Natterer f93d23b01b app: some code and UI cleanup in GimpCriticalDialog 2018-01-30 21:51:15 +01:00
Jehan 42e9ddd4dd app: make the buttons translatable again.
I actually think the buttons were translatable, but the strings were
simply not auto-extracted with previous code (which is nearly the same
in the end). Should be better now.
2018-01-29 20:34:33 +01:00
Jehan 1b4efd2d5a app, tools: rename app/version.[ch] to app/gimp-version.[ch].
Since commit 9fdf35550b, I removed the GIMP_APP_GLUE_COMPILATION check
because we need to have the whole versioning info from the new debug
widget. It just makes sense to go further and just make this a proper
internal API to get version information.
2018-01-29 01:48:30 +01:00
Jehan ee6e981c04 app: remove the "save your work and restart" advice on fatal errors.
This is obviously not possible anymore to do this manually so this step
is bogus in a crash case. We keep this step for other (non-fatal)
errors. We may add an automatic "attempt" to save in a backup file
later, which may not work depending on how bad the crash is (which is
why it will be done in a backup file, we don't want to corrupt saved
files).
2018-01-28 20:15:49 +01:00
Jehan b8fa968b79 app: add backtraces on warning messages in GIMP_UNSTABLE. 2018-01-28 17:20:11 +01:00
Jehan 4e5a5dbb87 app: make the backtrace GUI actually work on Win32.
It was previously untested, hence as expected needed fixes. First I add
our own exception handler using Win32 API SetUnhandledExceptionFilter().
Second, I reorder things so that ExcHndlInit() is run after this setter,
since they will be executed as a FILO and we need backtraces to be
generated before our separate GUI runs. Last I run the backtrace GUI as
async. No need to keep the main GIMP waiting since the traces have
already been generated into a separate file.

Also replace gtk_show_uri() by the implementation taken straight from
our web-browser plug-in, since apparently gtk_show_uri() doesn't work in
Windows (and probably not macOS either since I see we have a separate
implementation for this platform as well). I would like to be able to
use the PDB but can't because this code needs to be usable both within
the main process and into a separate tool process. Ideally, this should
just be a utils function which could be included without a problem.
2018-01-28 15:43:07 +01:00