1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-03 14:24:15 +01:00
Commit Graph

1851 Commits

Author SHA1 Message Date
Martino Facchin
e1a5be7354 Cleanup IDE quit()
There were two different routines andling more or less the same operations.
Let the IDE call "real" quit when the last Editor windows is being closed.
2018-11-08 18:07:33 +01:00
Cristian Maglie
edb707378f makeup: call I18n.format using static imports in Base class 2018-10-08 12:56:22 +02:00
Cristian Maglie
6a1c1f4df9 Invalid use of toString in Optional<Version>
It should be used on the actual Version.

Fix #8034
2018-10-08 11:53:33 +02:00
Martino Facchin
d3cb01424f Provide actual string to findPlatform for Optional<Version>
Fix https://github.com/arduino/Arduino/issues/8034
2018-10-08 09:53:36 +02:00
Cristian Maglie
ddbe80b3fa Update library list model after a round of library_index.json update 2018-09-06 11:57:21 +02:00
Cristian Maglie
3dfe85916c Preserve boards.txt custom menu order.
Fix #7955
2018-09-04 10:31:36 +02:00
PaulStoffregen
4ccf9bbd90 Show a helpful message when no Port is selected 2018-09-03 16:39:39 +02:00
Cristian Maglie
5f9ff25b3c Added missing update to jssc lib 2018-09-03 13:29:42 +02:00
Martino Facchin
6080907ba3 Update jscc to 2.8.0-arduino2 (aarch64 support) 2018-08-28 17:53:04 +02:00
Martino Facchin
2f3a561c61 Fix rebuild being triggered on every menu open()
Fixes #7924

JRE 8u161 made JMenu.insert() MUCH slower on OSX.
This exposed a bug lurking there for years; in fact the menu entries were rebuilt every time since JMenu.getComponent() returns an empty list.
The correct function is JMenu.getMenuComponents().
In the meantime, also remove sketchbookMenu and examplesMenu being deleted on board change; only their content needs to be updated, not the container itself.
2018-08-27 16:22:42 +02:00
Martino Facchin
49cd9b57dd Fix check for wrong submenu 2018-08-27 16:20:20 +02:00
Cristian Maglie
d97147826e Serial monitor timestamp: add the arrow ' -> ' to the timestamp format
This saves another "append" call while streaming.
2018-08-23 10:46:32 +02:00
Cristian Maglie
986d67f1d9 Serial monitor timestamp: cache newline status
This saves an access to the Document object (as well as a bunch
temporary object allocations).
2018-08-23 10:46:32 +02:00
Cristian Maglie
8128525e83 Improve performance on serial monitor 'Show timestamp'
This patch dramatically reduce pressure on heap memory:

- use a StringTokenizer instead of the very slow String.split(...)
  method to decode newlines. This avoid allocation/deallocation of
  big strings array and use of regexp.
- pre allocate as many object as possible to avoid new allocation
  while streaming data.
- the "timestamp" string is calculated only once per iteration.
- use StringBuilder instead of inline temporary strings (that are,
  again, allocated and deallocated on each iteration)
2018-08-23 10:46:32 +02:00
Cristian Maglie
13c3750ecf Revert "Moving a sketch to another folder should move all files"
This reverts commit c4f5cafd33.
2018-08-23 10:39:20 +02:00
Cristian Maglie
4700cc3d27 Transformed some ActionListener anonumous class into lambdas
No code change
2018-08-15 17:23:04 +02:00
Cristian Maglie
2988136f97 Added alternative key binding for "Increase Font Size"
This commits adds the "CTRL SHIFT =" as key to increase font size.
The old shortcut "CTRL +" is still active, but it's not always
possible to produce it if the keyboard layout doesn't have the + key
on the base layer.

This add the possibility to compose "CTRL +" when the keyboard has
the "+" available as "SHIFT =", that seems to be very common in
many layouts.

Fix #6806
2018-08-15 17:22:47 +02:00
Cristian Maglie
1a576dd468 Fixed wrong keybinding for "Increase Font Size"
See https://github.com/arduino/Arduino/issues/6806#issuecomment-335044967
2018-08-15 00:11:41 +02:00
Cristian Maglie
60146b3d7d Fixed unused import warnings 2018-08-14 22:01:04 +02:00
per1234
19bfd2ada9 Correct messages re: sketch/library folder name restrictions
- Specify that library name error is about folder name.
  - We would normally expect "library name" to mean the "fancy name" (as defined by the library.properties name field).
- Specify exactly which characters are allowed.
- State that spaces are prohibited in sketch folder name.
- Remove outdated message about library folders not being allowed to start with a number.
  - This restriction was removed by 4545283ae7.
