Commit Graph

130 Commits

Author SHA1 Message Date
Léa Saviot
1ccb55a16e [apps/code] Fix script importation status
Scenario: Execute the script parabola.py, open the variable box, select
any leaf, enter, open the variable box again -> no variables are loaded
anymore
2020-06-09 15:12:13 +02:00
Léa Saviot
1635f6132b [apps/code] Fix circular importation in the variable box
Scenario (crashed only on the calculator):

script1.py
from script2 import *
a=1

script2.py
from script1 import *
b=2
2020-06-04 14:50:10 +02:00
Léa Saviot
f763bb50ac [apps/code] Do not display subtitles in var box from console 2020-06-04 14:50:07 +02:00
Léa Saviot
714410287a [apps/code] Remove TODOs 2020-06-04 14:50:06 +02:00
Léa Saviot
bba5b237d2 [apps/code] Display different varbox titles from editor and console 2020-06-04 14:50:06 +02:00
Léa Saviot
ac654f0097 [apps/code] Load varbox before returning it in console 2020-06-04 14:50:06 +02:00
Léa Saviot
d1c8bbdaf7 [apps/code] The console marks imported script for the var box
After lauching the console, if we fetch a script we mark it as fetched.
When the variable box displays variables from imported scripts, it scans
all the variables from the scripts marked as fetched.
2020-06-04 14:50:06 +02:00
Léa Saviot
f412d95584 [apps/code] Load builtins according to autocompleted text 2020-06-04 14:50:04 +02:00
Léa Saviot
b9693f1f26 [apps/code] Load variable box with script index argument 2020-06-04 14:50:03 +02:00
Romain Goyet
950862f8d0 Use std::min and std::max 2020-04-14 09:31:02 -04:00
Émilie Feral
d247843da6 [apps/code] Clean ConsoleController::reloadData (always returns true) 2020-04-01 10:18:09 +02:00
Émilie Feral
81284120af [apps/code] ConsoleController: refreshOutput is now done only when the
console is active
2020-04-01 10:18:09 +02:00
Émilie Feral
fb3f6ab6f3 [apps/code][python] ConsoleController doesn't keep any pointer/boolean to know
if the sandbox/matplotlib view controller is displayed. Its state won't be
always right; instead, use the StackViewController depth.

This fixes the following bug: when popping the sandbox/matplotlib view
controller, the first responder token was not given to the console
controller!
2020-04-01 10:18:09 +02:00
Émilie Feral
89b54d424e [apps/code] ConsoleController: when becoming first responder, check if a
controller is displayed and switch the first responder accordingly
2020-04-01 10:18:09 +02:00
Émilie Feral
7d48d4e7c4 [apps/code] Console controller: display only one ExecutionViewController
at a time
2020-04-01 10:18:08 +02:00
Émilie Feral
53ec023ea0 [apps/code] ConsoleController: factorize code to reload the table 2020-04-01 10:18:08 +02:00
Émilie Feral
659da1dff8 [apps][python] ExecutionEnvironment handles hide sand display of sandbox
and plot controller the same way
2020-04-01 10:18:08 +02:00
Émilie Feral
51da01aa11 [apps/code] Remove 'm_preventEdition' from ConsoleController, it was
always used with m_preventEdition = true.
2020-04-01 10:18:08 +02:00
Romain Goyet
d71ad9b288 [wip] Convenience to test matplotlib 2020-04-01 10:18:08 +02:00
Romain Goyet
3df8018943 [apps/code] Remove useless code 2020-04-01 10:18:08 +02:00
Romain Goyet
2b73c4c9aa [apps/code] Quick hacks to allow pushing a view controller 2020-04-01 10:18:08 +02:00
Romain Goyet
131df18b00 [python] A module can now ask to present a view controller 2020-04-01 10:18:08 +02:00
Léa Saviot
f12c53b3f2 [apps/code] printText should not be asynchronous in emscripten
Otherwise, we need to put in the whitelist all methods that might call
printText, which are a lot.
2020-02-27 11:32:26 +01:00
Léa Saviot
02e79ad595 [apps/code] Do not refresh the print if the sandbox is displayed
Otherwise the first responder becomes the console edit line, and events
(such as Toolbox) are not intercepted by the sandbox anymore.
2020-02-25 15:31:25 +01:00
Léa Saviot
9bc0776a6a [apps/code] Allow interruption of infinite print loops
while (True):
  print("hello")
