Commit graph

3989 commits

Author SHA1 Message Date
Gina Häußge
f4bcbd7c7b Wizard also uses new confirmation dialog parameter format 2015-08-17 16:42:30 +02:00
Gina Häußge
18c0dc6bf8 URL test API now also supports returning the response content
Also fixed a bunch of errors with that while at it.
2015-08-17 16:41:51 +02:00
Gina Häußge
ea662849bc Construct message/confirmation dialogs programmatically
No need to have templates here, we do it directly from the helper methods.
That also leaves us more options regarding callbacks, classes etc.

Helper methods now take an options dictionary (but still can fallback to the
old signature) containing messages, titles, callbacks etc instead of using
positional arguments for that. Switched code over to utilize that new
calling approach.
2015-08-17 16:41:12 +02:00
Gina Häußge
1238507806 Merge branch 'devel' into dev/firstRunWizard 2015-08-17 12:14:31 +02:00
Gina Häußge
31db13e0c3 Some more comments for the new settings processing 2015-08-17 12:12:45 +02:00
Gina Häußge
ea16615337 Map settings from observables automatically 2015-08-14 15:05:10 +02:00
Gina Häußge
833a618dbe More user control for server side settings update when dialog is open
The user will now be offered a dialog with two choices if a server side update
of the settings is detected while the user has the settings dialog opened and made
local changes: Either reload all changes, effectively overwriting any local changes,
or only set those settings changed on the server that are not also changed locally.
2015-08-14 14:34:41 +02:00
Gina Häußge
7518b44e6d Use configHash to check if frontend needs to be reloaded
If after a reconnect the server side configuration has changed, we want to reload.
Using the SettingsUpdated event the clients can track the current config hash during
runtime so that no unnecessary reloads during runtime should be demanded.
2015-08-14 14:11:50 +02:00
Gina Häußge
ff820837a5 Include config hash in SettingsUpdated event and SockJS connected message 2015-08-14 14:09:31 +02:00
Gina Häußge
4a49948223 FileMgr: Only remove callback if it exists. 2015-08-14 14:06:22 +02:00
Gina Häußge
d97f92ea3d Merge branch 'devel' into dev/firstRunWizard
Conflicts:
	src/octoprint/static/js/app/viewmodels/settings.js
2015-08-14 10:35:32 +02:00
Salandora
0ff43def3a Fix sorting of templates
(cherry picked from commit 3866c1a)
2015-08-14 09:01:02 +02:00
Gina Häußge
cc14b77487 Use connection closing flag only for exception handling
Otherwise we kill the beforePrinterDisconnected gcode script...

See #1021
(cherry picked from commit 2fe956e)
2015-08-14 09:00:40 +02:00
Gina Häußge
7f10c317f1 Properly handle serial close on Macs
Readline could still be stuck in a read loop, leading to an exception on Mac
when closing the connection from another thread. This should now be captured
correctly.

Fixes #1021
(cherry picked from commit c829b27)
2015-08-14 09:00:19 +02:00
Gina Häußge
ba1f8c58b4 Log exception on error while reading from serial
(cherry picked from commit ac3409a)
2015-08-14 08:55:29 +02:00
Gina Häußge
2fe956e515 Use connection closing flag only for exception handling
Otherwise we kill the beforePrinterDisconnected gcode script...

See #1021
2015-08-13 17:22:43 +02:00
Gina Häußge
c829b27fdd Properly handle serial close on Macs
Readline could still be stuck in a read loop, leading to an exception on Mac
when closing the connection from another thread. This should now be captured
correctly.

Fixes #1021
2015-08-13 17:16:51 +02:00
Salandora
c00b13680f Merge pull request #1022 from Salandora/fixSorting1
Fix sorting of templates
2015-08-13 15:16:22 +02:00
Salandora
2bf5624a00 Fix positioning of ContextMenu 2015-08-13 15:14:30 +02:00
Salandora
3866c1a112 Fix sorting of templates 2015-08-13 14:32:41 +02:00
Gina Häußge
8f11d2fd5d Fixed a description text in the UI 2015-08-13 13:31:20 +02:00
Gina Häußge
7dfa6ae4bd Never send empty/whitespace only commands 2015-08-13 13:09:06 +02:00
Gina Häußge
84b343a751 Added new serial config options to UI
Also pushed more advanced config option into an initially hidden
"Advanced Options" section, similar to other places.
2015-08-13 13:08:20 +02:00
Gina Häußge
5c2ae378e1 Improved handshake procedure on comm layer
"Hello" command sent to printer to trigger initial handshake can now be
configured. Commands that _always_ necessitate to be sent with checksum/
line number (e.g. M110 on Marlin) can be configured as such too.

Also fixed an issue causing the "Hello" command to not be actually enqueued
first thing on opening a connection. Seems to not have caused harm in the
wild, but was unintentional.
2015-08-13 13:07:18 +02:00
Gina Häußge
ac3409a223 Log exception on error while reading from serial 2015-08-13 12:05:08 +02:00
Gina Häußge
91539624df Virtual printer now has its own serial.log 2015-08-13 10:55:45 +02:00
Gina Häußge
963d590728 Allow specifying additional baud rates 2015-08-12 13:39:12 +02:00
Gina Häußge
273bb45741 Fixed broken GCODE viewer / concurrent settings requests
The GCODE viewer settings callback was not properly called, hence the
viewer was not initialized properly.

Changed prevention of concurrent settings requests to properly handle
the situation where the registered settings callbacks might be extended
through another callback.
(cherry picked from commit 7d6462b)
2015-08-12 12:31:23 +02:00
Gina Häußge
7d6462b815 Fixed broken GCODE viewer / concurrent settings requests
The GCODE viewer settings callback was not properly called, hence the
viewer was not initialized properly.

Changed prevention of concurrent settings requests to properly handle
the situation where the registered settings callbacks might be extended
through another callback.
2015-08-12 12:30:56 +02:00
Gina Häußge
e33f69917f Made webassets folder cleanup win32-proof
If re-creation of the folder fails due to an access error, perform three retries. It might
be caused by the folder being open in the file explorer. Waiting a bit before retrying
seems to do the trick.

See also #1019
(cherry picked from commit a43de42)
2015-08-11 18:14:39 +02:00
Gina Häußge
a43de4201f Made webassets folder cleanup win32-proof
If re-creation of the folder fails due to an access error, perform three retries. It might
be caused by the folder being open in the file explorer. Waiting a bit before retrying
seems to do the trick.

See also #1019
2015-08-11 18:14:20 +02:00
Gina Häußge
4b8bdd244e Improved settings dialog behaviour
* Show when settings are saving
  * Show when settings are being retrieved
  * Disable Send/Cancel buttons while settings are saving
  * Prevent concurrent retrieval
(cherry picked from commit 88eb124)
2015-08-11 15:30:38 +02:00
Gina Häußge
202f93426a Capture compilation errors on additional templates
Shouldn't cause the whole page not to render but log an error. Should
provide more resilience against bad plugins.
(cherry picked from commit d25202d)
2015-08-11 15:30:19 +02:00
Gina Häußge
64fa330fc5 Update for 1.3.0 change log 2015-08-11 15:29:21 +02:00
Gina Häußge
c538604cd5 Added tooltip for additional data in file list
Also fixed tooltips to those buttons instead of the icons within the buttons.

Fixes #986
(cherry picked from commit 8772162)
2015-08-11 14:08:10 +02:00
Gina Häußge
0c44762f6f Fix: Better error handling for webassets + cache
(cherry picked from commit 38be47c)
2015-08-11 14:08:04 +02:00
Gina Häußge
6df57bc1d1 Evaluate return code of pip while updating
Should not report a successful update anymore when the pip call failes for whatever reason.
(cherry picked from commit 54b981b)
2015-08-11 14:07:38 +02:00
Gina Häußge
e328695100 Do not hiccup on unset Content-Type fields in multipart file uploads
Just don't set the content_type parameter in that case.

Fixes #985
(cherry picked from commit 4bb5be7)
2015-08-11 14:07:31 +02:00
Mark Walker
738c699a6e Fix for #1001 connection tab not unfolding
Defer collapsing the connection element until the whole wrapper part is
visible (it's hidden for non-admins).
(cherry picked from commit af67d8b)
2015-08-11 14:07:11 +02:00
Gina Häußge
8a28220e63 responsive => snappy
Finally found a replacement for the word "responsive", which these
days is almost inclusively understood as "viewport adjusting"
instead of its original meaning "reacting quickly".

Thanks to the javascript world, even "reactive" isn't an option
anymore, this term has now been hijacked as well.
(cherry picked from commit 2e27b94)
2015-08-11 14:06:43 +02:00
Gina Häußge
87721623b1 Added tooltip for additional data in file list
Also fixed tooltips to those buttons instead of the icons within the buttons.

Fixes #986
2015-08-11 14:04:52 +02:00
Gina Häußge
38be47c01b Fix: Better error handling for webassets + cache 2015-08-11 12:35:35 +02:00
Gina Häußge
7f2476e513 Better tracking of printer connection state
Introduced three new events:

  * CONNECTING - fired just before starting the connection process
  * DISCONNECTING - fired just before starting the (active) disconnection
     process
  * PRINTER_STATE_CHANGED - fired every time the printer state changes

 Also introduced new GCODE script beforePrinterDisconnected, which will
 get sent just before the printer gets (actively) disconnected. Also enabled
 communication object to wait for the send queue to be emptied before
 closing it, in order to allow sending all lines from the disconnect script.
2015-08-11 12:02:26 +02:00
Gina Häußge
c516b91a6d Virtual Printer: Don't try to send on closed connections 2015-08-11 11:55:17 +02:00
Mark Walker
4bcdcced8a Lengthen doc on PrinterInterface.select_file 2015-08-11 01:08:25 -07:00
Gina Häußge
214b48451b Turned SessionUser into a delegate
That should fix user settings across multiple SessionUser wrappers. User settings were
previously only copied upon initialization of the SessionUser, with no update later on,
leading to them becoming out of sync with the underlying User instance.

This commit changes SessionUser to delegate method and attribute access for anything
but its own members to delegate to the wrapped User instance instead.
2015-08-10 14:27:57 +02:00
Gina Häußge
54b981b1ec Evaluate return code of pip while updating
Should not report a successful update anymore when the pip call failes for whatever reason.
2015-08-10 10:11:40 +02:00
Gina Häußge
4bb5be76d0 Do not hiccup on unset Content-Type fields in multipart file uploads
Just don't set the content_type parameter in that case.

Fixes #985
2015-08-10 09:40:48 +02:00
Gina Häußge
f8702e455a Merge pull request #1016 from DanLipsitt/fix/tests
MacOS: fix path quirk in filemanager unit tests.
2015-08-07 14:10:36 +02:00
Gina Häußge
8a79c6cdfe Merge pull request #1014 from DanLipsitt/fix/assert_called_once
Fix call to non-existent Mock method.
2015-08-07 14:01:23 +02:00