diff --git a/NEWS b/NEWS index 8a0f8b1..1bcff7f 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ 1.6.6: ? + * Luminotes Desktop now has a "close" link at the top of the page to + completely shut down the process. * Luminotes Desktop now attempts to always run on a particular port number, which means that as long as it's running you can reach it from a constant URL. diff --git a/controller/Root.py b/controller/Root.py index a4acf30..f7ba256 100644 --- a/controller/Root.py +++ b/controller/Root.py @@ -23,6 +23,7 @@ from view.Notebook_rss import Notebook_rss from view.Json import Json from view.Error_page import Error_page from view.Not_found_page import Not_found_page +from view.Close_page import Close_page class Root( object ): @@ -397,6 +398,16 @@ class Root( object ): return dict() + @expose( view = Close_page ) + def close( self ): + # this is typically only allowed in the desktop configuration + if self.__settings[ u"global" ].get( u"luminotes.allow_shutdown_command" ) is not True: + return dict() + + cherrypy.server.stop() + + return dict() + def _cp_on_http_error( self, status, message ): """ CherryPy HTTP error handler, used to display page not found and generic error pages. diff --git a/view/Close_page.py b/view/Close_page.py new file mode 100644 index 0000000..561184d --- /dev/null +++ b/view/Close_page.py @@ -0,0 +1,23 @@ +from Tags import Html, Head, Link, Body, Div, P +from config.Version import VERSION + + +class Close_page( Html ): + def __init__( self, script = None ): + Html.__init__( + self, + Head( + Link( rel = u"stylesheet", type = u"text/css", href = u"/static/css/style.css?%s" % VERSION ), + ), + Body( + Div( + P( + u"Luminotes Desktop has been shut down." + ), + P( + u"To start Luminotes again, simply launch it from your Start Menu." + ), + id = u"center_area", + ), + ), + ) diff --git a/view/Header.py b/view/Header.py index 75fc370..7570ee9 100644 --- a/view/Header.py +++ b/view/Header.py @@ -19,7 +19,8 @@ class Header( Div ): u"version", VERSION, u" | ", A( u"upgrade", href = u"http://luminotes.com/download?upgrade=True", target = "_new" ), u" | ", A( u"community", href = u"http://luminotes.com/community", target = "_new" ), u" | ", - A( u"blog", href = u"http://luminotes.com/blog/", target = "_new" ), + A( u"blog", href = u"http://luminotes.com/blog/", target = "_new" ), u" | ", + A( u"close", href = u"/close" ), class_ = u"header_links", ), class_ = u"wide_center_area",