is now interruptible when the user presses Back
2020-02-20 10:59:01 +01:00
Léa Saviot
cf37e5c45a [apps/code] Fix input(), that did not return the input 2020-02-20 10:52:19 +01:00
Romain Goyet
a187f39094 [apps] Report telemetry events 2020-02-17 10:31:24 -05:00
Romain Goyet
7f43b73049 [apps] Don't forget to call viewWillAppear
At the moment ViewController::viewWillAppear doesn't do anything, so
there is no real impact. But if we want to use it it needs to be called
from subclasses.
2020-02-17 10:31:24 -05:00
Léa Saviot
b7e177865a [apps/code] Fix prompt after input 2020-02-12 15:13:22 +01:00
Léa Saviot
3dcb40b5d4 [apps/code] Do not call interrupt in printText 2020-02-12 15:13:22 +01:00
Léa Saviot
1dacd71acb [apps/code] Remove unneeded arguments 2020-02-12 15:13:22 +01:00
Léa Saviot
c6c3e3f340 [apps/code] Hide prompt when running script 2020-02-12 15:13:22 +01:00
Léa Saviot
f47f1f0543 [apps/code] Refresh view in printText 2020-02-12 15:13:22 +01:00
Léa Saviot
f20bb1fcf2 [apps/code] Display the console before running auto-imported script 2020-02-12 15:13:22 +01:00
Émilie Feral
d64321d116 [apps/code] Remove useless class member in ConsoleController 2020-02-12 15:13:17 +01:00
Émilie Feral
c2dabf6510 [apps/code] Choose console text size from GlobalPreferences 2020-02-12 15:13:15 +01:00
Adrien Bertrand
2ec4bc29e0 [apps] [code] Fix nullptr deref (fix #1176)
When scrolling up in the python shell history, `selectedCell` could be NULL.
2019-11-04 09:57:45 +01:00
Léa Saviot
4caf9f5197 [coding style] Make some methods const 2019-09-09 20:05:14 +02:00
Léa Saviot
5fac7a8cd2 [apps/code] Fix typo 2019-08-08 17:29:10 +02:00
Léa Saviot
c2b4d2b760 [strlcpy] Assertions on len parameter 2019-08-08 17:22:06 +02:00
Léa Saviot
7b84b65502 [apps/code] Fix sandbox and input clash
The command "squares()%input()" followed by text, OK, and a backspace
event broke an assertion on the consoleStore number of lines.
2019-07-30 11:31:21 +02:00
Ruben Dashyan
eb6d697927 [apps] Make app accessors static members of App classes 2019-07-19 15:06:25 +02:00
Ruben Dashyan
44809f4b3f Substitute Escher app() by Container::activeApp() 2019-07-19 15:06:25 +02:00
Romain Goyet
21907fb89a [apps] Get rid of App casts 2019-07-19 15:06:25 +02:00
Romain Goyet
45875dd642 [escher] Make app() a global function
This way it can easily be reached by anyone, including non-responders.
And it can easily be overwritten in namespaced apps.
2019-07-19 15:06:25 +02:00
Ruben Dashyan
eb3da7f395 [apps] Substitute "app()->container()" by "AppsContainer::sharedAppsContainer()" 2019-07-19 15:06:25 +02:00
Émilie Feral
9a411874ee [code] Console: when displaying results, do not split in lines in middle
of code points. Otherwise, this triggers crashes when manipulaping the
text (removing code point for instance)
2019-05-03 15:54:22 +02:00
Émilie Feral
2217eebaec [escher] SelectableTableView: when reloading data, we temporary deselect
the table. We warn the SelectableTableViewDelegate that the selection
change is 'within a temporary selection change' when notifying it of the
change.
2019-05-03 15:54:21 +02:00
Léa Saviot
496d346049 Remove max/min inline from KDCoordinate header 2019-05-03 15:53:19 +02:00
Léa Saviot
a021af46fe [apps/code] Hide the sandbox between script importations 2019-02-06 11:45:03 +01:00