Added "kiosk" and "show" options.
This commit is contained in:
parent
6dc5a981b3
commit
0a2f4ce4a4
3 changed files with 61 additions and 7 deletions
|
|
@ -98,6 +98,7 @@ class Setting(object):
|
||||||
self.values = kwargs.pop('values', [])
|
self.values = kwargs.pop('values', [])
|
||||||
self.filter = kwargs.pop('filter', '(?s).*')
|
self.filter = kwargs.pop('filter', '(?s).*')
|
||||||
self.filter_action = kwargs.pop('filter_action', 'None')
|
self.filter_action = kwargs.pop('filter_action', 'None')
|
||||||
|
self.check_action = kwargs.pop('check_action', 'None')
|
||||||
|
|
||||||
self.set_extra_attributes_from_keyword_args(**kwargs)
|
self.set_extra_attributes_from_keyword_args(**kwargs)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,11 @@ linux_64_dir_prefix = 'node-webkit-v{}-linux-x64'
|
||||||
default_value=True
|
default_value=True
|
||||||
type='check'
|
type='check'
|
||||||
description='Hide the app running in the taskbar'
|
description='Hide the app running in the taskbar'
|
||||||
|
[[[show]]]
|
||||||
|
display_name='Show'
|
||||||
|
default_value=True
|
||||||
|
type='check'
|
||||||
|
description='Uncheck to make your app hidden on startup.'
|
||||||
[[[visible]]]
|
[[[visible]]]
|
||||||
default_value=True
|
default_value=True
|
||||||
type='check'
|
type='check'
|
||||||
|
|
@ -191,11 +196,20 @@ linux_64_dir_prefix = 'node-webkit-v{}-linux-x64'
|
||||||
default_value=False
|
default_value=False
|
||||||
type='check'
|
type='check'
|
||||||
description='Allows window tranparency.'
|
description='Allows window tranparency.'
|
||||||
|
[[[kiosk]]]
|
||||||
|
default_value=False
|
||||||
|
type='check'
|
||||||
|
description='Puts the application is kiosk mode.'
|
||||||
|
[[[kiosk_emulation]]]
|
||||||
|
default_value=False
|
||||||
|
type='check'
|
||||||
|
description='Puts the application is kiosk emulation mode. Will automatically check off required settings that will emulate kiosk.'
|
||||||
|
check_action='set_kiosk_emulation_options'
|
||||||
|
|
||||||
[[download_settings]]
|
[[download_settings]]
|
||||||
[[[nw_version]]]
|
[[[nw_version]]]
|
||||||
display_name='Node-webkit version'
|
display_name='Node-webkit version'
|
||||||
default_value='0.9.2'
|
default_value='0.12.0'
|
||||||
values=[]
|
values=[]
|
||||||
type='list'
|
type='list'
|
||||||
button='Update'
|
button='Update'
|
||||||
|
|
@ -324,8 +338,8 @@ linux_64_dir_prefix = 'node-webkit-v{}-linux-x64'
|
||||||
window_setting_order = """['title', 'icon', 'mac_icon', 'exe_icon', 'position', 'width', 'height',
|
window_setting_order = """['title', 'icon', 'mac_icon', 'exe_icon', 'position', 'width', 'height',
|
||||||
'min_width', 'min_height',
|
'min_width', 'min_height',
|
||||||
'max_width', 'max_height', 'toolbar', 'always-on-top', 'frame',
|
'max_width', 'max_height', 'toolbar', 'always-on-top', 'frame',
|
||||||
'show_in_taskbar', 'visible', 'resizable', 'fullscreen', 'as_desktop',
|
'show_in_taskbar', 'show', 'visible', 'resizable', 'fullscreen', 'as_desktop',
|
||||||
'transparent']"""
|
'kiosk', 'transparent']"""
|
||||||
|
|
||||||
export_setting_order = """['windows-x32', 'windows-x64', 'mac-x32', 'mac-x64', 'linux-x64', 'linux-x32']"""
|
export_setting_order = """['windows-x32', 'windows-x64', 'mac-x32', 'mac-x64', 'linux-x64', 'linux-x32']"""
|
||||||
|
|
||||||
|
|
|
||||||
47
main.py
47
main.py
|
|
@ -1,6 +1,6 @@
|
||||||
from utils import log, open_folder_in_explorer
|
from utils import log, open_folder_in_explorer
|
||||||
|
|
||||||
__gui_version__ = "v0.1.17b"
|
__gui_version__ = "v0.2.0b"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
@ -13,7 +13,7 @@ from PySide.QtNetwork import QHttp
|
||||||
from PySide.QtCore import QUrl, QFile, QIODevice, QCoreApplication
|
from PySide.QtCore import QUrl, QFile, QIODevice, QCoreApplication
|
||||||
|
|
||||||
|
|
||||||
from command_line import CWD, CommandBase
|
from command_line import CWD, CommandBase, logger
|
||||||
|
|
||||||
|
|
||||||
class Validator(QtGui.QRegExpValidator):
|
class Validator(QtGui.QRegExpValidator):
|
||||||
|
|
@ -50,9 +50,16 @@ class MainWindow(QtGui.QWidget, CommandBase):
|
||||||
def update_nw_versions(self, button):
|
def update_nw_versions(self, button):
|
||||||
self.get_versions_in_background()
|
self.get_versions_in_background()
|
||||||
|
|
||||||
def __init__(self, width, height, parent=None):
|
def __init__(self, width, height, app, parent=None):
|
||||||
super(MainWindow, self).__init__(parent)
|
super(MainWindow, self).__init__(parent)
|
||||||
CommandBase.__init__(self)
|
CommandBase.__init__(self)
|
||||||
|
|
||||||
|
self.logger = logger
|
||||||
|
|
||||||
|
self.gui_app = app
|
||||||
|
self.desktop_width = app.desktop().screenGeometry().width()
|
||||||
|
self.desktop_height = app.desktop().screenGeometry().height()
|
||||||
|
|
||||||
self.options_enabled = False
|
self.options_enabled = False
|
||||||
self.output_package_json = True
|
self.output_package_json = True
|
||||||
self.setWindowIcon(QtGui.QIcon(os.path.join(CWD, 'files',
|
self.setWindowIcon(QtGui.QIcon(os.path.join(CWD, 'files',
|
||||||
|
|
@ -773,6 +780,35 @@ class MainWindow(QtGui.QWidget, CommandBase):
|
||||||
setting.value = old_val
|
setting.value = old_val
|
||||||
widget.setValue(old_val)
|
widget.setValue(old_val)
|
||||||
|
|
||||||
|
def set_kiosk_emulation_options(self, is_checked):
|
||||||
|
if is_checked:
|
||||||
|
width_field = self.find_child_by_name('width')
|
||||||
|
width_field.setText(str(self.desktop_width))
|
||||||
|
|
||||||
|
height_field = self.find_child_by_name('height')
|
||||||
|
height_field.setText(str(self.desktop_height))
|
||||||
|
|
||||||
|
toolbar_field = self.find_child_by_name('toolbar')
|
||||||
|
toolbar_field.setChecked(not is_checked)
|
||||||
|
|
||||||
|
frame_field = self.find_child_by_name('frame')
|
||||||
|
frame_field.setChecked(not is_checked)
|
||||||
|
|
||||||
|
show_field = self.find_child_by_name('show')
|
||||||
|
show_field.setChecked(is_checked)
|
||||||
|
|
||||||
|
kiosk_field = self.find_child_by_name('kiosk')
|
||||||
|
kiosk_field.setChecked(not is_checked)
|
||||||
|
|
||||||
|
fullscreen_field = self.find_child_by_name('fullscreen')
|
||||||
|
fullscreen_field.setChecked(not is_checked)
|
||||||
|
|
||||||
|
always_on_top_field = self.find_child_by_name('always-on-top')
|
||||||
|
always_on_top_field.setChecked(is_checked)
|
||||||
|
|
||||||
|
resizable_field = self.find_child_by_name('resizable')
|
||||||
|
resizable_field.setChecked(not is_checked)
|
||||||
|
|
||||||
def setting_changed(self, obj, setting, *args, **kwargs):
|
def setting_changed(self, obj, setting, *args, **kwargs):
|
||||||
if (setting.type == 'string' or
|
if (setting.type == 'string' or
|
||||||
setting.type == 'file' or
|
setting.type == 'file' or
|
||||||
|
|
@ -780,6 +816,9 @@ class MainWindow(QtGui.QWidget, CommandBase):
|
||||||
setting.value = obj.text()
|
setting.value = obj.text()
|
||||||
elif setting.type == 'check':
|
elif setting.type == 'check':
|
||||||
setting.value = obj.isChecked()
|
setting.value = obj.isChecked()
|
||||||
|
check_action = setting.check_action
|
||||||
|
if hasattr(self, check_action):
|
||||||
|
getattr(self, check_action)(obj.isChecked())
|
||||||
elif setting.type == 'list':
|
elif setting.type == 'list':
|
||||||
setting.value = obj.currentText()
|
setting.value = obj.currentText()
|
||||||
elif setting.type == 'range':
|
elif setting.type == 'range':
|
||||||
|
|
@ -922,7 +961,7 @@ if __name__ == '__main__':
|
||||||
QCoreApplication.setOrganizationName("SimplyPixelated")
|
QCoreApplication.setOrganizationName("SimplyPixelated")
|
||||||
QCoreApplication.setOrganizationDomain("simplypixelated.com")
|
QCoreApplication.setOrganizationDomain("simplypixelated.com")
|
||||||
|
|
||||||
frame = MainWindow(1000, 500)
|
frame = MainWindow(1000, 500, app)
|
||||||
frame.show_and_raise()
|
frame.show_and_raise()
|
||||||
|
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue