Code cleanup ready for reviews

This commit is contained in:
Tim Bentley 2013-03-29 09:39:41 +00:00
parent 6cd384e028
commit eb51590bec
4 changed files with 19 additions and 99 deletions

View File

@ -1,46 +0,0 @@
/******************************************************************************
* OpenLP - Open Source Lyrics Projection *
* --------------------------------------------------------------------------- *
* Copyright (c) 2008-2013 Raoul Snyman *
* Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan *
* Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, *
* Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. *
* Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, *
* Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, *
* Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, *
* Frode Woldsund, Martin Zibricky *
* --------------------------------------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the Free *
* Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
* more details. *
* *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., 59 *
* Temple Place, Suite 330, Boston, MA 02111-1307 USA *
******************************************************************************/
.ui-icon-blank {
background-image: url(images/ui-icon-blank.png);
}
.ui-icon-unblank {
background-image: url(images/ui-icon-unblank.png);
}
/* Overwrite style from jquery-mobile.css */
.ui-li .ui-btn-text a.ui-link-inherit{
white-space: normal;
}
.ui-page{
padding: 100px 100px 100px 100px;
width: 300px;
}
.ui-input-text{
width: 30px;
}

View File

@ -1,48 +0,0 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<!--
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, #
# Frode Woldsund, Martin Zibricky, Patrick Zimmermann #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-->
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
<title>${title}</title>
<link rel="stylesheet" href="/files/jquery.mobile.css" />
<link rel="stylesheet" href="/files/login.css" />
<link rel="shortcut icon" type="image/x-icon" href="/files/images/favicon.ico">
</head>
<body>
<form method="post" action="/auth/login">
<input type="hidden" name="from_page" value="${from_page}" />
<h2>${message}</h2>
</p>
<strong>User name: </strong><input type="text" name="username" value="${username}" /><br />
<strong>Password: </strong><input type="password" name="password" /><br />
<input type="submit" value="Log in" />
</form>
</body></html>

View File

@ -348,11 +348,7 @@ class HttpRouter(object):
'no_results': translate('RemotePlugin.Mobile', 'No Results'),
'options': translate('RemotePlugin.Mobile', 'Options'),
'service': translate('RemotePlugin.Mobile', 'Service'),
'slides': translate('RemotePlugin.Mobile', 'Slides'),
'title': translate('RemotePlugin.Mobile', 'OpenLP 2.1 User Login'),
'from_page': "",
'message': "",
'username': "username"
'slides': translate('RemotePlugin.Mobile', 'Slides')
}
def serve_file(self, filename=None):
@ -588,12 +584,21 @@ class HttpRouter(object):
self._http_success()
def _http_success(self):
"""
Set the HTTP success return code.
"""
cherrypy.response.status = 200
def _http_bad_request(self):
"""
Set the HTTP bad response return code.
"""
cherrypy.response.status = 400
def _http_not_found(self):
"""
Set the HTTP not found return code.
"""
cherrypy.response.status = 404
cherrypy.response.body = ["<html><body>Sorry, an error occurred </body></html>"]

View File

@ -181,6 +181,9 @@ class RemoteTab(SettingsTab):
self.password_label.setText(translate('RemotePlugin.RemoteTab', 'Password:'))
def set_urls(self):
"""
Update the display based on the data input on the screen
"""
ip_address = u'localhost'
if self.address_edit.text() == ZERO_URL:
interfaces = QtNetwork.QNetworkInterface.allInterfaces()
@ -206,6 +209,9 @@ class RemoteTab(SettingsTab):
self.stage_https_url.setText(u'<a href="%s">%s</a>' % (https_url, https_url))
def load(self):
"""
Load the configuration and update the server configuration if necessary
"""
self.port_spin_box.setValue(Settings().value(self.settings_section + u'/port'))
self.https_port_spin_box.setValue(Settings().value(self.settings_section + u'/https port'))
self.address_edit.setText(Settings().value(self.settings_section + u'/ip address'))
@ -249,6 +255,9 @@ class RemoteTab(SettingsTab):
Settings().setValue(self.settings_section + u'/password', self.password.text())
def on_twelve_hour_check_box_changed(self, check_state):
"""
Toggle the 12 hour check box.
"""
self.twelve_hour = False
# we have a set value convert to True/False
if check_state == QtCore.Qt.Checked: