Browse Source

Luminotes Desktop now has a "close" link at the top of the page to completely shut down the process.

Dan Helfman 9 years ago
parent
commit
c74a18ae1e
4 changed files with 38 additions and 1 deletions
  1. 2
    0
      NEWS
  2. 11
    0
      controller/Root.py
  3. 23
    0
      view/Close_page.py
  4. 2
    1
      view/Header.py

+ 2
- 0
NEWS View File

@@ -1,4 +1,6 @@
1 1
 1.6.6: ?
2
+ * Luminotes Desktop now has a "close" link at the top of the page to
3
+   completely shut down the process.
2 4
  * Luminotes Desktop now attempts to always run on a particular port number,
3 5
    which means that as long as it's running you can reach it from a constant
4 6
    URL.

+ 11
- 0
controller/Root.py View File

@@ -23,6 +23,7 @@ from view.Notebook_rss import Notebook_rss
23 23
 from view.Json import Json
24 24
 from view.Error_page import Error_page
25 25
 from view.Not_found_page import Not_found_page
26
+from view.Close_page import Close_page
26 27
 
27 28
 
28 29
 class Root( object ):
@@ -397,6 +398,16 @@ class Root( object ):
397 398
 
398 399
     return dict()
399 400
 
401
+  @expose( view = Close_page )
402
+  def close( self ):
403
+    # this is typically only allowed in the desktop configuration
404
+    if self.__settings[ u"global" ].get( u"luminotes.allow_shutdown_command" ) is not True:
405
+      return dict()
406
+
407
+    cherrypy.server.stop()
408
+
409
+    return dict()
410
+
400 411
   def _cp_on_http_error( self, status, message ):
401 412
     """
402 413
     CherryPy HTTP error handler, used to display page not found and generic error pages.

+ 23
- 0
view/Close_page.py View File

@@ -0,0 +1,23 @@
1
+from Tags import Html, Head, Link, Body, Div, P
2
+from config.Version import VERSION
3
+
4
+
5
+class Close_page( Html ):
6
+  def __init__( self, script = None ):
7
+    Html.__init__(
8
+      self,
9
+      Head(
10
+        Link( rel = u"stylesheet", type = u"text/css", href = u"/static/css/style.css?%s" % VERSION ),
11
+      ),
12
+      Body(
13
+        Div(
14
+          P(
15
+            u"Luminotes Desktop has been shut down."
16
+          ),
17
+          P(
18
+            u"To start Luminotes again, simply launch it from your Start Menu."
19
+          ),
20
+          id = u"center_area",
21
+        ),
22
+      ),
23
+    )

+ 2
- 1
view/Header.py View File

@@ -19,7 +19,8 @@ class Header( Div ):
19 19
             u"version", VERSION, u" | ",
20 20
             A( u"upgrade", href = u"http://luminotes.com/download?upgrade=True", target = "_new" ), u" | ",
21 21
             A( u"community", href = u"http://luminotes.com/community", target = "_new" ), u" | ",
22
-            A( u"blog", href = u"http://luminotes.com/blog/", target = "_new" ),
22
+            A( u"blog", href = u"http://luminotes.com/blog/", target = "_new" ), u" | ",
23
+            A( u"close", href = u"/close" ),
23 24
             class_ = u"header_links",
24 25
           ),
25 26
           class_ = u"wide_center_area",