- State library folder name length restriction.
- Make sketch and library messages consistent with each other.
2018-08-10 10:53:15 +02:00
Jose Juan Juarez Monsivais
9d904dad31 Fixed the bug that doesn't updates the title when an example sketch is saved 2018-08-10 10:50:43 +02:00
Martino Facchin
f2b9328d30 Fix build by restoring onIndexesUpdated override 2018-07-19 10:08:32 +02:00
Martino Facchin
0ee0fcc018 [Lib manager] Fix only member being rendered incorrectly if filter active and update/install 2018-07-18 14:31:17 +02:00
Martino Facchin
fa51a39b58 Fix SerialMonitor and SerialPlotter lifecycles
Fixes #7683

When the selected serial port is busy both monitors now avoid displaying a useless window, cleaning the status area once the open succeeds.
2018-06-12 10:41:45 +02:00
Cristian Maglie
a76588cf5d Added newline at the end of --version output
See #7549
2018-05-22 17:48:29 +02:00
Yohsuke FURUTA
24029c5ace CLI: Add --version to CLI option (#7549)
* CLI: Add --version to CLI option

I added to get the Arduino IDE version from the command line
It will allow to check easily if the new Arduino is already installed.

This feature makes it easier to build external systems linked to specific versions of Arduino.

1. I added `--version` action, which shows version name and exit
  1. Currently, VERSION_NAME_LONG (like `1.8.5`, `1.9.0-beta`, `1.8.6 Hourly Build XXX`, etc...) is used. Because I want to know its version number and stable/beta/hourly.
  2. Finish with `0`. Because it is `SUCCESSFLLY FINISHED`.
2. Updated man page.

* Split "parse" and "action".
Move print action to probably suitable place.

This commit will fix the behavior of multiple actions about --version.

* add testcase
2018-05-22 17:46:11 +02:00
Cristian Maglie
60021c1e63 Library search now works also for headers (.h) provided by libraries
Fixes #7604
2018-05-22 16:28:52 +02:00
Cristian Maglie
e18261f486 library manager: installed element is now displayed correctly 2018-05-22 09:53:37 +02:00
Cristian Maglie
901d8c77fe Fixed UpdatableLibrarieyTest 2018-05-21 12:04:01 +02:00
Cristian Maglie
b4efa5589b Moved cc.arduino.i18n.Language* classes in arduino-core project 2018-05-21 11:27:53 +02:00
Cristian Maglie
b70e876c0c Removed et_EE localization.
Fix #4747
2018-05-21 10:43:19 +02:00
Martino Facchin
397f4e81ea Fixed LibraryOfSameTypeComparator comparator 2018-05-21 10:00:47 +02:00
Cristian Maglie
3bce82092e Command line: added more verbosity and made output coherent 2018-05-17 09:14:25 +02:00
Cristian Maglie
8d27171b74 Fixed error in cmd-line lib installer 2018-05-17 09:14:25 +02:00
Cristian Maglie
fee5848a02 Removed no more used predicates 2018-05-17 09:14:25 +02:00
Cristian Maglie
8fa45a3a07 Removed useless double sort
Removed also the weird LibraryByTypeComparator comparator that is no
more used.
2018-05-17 09:14:25 +02:00
Cristian Maglie
ac570c50bd UserLibrary: ensure that types field is always not-null 2018-05-17 09:14:25 +02:00
Cristian Maglie
b3d01d8281 Moved install-related fields out of DownloadableContribution
Those fields have a slightly different meaning on each object that
extends DownloadableContribution and having them grouped in
DownloadableContribution only increase confusion in change of a
(very) tiny code reuse.

Moreover:

- the `readOnly` field has been renamed to `builtIn`
- predicates have been replaced by lambdas
- DownloadableContributionBuiltInAtTheBottomComparator has been replaced
  with a singleton instance
2018-05-17 09:14:25 +02:00
Cristian Maglie
0042a30c81 Simplified version display logic in Library Manager
- replaced the logic to check if an installed-library is a
  builtin library by reusing the same method available in
  ContributedLibraryReleases
- renamed some local vars to better reflect their contents:

  uninstalledLibraries        -> notInstalled
  uninstalledNewerReleases    -> notInstalledNewer
  uninstalledPreviousReleases -> notInstalledPrevious
2018-05-17 09:14:25 +02:00
Cristian Maglie
ac6d3c1aff Core and ref-Core libraries are not handled by the library manager. 2018-05-17 09:14:25 +02:00
Cristian Maglie
b03a9af19a ContributedLibraryReleases: removed getLibrary() method
this method is now useless
2018-05-17 09:14:25 +02:00
Cristian Maglie
5cc66e9715 Moved ContributedLibraryReleases in arduino-core 2018-05-17 09:14:25 +02:00
Cristian Maglie
1089378575 Preparing ContributedLibraryReleases to move in arduino-core
Removed dependency on FilteredAbstractTableModel.getLatestOf() method.
2018-05-17 09:14:25 +02:00
Cristian Maglie
904a898108 Fixed UpdatableLibraryPredicate 2018-05-17 09:14:25 +02:00
Cristian Maglie
86441e4341 Added first tests for library manager engine 2018-05-17 09:14:25 +02:00
Cristian Maglie
2374d9d1bd Introducing UserLibraryFolder
This class allows to attach a Location property to a folder
path, this way we directly know if a library is in the sketchbook,
core, referenced-core or bundled in the IDE.

This simplify a lot of logic in the IDE.
2018-05-17 09:14:25 +02:00
Cristian Maglie
040caad124 Fixed library layout detection when adding new library 2018-05-17 09:14:25 +02:00
Cristian Maglie
e896595214 UserLibrary doesn't extend ContributedLibrary anymore
ContributedLibrary is used to decode library_index.json and it's
intended to keep data coming only from the index.

Now, when the library_index is synced with the filesystem, the
metadata about installed libraries are kept in a separate list
to not mess up with the main index.
2018-05-17 09:14:25 +02:00
Cristian Maglie
3ec6748dc4 Lib manager Predicates must act on ContributedLibraryReleases
Previously the filtering was made on ContributedLibrary, but the
objects that is actually displayed is a ContributeLibraryReleases,
so it comens natural to filter on this class of objects.

Apparently the functionality is not affected by this commit, but
there may be some side-effect that may probably fix some
visualization bug.
2018-05-17 09:14:25 +02:00
Cristian Maglie
482b905a62 Using Optional<T> semantics for 'replacedLib' in LibraryInstaller
Optional<T> helps to not forget to check about nullness where it is
needed.

This commit should be equivalent and shouln't fix any bug, BTW the
Optional<T> semantic turns out to be useful in the next commits.

Possibly all nullable values will be replaced by Optional in the
future.
2018-05-17 09:14:25 +02:00
Cristian Maglie
212825eb55 Simplified overly complex filtering of InstallerJDialog
- we ensure that there is always a filter selected, no more need
  to check for non-nullness
- the filters are always the same, no need to pass a
  Stream<Predicate<T>> around where Predicate<T> suffices
2018-05-17 09:14:25 +02:00
Cristian Maglie
f111905da6 Removed a lot of useless equals overrides.
Those introduces a very convoluted logic that is needed only in
two cases. Moreover those are better handled by directly checking
the object.
2018-05-17 09:14:25 +02:00
Cristian Maglie
b832e0d8b1 Use anyMatch instead of count in ContributionSelfCheck checks 2018-05-17 09:14:25 +02:00
Cristian Maglie
d285b7fdc9 Improved VersionComparator API 2018-05-17 09:14:25 +02:00
Cristian Maglie
27b99860b4 Simplified SketchController.isReadOnly(..) method
Since the method is called everywhere with the following parameters

  isReadOnly(
    BaseNoGui.librariesIndexer.getInstalledLibraries(),
    BaseNoGui.getExamplesPath())
  )

