diff --git a/Makefile b/Makefile index c496781..0aa4ca3 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,6 @@ tests: build clean: python3.3 build/scripts/build.py clean - rm -fr build/resources/* || true + rm -fr build/resources || true rm -fr build/exe.* || true rm -fr tests/temp/* || true diff --git a/commotion_client/GUI/extension_toolbar.py b/commotion_client/GUI/extension_toolbar.py new file mode 100644 index 0000000..48fdbe3 --- /dev/null +++ b/commotion_client/GUI/extension_toolbar.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +Extension Toolbar + +The toolbar object extensions can use to derive extra menu items from. + +""" +#Standard Library Imports +import logging + +#PyQt imports +from PyQt4 import QtCore +from PyQt4 import QtGui + +#Commotion Client Imports +import commotion_assets_rc + +class ExtensionToolBar(object): + """ + The central widget for the commotion client. This widget initalizes all other sub-widgets and extensions as well as defines the paramiters of the main GUI container. + + + An example of adding a single button to the menu that calls a function "save_form()" + + new_button = MenuItem + my_button.setIcon(icon.save) + my_button.setText(self.translate("menu", "Save")) + new_button.action = self.save_form + self.add_item(new_button) + + + """ + + def __init__(self, viewport): + """Sets up all the translation, logging, and core items needed for an extension toolbar. + + Args: + extension_menu_items (object): The extension specific menu-item to be used by an extension. This class is derived from the + viewport (object): The extensions viewport. This allows menu_items to have its actions interact with the current viewport. + """ + super().__init__() + self._dirty = False + self.log = logging.getLogger("commotion_client."+__name__) + self.translate = QtCore.QCoreApplication.translate + self.viewport = viewport + self.menu_items = {} + #The basic set of icons for extensions + self.icon = { + "save":QtGui.QIcon(":save32.png"), + "load":QtGui.QIcon(":load32.png"), + "user":QtGui.QIcon(":user32.png"), + "settings":QtGui.QIcon(":settings32.png"), + "full_screen_start":QtGui.QIcon(":full_screen_start32.png"), + "full_screen_end":QtGui.QIcon(":full_screen_end32.png"), + } + + def add_item(self, tool_button): + if tool_button.icon().isNull(): + tool_button.setIcon(self.icon.settings) + self.menu_items.append(tool_button) + +class MenuItem(QtGui.QToolButton): + """The menu_item template object + + To Make a basic toolbar button simply run the following. + + #From within the ExtensionToolBar + my_button = MenuItem + my_button.setIcon(self.icon.save) + my_button.setText(self.translate("menu", "Save")) + my_button.triggered.connect(self.my_save_function) + + To Make a toolbar with a menu run the following. + + #From within the ExtensionToolBar + my_menu = MenuItem + my_menu.setIcon(self.icon.settings) + my_menu.setText(self.translate("menu", "Options")) + my_menu.set_menu(True) + menu_save = QtGui.QAction("Save", icons.save, self.my_save_function) + my_menu.sub_menu.addAction(menu_save) + #Using a custom icon from an extension. + menu_load = QtGui.QAction("Load", QtGui.QIcon("icons/load.png"), statusTip=self.translate("menu", "Load a item from a file"), triggered=self.my_load_function) + my_menu.menu.addAction(menu_load) + + menuItems are QToolButtons + menuItems that have sub menu's are composed of a QMenu with QActions within it. + + QToolButton:http://pyqt.sourceforge.net/Docs/PyQt4/qtoolbutton.html + QMenu: http://pyqt.sourceforge.net/Docs/PyQt4/qmenu.html + QAction: http://pyqt.sourceforge.net/Docs/PyQt4/qaction.html + + """ + + def __init__(self, parent=None, viewport=None): + """Sets up all the core components needed for a minimal menuItem + + Args: + viewport (object): The current viewport. This allows menu_items to have its actions interact with the current viewport. + + """ + super().__init__() + self._dirty = False + self.log = logging.getLogger("commotion_client."+__name__) + self.translate = QtCore.QCoreApplication.translate + self.viewport = viewport + + def set_menu(self, value): + if value == True: + self.log.debug(self.translate("logs", "Setting toolbar item {0} to be a menu.".format(self.text()))) + #Set menu to pop up immediately. + self.setPopupMode(QtGui.QToolButton.InstantPopup) + #Create a new menu and set it + self.sub_menu = QtGui.QMenu(self) + self.setMenu(self.sub_menu) + elif value == False: + self.log.debug(self.translate("logs", "Setting toolbar item {0} to NOT be a menu.".format(self.text()))) + #Remove the menu if it exists + self.sub_menu = None + else: + self.log.debug(self.translate("logs", "{0} is not a proper value for set_menu. Please use a bool value True or False.".format(value))) + raise ValueError(self.translate("logs", "Attempted to set the menu state to an invalid value.")) + diff --git a/commotion_client/GUI/main_window.py b/commotion_client/GUI/main_window.py index df2c67f..86998cc 100644 --- a/commotion_client/GUI/main_window.py +++ b/commotion_client/GUI/main_window.py @@ -19,12 +19,14 @@ from PyQt4 import QtGui #Commotion Client Imports -from commotion_client.assets import commotion_assets_rc +import commotion_assets_rc from commotion_client.GUI.menu_bar import MenuBar from commotion_client.GUI.crash_report import CrashReport from commotion_client.GUI import welcome_page +from commotion_client.GUI import toolbar_builder from commotion_client.utils import extension_manager + class MainWindow(QtGui.QMainWindow): """ The central widget for the commotion client. This widget initalizes all other sub-widgets and extensions as well as defines the paramiters of the main GUI container. @@ -45,8 +47,8 @@ def __init__(self, parent=None): self.setup_menu_bar() #Setup extension manager for viewports self.ext_manager = extension_manager.ExtensionManager() - self.viewport = welcome_page.ViewPort(self) - self.load_viewport(self.viewport) + self.viewport = welcome_page.ViewPort + self.apply_viewport(self.viewport) #Default Paramiters #TODO to be replaced with paramiters saved between instances later try: @@ -104,18 +106,39 @@ def set_viewport(self): """Load and set viewport to next viewport and load viewport """ self.log.info(self.next_extension) next_view = self.next_extension - next_viewport = self.ext_manager.load_user_interface(str(next_view), "main") - viewport_object = next_viewport(self) - self.load_viewport(viewport_object) + ext_viewport = self.ext_manager.load_user_interface(str(next_view), "main") + ext_toolbar = self.ext_manager.load_user_interface(str(next_view), "toolbar") + self.apply_viewport(ext_viewport, ext_toolbar) - def load_viewport(self, viewport): + def apply_viewport(self, viewport, toolbar=None): """Apply current viewport to the central widget and set up proper signal's for communication. """ - testme = self.setCentralWidget(viewport) - self.viewport = viewport + #Create central widget (replaced due to splitter) + # self.central_widget = QtGui.QWidget(self) + self.central_widget = QtGui.QSplitter(QtCore.Qt.Vertical, self) + self.viewport = viewport(self.central_widget) + if not toolbar: + toolbar = False + self.toolbar = self.init_toolbar(toolbar) + + #Set up central layout (Replaced due to splitter) + #self.central_layout = QtGui.QVBoxLayout(self.central_widget) + + self.scroll_area = QtGui.QScrollArea(self.central_widget) + self.scroll_area.setWidgetResizable(True) + self.scroll_area.setWidget(self.viewport) + + #add scroll area to central layout (replaced due to splitter) + #self.central_layout.addWidget(self.scroll_area) + + self.central_widget.addWidget(self.scroll_area) + self.central_widget.addWidget(self.toolbar) + + self.setCentralWidget(self.central_widget) + self.init_viewport_signals() + self.central_widget.show() self.viewport.show() - self.log.info(testme) - self.log.info(self.centralWidget()) + def init_viewport_signals(self): #connect viewport extension to crash reporter self.viewport.data_report.connect(self.crash_report.crash_info) self.crash_report.crash_override.connect(self.viewport.start_report_collection) @@ -136,6 +159,12 @@ def change_viewport(self, viewport): else: self.set_viewport() + def init_toolbar(self, ext_toolbar): + """ """ + toolbar = toolbar_builder.ToolBar(self.central_widget, self.viewport, ext_toolbar,) + return toolbar + + def purge(self): """ Closes the menu and sets its data up for immediate removal. diff --git a/commotion_client/GUI/system_tray.py b/commotion_client/GUI/system_tray.py index ff12bcf..f826cdf 100644 --- a/commotion_client/GUI/system_tray.py +++ b/commotion_client/GUI/system_tray.py @@ -6,7 +6,7 @@ from PyQt4 import QtGui #Commotion Client Imports -from commotion_client.assets import commotion_assets_rc +import commotion_assets_rc class TrayIcon(QtGui.QWidget): """ diff --git a/commotion_client/GUI/toolbar.py b/commotion_client/GUI/toolbar.py new file mode 100644 index 0000000..2d3ad8c --- /dev/null +++ b/commotion_client/GUI/toolbar.py @@ -0,0 +1,168 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +Toolbar + +The core toolbar object for commotion viewports. + +The tool bar is an object that is created in the main viewport. This tool-bar has pre-built objects for common functions and an add-on section that will allow a developer building a extension to add functionality they need. + + +""" +#Standard Library Imports +import logging + +#PyQt imports +from PyQt4 import QtCore +from PyQt4 import QtGui + +#Commotion Client Imports +from commotion_client.assets import commotion_assets_rc +from commotion_client.GUI import extension_toolbar + + +class ToolBar(QtGui.QWidget): + """ + The Core toolbar object that populates manditory toolbar sections. + """ + + def __init__(self, parent=None, extension_toolbar=None, viewport): + """Creates the core toolbar including any extension toolbar passed to it. + + Initializes the core functionality of the toolbar. If an extension_toolbar object is also passed to the toolbar it will attempt to add the extension toolbar into itself. + + Args: + extension_toolbar (object): The extension specific menu-item to be used by an extension. This class is derived from the "commotion_client/GUI/extension_toolbar.ExtensionToolBar" object. + viewport (object): The current viewport. This allows menu_items to have its actions interact with the current viewport. + + Raises: + exception: Description. + + """ + super().__init__() + self._dirty = False + self.log = logging.getLogger("commotion_client."+__name__) + self.translate = QtCore.QCoreApplication.translate + + self.viewport = viewport + #Create toolbar object + self.toolbar = QtGui.QToolBar(self) + #Create & add settings item + self.settings = self.init_settings() + self.toolbar.addWidget(self.settings) + #Create & add user item +# self.user = self.init_user() +# self.toolbar.addWidget(self.user) + #Create extension toolbar section if needed +# if extension_toolbar: +# self.extension_toolbar = extension_toolbar(self, viewport) +# self.init_extension_toolbar() + + def init_settings(self): + """short description + + long description + + Args: + name (type): Description. + + Returns: + Description. + + Raises: + exception: Description. + + """ + settings_menu = extension_toolbar.MenuItem(self, self.viewport) + settings_menu.setIcon(extension_toolbar.icon.settings) + settings_menu.setText(self.translate("menu", "Settings")) + settings_menu.set_menu = True + extensions_item = QtGui.QAction(self.translate("menu", "&Extensions"), + statusTip=self.translate("menu", "Open the extensions menu."), + triggered=self.load_extensions, + parent=settings_menu) + + settings_item = QtGui.QAction(self.translate("menu", "&Settings"), + QtGui.QIcon("icons/load.png"), + statusTip=self.translate("menu", "Open the settings menu."), + triggered=self.load_settings, + parent=settings_menu) + about_item = QtGui.QAction(self.translate("menu", "&About"), + QtGui.QIcon("icons/load.png"), + statusTip=self.translate("menu", "Open the \'about us\' page"), + triggered=self.load_about, + parent=settings_menu) + exit_item = QtGui.QAction(self.translate("menu", "&Exit"), + QtGui.QIcon("icons/load.png"), + statusTip=self.translate("menu", "Exit the application."), + triggered=self.exit_application, + parent=settings_menu) + update_item = QtGui.QAction(self.translate("menu", "&Update"), + QtGui.QIcon("icons/load.png"), + statusTip=self.translate("menu", "Open the updates page."), + triggered=self.load_update, + parent=settings_menu) + return settings_menu + + def load_settings(self): + """Opens the settings menu in the main viewport """ + pass + + def load_about(self): + """Opens the about page in the main viewport """ + pass + + def load_update(self): + """Opens the updates menu in the main viewport """ + pass + + def load_user(self): + """Opens the user menu in the main viewport """ + pass + + def exit_application(self): + """Exits the application.""" + pass + + def load_extensions(self): + """Opens the extensions menu in the main viewport """ + pass + + def init_user(self): + """short description + + long description + + Args: + name (type): Description. + + Returns: + Description. + + Raises: + exception: Description. + + """ + pass + + + + def init_extension_toolbar(self): + """short description + + long description + + Args: + name (type): Description. + + Returns: + Description. + + Raises: + exception: Description. + + """ + for menu_item in self.extension_menu.menu_items: + try: + self.toolbar.addWidget(menu_item) diff --git a/commotion_client/GUI/toolbar_builder.py b/commotion_client/GUI/toolbar_builder.py new file mode 100644 index 0000000..3817c6c --- /dev/null +++ b/commotion_client/GUI/toolbar_builder.py @@ -0,0 +1,171 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +Toolbar + +The core toolbar object for commotion viewports. + +The tool bar is an object that is created in the main viewport. This tool-bar has pre-built objects for common functions and an add-on section that will allow a developer building a extension to add functionality they need. + +""" +#Standard Library Imports +import logging + +#PyQt imports +from PyQt4 import QtCore +from PyQt4 import QtGui + +#Commotion Client Imports +import commotion_assets_rc +from commotion_client.GUI import extension_toolbar + + +class ToolBar(QtGui.QWidget): + """ + The Core toolbar object that populates manditory toolbar sections. + """ + + def __init__(self, viewport, parent=None, extension_toolbar=None): + """Creates the core toolbar including any extension toolbar passed to it. + + Initializes the core functionality of the toolbar. If an extension_toolbar object is also passed to the toolbar it will attempt to add the extension toolbar into itself. + + Args: + extension_toolbar (object): The extension specific menu-item to be used by an extension. This class is derived from the "commotion_client/GUI/extension_toolbar.ExtensionToolBar" object. + viewport (object): The current viewport. This allows menu_items to have its actions interact with the current viewport. + + Raises: + exception: Description. + + """ + super().__init__() + self._dirty = False + self.log = logging.getLogger("commotion_client."+__name__) + self.translate = QtCore.QCoreApplication.translate + + self.viewport = viewport + #Create toolbar object + self.toolbar = QtGui.QToolBar(self) + self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon) + #Create & add settings item + self.init_settings() + self.toolbar.addWidget(self.settings) + #Create & add user item +# self.user = self.init_user() +# self.toolbar.addWidget(self.user) + #Create extension toolbar section if needed +# if extension_toolbar: +# self.extension_toolbar = extension_toolbar(self, viewport) +# self.init_extension_toolbar() + + def init_settings(self): + """short description + + long description + + Args: + name (type): Description. + + Returns: + Description. + + Raises: + exception: Description. + + """ + self.settings = QtGui.QToolButton(self.toolbar) + # settings = extension_toolbar.MenuItem(self.toolbar, self.viewport) +# self.settings.setText(self.translate("menu", "Settings")) + # settings.set_menu(True) +# self.settings.setIcon(QtGui.QIcon(":logo48.png")) + self.settings.setPopupMode(QtGui.QToolButton.InstantPopup) + self.settings.setMenu(QtGui.QMenu(self.settings)) + + + extensions_item = QtGui.QAction(self.translate("menu", "&Extensions"), self.settings) + extensions_item.setStatusTip(self.translate("menu", "Open the extensions menu.")) + extensions_item.triggered.connect(self.load_extensions) + self.settings.menu().addAction(extensions_item) + + settings_item = QtGui.QAction(QtGui.QIcon(":settings32.png"), self.translate("menu", "&Settings"), self.settings) + settings_item.setStatusTip(self.translate("menu", "Open the settings menu.")) + settings_item.triggered.connect(self.load_settings) + self.settings.menu().addAction(settings_item) + self.settings.setDefaultAction(settings_item) + + about_item = QtGui.QAction(self.translate("menu", "&About"), self.settings) + about_item.setStatusTip(self.translate("menu", "Open the \'about us\' page")) + about_item.triggered.connect(self.load_about) + self.settings.menu().addAction(about_item) + + exit_item = QtGui.QAction(self.translate("menu", "&Exit"), self.settings) + exit_item.setStatusTip(self.translate("menu", "Exit the application.")) + exit_item.triggered.connect(self.exit_application) + self.settings.menu().addAction(exit_item) + + update_item = QtGui.QAction(self.translate("menu", "&Update"), self.settings) + update_item.setStatusTip(self.translate("menu", "Open the updates page.")) + update_item.triggered.connect(self.load_update) + self.settings.menu().addAction(update_item) + + + def load_settings(self): + """Opens the settings menu in the main viewport """ + pass + + def load_about(self): + """Opens the about page in the main viewport """ + pass + + def load_update(self): + """Opens the updates menu in the main viewport """ + pass + + def load_user(self): + """Opens the user menu in the main viewport """ + pass + + def exit_application(self): + """Exits the application.""" + pass + + def load_extensions(self): + """Opens the extensions menu in the main viewport """ + pass + + def init_user(self): + """short description + + long description + + Args: + name (type): Description. + + Returns: + Description. + + Raises: + exception: Description. + + """ + pass + + + + def init_extension_toolbar(self): + """short description + + long description + + Args: + name (type): Description. + + Returns: + Description. + + Raises: + exception: Description. + """ + for menu_item in self.extension_menu.menu_items: + self.toolbar.addWidget(menu_item) diff --git a/commotion_client/assets/commotion_assets.qrc b/commotion_client/assets/commotion_assets.qrc index 5264746..a3dcf39 100644 --- a/commotion_client/assets/commotion_assets.qrc +++ b/commotion_client/assets/commotion_assets.qrc @@ -1,6 +1,23 @@ - + + + images/alert32.png + images/alert48.png + images/alert62.png + + images/save32.png + images/load32.png + images/user32.png + images/settings32.png + images/full_screen_start32.png + images/full_screen_end32.png + + images/question_mark_filled41.png + images/question_mark_filled20.png + + images/loading62.gif + images/logo16.png images/logo32.png images/logo48.png @@ -8,15 +25,5 @@ images/logo256.png images/logo512.png images/logo1024.png - - images/alert32.png - images/alert48.png - images/alert62.png - - images/loading62.gif - - images/question_mark_filled41.png - images/question_mark_filled20.png - diff --git a/commotion_client/assets/images/full_screen_end32.png b/commotion_client/assets/images/full_screen_end32.png new file mode 100644 index 0000000..52f6aff Binary files /dev/null and b/commotion_client/assets/images/full_screen_end32.png differ diff --git a/commotion_client/assets/images/full_screen_start32.png b/commotion_client/assets/images/full_screen_start32.png new file mode 100644 index 0000000..abcfe4c Binary files /dev/null and b/commotion_client/assets/images/full_screen_start32.png differ diff --git a/commotion_client/assets/images/load32.png b/commotion_client/assets/images/load32.png new file mode 100644 index 0000000..6105c49 Binary files /dev/null and b/commotion_client/assets/images/load32.png differ diff --git a/commotion_client/assets/images/save32.png b/commotion_client/assets/images/save32.png new file mode 100644 index 0000000..3d39b6d Binary files /dev/null and b/commotion_client/assets/images/save32.png differ diff --git a/commotion_client/assets/images/settings32.png b/commotion_client/assets/images/settings32.png new file mode 100644 index 0000000..71108d3 Binary files /dev/null and b/commotion_client/assets/images/settings32.png differ diff --git a/commotion_client/assets/images/user32.png b/commotion_client/assets/images/user32.png new file mode 100644 index 0000000..d947b94 Binary files /dev/null and b/commotion_client/assets/images/user32.png differ diff --git a/commotion_client/extensions/config_editor/main.py b/commotion_client/extensions/config_editor/main.py index 13d5cbf..080fa5b 100644 --- a/commotion_client/extensions/config_editor/main.py +++ b/commotion_client/extensions/config_editor/main.py @@ -19,6 +19,9 @@ from PyQt4 import QtCore from PyQt4 import QtGui + +from commotion_client.GUI import extension_toolbar + #import python modules created by qtDesigner and converted using pyuic4 #from extensions.core.config_manager.ui import Ui_config_manager.py from ui import Ui_config_manager @@ -42,7 +45,6 @@ def __init__(self, parent=None): self.start_report_collection.connect(self.send_signal) self._dirty = False - @property def is_dirty(self): """The current state of the viewport object """ @@ -58,3 +60,8 @@ def send_error(self): """HI""" self.error_report.emit("THIS IS AN ERROR MESSAGE!!!") pass + + + +class ToolBar(extension_toolbar.ExtensionToolBar): + pass diff --git a/commotion_client/extensions/config_editor/ui/config_manager.ui b/commotion_client/extensions/config_editor/ui/config_manager.ui index 826e15d..2035847 100644 --- a/commotion_client/extensions/config_editor/ui/config_manager.ui +++ b/commotion_client/extensions/config_editor/ui/config_manager.ui @@ -6,8 +6,8 @@ 0 0 - 822 - 2413 + 760 + 2260 @@ -24,1901 +24,1712 @@ Commotion Configuration Manager - + :/logo16.png:/logo16.png THIS NEEDS NEW POP UP TEXT!!! - - - - 30 - 50 - 746 - 2336 - - - - - - - - - - - - 11 - 50 - false - - - - - - - Security Settings - - - - - - - Security related settings. - - - - - - - - - - - 6 - - - - - - 0 - 0 - - - - announce - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - Setting this to true will cause your device to advertise any gateway it has to the internet to the mesh. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - 0 - 0 - - - - True/False - - - - - - - - 0 - 0 - - - - - - - Advertise your gateway to the mesh. - - - - - - - - - - - - - 6 - - - - - - 0 - 0 - - - - encryption - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - Encrypt data over the mesh using WPA-PSK2 and a shared network key. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - 0 - 0 - - - - - - - On/Off - - - - - - - - 0 - 0 - - - - - - - Choose whether or not to encrypt data sent between mesh devices for added security. - - - - - - - - - - - 6 - - - - - 6 - - - - - - 0 - 0 - - - - key (Mesh Encryption Password) - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - To encrypt data between devices, each device must share a common mesh encryption password. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - Key - - - - - - - - - - - - - - Confirm - - - - - - - - - - - - - 0 - 0 - - - - To encrypt data between devices, each device must share a common mesh encryption password. This password must be between 8 and 63 printable ASCII characters. - - - true - - - - - - - - - - - 6 - - - - - - 0 - 0 - - - - serval - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - Route signing is the signing of known/trusted routes by nodes on the network. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - 0 - 0 - - - - On/Off - - - - - - - - 0 - 0 - - - - - - - Use serval route signing to have devices on this mesh sign and authenticate routes that they receive. - - - - - - - - - - - 6 - - - - - 6 - - - - - - 0 - 0 - - - - mdp_keyring (Mesh Keychain) - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - To ensure that only authorized devices can route traffic on your Commotion mesh network, one Shared Mesh Keychain file can be generated and shared by all devices. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - Browse... - - - - - - - New - - - - - - - - - - 0 - 0 - - - - If a Shared Mesh Keychain file was provided to you by a network administrator or another community member, you can browse your computer for it here to join this device to an existing mesh network. Otherwise, you can create a new keychain to share with those you wish to mesh with. - - - true - - - - - - - - - - - 6 - - - - - - 0 - 0 - - - - mdp_sid (Keychain Fingerprint) - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - This is the fingerprint of the above mesh keychain. It will change depending upon the keyring uploaded. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - 0 - 0 - - - - 0000000000000000000000000000000000000000000000000000000000000000 - - - - - - - - - - - - - - - - - - 11 - 50 - false - - - - - - - Networking Settings - - - - - - - Network related settings. - - - - - - - - - 6 - - - - - 6 - - - - - - 0 - 0 - - - - routing (Mesh Routing Protocol) - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - The method of communication that devices use to communicate with each other on the mesh. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - O.L.S.R (Optimized Link State Routing Protocol) - - - - - Babel - - - - - B.A.T.M.A.N (Better Approach To Mobile Adhoc Networking) - - - - - - - - - 0 - 0 - - - - The mesh routing protocol used by devices to communicate over the mesh. - - - true - - - - - - - - - - - 6 - - - - - - 0 - 0 - - - - mode - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - This is the fingerprint of the above mesh keychain. It will change depending upon the keyring uploaded. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - 0 - 0 - - - - adhoc - - - - - - - - - - - - - 6 - - - - - - 0 - 0 - - - - type - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - This is the fingerprint of the above mesh keychain. It will change depending upon the keyring uploaded. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - 0 - 0 - - - - mesh - - - - - - - - - - - - - 6 - - - - - - 0 - 0 - - - - channel - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - All of the mesh devices on a mesh network need to be on the same frequency and channel to communicate. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - 2.4 GHz - - - - - - - 5 GHz - - - - - - - - - - - - Select the radio frequency that devices on this will use to connect to the mesh. - - - - - - - - - - - - - 0 - 0 - - - - What channel should devices use to communicate on this mesh. - - - - - - - - - - - 6 - - - - - 6 - - - - - - 0 - 0 - - - - ssid (Mesh Network Name) - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - Commotion networks share a network-wide name. This must be the same across all devices on the same mesh. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - - 0 - 0 - - - - Commotion networks share a network-wide name. This must be the same across all devices on the same mesh. + + + + + + + + + + 0 + 0 + + + + ipgen (Auto-Generate the IP Address) + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + I NEED HELP TXT!!!! + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + On/Off + + + + + + + + 0 + 0 + + + + Auto-generate a bssid based upon the SSID and channel set in the profile. + + + + + + + + + + + + Select the radio frequency that devices on this will use to connect to the mesh. + + + + + + + + 0 + 0 + + + + Commotion networks share a network-wide name. This must be the same across all devices on the same mesh. - - - true - - - - - - - - - - - 6 - - - - - - 0 - 0 - - - - bssidgen (Auto-Generate BSSID) - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - - - - - On/Off - - - - - - - - 0 - 0 - - - - Auto-generate a bssid based upon the SSID and channel set in the profile. - - - - - - - - - - - 6 - - - - - 6 - - - - - - 0 - 0 - - - - bssid (Basic Identifier) - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - The adhoc BSSID must be shared by all devices in a particular mesh network. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - - 0 - 0 - - - - This is the basic identifier of a wireless mesh network (this takes priority over SSID) + + + true + + + + + + + + + + 0 + 0 + + + + bssidgen (Auto-Generate BSSID) + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + + + + + + + + + + 0 + 0 + + + + 4FIX THIS TEXT FILL WITH REAL TEXT GIVE ME CONTENT!!!!!!!!!!!! + + + true + + + + + + + + + + 0 + 0 + + + + dns + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + I NEED HELP TXT!!!! + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + + + + + 0 + 0 + + + + bssid (Basic Identifier) + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + The adhoc BSSID must be shared by all devices in a particular mesh network. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + + 0 + 0 + + + + channel + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + All of the mesh devices on a mesh network need to be on the same frequency and channel to communicate. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + 2.4 GHz + + + + + + + 5 GHz + + + + + + + + + + + + + 0 + 0 + + + + 2FIX THIS TEXT FILL WITH REAL TEXT GIVE ME CONTENT!!!!!!!!!!!! + + + true + + + + + + + + + + 0 + 0 + + + + ssid (Mesh Network Name) + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + Commotion networks share a network-wide name. This must be the same across all devices on the same mesh. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + + 0 + 0 + + + + ipgenmask (IP Mask forAuto-Generated IP Address) + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + I NEED HELP TXT!!!! + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + + + 0 + 0 + + + + 3FIX THIS TEXT FILL WITH REAL TEXT GIVE ME CONTENT!!!!!!!!!!!! + + + true + + + + + + + + + + 0 + 0 + + + + ip (IP Address) + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + I NEED HELP TXT!!!! + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + 0 + 0 + + + + 5FIX THIS TEXT FILL WITH REAL TEXT GIVE ME CONTENT!!!!!!!!!!!! + + + true + + + + + + + + 0 + 0 + + + + This is the basic identifier of a wireless mesh network (this takes priority over SSID) - - - true - - - - - - - - - - - 6 - - - - - - 0 - 0 - - - - family (Internet Protocol Family) - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - This will determine the acceptable values for all addresses in the profile. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - IPV4 - - - - - - - IPV6 - - - - - - - - - - - - The communication protocol that determines the basic addressing of the network. - - - - - - - - - 6 - - - - - 6 - - - - - - 0 - 0 - - - - netmask - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - The adhoc BSSID must be shared by all devices in a particular mesh network. - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - - 0 - 0 - - - - FIX THIS TEXT FILL WITH REAL TEXT GIVE ME CONTENT!!!!!!!!!!!! - - - true - - - - - - - - - 6 - - - - - 6 - - - - - - 0 - 0 - - - - ipgen (Auto-Generate the IP Address) - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - I NEED HELP TXT!!!! - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - - 0 - 0 - - - - FIX THIS TEXT FILL WITH REAL TEXT GIVE ME CONTENT!!!!!!!!!!!! - - - true - - - - - - - - - 6 + + + true + + + + + + + + + + 0 + 0 + + + + family (Internet Protocol Family) + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + This will determine the acceptable values for all addresses in the profile. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + IPV4 + + + + + + + IPV6 + + + + + + + + + + + + The communication protocol that determines the basic addressing of the network. + + + + + + + + + + 0 + 0 + + + + netmask + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + The adhoc BSSID must be shared by all devices in a particular mesh network. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + + + 0 + 0 + + + + 1FIX THIS TEXT FILL WITH REAL TEXT GIVE ME CONTENT!!!!!!!!!!!! + + + true + + + + + + + + 11 + 50 + false + + + + + + + Networking Settings + + + + + + + + + + 0 + 0 + + + + routing (Mesh Routing Protocol) + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + The method of communication that devices use to communicate with each other on the mesh. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + + 0 + 0 + + + + mode + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + This is the fingerprint of the above mesh keychain. It will change depending upon the keyring uploaded. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + 0 + 0 + + + + adhoc + + + + + + + + + + 0 + 0 + + + + type + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + This is the fingerprint of the above mesh keychain. It will change depending upon the keyring uploaded. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + O.L.S.R (Optimized Link State Routing Protocol) - - - - 6 - - - - - - 0 - 0 - - - - ipgenmask (IP Mask forAuto-Generated IP Address) - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - I NEED HELP TXT!!!! - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - - 0 - 0 - - - - FIX THIS TEXT FILL WITH REAL TEXT GIVE ME CONTENT!!!!!!!!!!!! - - - true - - - - - - - - - 6 + + + + Babel - - - - 6 - - - - - - 0 - 0 - - - - ip (IP Address) - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - I NEED HELP TXT!!!! - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - - 0 - 0 - - - - FIX THIS TEXT FILL WITH REAL TEXT GIVE ME CONTENT!!!!!!!!!!!! - - - true - - - - - - - - - 6 + + + + B.A.T.M.A.N (Better Approach To Mobile Adhoc Networking) - - - - 6 - - - - - - 0 - 0 - - - - dns - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - I NEED HELP TXT!!!! - - - - - - - :/filled?20.png:/filled?20.png - - - - 20 - 20 - - - - false - - - true - - - true - - - - - - - - - - - - - 0 - 0 - - - - FIX THIS TEXT FILL WITH REAL TEXT GIVE ME CONTENT!!!!!!!!!!!! - - - true - - - - - - - - - + + + + + + + + + + + + + 0 + 0 + + + + What channel should devices use to communicate on this mesh. + + + + + + + + + + 0 + 0 + + + + The mesh routing protocol used by devices to communicate over the mesh. + + + true + + + + + + + + 0 + 0 + + + + mesh + + + + + + + Network related settings. + + + + + + + + + + + + + + + + + 11 + 50 + false + + + + + + + Security Settings + + + + + + + Security related settings. + + + + + + + + + + + + 0 + 0 + + + + announce + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + Setting this to true will cause your device to advertise any gateway it has to the internet to the mesh. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + + 0 + 0 + + + + True/False + + + + + + + + 0 + 0 + + + + + + + Advertise your gateway to the mesh. + + + + + + + + + + + + 0 + 0 + + + + encryption + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + Encrypt data over the mesh using WPA-PSK2 and a shared network key. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + On/Off + + + + + + + + 0 + 0 + + + + + + + Choose whether or not to encrypt data sent between mesh devices for added security. + + + + + + + + + + + + 0 + 0 + + + + key (Mesh Encryption Password) + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + To encrypt data between devices, each device must share a common mesh encryption password. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + Key + + + + + + + + + + + + + + Confirm + + + + + + + + + + + + + 0 + 0 + + + + To encrypt data between devices, each device must share a common mesh encryption password. This password must be between 8 and 63 printable ASCII characters. + + + true + + + + + + + + + + 0 + 0 + + + + serval + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + Route signing is the signing of known/trusted routes by nodes on the network. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + + 0 + 0 + + + + On/Off + + + + + + + + 0 + 0 + + + + + + + Use serval route signing to have devices on this mesh sign and authenticate routes that they receive. + + + + + + + + + + + + 0 + 0 + + + + mdp_keyring (Mesh Keychain) + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + To ensure that only authorized devices can route traffic on your Commotion mesh network, one Shared Mesh Keychain file can be generated and shared by all devices. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + + Browse... + + + + + + + New + + + + + + + + + + 0 + 0 + + + + If a Shared Mesh Keychain file was provided to you by a network administrator or another community member, you can browse your computer for it here to join this device to an existing mesh network. Otherwise, you can create a new keychain to share with those you wish to mesh with. + + + true + + + + + + + + + + 0 + 0 + + + + mdp_sid (Keychain Fingerprint) + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + This is the fingerprint of the above mesh keychain. It will change depending upon the keyring uploaded. + + + + + + + :/filled?20.png:/filled?20.png + + + + 20 + 20 + + + + false + + + true + + + true + + + + + + + + + + 0 + 0 + + + + 0000000000000000000000000000000000000000000000000000000000000000 + + + + + + diff --git a/commotion_client/tests/test_util_config.py b/commotion_client/tests/test_util_config.py deleted file mode 100644 index 2020274..0000000 --- a/commotion_client/tests/test_util_config.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from utils import config - - - -def testGetAll(confType): - checkConf = config.findConfigs("global") - return checkConf - -def testGetSingle(confType, name): - checkName = config.findConfigs("global", "testme") - return checkName - -def runTests(): - #Move test conf files into data folder - fs.move(testFiles, newTestLocation) #NOT REAL - confTypes = ["global", "user", "extension"] - brokenConfTypes = ["brokenString", 5, "\n", "\0", "badFormatFile", "missingNameValueJsonFile"] - for CT in confTypes: - assertNotFail(testGetAll(CT)) #NOT REAL - for CT in brokenConfTypes: - assertFailNicely(testGetAll(CT)) #NOT REAL - - correctNames = ["GlobalName01", "UserName01", "extensionName01"] - brokeNames = ["GlobalBROKEName01", "UserBROKEName01", "extensionBROKEName01"] - #working conf broken name - for CT in confTypes: - for CN in correctNames: - assertNotFail(testGetSingle(CT, CN)) #NOT REAL - #working name broken conf - for CT in confTypes: - for CN in brokenNames: - assertNotFail(testGetSingle(CT, CN)) #NOT REAL - #Both broken - for CT in brokenConfTypes: - for CN in brokenNames: - assertNotFail(testGetSingle(CT, CN)) #NOT REAL - diff --git a/setup.py b/setup.py index a72c3b3..ec3bfb1 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ core_pkgs = ["commotion_client", "utils", "GUI", "assets"] # Include compiled assets file. -assets_file = os.path.join("commotion_client", "assets", "commotion_assets_rc.py") +assets_file = os.path.join("build", "resources", "commotion_assets_rc.py") # Place compiled assets file into the root directory. include_assets = (assets_file, "commotion_assets_rc.py") all_assets = [include_assets]