Browse Source

more work on python port

sisyphus
Dustin Falgout 8 years ago
parent
commit
458a292530
  1. 19
      src/gresource/greeter-resources.gresource.xml
  2. 25
      web-greeter/bridge/Config.py
  3. 3
      web-greeter/greeter.py
  4. 0
      web-greeter/resources/css/style.css
  5. 0
      web-greeter/resources/js/ThemeUtils.js
  6. 0
      web-greeter/resources/js/_vendor/moment-with-locales.min.js
  7. 40
      web-greeter/resources/js/bootstrap.js
  8. 0
      web-greeter/resources/js/docs/Greeter.js
  9. 0
      web-greeter/resources/js/docs/GreeterConfig.js
  10. 0
      web-greeter/resources/js/docs/LightDMObjects.js
  11. 9
      web-greeter/resources/resources.qrc

19
src/gresource/greeter-resources.gresource.xml

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/com/antergos/webkit2-greeter/">
<file>css/style.css</file>
<file>js/bundle.js</file>
<!--<file>js/_vendor/moment-with-locales.min.js</file>
<file>js/LightDMObjects.js</file>
<file>js/Greeter.js</file>
<file>js/GreeterConfig.js</file>
<file>js/ThemeUtils.js</file>
<file>js/ThemeHeartbeat.js</file>-->
</gresource>
</gresources>
<!--
glib-compile-resources -\-c-name greeter_resources -\-generate -\-target greeter-resources-css.h greeter-resources.gresource.xml
glib-compile-resources -\-c-name greeter_resources -\-generate -\-target greeter-resources-css.c greeter-resources.gresource.xml
-->

25
web-greeter/bridge/Config.py

@ -26,4 +26,27 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Web Greeter; If not, see <http://www.gnu.org/licenses/>. # along with Web Greeter; If not, see <http://www.gnu.org/licenses/>.
# Standard Lib # 3rd-Party Libs
from PyQt5.QtCore import QVariant
# This Application
from whither.bridge import (
BridgeObject,
bridge,
)
class Config(BridgeObject):
def __init__(self, config, *args, **kwargs):
super().__init__(name='Config', *args, **kwargs)
self._branding, self._greeter = config.branding, config.greeter
@bridge.prop(QVariant)
def branding(self):
return self._branding
@bridge.prop(QVariant)
def greeter(self):
return self._greeter

3
web-greeter/greeter.py

@ -36,6 +36,7 @@ from whither.base.data import AttributeDict
# This Application # This Application
from bridge.Greeter import Greeter from bridge.Greeter import Greeter
from bridge.Config import Config
BASE_DIR = os.path.dirname(os.path.realpath(__file__)) BASE_DIR = os.path.dirname(os.path.realpath(__file__))
@ -51,7 +52,7 @@ class WebGreeter(App):
self.get_and_save_user_config() self.get_and_save_user_config()
self._greeter = Greeter() self._greeter = Greeter()
self._web_container.bridge_objects = (self._greeter,) self._web_container.bridge_objects = (self._greeter, Config(self._user_config))
self._web_container.initialize_bridge_objects() self._web_container.initialize_bridge_objects()
self.load_theme() self.load_theme()

0
src/gresource/css/style.css → web-greeter/resources/css/style.css

0
src/gresource/js/ThemeUtils.js → web-greeter/resources/js/ThemeUtils.js

0
src/gresource/js/_vendor/moment-with-locales.min.js → web-greeter/resources/js/_vendor/moment-with-locales.min.js vendored

40
web-greeter/resources/js/bootstrap.js vendored

@ -0,0 +1,40 @@
/*
* bootstrap.js
*
* Copyright © 2017 Antergos Developers <dev@antergos.com>
*
* This file is part of lightdm-webkit2-greeter.
*
* lightdm-webkit2-greeter 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; either version 3 of the License, or
* (at your option) any later version.
*
* lightdm-webkit2-greeter 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.
*
* The following additional terms are in effect as per Section 7 of the license:
*
* The preservation of all legal notices and author attributions in
* the material or in the Appropriate Legal Notices displayed
* by works containing it is required.
*
* You should have received a copy of the GNU General Public License
* along with lightdm-webkit2-greeter; If not, see <http://www.gnu.org/licenses/>.
*/
let _channel;
function initialize() {
new QWebChannel( qt.webChannelTransport, channel => {
_channel = channel;
window.lightdm = _channel.objects.LightDMGreeter;
window.greeter_config = _channel.objects.Config;
});
}
$(window).on('load', initialize);

0
src/gresource/js/Greeter.js → web-greeter/resources/js/docs/Greeter.js

0
src/gresource/js/GreeterConfig.js → web-greeter/resources/js/docs/GreeterConfig.js

0
src/gresource/js/LightDMObjects.js → web-greeter/resources/js/docs/LightDMObjects.js

9
web-greeter/resources/resources.qrc

@ -0,0 +1,9 @@
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/_greeter">
<file>css/style.css</file>
<file>js/bundle.js</file>
</qresource>
</RCC>
Loading…
Cancel
Save