the static calls to BaseNoGui have been inlined into isReadOnly()
removing all the duplications around.
2018-05-17 09:14:25 +02:00
Cristian Maglie
627d4fb536 Removed NoopPredicate 2018-05-17 09:14:25 +02:00
Martino Facchin
2be54da740 SaveAs should preserve the folder structure if user selected a sketch
Fixes https://github.com/arduino/Arduino/issues/6416
2018-05-10 10:54:54 +02:00
Martino Facchin
950d88dcbe Handle unsaved tab deletion correctly 2018-05-09 16:09:29 +02:00
Martino Facchin
f8540b3a59 rescan libraries when installing from zip file
Fixes https://github.com/arduino/Arduino/issues/6960
2018-05-09 16:09:29 +02:00
Martino Facchin
b6280cfd65 Apply on-the-fly setFontSize to Console
Fixes #7022
2018-05-09 15:56:11 +02:00
Cristian Maglie
4aec8997e2 If theme couldn't be loaded print a message explaining why 2018-05-09 11:44:03 +02:00
Cristian Maglie
b96b2508db Fixed warnings 2018-05-09 11:43:40 +02:00
Martino Facchin
01519eba9c Move Sketchbook preparation before Theme.init()
Fixes NPE when searching for themes in portable installation
2018-05-08 16:53:55 +02:00
Martino Facchin
260e0c284c Abbreviate Theme name to max 40 characters 2018-05-08 16:53:55 +02:00
Mumfrey
794ef806f1 Support selectable, user-defined themes contained in zip files 2018-05-08 16:53:55 +02:00
Mumfrey
78ef37ef08 Support user-defined theme elements via "theme" folder in sketchbook dir 2018-05-08 16:53:54 +02:00
Martino Facchin
60f267745b Add on-hover selection on Board/Library manager
User testing on skilled devs showed that "buttons appear on click" behaviour is far from being understood.
Accessibility features (like moving with Arrow keys) should be untouched.
2018-05-02 16:41:59 +02:00
Martino Facchin
a47e62627c [Lib/Board Manager] Give some padding to the dropdown lists 2018-05-02 16:41:59 +02:00
Martino Facchin
1f9d99b699 Add copy/paste contextual menu to Firnd/replace text fields
Fixes #4883
2018-05-02 16:17:06 +02:00
Martino Facchin
921dd272ad Update jackson to 2.9.5
Fixes CVE-2018-7489
2018-05-02 16:14:03 +02:00
Martino Facchin
4562b4ba44 Update jmdns to 3.5.3 2018-05-02 16:12:32 +02:00
Martino Facchin
634fe10fa2 Mitigate stdout roaming through editor consoles
Still not a perfect solution; two compilation outputs will mix up anyway.

