1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00
Commit Graph

1345 Commits

Author SHA1 Message Date
Matthijs Kooijman
7eea624dfa Remove EditorListener class
It did not contain any actual code anymore, so it can be removed, along
with the infrastructure for setting it up.
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
ac66a9c64a Change workaround for ctrl-slash handling in RSyntaxTextArea
Previously, there was a handler on the text area that consumed most
KEY_TYPED events with control pressed. This was added a long time ago to
fix a problem with ctrl-slash doing both the toggle comment action and
inserting a /. Further investigation shows that with RSyntaxTextArea
this problem is still present, but is caused by a weird binding on the
slash key that Arduino is not even using. Removing that binding is a
cleaner workaround for this problem, so this commit switches to that
workaround.

Ideally this would be fixed in RSyntaxTextArea, see
https://github.com/bobbylight/RSyntaxTextArea/issues/157
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
f06820713e Make ctrl-tab and ctrl-shift-tab work again
In the previous commit, these bindings were moved to EditorTab and
registered in a cleaner way, but this move also allows more components
to hijack these keystrokes and prevent them from reaching EditorTab.

This commit makes the keybindings work again, by preventing other
components from handling the keys. In particular:
 - JSplitPane had a binding to switch between its two panes, which is
   now removed after creating the JSplitPane.
 - The default focus traversal manager in Swing uses these keys to
   traverse focus (in addition to the the normal tab and shift-tab
   keys). By removing these keys from the set of "focus traversal keys"
   defined for the window, this should be prevented when the focus is on
   any component inside the window.
 - JTextPane didn't respond to the previous modification of the
   window-default focus traversal keys, since it defines its own set (to
   only contain ctrl-tab and ctrl-shift-tab, but not tab and shift-tab,
   for undocumented reasons). To fix this, focus traversal is simply
   disabled on the JTextPane, since this wasn't really being used
   anyway.

There was some code in SketchTextArea that tried to modify the focus
traversal keys for just the text area, which is now removed. This code
wasn't really useful, since focus traversal is disabled for the text
area already. Also, the code contained a bug where it would not actually
set the new set of keys for the backward focus traversal.

Closes #195
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
fc4b2028fa Move ctrl-tab and ctrl-shift-tab handling into EditorHeader
Previously, EditorListener handled these keys, by registering a handler
in the text area. This meant that they would only work while the text
area was focused. By registering the keys as WHEN_IN_FOCUSED_WINDOW
bindings, they can always be handled, and EditorHeader seems like a more
appropriate place.

Note that this does not currently work (so this commit breaks these
keys), since these keys are also handled in a few different places as
well, preventing these newly added keybindings to take effect. This will
be fixed in the next commit.

One additional change is that previously, these keybindings did not work
when the text area was readonly. This was probably a remnant from when
EditorListener took care of a lot of other editing keybindings, but
this does not make much sense anymore now.

Finally, with the old bindings, ctrl-shift-tab did not (seem to) work.
What happened is that the binding for ctrl-tab did not check the shift
state, so both bindings would fire on ctrl-shift-tab, switching forward
and back again, making it seem the keys did not work. The Swing
keybinding mechanism that is now used for these bindings checks the
complete keystroke, including all modifier keys, so this problem is
fixed by this change.

References #195
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
e98285f900 Remove duplicate ctrl+alt+left/right handling
These key combinations were registered as accelerator keystrokes in the
tab bar popup menu, but also handled by EditorListener. This was
probably added in an attempt to work around the broken accelerator keys
on the tab bar popup menus, but in practice this only meant that the
shortcut would sometimes (and now that the accelerator keys are fixed,
always) switch tabs *twice*. Removing the handling from EditorListener
helps to fix this.

References: #4228
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
a3ba935a57 Slightly simplify EditorHeader tab selection menu items
Previously, this would use a single ActionListener object, and pass the
filename of the file to switch to in the action command. This means that
whenever switching the filename needs to be looked up. This commit
instead uses a lambda to capture the index of the tab to switch to for
every tab (so it uses a different ActionListener for each tab).
2015-12-11 19:31:16 +01:00
Matthijs Kooijman
2f5375d523 Fix accelerator keybindings for the tab menu
Some items in this menu had accelerator keys (shortcuts) defined.
Normally, this automatically takes care of registering such keybindings
when the menu item is added to a menu. However, this requires adding the
item (indirectly) to a menubar, which is again added to a window. Since
the tab menu is just a separate popup menu, this did not work.

It seems an attempt was made to fix this by adding the popup menu to the
EditorHeader JComponent, which indeed made the keybindings work.
However, this is a hack at best, and as soon as the popup menu was
opened, it would be moved to another container and again detached when
the menu was closed, breaking the keyboard shortcuts again (re-adding
the popup menu turned out not to work either, then the menu would
actually be drawn on top of the tab bar).

To properly fix this, keybindings for the menu items are added to the
EditorHeader itself. By looking at the existing accelerator keystroke
property of the actions, there is no need to duplicate the keystrokes
themselves, and the displayed value will always match the actually bound
value. To simplify this, some methods are added to the Keys helper
class, which will likely come in handy in other places as well.
2015-12-11 19:31:15 +01:00
Matthijs Kooijman
957331299b Use Actions to simplify the EditorHeader popup menu building
Instead of defining JMenuItems, setting accelerator keys, and attaching
an ActionListener inline, this first defines a list of actions (with a
name, optional accelerator key and using a lambda as the action
listener). Then menu items are added, that simply refer to the
previously defined actions.

The actions are defined in a inner class named Actions, of which one
instance is created. This allows grouping the actions together inside
the `actions` attribute, and allows external access to the actions (in
case the same action is present in multiple menus, or otherwise
performed from other places). This might not be the best way to expose
these actions, and perhaps they should be moved elsewhere, but for now
this seems like a good start.

This adds new helper classes SimpleAction, to allow more consisely
defining Action instances, and a new class Keys, to allow consisely
defining keyboard shortcuts.
2015-12-11 19:31:15 +01:00
Matthijs Kooijman
8c176e7429 Remove some old, commented out code 2015-12-11 16:16:01 +01:00
Matthijs Kooijman
f9e1dbd484 Remove unused method 2015-12-11 16:16:01 +01:00
Federico Fissore
98d5ff79eb Upgrading arduino-builder to 1.3.7, which changes the way messages are sent
back to the IDE. Instead of having just stdour and stderr, stdout only is
used, but each message has a log level: info, warn, debug, error
Plain stdout/stderr are still used by child processes
2015-12-11 14:25:13 +01:00
Federico Fissore
66117a5cc0 Burn Bootloader was run in the UI thread, avoiding intermediate messages to be printed to IDE console 2015-12-03 11:09:50 +01:00
Federico Fissore
321f589b0f Reduced "scroll down" timer of ConsoleOutputStream back to 100ms 2015-12-02 16:41:15 +01:00
Federico Fissore
f9c80816aa Halved "scroll down" timer of ConsoleOutputStream 2015-12-01 16:39:17 +01:00
Federico Fissore
e224698ecf Files weren't deleted from temp unsaved sketch folder. Fixes #4233 2015-11-30 10:17:29 +01:00
Federico Fissore
aaebb0a4d6 Stored some regexps in static finals, given names to threads, and slightly
optimized ConsoleOutputStream
2015-11-27 15:07:44 +01:00
Federico Fissore
6855e91883 Fixed various Board/Library managers glitches, in particular when removing/upgrading 2015-11-24 16:14:16 +01:00
Federico Fissore
4f3415279c Boards manager: when upgrading, first remove, then install 2015-11-24 10:54:29 +01:00
Federico Fissore
7dd6e8f57d Windows: proper, non blurry, icon displayed. Fixes #3473 2015-11-24 09:53:27 +01:00
Federico Fissore
ceef83dbb9 Libraries that contain type "Arduino" are now listed at the top. Fixes #4195 2015-11-23 16:15:37 +01:00
Federico Fissore
bfeb994974 Moved ContributedLibraryReleases out of LibrariesIndexTableModel and introduced its own special comparator. Will help with #4195 2015-11-23 16:06:32 +01:00
Federico Fissore
d5a0476948 Installing tools from packager (eg: arduino) in packager folder, thus avoiding
tools duplication and disk space wasting. Fixes #4193
2015-11-20 17:15:53 +01:00
Federico Fissore
7e9f19c43b MacOSX: faster startup, fixed double clicking on a .ino file. Fixes #4057 2015-11-20 11:02:52 +01:00
Federico Fissore
1862827c25 Portable folder can now be set to any arbitrary path, not just subfolders
of "portable". Fixes #4103
2015-11-19 13:43:49 +01:00
Federico Fissore
20ddeb0fe3 Updated translations 2015-11-18 17:27:51 +01:00
Federico Fissore
b450a2743e Allowing boards/libs types and categories to be translated. Fixes #3646 2015-11-18 17:27:35 +01:00
Federico Fissore
9729b1b069 Windows: in case Shell Folders entry is missing, attempts to discover Documents folder using User Shell Folders. See #4124 2015-11-18 15:55:26 +01:00
Federico Fissore
846b8216c8 Merge pull request #4022 from henningpohl/multiplot
Added functionality to plot multiple signals at the same time
2015-11-18 14:28:05 +01:00
Federico Fissore
d0bd09c8d3 Saving caret position when using external editor, attempting to restore it on window activation. Fixes #4155 2015-11-17 17:27:34 +01:00
Federico Fissore
1328f3a9e2 Library and Boards Managers were using old copies of library/boards indeces. thus making the UI show old data. Fixes #4139 #3904 #3795 2015-11-17 12:24:28 +01:00
Martino Facchin
10e8480d3d Increase SerialMonitor reopening timeout to 10 seconds 2015-11-13 16:59:50 +01:00
Cristian Maglie
ab61ab92fd Removed superfluous @SuppressWarnings 2015-11-13 14:52:36 +01:00
Federico Fissore
375146cd91 Increasing Recent files list from 5 to 10 elements. Fixes #4131 2015-11-11 10:20:57 +01:00
Federico Fissore
2e80ee5bbd Testing translation for proper formatting. This test will fail when a
translation uses wrong syntax, thus avoiding any future issue similar to #4095
2015-11-06 17:24:26 +01:00
Federico Fissore
53987f9db9 Windows: msvc*.dll are not found when loading AStyle.dll. Forcing load.
Fixes #4076
2015-11-06 13:41:59 +01:00
Federico Fissore
77c3d3eaa8 Carriage return is not properly handled by EditorConsole, better replace it with a new line 2015-11-03 13:17:26 +01:00
Federico Fissore
152aa595ec Updated splash screen 2015-11-03 13:09:30 +01:00
Federico Fissore
31e8706cf4 Update notification popup was not sticking to bottom left corner when windows was resized. Fixes #4068 2015-11-03 09:03:32 +01:00
Henning Pohl
7d78a9c07e Also allow tabs as value delimiters 2015-11-02 13:12:11 +01:00
Federico Fissore
320dcef67e FindReplace: setting default button each time the window is made visible, because Find button was let unselected with subsequent Edit>Find clicks on Windows. Fixes #3959 2015-11-02 12:44:35 +01:00
Federico Fissore
f5c3136b34 'Partner' libs moved above 'Contributed'. Fixes #4060 2015-11-02 12:13:52 +01:00
Federico Fissore
e5252e3031 Slightly improved how EditorConsole works 2015-10-30 15:31:58 +01:00
Federico Fissore
648625deb5 Revised DiscourseFormat to handle multiline comments. Also cleaned up code. Fixes #3970 2015-10-28 15:12:52 +01:00
Federico Fissore
3d3fc08993 Made findreplace dialog NOT resizable 2015-10-28 11:19:13 +01:00
Federico Fissore
97ed162618 It was impossible to save a sketch with its default name. Fixed 2015-10-28 10:48:49 +01:00
Federico Fissore
421508268c Removing highlight when autoformatting. Fixes #3988.
Current highlighting logic is a bit buggy: see https://github.com/bobbylight/RSyntaxTextArea/issues/150.
2015-10-26 19:41:09 +01:00
Federico Fissore
0102a58122 "static" makes sense for constants and few other things. Avoid it if you don't have a specific reason for using it. 2015-10-26 15:49:31 +01:00
Henning Pohl
fe96ab9f44 Added functionality to plot multiple signals at the same time 2015-10-23 18:18:42 +02:00
Cristian Maglie
2ae36940c6 Fixed parsing for SystemProfiler on Macosx El Capitan
Should alleviate #3928
2015-10-20 23:36:56 +02:00
Cristian Maglie
28ad89d694 Make SystemProfilerParser.extractVIDAndPID() static
There is no need to instantiate a SystemProfilerParser object
each time extractVIDAndPID is invoked.

Added also `synchronized` keword to avoid reentrance problems
if the method is being used in multiple threads.
2015-10-20 23:34:27 +02:00