A major refactor should be needed to avoid using System.out anywhere and inverse multiplexing the streams so they can be muted or replicated on any Console.
2018-05-02 15:52:13 +02:00
Martino Facchin
c4f5cafd33 Moving a sketch to another folder should move all files
Fixes #6402
2018-05-02 15:52:13 +02:00
Cristian Maglie
1fd794dfdb Cache editor tools (don't create new instance for each menu item) 2018-05-02 15:26:14 +02:00
Cristian Maglie
a15abacc7f Added setting for autoformat before saving (editor.autoformat_currentfile_before_saving) 2018-05-02 15:26:14 +02:00
Cristian Maglie
8e0d668344 Serial Monitor: added "show timestamp" checkbox 2018-05-02 15:26:14 +02:00
Cristian Maglie
0175a4ee94 Revert "Fix keyword loading to use any whitespace as separator"
This reverts commit eed9e7069f.
See #6693
2018-02-19 12:58:01 +01:00
Cristian Maglie
8ffbe05437 Sligthly simplified buildImportMenu loop 2018-01-18 11:46:49 +01:00
Cristian Maglie
534d62653c Removed deprecated method Base.getLibraries() 2018-01-03 15:17:20 +01:00
Cristian Maglie
3ed68c5d71 No need to make copy of list when caling BaseNoGui.librariesIndexer.getInstalledLibraries() 2018-01-03 15:04:44 +01:00
Cristian Maglie
472d0b8ef6 Removed unused import 2018-01-03 14:50:55 +01:00
Corey Knapp
9891a6ba21 Improve accessibility in the Preferences dialog
This commit makes the Preferences dialog more usable by accessibility devices like screen readers.

Previously, a screen reader would only read the content of the text boxes. By using JLabel's setLabelFor() feature (and in some extreme cases, setAccessibleName()), a screen reader will know that a label is assigned to a text field. For example, instead of just reading "12", it will now read "Editor font size: 12".
2017-11-10 07:57:38 -05:00
Flavio Monteiro
a3f59fae91 Display the keyboard shortcut tip on both "Manage Libraries..."
This commit adds the Menu+Shift+I shortcut to the remaining menu entry in Base.java.

When the shortcut is called, the menu entry from Base.java is the one that will be called.
2017-10-30 11:04:26 +01:00
Flavio Monteiro
f8621b0421 Add Menu+Shift+I shortcut to the Library Manager
Please note that this commit actually adds the shortcut to its menu
entry under the "Tools" menu.

As a side effect, the shortcut tip is only shown in this entry and not
on the another one.

Menu usually means the Ctrl key on most modern systems.
2017-10-30 11:04:26 +01:00
Flavio Monteiro
d860c907bb Show "Manage Libraries" item in the Tools menu too
This duplicates the entry, so now "Manage Libraries..." is available
in both under the "Tools" menu and inside the "Sketch" -> "Include
Library" menu.

The reasons for this change are:
  - It makes sense for the entry to be there
  - It makes easier for the user to click on the entry

Aditionally, I added a comment about a issue I found with the
newJMenuItemShift function on Xubuntu 17.04 regarding the Ctrl+Shift+K
shortcut.
2017-10-30 11:04:26 +01:00
Flavio Monteiro
4a80f50d28 Trim trailing spaces from Editor.java 2017-10-30 11:04:26 +01:00
Flavio Monteiro
bafd66ba4f Fix comment of the ctrlAlt() helper function 2017-10-30 11:04:26 +01:00
Cristian Maglie
48384a7ad0 tests: added some missing null checks 2017-10-20 13:17:09 +02:00
Brett Hagman
eed9e7069f Fix keyword loading to use any whitespace as separator
Instead of forcing keywords.txt to use tabs, let library developers use spaces too.
2017-10-16 18:19:35 +02:00
Martino Facchin
0460dc4941 Add accelerator for scrollable menus
Press A when on a scrollable menu for a 6x acceleration
2017-10-16 18:19:35 +02:00
Martino Facchin
bfea2724ba Add scroller for programmers menu 2017-10-16 18:19:35 +02:00
Martino Facchin
ffa13ed733 Keep "Board Manager" entry always on top of its menu 2017-10-16 18:19:35 +02:00
ReAlUA
ba04ed2f7f Correct grammatical gender for Ukrainian in Ukrainian 2017-10-11 11:55:45 +02:00
ReAlUA
190eb8f9b1 IDE: call translation function for lastLibType
In menu Sketch/Include Library/ library types (Arduino|Recommended|Contributed) are not translated into selected «Editor language» although types are translated in .po files.
2017-10-11 11:55:45 +02:00
Cristian Maglie
d0f8037f6d Added exception printout while building 2017-09-28 13:13:29 +02:00
Cristian Maglie
369b23a7d2 Refactored function to get status of menus in MacOSX 2017-09-28 12:57:56 +02:00
Martino Facchin
59a57a9312 Use classic close() handle when macOS 10.13 workaround is on 2017-09-28 09:25:46 +02:00
Martino Facchin
a2b5f661b8 Fix macOS 10.13 missing menubar
The global bar is being used if locale is English and About() menu is present
2017-09-27 17:43:52 +02:00
Cristian Maglie
5427f94b9d Do not allow negative font resize
Fix #6359 (again)
2017-08-28 17:57:21 +02:00
Cristian Maglie
fcd88e6a43 IDE: "New/rename tab" now allow numbers as first char
Fix #6656
Related to #6592 and 4545283ae7
2017-08-28 14:35:49 +02:00
Martino Facchin
328296a2c5 Only reapply serial monitor last location if it fits the screen
There could be a couple of edge cases in this approach (for example, if someone wants to keep the serial monitor window only half visible).
However, it should be at least safe (no serial monitors on the second screen) if the Window Manager acts correctly (by moving all the windows on the second monitor to the primary on detach).
2017-08-18 15:25:11 +02:00
Martino Facchin
8292989e2d Separate screen dimensions storing from recent sketches 2017-08-18 15:25:11 +02:00
Cristian Maglie
4545283ae7 Sketch names starting with a digit are now allowed
Fix #6592
2017-08-18 15:11:24 +02:00
Martino Facchin
ad02e4940c Merge pull request #6130 from facchinm/allow_resizing_console_to_zero
Allow setting low values as minimum console size
2017-08-01 11:47:01 +02:00
Martino Facchin
d9d1406f64 Merge pull request #6459 from facchinm/smaller_preference_panel
Remove gaps on confirmation button to fit 600px height
2017-08-01 11:46:22 +02:00
Martino Facchin
91cdf53147 Merge pull request #6551 from facchinm/test_pr6394
Add font size shortcuts (menu, keyboard and mouse)
2017-08-01 11:45:04 +02:00
Martino Facchin
0c4d59d13f Merge pull request #6411 from facchinm/huge_serialportlist_scrollable
Add scroller for serial port list menu
2017-08-01 11:44:28 +02:00
Cristian Maglie
93217c40c7 CLI: fixed missing "runtime.platform.path"
This happens when the CLI is runned without the `--board` option.

Fix #6463
2017-07-27 15:56:24 +02:00
Martino Facchin
388822ad95 Implement font increse/decrease with CTRL+MouseWheel 2017-07-25 14:58:10 +02:00
Martino Facchin
c07f8fca54 Use CTRL+"+" as Increase Font shortcut 2017-07-25 14:57:21 +02:00
Cristian Maglie
ddf60361d6 Toolbar can now go full width on 4K display
Fix #5341
2017-07-18 14:00:56 +02:00
Martino Facchin
2191315123 [Pref panel] Remove gaps on confirmation button to fit 600px height
Should solve #4753
2017-07-05 11:19:46 +02:00
Martino Facchin
76f4668f02 Call setScrollerFor port menu only once 2017-06-26 09:43:22 +02:00
Martino Facchin
506ebd8011 add scroller for serial port list menu
Fixes #6397
2017-06-22 10:24:22 +02:00
Michael G
04a7e7ff15 Add font size shortcuts (menu and keyboard) 2017-06-20 11:33:24 +02:00
Cristian Maglie
d65e6ffc3d Merge pull request #6331 from cmaglie/jssc-no-unpack
Two fix for future Windows compatibility
2017-05-30 15:58:10 +02:00
Cristian Maglie
229c32ccad Avoid dll unpacking within JSSC
This requires a custom build of JSSC.
https://github.com/scream3r/java-simple-serial-connector/pull/105
2017-05-18 15:36:17 +02:00
Cristian Maglie
626a00a9bf Show the dialog just once when there are many unsaved sketches 2017-05-16 14:53:27 +02:00
Cristian Maglie
e500c7c41f Enabling "external editor" now requires to save all sketches.
Fix #6196
2017-05-16 14:53:27 +02:00
Cristian Maglie
00c1a3b3eb Renamed editor.auto_close_braces pref and set default value 2017-04-13 11:38:23 +02:00
bob
8ecbded312 add editor.autocomplete flag to disable automatic curly braces 2017-04-13 11:38:23 +02:00
Martino Facchin
39da3f0867 Apply editor.indent preference
Solves #6128
2017-04-13 11:38:23 +02:00
Cristian Maglie
323bd64a60 Serial Monitor: move "clear output" button from left to right side 2017-04-10 16:26:08 +02:00
Michael michael.sytko
99006fc5c6 Serial Monitor: added "clear output" button 2017-04-10 16:19:19 +02:00
Michael michael.sytko
8943b7ccbe added custom title format setting (editor.custom_title_format) 2017-04-10 14:24:26 +02:00
Michael michael.sytko
74384400e2 configurable shortcut for comment / uncomment 2017-04-10 14:24:26 +02:00
Cristian Maglie
e4ebd4a6fc Fixed CommandLineTest for windows 2017-04-10 13:49:04 +02:00
Martino Facchin
0190225050 Allow setting low values as minimum console size
Fixes #6085 when setting console.lines=0 in preferences.txt
2017-03-27 12:52:47 +02:00
Cristian Maglie
c70efd950f Fixed --save-prefs regression
Also removed deprecated Prefences.save() method.

Fix #6067
2017-03-22 13:13:06 +01:00
Cristian Maglie
39f396e55a Added test to check preference saving from cmd line
See #6067
2017-03-22 12:59:38 +01:00
Cristian Maglie
674419a464 Fixed a bunch of trivial javac warnings 2017-03-22 12:12:46 +01:00
Martino Facchin
5b6adec95f add preference checkbox for core cache 2017-03-20 17:31:38 +01:00
Sandeep Mistry
3e9448d34b Disable serial monitor for non-SSH network ports 2017-03-20 15:09:54 +01:00
tomneutens
938df21778 Added a CompilerProgressListenerList to the EditorStatus class so you can add a listener for compiler progress from an external tool. To enable this the build method in the compiler class had to be changed 2017-03-15 19:32:53 +02:00
Petri Laarne
1fc0997f71 Do not delete the source if source = destination
While the previous version could handle the case, it only did so after
deleting the destination file, therefore causing data loss.
2017-03-08 13:23:50 +01:00
Cristian Maglie
1f35bfca53 Fixed regression tests on Indent/Unindent and Comment/Uncomment actions
RSTA for some reason doesn't fire update signals on DocumentListeners.
2017-03-01 10:38:09 +01:00
Matthijs Kooijman
f5eb673f44 Update RSyntaxTextArea to 2.6.1
This imports the unmodified upstream version of RSTA from
http://repo1.maven.org/maven2/com/fifesoft/rsyntaxtextarea/2.6.1/rsyntaxtextarea-2.6.1.jar
since the Arduino-specific changes are no longer required.

This fixes #5888
2017-03-01 10:38:09 +01:00
Cristian Maglie
5f12bb9a3e Removed the need for get/setUndoManager()
This dramatically simplifies undo/redo handling and allows to use
unpatched RSyntaxTextArea library.
2017-03-01 10:38:09 +01:00
Cristian Maglie
1062307c52 Removed some redundant this keyword 2017-02-27 13:48:54 +01:00
Cristian Maglie
dd17388280 Removed unneeded up-cast 2017-02-27 13:48:54 +01:00
Matthijs Kooijman
87c917f4ea Remove unused CaretAwareUndoableEdit class
It seems this class has been unused since the switch to RSyntaxTextArea
was made.
2017-02-27 13:46:38 +01:00
Cristian Maglie
ad503bce6d Added missing license 2017-02-27 13:45:16 +01:00
Martino Facchin
c0a99f9ec9 Disallow opening Serial monitor during compilation
Commit 6d5597b070 introduced a guard against multiple concurrent operations.
This guard also avoid any real serial monitor "open" during the compile+upload phase, but it didn't handle keyboard shortcuts.

Fixes https://github.com/arduino/Arduino/issues/6015
2017-02-24 16:42:58 +01:00
Cristian Maglie
ffe6aee5a6 Updated eclipse formatter options 2017-02-20 15:22:27 +01:00
Cristian Maglie
4d6385ab6d Serial monitor: input textfield is automatically selected
When the serial monitor window is focused again (not reopened but put
in background and selected again) the text input field is now
automatically focused.

Fix #5810
2017-02-17 10:57:20 +01:00
Martino Facchin
e9e24bd369 Merge pull request #5879 from facchinm/better-mdns
Update jmdns to 3.5.1
2017-02-10 18:36:14 +01:00
Dan Stutts
a095d2a3c8 Add 500Kbps, 1Mbps and 2Mbps to the list of available serial speeds 2017-02-08 17:21:12 +01:00
Cristian Maglie
61cccc0151 verify/upload from CLI with relative path works again
Fix #5836
2017-01-23 13:41:03 +01:00
Cristian Maglie
3f74631762 Added test for command line regression
See #5836
2017-01-23 13:41:03 +01:00
Martino Facchin
0c8aebd6e8 Port fixes for upstream jmdns 2017-01-19 17:02:50 +01:00
Martino Facchin
0df438b817 Update jmdns to 3.5.1 2017-01-19 11:47:53 +01:00
Cristian Maglie
34fb802793 Fix font anti-alias on windows
The properties:

      System.setProperty("awt.useSystemAAFontSettings", "on");
      System.setProperty("swing.aatext", "true");

actually works on Linux (where the hint helps X11 to enable antialiased
rendering) but makes things worse on Windows where the outcome is exactly
the opposite (anti-alias is disabled).

Previously those settings had no effect because they were executed
*after* the initialization of the graphics. This is no more true
after the merge of #5578, that moved the graphics initialization
after commmand line parsing and consequently revealed the weird
behaviour on windows.

Fix #5750
2016-12-28 11:09:33 +01:00
Martino Facchin
e9709689de Add extra field to serial discovery targeting Tian board 2016-12-16 10:59:00 +01:00
Martino Facchin
55b55b29e6 Swap "Copy for Forum" and "Copy as HTML" actions
Fixes #5401

The bug was introduced by 982d4f3f, when DiscourseFormat(Editor, bool html) declarations were swapped. The contextual/right click menu in EditorTab already behaves correctly.
2016-12-13 10:07:05 +01:00
Martino Facchin
e39560ecfd Rebuild header on "Save as"
Fixes #5550
2016-11-28 15:07:42 +01:00
Fabián Inostroza
b17c5122c2 Set default color of text for descriptions shown in library manager. 2016-11-25 15:19:36 +01:00
Cristian Maglie
3d52de7191 Removed useless showEditor parameter from Base.handleOpen
Previously it was used to prevent the Editor from being displayed
when running in command-line mode. Now the Editor is not created at
all, so this parameter is useless.

This is also confirmed by the remaining calls to `handleOpen` that
all have the parameter set to `true`.
2016-11-25 15:10:38 +01:00
Cristian Maglie
1a640f6139 ...and Upload too (part 3/3)
This commit concludes the refactoring.
2016-11-25 15:10:37 +01:00
Cristian Maglie
ae990954d3 ...now Verify works again... (part 2/3) 2016-11-25 15:10:36 +01:00
Cristian Maglie
611ed081b3 Use PreferenceData.setBoolean() where appropriate 2016-11-25 15:09:51 +01:00
Cristian Maglie
df1841f0cd Initialize Editor only in GUI mode (part 1/3)
Move the initialization of Editor into the GUI section of the big
if-then-elseif chain. This actually breaks cases for Verify and
Upload that uses Editor to access core functions.

This will be fixed in next commits.
2016-11-25 15:04:35 +01:00
Cristian Maglie
21bcb6417c Build menus only in gui mode 2016-11-25 15:04:33 +01:00
Cristian Maglie
8d84432f71 Prompt for sketchbook folder only if in GUI mode 2016-11-25 15:04:33 +01:00
Cristian Maglie
fedc2b6cd2 Give sense to isCommandLine() method 2016-11-25 15:04:27 +01:00
Cristian Maglie
b73bc92a5c Moving some other graphic related parts into GUI initialization 2016-11-25 15:04:24 +01:00
Cristian Maglie
cf54cce660 SplashScreenHelper output progress in console for text-only mode
This commit makes this changes:

- SplashScreenHelper is now local in Base constructor
- if SplashScreenHelper is instantiated with a null SplashScreen
  instance then it outputs progress in console and avoid to make
  calls to Swing toolkit
- The parsing of command line arguments is anticipated so we can
  determine if we are in command line or GUI mode early and setup
  objects that produces output to not use graphics toolkits.
- In this case the SplashScreenHelper is initialized with a real
  splashscreen only if we are in GUI mode
2016-11-25 15:04:24 +01:00
Cristian Maglie
fbe6bf3792 Moved all initializations into Base constructor 2016-11-25 15:04:24 +01:00
Cristian Maglie
27d1b8d9a1 Merge branch 'windows-dpi-awareness' 2016-11-21 12:43:01 +01:00
Cristian Maglie
41092be596 Merge branch 'editor-refactor-fixup' 2016-11-09 14:25:45 +01:00
Cristian Maglie
650840381f Small cleanup, no code change 2016-11-07 14:51:25 +01:00
Cristian Maglie
5b4af28f47 Removed dead code 2016-11-07 14:47:33 +01:00
Cristian Maglie
10dcc1d932 When a new tab is created is also selected
Previously it was selected always the last tab because the action
sequence was:

 - create the new tab (in the last position)
 - select the new tab index (last)
 - sort the tabs (the new tab is now in the middle but the selected
   is always the last)

instead the correct action sequence is

 - create the new tab (in the last position)
 - sort the tabs (now the new tab is in the middle)
 - select the new tab index (now the correct index is selected)
2016-11-07 12:25:53 +01:00
Cristian Maglie
5244daa5d1 Use the same Comparator to sort EditorTab and SketchFile 2016-11-07 12:13:30 +01:00
Cristian Maglie
d63162b5a1 Added Platform.getSystemDPI() API 2016-11-04 10:23:48 +02:00
Cristian Maglie
b00185e63d juint tests now use the correct jna lib again 2016-11-03 15:01:36 +02:00
Cristian Maglie
21ff728c59 Merge remote-tracking branch 'cmaglie/fix-win-paths' 2016-11-03 12:10:24 +01:00
Martino Facchin
1d74bb87ac Trigger Keywords update if a new library is added
Fixes #5415
2016-10-27 12:47:00 +02:00
Martino Facchin
c6642c1bd2 Reorder tabs when a new file is inserted/renamed
Fixes #5402
2016-10-27 12:47:00 +02:00
Martino Facchin
4e84238527 Restore "Delete" tab functionality
The file was being deleted but the tab was still there
2016-10-27 12:47:00 +02:00
Cristian Maglie
2856600463 Windows: Use Shell32 utility to determine known paths 2016-10-19 16:28:21 +02:00
Cristian Maglie
7d9ec39ca9 Update jna.jar to 4.2.2 2016-10-19 16:28:20 +02:00
Cristian Maglie
3d6abacee4 Merge branch 'master' of git://github.com/duff2013/Arduino 2016-10-18 16:39:30 +02:00
duff2013
9a3881ecce set grid color through theme.txt now 2016-10-18 00:04:43 -07:00
Cristian Maglie
a8525c6bb0 Parse libraries index after updating it (when launche from CLI)
Fix #5424
2016-10-04 14:06:32 +02:00
duff2013
db8526c27c upgrade Serial Plotter 2016-10-03 19:34:57 -07:00
xloem
8b5a900ae1 Message parsing logic fix
comparison was invalid if some parts were not parsable numbers
2016-09-30 17:04:01 -04:00
xloem
be01c39c3a Empty graph hack fixes #4722 and fixes #5316 2016-09-30 16:56:57 -04:00
Cristian Maglie
bd7e76533a Removed redundant type specifiers for generics 2016-09-29 20:15:56 +02:00
Cristian Maglie
fca863f325 Removed unused variable 2016-09-29 20:15:55 +02:00
Cristian Maglie
3cc9446f04 Removed unused import 2016-09-29 20:15:55 +02:00
Cristian Maglie
0def10443f Fixed another error in string comparison 2016-09-29 20:15:55 +02:00
Cristian Maglie
635807105a Merge remote-tracking branch 'cmaglie/examples-menu-take2' 2016-09-21 09:53:50 +02:00
Cristian Maglie
c58e2e68d1 Fix regression: ignore case in file extensions
Fix #5389
2016-09-20 17:34:03 +02:00
Cristian Maglie
646c9f798f Fix regression: after "save as..." window title is updated
Fix #5388
2016-09-20 16:36:41 +02:00
Cristian Maglie
1efa07f010 Enable visibility of selection on find
Fix #5380
2016-09-20 15:31:17 +02:00
Cristian Maglie
c5a6a44b55 Simplify FindReplace.find() logic (part 2)
The snippet:

    boolean wrapNeeded = false;
    if (wrap && nextIndex == -1) {
      // if wrapping, a second chance is ok, start from the end
      wrapNeeded = true;
    }

Can be moved inside the `if (nextIndex == -1)` that follows, this way:

    if (nextIndex == -1) {
      boolean wrapNeeded = false;
      if (wrap) {
        // if wrapping, a second chance is ok, start from the end
        wrapNeeded = true;
      }

      [...CUT...]

      if (wrapNeeded) {
        nextIndex = backwards ? text.lastIndexOf(search) : text.indexOf(search, 0);
      }
    }

but since `wrapNeeded` is used only at the very end of the `if` statement
we can move it forward:

    if (nextIndex == -1) {
      [...CUT...]

      boolean wrapNeeded = false;
      if (wrap) {
        // if wrapping, a second chance is ok, start from the end
        wrapNeeded = true;
      }
      if (wrapNeeded) {
        nextIndex = backwards ? text.lastIndexOf(search) : text.indexOf(search, 0);
      }
    }

and finally simplify it by removing `wrapNeeded` altogether:

    if (nextIndex == -1) {
      [...CUT...]

      if (wrap) {
        nextIndex = backwards ? text.lastIndexOf(search) : text.indexOf(search, 0);
      }
    }
2016-09-20 13:58:36 +02:00
Cristian Maglie
47fcff77d5 Simplify FindReplace.find() logic (part 1)
The snippet:

    boolean wrapNeeded = false;
    if (wrap && nextIndex == -1) {
      // if wrapping, a second chance is ok, start from the end
      wrapNeeded = true;
    }

is present on both sides of the `if` statement so it can be factored out.
2016-09-20 13:52:24 +02:00
Cristian Maglie
9723726387 Call ensureOffsetNotInClosedFold only when a match is found 2016-09-20 13:45:11 +02:00
Cristian Maglie
096e545257 Examples of arch-independent libs from Arduino goes into Examples for any board
The other cases remain unchanged
2016-09-19 16:30:18 +02:00
Cristian Maglie
821ee53d40 Replaced some example menu labels
From: `Examples from Built-in Libraries`
To:   `Examples for any board`

From: `Examples from Arduino AVR Boards Libraries` (selected platform)
To:   `Examples for Arduino/Genuino Micro` (selected board)

From: `Examples from Arduino AVR Boards Libraries` (referenced platform)
To:   `Examples for Arduino AVR Boards` (referenced platform)
2016-09-19 16:27:47 +02:00