def __init__(self):
        super(Dialog, self).__init__()

        # Setup the widget.
        self.setObjectName("3Dfindit_Dialog")
        self.setWindowTitle("3DfindIT")

        # Grab the browser.
        from freecad.cadenas3dfindit import browser
        self.webView = browser.getInstance().getBrowser()
        self.threeDNativeAPI = browser.getInstance().getThreeDNativeAPI()

        # Prepare a simple layout.
        self.layout = QtWidgets.QVBoxLayout(self)
        self.layout.addLayout(QtWidgets.QHBoxLayout())
        self.layout.addWidget(self.webView)

        # Setup our page. We want our own profile so other browsers in FreeCAD
        # can't interfere with our cookies. We also want our own page so we can
        # ask the user what to do if we encounter any SSL errors.
        profile = QtWebEngineWidgets.QWebEngineProfile("3Dfindit",
                                                       self.webView)
        page = MyWebEnginePage(
            QtWebEngineWidgets.QWebEnginePage(profile, self.webView))
        self.webView.setPage(page)

        # Setup our webchannel.
        channel = QtWebChannel.QWebChannel(self)
        channel.registerObject("ThreeDfinditNativeAPI", self.threeDNativeAPI)
        self.webView.page().setWebChannel(channel)

        # Re-direct to landing page.
        self.webView.setUrl(
            "https://freecad-embedded.3dfindit.com/?webview=QTWEBCHANNEL")
Ejemplo n.º 2
0
    def __init__(self, parent: Optional[QtWidgets.QWidget] = None, url: str = "https://www.hydroffice.org") -> None:
        super().__init__(parent)

        self.setWindowTitle('Browser')

        self._actions = {}
        self._create_menu()

        self._tool_bar = QtWidgets.QToolBar()
        self._tool_bar.setIconSize(QtCore.QSize(16, 16))
        self.addToolBar(self._tool_bar)
        for action in self._actions.values():
            if not action.icon().isNull():
                self._tool_bar.addAction(action)

        self.address_line_edit = QtWidgets.QLineEdit()
        self.address_line_edit.setClearButtonEnabled(True)
        # noinspection PyUnresolvedReferences
        self.address_line_edit.returnPressed.connect(self._load)
        self._tool_bar.addWidget(self.address_line_edit)

        self.view = QtWebEngineWidgets.QWebEngineView()
        # self.view.settings().setAttribute(QtWebEngineWidgets.QWebEngineSettings.PluginsEnabled, True)
        # self.view.settings().setAttribute(QtWebEngineWidgets.QWebEngineSettings.FullScreenSupportEnabled, True)
        # self.view.settings().setAttribute(QtWebEngineWidgets.QWebEngineSettings.AllowRunningInsecureContent, True)
        # self.view.settings().setAttribute(QtWebEngineWidgets.QWebEngineSettings.SpatialNavigationEnabled, True)
        self.view.settings().setAttribute(QtWebEngineWidgets.QWebEngineSettings.JavascriptEnabled, True)
        self.view.settings().setAttribute(QtWebEngineWidgets.QWebEngineSettings.JavascriptCanOpenWindows, True)
        self.view.settings().setAttribute(
            QtWebEngineWidgets.QWebEngineSettings.WebAttribute.LocalContentCanAccessRemoteUrls, True)
        self.view.settings().setAttribute(
            QtWebEngineWidgets.QWebEngineSettings.WebAttribute.LocalContentCanAccessFileUrls, True)
        # self.interceptor = RequestInterceptor()
        self.profile = QtWebEngineWidgets.QWebEngineProfile()
        # self.profile.setRequestInterceptor(self.interceptor)
        # noinspection PyUnresolvedReferences
        self.profile.downloadRequested.connect(self._download_requested)
        self.profile.setPersistentCookiesPolicy(QtWebEngineWidgets.QWebEngineProfile.NoPersistentCookies)
        self.profile.setHttpCacheType(QtWebEngineWidgets.QWebEngineProfile.NoCache)
        self.profile.setPersistentStoragePath(self._web_engine_folder())
        self.page = WebEnginePage(self.profile, self.view)
        self.view.setPage(self.page)

        # noinspection PyUnresolvedReferences
        self.view.page().titleChanged.connect(self.setWindowTitle)
        # noinspection PyUnresolvedReferences
        self.view.page().urlChanged.connect(self._url_changed)
        self.setCentralWidget(self.view)

        self.change_url(url=url)
 def test_WebEngineView_findText_exists(self):
     qApp = (QtWidgets.QApplication.instance()
             or QtWidgets.QApplication([]))
     view = QtWebEngineWidgets.QWebEngineView()
     with self.assertRaises(TypeError):
         view.findText(123)
     view.findText("nothing")
Ejemplo n.º 4
0
    def __init__(self,
                 files: t.List[pl.Path],
                 udpipe: pl.Path,
                 optimal_topics: bool,
                 parent: t.Optional[qw.QWidget] = None,
                 f: qq.WindowFlags = qq.WindowFlags()):
        super().__init__(parent, f)

        # other

        model = TopicDefinitionModel()
        thread = TopicsDefinitionThread(files, udpipe, optimal_topics)

        # widget

        webview = qweb.QWebEngineView()

        frame = qw.QFrame()
        frame.setFrameShape(qw.QFrame.StyledPanel)

        table_tv = qw.QTableView()
        table_tv.setModel(model)

        splitter = qw.QSplitter(qq.Horizontal)
        splitter.addWidget(frame)
        splitter.addWidget(table_tv)
        splitter.setOpaqueResize(False)
        splitter.setSizes([999999, 999999])

        # connect

        thread.process_finished.connect(self._on_process_finished)
        thread.process_error.connect(self._on_process_error)

        webview.loadStarted.connect(self._on_load_started)
        webview.loadProgress.connect(self._on_load_progress)
        webview.loadFinished.connect(self._on_load_finished)

        # layout

        wv_vbox = qw.QVBoxLayout()
        wv_vbox.setMargin(0)
        wv_vbox.addWidget(webview)
        frame.setLayout(wv_vbox)

        hbox = qw.QHBoxLayout()
        hbox.addWidget(splitter)
        self.content_layout = hbox

        # fields
        self._model = model
        self._thread = thread

        self._webview = webview

        # setup

        self.setWindowTitle('Определение тематики')
        self.progress_bar.setRange(0, 0)
        self._thread.start()
Ejemplo n.º 5
0
 def setWebVid(self, ui, cam, camurl, parent=None):
     camlayout = QtWidgets.QVBoxLayout()
     ui.webview = QtWebEngineWidgets.QWebEngineView()
     ui.webview.setUrl(QtCore.QUrl(camurl))
     camlayout.addWidget(ui.webview)
     cam.setLayout(camlayout)
     return cam
Ejemplo n.º 6
0
 def __init__(self, path=None):
     super(Editor, self).__init__()
     self.setWindowTitle("AsciiMathMarkdown")
     self.vlayout = QtWidgets.QVBoxLayout(self)
     self.layout = QtWidgets.QHBoxLayout()
     self.entry = QtWidgets.QTextEdit()
     self.browser = QtWebEngineWidgets.QWebEngineView()
     self.browser.setEnabled(False)
     self.browser.setZoomFactor(0.7)
     if path is not None:
         with open(path) as f:
             for line in f.readlines():
                 self.entry.append(line.replace('\n', ''))
         self.update_webview()
     self.entry.setAcceptRichText(False)
     self.layout.addWidget(self.entry, 50)
     self.layout.addWidget(self.browser, 50)
     self.entry.textChanged.connect(self.update_webview)
     self.topbar = QtWidgets.QMenuBar(self)
     self.vlayout.addWidget(self.topbar)
     self.vlayout.addLayout(self.layout)
     self.export = QtWidgets.QAction("Export", self)
     self.export.setShortcut('Ctrl+E')
     self.export.setStatusTip("Export to a PDF")
     self.save = QtWidgets.QAction("Save", self)
     self.save.setShortcut('Ctrl+S')
     self.save.setStatusTip("Save Markdown")
     self.save.triggered.connect(self.save_markdown)
     self.export.triggered.connect(self.export_pdf)
     self.topbar.addAction(self.save)
     self.topbar.addAction(self.export)
Ejemplo n.º 7
0
    def __init__(self, cs_name, parent=None):
        super().__init__(parent)

        self.cs = cs_name
        self.selected_db = None
        self.has_sankey = False
        self.graph = Graph()

        # qt js interaction
        self.bridge = Bridge()
        self.channel = QtWebChannel.QWebChannel()
        self.channel.registerObject('bridge', self.bridge)
        self.view = QtWebEngineWidgets.QWebEngineView()
        self.view.loadFinished.connect(self.loadFinishedHandler)
        self.view.setContextMenuPolicy(Qt.PreventContextMenu)
        self.view.page().setWebChannel(self.channel)
        html = os.path.join(os.path.abspath(os.path.dirname(__file__)),
                            'sankey_navigator.html')
        self.url = QtCore.QUrl.fromLocalFile(html)


        # graph
        self.draw_graph()

        # layout
        self.make_layout()

        self.connect_signals()
Ejemplo n.º 8
0
    def __init__(self):
        super().__init__()

        self.setStyleSheet("QWidget{background-color: #343a40;}")

        self.main_layout = QtWidgets.QGridLayout(self)

        self.spin = QtWidgets.QSpinBox()
        self.spin.setValue(30)
        self.spin.setRange(7, 1200)

        self.btn_refresh = QtWidgets.QPushButton("Rafraichir")
        self.btn_refresh.clicked.connect(self.refresh)

        self.spin.setStyleSheet("color: white;")
        self.btn_refresh.setStyleSheet("color: white;")
        self.btn_refresh.setFlat(True)

        self.view = QtWebEngineWidgets.QWebEngineView()
        self.view.load(QtCore.QUrl("http://claquirou.pythonanywhere.com/"))
        self.setWindowTitle("Tableau de bord- Devise")

        self.main_layout.addWidget(self.spin, 0, 0, 1, 1)
        self.main_layout.addWidget(self.btn_refresh, 0, 1, 1, 1)
        self.main_layout.addWidget(self.view, 1, 0, 1, 2)
Ejemplo n.º 9
0
    def __init__(self, packageConfig):
        super(PackageTabView, self).__init__()
        self.setupUi(self)
        self.packageConfig = packageConfig

        self.central_layout = QVBoxLayout()
        self.setLayout(self.central_layout)

        self.updateBtn.clicked.connect(self.onUpdateBtnClicked)

        self.changelog_layout = QVBoxLayout()
        self.changelogHook.setLayout(self.changelog_layout)

        self.webEngineView = QtWebEngineWidgets.QWebEngineView(
            self.changelogHook)
        self.page = self.webEngineView.page()
        self.app_manager = AppManager(self.packageConfig)
        channel = QWebChannel(self)
        self.page.setWebChannel(channel)
        channel.registerObject("app_manager", self.app_manager)
        packageFolder = self.packageConfig.getPackageLocation()
        indexPath = packageFolder + "/index.html"
        if os.path.exists(indexPath):
            url = QUrl.fromLocalFile(indexPath)
            self.webEngineView.setUrl(url)
        else:
            self.webEngineView.setContent(
                "Something went wrong during package installation, please reinstall tool package"
            )
        self.changelog_layout.addWidget(self.webEngineView)
        self.webEngineView.setContentsMargins(0, 0, 10, 0)
        self.webEngineView.loadFinished.connect(self.resizeWebView)

        self.resizeEvent = self.onResize
        self.isValid = True

        if self.packageConfig.use_vcs and self.packageConfig.vcs_type == VCSType.Perforce:
            currentVersion = utility.getServerVersion(self.packageConfig)
        else:
            currentVersion = PackageConfiguration.getCurrentVersion2(
                self.packageConfig)

        if not currentVersion:
            # self.isValid = False
            logging.info(
                "impossible to retrieve server version for package: {0}".
                format(packageConfig.package_name))
            # return

        userVersion = self.packageConfig.getUserVersion()
        if not userVersion:
            self.isValid = False
            logging.info(
                "impossible to retrieve local version for package: {0}".format(
                    packageConfig.package_name))
            return

        self.display_version_info(userVersion, currentVersion)
        self.showImage()
Ejemplo n.º 10
0
 def __init__(self, webapp):
     super().__init__()
     self.webapp = webapp
     self.profile = None
     if self.webapp.persist:
         self.profile = QtWebEngineWidgets.QWebEngineProfile(webapp.title)
     else:
         self.profile = QtWebEngineWidgets.QWebEngineProfile()
     self.page = QtWebEngineWidgets.QWebEnginePage(self.profile)
     self.view = QtWebEngineWidgets.QWebEngineView()
     self.view.setPage(self.page)
     self.view.load(QtCore.QUrl(self.webapp.url))
     self.layout = QtWidgets.QVBoxLayout(self)
     self.layout.addWidget(self.view)
     self.layout.setContentsMargins(QtCore.QMargins(0, 0, 0, 0))
     self.setWindowTitle(self.webapp.title)
     self.view.iconChanged.connect(self.iconChangedListener)
Ejemplo n.º 11
0
    def __init__(self,
                 nltk: pl.Path, udpipe: pl.Path, text: pl.Path, rus: bool,
                 parent: t.Optional[qw.QWidget] = None, f: qq.WindowFlags = qq.WindowFlags()):
        super().__init__(parent, f)

        # other

        model = MorphologyModel()
        thread = MorphSyntaxThread(nltk, udpipe, text, rus)

        # widget

        morph_tv = qw.QTableView()
        morph_tv.setModel(model)
        morph_tv.setSelectionMode(morph_tv.SelectionMode.SingleSelection)

        syntax_wv = qweb.QWebEngineView()

        syntax_frame = qw.QFrame()
        syntax_frame.setFrameShape(qw.QFrame.StyledPanel)

        tabs = qw.QTabWidget()
        tabs.addTab(morph_tv, 'Морфология')
        tabs.addTab(syntax_frame, 'Синтаксис')

        # connect

        thread.process_finished.connect(self._on_process_finished)
        thread.process_error.connect(self._on_process_error)

        syntax_wv.loadProgress.connect(self._on_load_progress)
        syntax_wv.loadFinished.connect(self._on_load_finished)

        # layout

        wv_vbox = qw.QVBoxLayout()
        wv_vbox.setMargin(0)
        wv_vbox.addWidget(syntax_wv)
        syntax_frame.setLayout(wv_vbox)

        vbox = qw.QVBoxLayout()
        vbox.addWidget(tabs)
        self.content_layout = vbox

        # fields

        self._model = model
        self._thread = thread
        self._syntax_wv = syntax_wv

        self._morph_progress = 0

        # setup

        self.setWindowTitle('Морфология и Синтаксис')
        self.progress_bar.setMaximum(200)  # Morph and Syntax
        self._thread.start()
Ejemplo n.º 12
0
    def __init__(self, parent=None):
        super().__init__(parent)
        self.m_view = QtWebEngineWidgets.QWebEngineView()
        self.setCentralWidget(self.m_view)
        page = self.m_view.page()
        page.featurePermissionRequested.connect(
            self.on_featurePermissionRequested)

        page.load(QtCore.QUrl("https://maps.google.com"))
Ejemplo n.º 13
0
    def __init__(self, parent):
        super(MOPS_FeedbackDialog, self).__init__(parent)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        # UI Title
        self.setWindowTitle("Houdini - Marmoset Toolbag Viewer")

        # Constructing UI
        windowUILayout = QtWidgets.QVBoxLayout()

        self.webViewer = QtWebEngineWidgets.QWebEngineView()
        self.webViewer.load(QtCore.QUrl("http://localhost:8000"))
        windowUILayout.addWidget(self.webViewer)
        self.setLayout(windowUILayout)
        self.activateWindow()
Ejemplo n.º 14
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     layout = QtWidgets.QVBoxLayout()
     self._graph_view = QtWebEngineWidgets.QWebEngineView(parent=self)
     self._error_view = QtWidgets.QTextBrowser()
     layout.addWidget(self._graph_view)
     layout.addWidget(self._error_view)
     layout.setContentsMargins(0, 0, 0, 0)
     self._error_view.setVisible(False)
     self.setLayout(layout)
     self.urlChanged = self._graph_view.urlChanged
     self._dot2svg = None
     self._threadpool = QtCore.QThreadPool()
     # otherwise it seems invisible
     self.resize(QtCore.QSize(self.height() + 100, self.width()))
Ejemplo n.º 15
0
    def __init__(self):
        super().__init__()

        self.setWindowIcon(QtGui.QIcon(Res.mainWindowIcon))
        self.setWindowTitle("地图")
        self.resize(1280, 860)

        map_view = QtWebEngineWidgets.QWebEngineView()
        url = "file:///" + os.getcwd() + Res.mapUrl
        url = eval(repr(url).replace('\\\\', '/'))
        map_view.load(QtCore.QUrl(url))

        mainlayout = QtWidgets.QVBoxLayout()
        mainlayout.addWidget(map_view)
        self.setLayout(mainlayout)
Ejemplo n.º 16
0
 def __init__(self):
     """Instantiate."""
     super(HelloWorld, self).__init__()
     self.setWindowTitle('helloworld')
     QWebEngineSettings.globalSettings().setAttribute(
         QWebEngineSettings.PluginsEnabled, True)
     self.centralwid = QtWidgets.QWidget(self)
     self.vlayout = QtWidgets.QVBoxLayout()
     self.webview = QtWebEngineWidgets.QWebEngineView()
     self.webview.setUrl(
         QUrl("https://www.youtube.com/watch?v=dQw4w9WgXcQ"))
     self.vlayout.addWidget(self.webview)
     self.centralwid.setLayout(self.vlayout)
     self.setCentralWidget(self.centralwid)
     self.show()
Ejemplo n.º 17
0
  def __init__(self):
    if self._instance is None:
      # Init browser.
      self.webView = QtWebEngineWidgets.QWebEngineView()
      self.webView.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)

      # Init native API.
      from freecad.cadenas3dfindit import native_api
      self.threeDNativeAPI = native_api.NativeAPI(self.webView)

      # Init API.
      from freecad.cadenas3dfindit import api
      self.threeDAPI = api.API(self.webView, self.threeDNativeAPI)
    else:
      raise Exception("Invalid state.")
Ejemplo n.º 18
0
    def __render(self):
        self.__view = QtWebEngineWidgets.QWebEngineView()
        self.__view.setFixedSize(self.canvasWidth, self.canvasHeight)
        self.__view.loadFinished.connect(self.__grabimage)

        myhtml = self.toHTML(self.text, self.style, self.size)

        self.__view.setHtml(myhtml)
        if not self.debug:
            self.__view.setAttribute(QtCore.Qt.WA_DontShowOnScreen, True)
            self.__view.setAttribute(QtCore.Qt.WA_ShowWithoutActivating, True)
            self.__view.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)
        self.__view.setAttribute(QtCore.Qt.WA_AlwaysStackOnTop, True)
        self.__view.show()

        self.__app.exec_()
Ejemplo n.º 19
0
    def __init__(self):
        self.profile = library.Profile()
        self.content = library.Content()

        # Start web server
        self.server = setup_server(self.profile, self.content)
        self.server.jinja_env.globals.update({
            'len': len,
            'enum': enumerate,
            'shuffle': shuffle,
            'prepare': prepare
        })
        self.server_thread = threading.Thread(target=self.server.run,
                                              args=('localhost', 20052),
                                              daemon=True)
        self.server_thread.start()

        # Start app
        self.app = QtWidgets.QApplication(sys.argv)
        self.window = QtWidgets.QMainWindow()

        # Setup app
        self.window.setWindowTitle('Learn App')
        self.window.resize(1280, 720)
        self.window.setMinimumSize(QtCore.QSize(640, 480))

        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("gui/assets/icon.svg"),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.window.setWindowIcon(icon)

        self.gui = QtWebEngineWidgets.QWebEngineView()
        self.gui.setUrl(QtCore.QUrl('http://localhost:20052/'))

        # Show app
        self.window.setCentralWidget(self.gui)
        self.window.show()

        self.app.exec_()

        self.profile.dump()
Ejemplo n.º 20
0
    def __init__(self,
                 app,
                 url=default_url,
                 port=5000,
                 debug=False,
                 using_win32=False,
                 icon_path=None,
                 app_name=None):
        self.flask_app = app
        self.flask_thread = Thread(target=self._run_flask,
                                   args=(url, port, debug, using_win32))
        self.flask_thread.daemon = True
        self.debug = debug

        self.url = "http://{}:{}".format(url, port)
        self.app = core_widgets.QApplication([])
        self.app.setWindowIcon(gui.QIcon(icon_path))
        self.app.setApplicationName(app_name)
        self.view = web_widgets.QWebEngineView(self.app.activeModalWidget())
        self.page = CustomWebEnginePage(self.view)
        self.view.setPage(self.page)
Ejemplo n.º 21
0
def init_gui(application,
             port=0,
             width=800,
             height=600,
             window_title="PyFladesk",
             icon="appicon.png",
             argv=None):
    if argv is None:
        argv = sys.argv

    if port == 0:
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.bind(('localhost', 0))
        port = sock.getsockname()[1]
        sock.close()

    # Application Level
    qtapp = QtWidgets.QApplication(argv)
    webapp = ApplicationThread(application, port)
    webapp.start()
    qtapp.aboutToQuit.connect(webapp.terminate)

    # Main Window Level
    window = QtWidgets.QMainWindow()
    window.resize(width, height)
    window.setWindowTitle(window_title)
    window.setWindowIcon(QtGui.QIcon(icon))

    # WebView Level
    webView = QtWebEngineWidgets.QWebEngineView(window)
    window.setCentralWidget(webView)

    # WebPage Level
    page = WebPage('http://localhost:{}'.format(port))
    page.home()
    webView.setPage(page)

    window.show()
    return qtapp.exec_()
Ejemplo n.º 22
0
    def create_layout(self):

        self.console = QtWidgets.QTextEdit(self)
        self.console.setMinimumHeight(250)
        self.console_container = GroupBox('Console', self, [self.console])

        self.instance_browser = InstanceBrowser(self)
        self.instance_browser_container = GroupBox('Instance List', self,
                                                   [self.instance_browser])

        self.tensorboard = QtWebEngineWidgets.QWebEngineView(self)
        self.code = QtWidgets.QTextEdit(self)
        self.code.setFont(QtGui.QFont('Monospace', 9))
        self.tab = QtWidgets.QTabWidget(self)
        self.tab.addTab(self.code, 'Config')
        self.tab.addTab(self.tensorboard, 'Tensorboard')
        self.tab.setMinimumHeight(400)

        self.bar_plot = BarPlot(self)
        self.reward_plot = pg.PlotWidget()
        self.reward_plot.setBackground(None)
        self.reward_plot.getPlotItem().showGrid(x=False, y=True, alpha=1)
        self.reward_plot.setMaximumHeight(200)
        self.plot_container = GroupBox('Action probabilities / Rewards', self,
                                       [self.bar_plot, self.reward_plot])

        self.buttons = Control(self)
        self.buttons.setMinimumWidth(650)

        lay = QtWidgets.QGridLayout(self)
        lay.addWidget(self.env_browser, 1, 1, 1, 1)
        lay.addWidget(self.instance_browser_container, 1, 2, 1, 1)
        lay.addWidget(self.buttons, 2, 1, 1, 2)
        lay.addWidget(self.display, 1, 3, 3, 2)
        lay.addWidget(self.tab, 4, 1, 3, 2)
        lay.addWidget(self.plot_container, 4, 3, 1, 2)
        lay.addWidget(self.console_container, 5, 3, 1, 2)
        lay.setRowMinimumHeight(1, 350)
Ejemplo n.º 23
0
    def __init__(self, parent=None, url=None, html_file=None):
        super().__init__(parent)
        self.view = QtWebEngineWidgets.QWebEngineView()
        self.page = RestrictedQWebEnginePage()

        if html_file:
            # print("Loading File:", html_file)
            self.url = QtCore.QUrl.fromLocalFile(html_file)
            self.page.allowed_pages.append(self.url)
            self.page.load(self.url)
        elif url:
            # print("Loading URL:", url)
            self.url = QtCore.QUrl(url)
            self.page.allowed_pages.append(self.url)
            self.page.load(self.url)

        # associate page with view
        self.view.setPage(self.page)

        # set layout
        self.vl = QtWidgets.QVBoxLayout()
        self.vl.addWidget(self.view)
        self.setLayout(self.vl)
Ejemplo n.º 24
0
    def __init__(self, parent=None, *args, **kwargs):
        super().__init__(parent)

        # Graph object subclassed from BaseGraph.
        self.graph: Type[BaseGraph]

        # Setup JS / Qt interactions
        self.bridge = Bridge(self)
        self.channel = QtWebChannel.QWebChannel()
        self.channel.registerObject('bridge', self.bridge)
        self.view = QtWebEngineWidgets.QWebEngineView()
        self.view.loadFinished.connect(self.load_finished_handler)
        self.view.setContextMenuPolicy(Qt.PreventContextMenu)
        self.view.page().setWebChannel(self.channel)
        self.url = QUrl.fromLocalFile(self.HTML_FILE)

        # Various Qt objects
        self.label_help = QtWidgets.QLabel(self.HELP_TEXT)
        self.button_toggle_help = QtWidgets.QPushButton("Help")
        self.button_back = QtWidgets.QPushButton(qicons.backward, "")
        self.button_forward = QtWidgets.QPushButton(qicons.forward, "")
        self.button_refresh = QtWidgets.QPushButton("Refresh HTML")
        self.button_random_activity = QtWidgets.QPushButton("Random Activity")
 def test_WebEngineView_findText_exists(self):
     qApp = (QtWidgets.QApplication.instance() or
             QtWidgets.QApplication([]))
     view = QtWebEngineWidgets.QWebEngineView()
     view.findText("nothing")
Ejemplo n.º 26
0
        self.button.clicked.connect(self.magic)

    def magic(self):
        self.text.setText(random.choice(self.hello))


if __name__ == "__main__":
    # app = QtWidgets.QApplication([])

    # widget = MyWidget()
    # widget.resize(800, 600)
    # widget.show()
    #
    # sys.exit(app.exec_())

    app = QtWidgets.QApplication([])
    file = QFile("testQtDesigner.ui")
    file.open(QFile.ReadOnly)
    loader = QtUiTools.QUiLoader()
    window = loader.load(file)
    window.show()

    view = QtWebEngineWidgets.QWebEngineView()
    view.setGeometry(100, 150, 1280, 550)
    url = "http://google.com"
    view.setWindowTitle("Browser - " + url)
    view.load(QtCore.QUrl(url))
    view.show()
    app.exec_()
    # QtWebEngine.QtWebEngine.initialize()
Ejemplo n.º 27
0
    def setupUi(self, window):
        # definimos el nombre e icono de la App
        window.setWindowTitle("Metro")
        window.setWindowIcon(QtGui.QIcon(self.icon_Path))

        # definimos los tamaños de la ventana principal
        window.resize(500, 600)
        window.setMinimumSize(QtCore.QSize(500, 600))
        window.setMaximumSize(QtCore.QSize(500, 600))
        window.setStyleSheet("background-color: white")
        window.setObjectName("window")

        # definimos el Widget de la ventana
        self.central_widget = QtWidgets.QWidget(window)
        self.central_widget.setObjectName("central_widget")

        # definimos el frame de la pantalla inicial
        self.frame_principal = QtWidgets.QFrame(self.central_widget)
        self.frame_principal.setGeometry(QtCore.QRect(0, 0, 500, 600))
        self.frame_principal.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.frame_principal.setObjectName("frame_principal")
        # definimos central_windget como widget principal de la ventana
        window.setCentralWidget(self.central_widget)

        # definimos el font para la hora
        arialFont_time = QtGui.QFont()
        arialFont_time.setFamily("Arial")
        arialFont_time.setPointSize(15)

        # definimos label para la hora
        self.label_time_pricipal = QtWidgets.QLabel(self.central_widget)
        self.label_time_pricipal.setGeometry(QtCore.QRect(425, 560, 55, 25))
        self.label_time_pricipal.setFont(arialFont_time)
        self.label_time_pricipal.setScaledContents(True)
        self.label_time_pricipal.setObjectName("label_time_pricipal")

        # definimos el logo principal
        self.label_logo = QtWidgets.QLabel(self.frame_principal)
        self.label_logo.setGeometry(QtCore.QRect(175, 25, 150, 150))
        self.label_logo.setScaledContents(True)
        self.label_logo.setObjectName("label_logo")

        # definimos la paleca de color para error los label de error
        # # solo definimos la activa
        error_palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        error_palette.setBrush(QtGui.QPalette.Active,
                               QtGui.QPalette.WindowText, brush)
        error_palette.setBrush(QtGui.QPalette.Inactive,
                               QtGui.QPalette.WindowText, brush)

        # definimos el font a usar en los label
        arialFont_label = QtGui.QFont()
        arialFont_label.setFamily("Arial")
        arialFont_label.setPointSize(15)
        arialFont_label.setBold(True)
        arialFont_label.setWeight(75)
        arialFont_label.setStrikeOut(False)

        # definimos el font a usar en los intro
        arialFont_intro = QtGui.QFont()
        arialFont_intro.setFamily("Arial")
        arialFont_intro.setPointSize(15)
        arialFont_intro.setBold(False)
        arialFont_intro.setWeight(1)
        arialFont_intro.setStrikeOut(False)

        # definimos el label Inicio
        self.label_inicio = QtWidgets.QLabel(self.frame_principal)
        self.label_inicio.setGeometry(QtCore.QRect(100, 240, 80, 35))
        self.label_inicio.setAlignment(
            QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
        self.label_inicio.setFont(arialFont_label)
        self.label_inicio.setObjectName("label_inicio")

        # definimos la caja de texto para el inicio
        self.intro_inicio = QtWidgets.QLineEdit(self.frame_principal)
        self.intro_inicio.setGeometry(QtCore.QRect(190, 240, 175, 35))
        self.intro_inicio.setAlignment(
            QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
        self.intro_inicio.setFont(arialFont_intro)
        self.intro_inicio.setStyleSheet("border : none;")
        self.intro_inicio.setObjectName("intro_inicio")

        # definimos la linea para resaltar la introduccion del inicio
        self.line_inicio = QtWidgets.QFrame(self.frame_principal)
        self.line_inicio.setGeometry(QtCore.QRect(190, 276, 175, 2))
        self.line_inicio.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_inicio.setLineWidth(2)

        # definimos el label de Inicio invalido
        self.label_invalid_inicio = QtWidgets.QLabel(self.frame_principal)
        self.label_invalid_inicio.setGeometry(QtCore.QRect(190, 275, 111, 21))
        self.label_invalid_inicio.setAlignment(
            QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
        self.label_invalid_inicio.setPalette(error_palette)
        self.label_invalid_inicio.setStyleSheet(
            "background-color: transparent")
        self.label_invalid_inicio.setObjectName("label_invalid_inicio")
        # # lo escondemos mientras no sea necesario
        self.label_invalid_inicio.hide()

        # definimos el label destino
        self.label_destino = QtWidgets.QLabel(self.frame_principal)
        self.label_destino.setGeometry(QtCore.QRect(100, 330, 80, 35))
        self.label_destino.setAlignment(
            QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
        self.label_destino.setFont(arialFont_label)
        self.label_destino.setObjectName("label_destino")

        # definimos la caja de texto para el destino
        self.intro_destino = QtWidgets.QLineEdit(self.frame_principal)
        self.intro_destino.setGeometry(QtCore.QRect(190, 330, 175, 35))
        self.intro_destino.setFont(arialFont_intro)
        self.intro_destino.setStyleSheet("border : none;")
        self.intro_destino.setText("")
        self.intro_destino.setObjectName("intro_destino")

        # definimos la linea para resaltar la introduccion del destino
        self.line_destino = QtWidgets.QFrame(self.frame_principal)
        self.line_destino.setGeometry(QtCore.QRect(190, 366, 175, 2))
        self.line_destino.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_destino.setLineWidth(2)

        # definimos el label de Destino invalido
        self.label_invalid_destino = QtWidgets.QLabel(self.frame_principal)
        self.label_invalid_destino.setGeometry(QtCore.QRect(190, 365, 111, 21))
        self.label_invalid_destino.setAlignment(
            QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
        self.label_invalid_destino.setPalette(error_palette)
        self.label_invalid_destino.setStyleSheet(
            "background-color: transparent")
        self.label_invalid_destino.setObjectName("label_invalid_destino")
        # # lo escondemos mientras no sea necesario
        self.label_invalid_destino.hide()

        # definimos el boton para el algoritmo
        self.button_calcular = QtWidgets.QPushButton(self.frame_principal)
        self.button_calcular.setGeometry(QtCore.QRect(200, 430, 100, 30))
        self.button_calcular.setFont(arialFont_intro)
        self.button_calcular.setStyleSheet("background-color: #A0A0A0A0")
        # # definimos la accion al presionar el boton
        self.button_calcular.clicked.connect(self.calcularAction)
        self.button_calcular.setObjectName("button_calcular")

        # # # # # # Frame de carga # # # # # #
        # definimos el segundo frame 2 "pantalla de carga"
        self.frame_carga = QtWidgets.QFrame(self.central_widget)
        self.frame_carga.setGeometry(QtCore.QRect(125, 120, 250, 250))
        self.frame_carga.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.frame_carga.setObjectName("frame_solucion")
        # # iniciamos el frame oculto
        self.frame_carga.hide()

        # font para el mensaje en pantalla de carga
        arialFont_WaitingLabel = QtGui.QFont()
        arialFont_WaitingLabel.setFamily("Arial")
        arialFont_WaitingLabel.setPointSize(12)
        arialFont_WaitingLabel.setBold(True)
        arialFont_WaitingLabel.setWeight(75)

        # definimos el label para el gif de carga
        self.label_cargaMovie = QtWidgets.QLabel(self.frame_carga)
        self.label_cargaMovie.setGeometry(QtCore.QRect(75, 40, 100, 100))
        self.label_cargaMovie.setScaledContents(True)

        # definimos el label para el mensaje de carga
        self.label_carga = QtWidgets.QLabel(self.frame_carga)
        self.label_carga.setGeometry(QtCore.QRect(75, 150, 100, 25))
        self.label_carga.setAlignment(
            QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)
        self.label_carga.setFont(arialFont_WaitingLabel)

        # # # # # # Frame de solucion # # # # # #
        # definimos el segundo frame 3 "pantalla de solucion"
        self.frame_solucion = QtWidgets.QFrame(self.central_widget)
        self.frame_solucion.setGeometry(QtCore.QRect(0, 0, 500, 600))
        self.frame_solucion.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.frame_solucion.setObjectName("frame_solucion")
        # # iniciamos el frame oculto
        self.frame_solucion.hide()

        self.label_time_solucion = QtWidgets.QLabel(self.frame_solucion)
        self.label_time_solucion.setGeometry(QtCore.QRect(425, 560, 55, 25))
        self.label_time_solucion.setFont(arialFont_time)
        self.label_time_solucion.setScaledContents(True)
        self.label_time_solucion.setObjectName("label_time_pricipal")

        # definimos el widgetBrowser
        self.browser = QtWebEngineWidgets.QWebEngineView(self.frame_solucion)
        self.browser.setGeometry(QtCore.QRect(0, 0, 500, 500))

        # definimos un boton para volver a la pagina principal
        self.button_volver_frame1 = QtWidgets.QPushButton(self.frame_solucion)
        self.button_volver_frame1.setGeometry(QtCore.QRect(200, 530, 100, 30))
        self.button_volver_frame1.setStyleSheet("background-color: #A0A0A0A0")
        # # definimos la accion del button
        self.button_volver_frame1.clicked.connect(self.volver_framePrincipal)
        self.button_volver_frame1.setObjectName("button_volver_frame1")

        # definimos al madre ne nuestra Gui a la window a la que esta asociada
        QtCore.QMetaObject.connectSlotsByName(window)

        # rellenamos todos los componentes
        self.fillTexts()

        # pool de treads
        self.poolThread = QtCore.QThreadPool()
Ejemplo n.º 28
0
    def __init__(self, root_interface, parent=None):
        super(ViewerInterface, self).__init__(parent)

        self._root_if = root_interface

        # Set the stylesheet
        self.setStyleSheet(glob_stylesheet)

        #create layout for main QWidget
        layout = QtWidgets.QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout)

        #call setup wizard to get data from PDG Graph
        setupWizard(self)
        #continue
        setupWizardViewer(self)

        #change interfaces in root interface
        startup_interface_inst = self._root_if._startup_interface

        #hide startup interface
        startup_interface_inst.hide()
        #add viewer interface (self)
        self._root_if._layout.addWidget(self)

        ####create interface

        #create QFrame with fixed size as container for image and grid table
        self._frame = QtWidgets.QWidget()
        self._frame.setGeometry(
            QtCore.QRect(0, 0, self._frame_width, self._frame_height))

        ####html webview for video playback

        #qt webview for html5 video playback
        self._webview = QtWebEngineWidgets.QWebEngineView(self._frame)
        self._webview.setGeometry(
            QtCore.QRect(0, 0, self._frame_width, self._frame_height))

        #set html content

        html_path = os.path.abspath(
            os.path.join(os.path.dirname(__file__),
                         "../html/pdg_mutagen_webvideo_temp.html"))
        base_url = QtCore.QUrl.fromLocalFile(html_path)

        html = codecs.open(html_path, 'r')
        html_str = html.read()
        #replace source path placeholder with actual video filepath
        html_out = html_str.replace('SOURCE_PATH', self._videofile)

        #set html content
        self._webview.setHtml(html_out, base_url)

        ####further layout

        #create QScrollArea attached to main QWidget and attach QFrame
        scroll_area = QtWidgets.QScrollArea(self)
        scroll_area.setWidget(self._frame)

        #create empty QGridLayout and attach to main QWidget
        self._grid = QtWidgets.QGridLayout(self._frame)
        self._grid.setContentsMargins(0, 0, 0, 0)
        #self._grid.setHorizontalSpacing(self._cell_frame_padding_h)
        #self._grid.setVerticalSpacing(self._cell_frame_padding_v)
        self._grid.setHorizontalSpacing(0)
        self._grid.setVerticalSpacing(0)
        #self._grid.setAlignment(QtCore.Qt.AlignLeft)

        #create cells by iteration and attach to QGridLayout

        idx = 0
        #if splits exist set to start index
        if self._num_pdg_splits > 0:
            idx = self._start_idx

        cell_count = 0

        self._cell_dict = {}

        for row in range(self._num_height):
            self._grid.setRowMinimumHeight(
                row, self._cell_frame_height + self._cell_frame_height_padding)

            for column in range(self._num_width):
                if cell_count < self._num_total:
                    #self._grid.setColumnMinimumWidth(row, self._cell_frame_width+self._cell_frame_padding_h)
                    #self._grid.setColumnMinimumWidth(row, self._cell_frame_width)

                    #get cell_idx from idx
                    cell_idx = self._wdg_idx_l[idx]

                    #create wedgeCell
                    cell = self._wedgeCell(cell_idx)

                    #add _wedgeCell instance to cell dictionary
                    self._cell_dict[cell_idx] = cell
                    #add as widget to grid layout
                    self._grid.addWidget(cell, row, column)

                    #incr
                    idx += 1
                    cell_count += 1

        #####load marked selection fir grid layout from file and initialize
        marked_file = self._marked_filepath
        if os.path.isfile(marked_file):
            print "Saved Marking State File found:\n{}".format(marked_file)
            print "Initializing UI...\n"

            with open(marked_file, 'r') as f:
                wedge_mark_dict = f.read()

            #convert back to dict
            wedge_mark_dict = ast.literal_eval(wedge_mark_dict)

            for i in wedge_mark_dict:
                mark_button = self._cell_dict[i].children()[0]
                mark_button.setChecked(wedge_mark_dict[i])

            print "Initializing UI successfull\n"

        ####top shelf button ui

        #button horizontal layout
        button_layout = QtWidgets.QHBoxLayout()
        button_layout.setContentsMargins(0, 4, 0, 0)
        button_layout.setAlignment(QtCore.Qt.AlignLeft)

        layout.addLayout(button_layout)

        #save marked button
        save_marked_button = QtWidgets.QPushButton("Store Marked Wedges")
        save_marked_button.clicked.connect(self._saveMarkedWedges)
        save_marked_button.setToolTip(
            "This will save the current Marked Wedges to a file.\nWhen reopening Hipfile or Mutagen Viewer, they will be loaded automatically.\nStored seperately for each FFmpeg Root Node."
        )
        save_marked_button.setFixedWidth(180)

        button_layout.addWidget(save_marked_button)

        #start mutation from marked wedges button
        mutation_from_marked_button = QtWidgets.QPushButton(
            "Setup Mutation from Marked Wedges")
        mutation_from_marked_button.clicked.connect(
            self._startMutationFromMarkedWedges)
        mutation_from_marked_button.setFixedWidth(280)
        mutation_from_marked_button.setToolTip(
            "This will create a new base Wedge TOP, containing all Parameter Settings from Marked Wedges.\nThis can then be used to generate further Wedge variation based on the Settings you liked,\nby appending further Wedge TOPs.\n\nNote: This will clear all existing Takes in Scene!\nWarning: Depending on number of Takes and edited Parameters this can take quite long,\nplease be patient and let Houdini cook without UI Interaction until the Wedge Node UI is selected.\n(Unfortunately there is currently no faster way to access Take parameters in HOM)."
        )
        button_layout.addWidget(mutation_from_marked_button)

        #add QScrollArea to main layout
        layout.addWidget(scroll_area)

        #refocus webwidget
        self._webview.activateWindow()
        self._webview.setFocus()
Ejemplo n.º 29
0
    def __init__(self, parent=None, cs=None):
        super().__init__(parent)
        self.name = "&Sankey Diagram"
        self.label = QtWidgets.QLabel('hello')
        self.grid_lay = QtWidgets.QGridLayout()
        self.grid_lay.addWidget(QtWidgets.QLabel('Activity: '), 0, 0)
        self.grid_lay.addWidget(QtWidgets.QLabel('Method: '), 1, 0)
        # self.cs = self.window().right_panel.LCA_setup_tab.list_widget.name
        self.cs = cs
        self.func_units = bw.calculation_setups[self.cs]['inv']
        self.func_units = [{bw.get_activity(k): v
                            for k, v in fu.items()} for fu in self.func_units]
        self.methods = bw.calculation_setups[self.cs]['ia']
        self.func_unit_cb = QtWidgets.QComboBox()
        self.func_unit_cb.addItems(
            [list(fu.keys())[0].__repr__() for fu in self.func_units])
        self.method_cb = QtWidgets.QComboBox()
        self.method_cb.addItems([m.__repr__() for m in self.methods])
        self.grid_lay.addWidget(self.func_unit_cb, 0, 1)
        self.grid_lay.addWidget(self.method_cb, 1, 1)
        self.reload_pb = QtWidgets.QPushButton('Reload')
        self.reload_pb.clicked.connect(self.new_sankey)
        self.grid_lay.addWidget(self.reload_pb, 2, 0)
        self.close_pb = QtWidgets.QPushButton('Close')
        self.close_pb.clicked.connect(self.switch_to_main)
        self.grid_lay.setColumnStretch(4, 1)
        self.grid_lay.addWidget(self.close_pb, 0, 5)
        self.color_attr_cb = QtWidgets.QComboBox()
        self.color_attr_cb.addItems(['flow', 'location', 'name'])
        self.grid_lay.addWidget(QtWidgets.QLabel('color by: '), 0, 2)
        self.grid_lay.addWidget(self.color_attr_cb, 0, 3)
        self.grid_lay.addWidget(QtWidgets.QLabel('cutoff: '), 1, 2)
        self.cutoff_sb = QtWidgets.QDoubleSpinBox()
        self.cutoff_sb.setRange(0.0, 1.0)
        self.cutoff_sb.setSingleStep(0.001)
        self.cutoff_sb.setDecimals(4)
        self.cutoff_sb.setValue(0.005)
        self.cutoff_sb.setKeyboardTracking(False)
        self.grid_lay.addWidget(self.cutoff_sb, 1, 3)
        self.hlay = QtWidgets.QHBoxLayout()
        self.hlay.addLayout(self.grid_lay)

        # qt js interaction
        self.bridge = Bridge()
        self.bridge.viewer_waiting.connect(self.send_json)
        self.bridge.link_clicked.connect(self.expand_sankey)

        self.channel = QtWebChannel.QWebChannel()
        self.channel.registerObject('bridge', self.bridge)
        self.view = QtWebEngineWidgets.QWebEngineView()
        self.view.page().setWebChannel(self.channel)
        html = os.path.join(os.path.abspath(os.path.dirname(__file__)),
                            'activity-browser-sankey.html')
        self.url = QtCore.QUrl.fromLocalFile(html)
        self.wait_url = QtCore.QUrl.fromLocalFile(wait_html)
        self.view.load(self.wait_url)
        self.vlay = QtWidgets.QVBoxLayout()
        self.vlay.addLayout(self.hlay)
        self.vlay.addWidget(self.view)
        self.setLayout(self.vlay)

        # sankey
        demand_all = dict(collections.ChainMap(*self.func_units))
        self.lca = bw.LCA(demand_all, bw.methods.random())
        self.lca.lci()
        self.lca.lcia()
        self.new_sankey()

        self.func_unit_cb.currentIndexChanged.connect(self.new_sankey)
        self.method_cb.currentIndexChanged.connect(self.new_sankey)
        self.color_attr_cb.currentIndexChanged.connect(self.update_colors)
        self.cutoff_sb.valueChanged.connect(self.new_sankey)

        # connections
        sankeysignals.calculating_gt.connect(self.busy_indicator)
        sankeysignals.initial_sankey_ready.connect(self.draw_sankey)
Ejemplo n.º 30
0
    def setupUi(self, MainWindow):

        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(800, 600)
        MainWindow.setWindowTitle(
            QtWidgets.QApplication.translate("MainWindow",
                                             "MainWindow - Portal", None, -1))

        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")

        self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
        self.tabWidget.setGeometry(QtCore.QRect(20, 10, 761, 551))
        self.tabWidget.setTabBarAutoHide(False)
        self.tabWidget.setObjectName("tabWidget")

        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")

        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 21))
        self.menubar.setObjectName("menubar")

        self.menuMain = QtWidgets.QMenu(self.menubar)
        self.menuMain.setObjectName("menuMain")
        self.menubar.addAction(self.menuMain.menuAction())
        self.menuMain.setTitle(
            QtWidgets.QApplication.translate("MainWindow", "Main", None, -1))

        MainWindow.setCentralWidget(self.centralwidget)
        MainWindow.setStatusBar(self.statusbar)
        MainWindow.setMenuBar(self.menubar)

        # Admin tab ---------------------------------------------------------------
        self.tab = QtWidgets.QWidget()
        self.tab.setObjectName("tab")
        self.tabWidget.addTab(self.tab, "")
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab),
            QtWidgets.QApplication.translate("MainWindow", "Admin", None, -1))

        # Admin tab -> Enrolled Devices table
        self.tableWidget_2 = QtWidgets.QTableWidget(self.tab)
        self.tableWidget_2.setGeometry(QtCore.QRect(300, 80, 431, 321))
        self.tableWidget_2.setObjectName("tableWidget_2")
        self.tableWidget_2.setColumnCount(3)
        self.tableWidget_2.setRowCount(self.device_db_rows)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_2.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_2.setHorizontalHeaderItem(1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_2.setHorizontalHeaderItem(2, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_2.setItem(0, 0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_2.setItem(0, 1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_2.setItem(0, 2, item)
        self.tableWidget_2.horizontalHeader().setCascadingSectionResizes(False)
        self.tableWidget_2.horizontalHeader().setStretchLastSection(True)
        self.tableWidget_2.horizontalHeader().setDefaultSectionSize(120)

        self.tableWidget_2.horizontalHeaderItem(0).setText(
            QtWidgets.QApplication.translate("MainWindow", "ID", None, -1))
        self.tableWidget_2.horizontalHeaderItem(1).setText(
            QtWidgets.QApplication.translate("MainWindow", "Customer", None,
                                             -1))
        self.tableWidget_2.horizontalHeaderItem(2).setText(
            QtWidgets.QApplication.translate("MainWindow", "Notes", None, -1))
        __sortingEnabled = self.tableWidget_2.isSortingEnabled()
        self.tableWidget_2.setSortingEnabled(False)
        self.tableWidget_2.setSortingEnabled(__sortingEnabled)

        # Admin tab -> Device enrolment groupbox
        self.groupBox = QtWidgets.QGroupBox(self.tab)
        self.groupBox.setGeometry(QtCore.QRect(20, 80, 251, 321))
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(185, 185, 185))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(185, 185, 185))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(185, 185, 185))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(185, 185, 185))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        self.groupBox.setPalette(palette)
        font = QtGui.QFont()
        font.setPointSize(14)
        self.groupBox.setFont(font)
        self.groupBox.setAutoFillBackground(True)
        self.groupBox.setObjectName("groupBox")

        self.groupBox.setTitle(
            QtWidgets.QApplication.translate("MainWindow", "Device Enrolment",
                                             None, -1))

        # Admin tab -> D.E. groupbox -> Device ID label
        self.label_5 = QtWidgets.QLabel(self.groupBox)
        self.label_5.setGeometry(QtCore.QRect(10, 50, 101, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.label_5.setFont(font)
        self.label_5.setObjectName("label_5")

        self.label_5.setText(
            QtWidgets.QApplication.translate("MainWindow", "Device ID:", None,
                                             -1))

        # Admin tab -> D.E. groupbox -> Device dropdown menu
        self.comboBox_2 = QtWidgets.QComboBox(self.groupBox)
        self.comboBox_2.setGeometry(QtCore.QRect(80, 50, 161, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.comboBox_2.setFont(font)
        self.comboBox_2.setObjectName("comboBox_2")
        self.comboBox_2.addItem("")
        self.comboBox_2.addItem("")

        self.comboBox_2.setItemText(
            0,
            QtWidgets.QApplication.translate("MainWindow", "0013A2004155E2AB",
                                             None, -1))
        self.comboBox_2.setItemText(
            1,
            QtWidgets.QApplication.translate("MainWindow", "0013A2004155E2A6",
                                             None, -1))

        # Admin tab -> D.E. groupbox -> name label
        self.label_6 = QtWidgets.QLabel(self.groupBox)
        self.label_6.setGeometry(QtCore.QRect(10, 90, 211, 20))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.label_6.setFont(font)
        self.label_6.setObjectName("label_6")

        self.label_6.setText(
            QtWidgets.QApplication.translate("MainWindow", "Name", None, -1))

        # Admin tab -> D.E. groupbox -> name textbox
        self.plainTextEdit_3 = QtWidgets.QPlainTextEdit(self.groupBox)
        self.plainTextEdit_3.setGeometry(QtCore.QRect(10, 110, 231, 41))
        self.plainTextEdit_3.setObjectName("plainTextEdit_3")

        self.plainTextEdit_3.setToolTip(
            QtWidgets.QApplication.translate(
                "MainWindow",
                "<html><head/><body><p>Enter text</p></body></html>", None,
                -1))

        # Admin tab -> D.E. groupbox -> notes label
        self.label_7 = QtWidgets.QLabel(self.groupBox)
        self.label_7.setGeometry(QtCore.QRect(10, 160, 131, 20))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.label_7.setFont(font)
        self.label_7.setObjectName("label_7")

        self.label_7.setText(
            QtWidgets.QApplication.translate("MainWindow", "Notes", None, -1))

        # Admin tab -> D.E. groupbox -> notes textbox
        self.plainTextEdit_4 = QtWidgets.QPlainTextEdit(self.groupBox)
        self.plainTextEdit_4.setGeometry(QtCore.QRect(10, 190, 231, 71))
        self.plainTextEdit_4.setObjectName("plainTextEdit_4")

        self.plainTextEdit_4.setToolTip(
            QtWidgets.QApplication.translate(
                "MainWindow",
                "<html><head/><body><p>Enter text</p></body></html>", None,
                -1))

        # Admin tab -> D.E. groupbox -> submit button
        self.pushButton_3 = QtWidgets.QPushButton(self.groupBox)
        self.pushButton_3.setGeometry(QtCore.QRect(20, 282, 211, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.pushButton_3.setFont(font)
        self.pushButton_3.setObjectName("pushButton_3")

        self.pushButton_3.setText(
            QtWidgets.QApplication.translate("MainWindow", "Submit", None, -1))

        self.pushButton_3.clicked.connect(self.enrol_device)

        # Admin tab -> enrolled devices label
        self.label_12 = QtWidgets.QLabel(self.tab)
        self.label_12.setGeometry(QtCore.QRect(300, 50, 431, 20))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label_12.setFont(font)
        self.label_12.setAlignment(QtCore.Qt.AlignCenter)
        self.label_12.setObjectName("label_12")

        self.label_12.setText(
            QtWidgets.QApplication.translate("MainWindow", "Enrolled Devices",
                                             None, -1))

        #----------------------------------------------------------------

        # Map tab ------------------------------------------------------
        self.tab_3 = QtWidgets.QWidget()
        self.tab_3.setObjectName("tab_3")
        self.tabWidget.addTab(self.tab_3, "")
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab_3),
            QtWidgets.QApplication.translate("MainWindow", "Map", None, -1))

        #self.widget = QtWidgets.QWidget(self.tab_3)
        self.widget = QtWebEngineWidgets.QWebEngineView(self.tab_3)
        self.widget.setGeometry(QtCore.QRect(0, 0, 751, 521))
        self.widget.setAutoFillBackground(True)
        self.widget.load(QtCore.QUrl().fromLocalFile(
            os.path.split(os.path.abspath(__file__))[0] +
            r'\html\plot_points_to_map.html'))
        self.widget.show()
        self.widget.setObjectName("widget")
        #---------------------------------------------------------------

        # Messages tab ------------------------------------------------
        self.tab_2 = QtWidgets.QWidget()
        self.tab_2.setObjectName("tab_2")
        self.tabWidget.addTab(self.tab_2, "")
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab_2),
            QtWidgets.QApplication.translate("MainWindow", "Messages", None,
                                             -1))

        # Messages tab -> message table
        self.tableWidget = QtWidgets.QTableWidget(self.tab_2)
        self.tableWidget.setGeometry(QtCore.QRect(0, 211, 751, 311))
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setColumnCount(3)
        self.tableWidget.setRowCount(self.message_db_rows)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setHorizontalHeaderItem(2, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(0, 0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(0, 1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget.setItem(0, 2, item)
        self.tableWidget.horizontalHeader().setCascadingSectionResizes(False)
        self.tableWidget.horizontalHeader().setStretchLastSection(True)
        self.tableWidget.horizontalHeader().setDefaultSectionSize(160)

        self.tableWidget.horizontalHeaderItem(0).setText(
            QtWidgets.QApplication.translate("MainWindow", "To", None, -1))
        self.tableWidget.horizontalHeaderItem(1).setText(
            QtWidgets.QApplication.translate("MainWindow", "DateTime", None,
                                             -1))
        self.tableWidget.horizontalHeaderItem(2).setText(
            QtWidgets.QApplication.translate("MainWindow", "Message", None,
                                             -1))

        # Messages tab -> broadcast send button
        self.pushButton = QtWidgets.QPushButton(self.tab_2)
        self.pushButton.setGeometry(QtCore.QRect(240, 130, 71, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.pushButton.setFont(font)
        self.pushButton.setObjectName("pushButton")

        self.pushButton.setText(
            QtWidgets.QApplication.translate("MainWindow", "Send", None, -1))

        self.pushButton.clicked.connect(self.broadcast_message)

        # Messages tab -> direct send button
        self.pushButton_2 = QtWidgets.QPushButton(self.tab_2)
        self.pushButton_2.setGeometry(QtCore.QRect(630, 130, 71, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.pushButton_2.setFont(font)
        self.pushButton_2.setObjectName("pushButton_2")

        self.pushButton_2.setText(
            QtWidgets.QApplication.translate("MainWindow", "Send", None, -1))

        self.pushButton_2.clicked.connect(self.direct_message)

        # Messages tab -> direct device id dropdown
        self.comboBox = QtWidgets.QComboBox(self.tab_2)
        self.comboBox.setGeometry(QtCore.QRect(540, 40, 161, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.comboBox.setFont(font)
        self.comboBox.setIconSize(QtCore.QSize(16, 16))
        self.comboBox.setObjectName("comboBox")
        self.comboBox.addItem("")
        self.comboBox.addItem("")

        self.comboBox.setCurrentText(
            QtWidgets.QApplication.translate("MainWindow", "", None, -1))

        # Messages tab -> broadcast message textbox
        self.plainTextEdit = QtWidgets.QPlainTextEdit(self.tab_2)
        self.plainTextEdit.setGeometry(QtCore.QRect(43, 80, 271, 41))
        self.plainTextEdit.setObjectName("plainTextEdit")

        self.plainTextEdit.setToolTip(
            QtWidgets.QApplication.translate(
                "MainWindow",
                "<html><head/><body><p>Enter text</p></body></html>", None,
                -1))

        # Messages tab -> direct message textbox
        self.plainTextEdit_2 = QtWidgets.QPlainTextEdit(self.tab_2)
        self.plainTextEdit_2.setGeometry(QtCore.QRect(420, 80, 281, 41))
        self.plainTextEdit_2.setPlaceholderText("")
        self.plainTextEdit_2.setObjectName("plainTextEdit_2")

        self.plainTextEdit_2.setToolTip(
            QtWidgets.QApplication.translate(
                "MainWindow",
                "<html><head/><body><p>Tool tip: Enter text</p></body></html>",
                None, -1))

        # Messages tab -> broadcast label
        self.label_2 = QtWidgets.QLabel(self.tab_2)
        self.label_2.setGeometry(QtCore.QRect(40, 40, 161, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.label_2.setFont(font)
        self.label_2.setObjectName("label_2")

        self.label_2.setText(
            QtWidgets.QApplication.translate("MainWindow", "Broadcast Message",
                                             None, -1))

        # Messages tab -> direct label
        self.label_3 = QtWidgets.QLabel(self.tab_2)
        self.label_3.setGeometry(QtCore.QRect(420, 40, 111, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.label_3.setFont(font)
        self.label_3.setObjectName("label_3")

        self.label_3.setText(
            QtWidgets.QApplication.translate("MainWindow", "Direct Message",
                                             None, -1))

        # Messages tab -> Message history label
        self.label_4 = QtWidgets.QLabel(self.tab_2)
        self.label_4.setGeometry(QtCore.QRect(0, 180, 751, 21))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label_4.setFont(font)
        self.label_4.setAlignment(QtCore.Qt.AlignCenter)
        self.label_4.setObjectName("label_4")

        self.label_4.setText(
            QtWidgets.QApplication.translate("MainWindow", "Message History",
                                             None, -1))

        #-----------------------------------------------------------------------------

        # Audio tab ------------------------------------------------------------------
        self.tab_4 = QtWidgets.QWidget()
        self.tab_4.setObjectName("tab_4")
        self.tabWidget.addTab(self.tab_4, "")
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab_4),
            QtWidgets.QApplication.translate("MainWindow", "Audio", None, -1))

        # audio tab -> sent table
        self.tableWidget_3 = QtWidgets.QTableWidget(self.tab_4)
        self.tableWidget_3.setGeometry(QtCore.QRect(0, 90, 751, 181))
        self.tableWidget_3.setRowCount(self.audio_sent_db_rows)
        self.tableWidget_3.setObjectName("tableWidget_3")
        self.tableWidget_3.setColumnCount(4)
        self.tableWidget_3.setRowCount(self.audio_sent_db_rows)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_3.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_3.setHorizontalHeaderItem(1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_3.setHorizontalHeaderItem(2, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_3.setHorizontalHeaderItem(3, item)
        self.tableWidget_3.horizontalHeader().setCascadingSectionResizes(False)
        self.tableWidget_3.horizontalHeader().setDefaultSectionSize(120)
        self.tableWidget_3.horizontalHeader().setStretchLastSection(True)
        self.tableWidget_3.verticalHeader().setStretchLastSection(False)

        self.tableWidget_3.horizontalHeaderItem(0).setText(
            QtWidgets.QApplication.translate("MainWindow", "To", None, -1))
        self.tableWidget_3.horizontalHeaderItem(1).setText(
            QtWidgets.QApplication.translate("MainWindow", "DateTime", None,
                                             -1))
        self.tableWidget_3.horizontalHeaderItem(2).setText(
            QtWidgets.QApplication.translate("MainWindow", "Filename", None,
                                             -1))
        self.tableWidget_3.horizontalHeaderItem(3).setText(
            QtWidgets.QApplication.translate("MainWindow", "Description", None,
                                             -1))

        self.tableWidget_3.cellClicked.connect(self.audio_cell_clicked)

        # audio tab -> sent label
        self.label_8 = QtWidgets.QLabel(self.tab_4)
        self.label_8.setGeometry(QtCore.QRect(0, 60, 91, 16))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label_8.setFont(font)
        self.label_8.setObjectName("label_8")

        self.label_8.setText(
            QtWidgets.QApplication.translate("MainWindow", "Sent", None, -1))

        # audio tab -> recieved table
        self.tableWidget_4 = QtWidgets.QTableWidget(self.tab_4)
        self.tableWidget_4.setGeometry(QtCore.QRect(0, 340, 751, 191))
        self.tableWidget_4.setRowCount(self.audio_recv_db_rows)
        self.tableWidget_4.setObjectName("tableWidget_4")
        self.tableWidget_4.setColumnCount(4)
        self.tableWidget_4.setRowCount(self.audio_recv_db_rows)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_4.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_4.setHorizontalHeaderItem(1, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_4.setHorizontalHeaderItem(2, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_4.setHorizontalHeaderItem(3, item)
        self.tableWidget_4.horizontalHeader().setCascadingSectionResizes(False)
        self.tableWidget_4.horizontalHeader().setDefaultSectionSize(120)
        self.tableWidget_4.horizontalHeader().setStretchLastSection(True)
        self.tableWidget_4.verticalHeader().setStretchLastSection(False)

        self.tableWidget_4.horizontalHeaderItem(0).setText(
            QtWidgets.QApplication.translate("MainWindow", "From", None, -1))
        self.tableWidget_4.horizontalHeaderItem(1).setText(
            QtWidgets.QApplication.translate("MainWindow", "DateTime", None,
                                             -1))
        self.tableWidget_4.horizontalHeaderItem(2).setText(
            QtWidgets.QApplication.translate("MainWindow", "Filename", None,
                                             -1))
        self.tableWidget_4.horizontalHeaderItem(3).setText(
            QtWidgets.QApplication.translate("MainWindow", "Notes", None, -1))

        self.tableWidget_4.cellClicked.connect(self.audio_cell_clicked)

        # audio tab -> recieved label
        self.label_9 = QtWidgets.QLabel(self.tab_4)
        self.label_9.setGeometry(QtCore.QRect(0, 310, 91, 16))
        font = QtGui.QFont()
        font.setPointSize(14)
        self.label_9.setFont(font)
        self.label_9.setObjectName("label_9")

        self.label_9.setText(
            QtWidgets.QApplication.translate("MainWindow", "Recieved", None,
                                             -1))

        # audio tab -> record button
        self.pushButton_4 = QtWidgets.QPushButton(self.tab_4)
        self.pushButton_4.setGeometry(QtCore.QRect(620, 40, 131, 41))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.pushButton_4.setFont(font)
        self.pushButton_4.setObjectName("pushButton_4")

        self.pushButton_4.setText(
            QtWidgets.QApplication.translate("MainWindow", "Record", None, -1))

        self.pushButton_4.clicked.connect(self.audio_record_click)

        # audio tab -> play button
        self.pushButton_5 = QtWidgets.QPushButton(self.tab_4)
        self.pushButton_5.setGeometry(QtCore.QRect(620, 290, 131, 41))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.pushButton_5.setFont(font)
        self.pushButton_5.setObjectName("pushButton_5")

        self.pushButton_5.setText(
            QtWidgets.QApplication.translate("MainWindow", "Play", None, -1))

        self.pushButton_5.clicked.connect(self.audio_play_click)

        #----------------------------------------------------------------------------------

        # Recorder tab -------------------------------------------------------------------
        self.tab_5 = QtWidgets.QWidget()
        self.tab_5.setObjectName("tab_5")
        self.tabWidget.addTab(self.tab_5, "")
        self.tabWidget.setTabText(
            self.tabWidget.indexOf(self.tab_5),
            QtWidgets.QApplication.translate("MainWindow", "Recorder", None,
                                             -1))

        # Recorder tab -> recorder groupbox
        self.groupBox_2 = QtWidgets.QGroupBox(self.tab_5)
        self.groupBox_2.setGeometry(QtCore.QRect(260, 70, 271, 371))

        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(130, 130, 130))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(130, 130, 130))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(130, 130, 130))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(130, 130, 130))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)

        self.groupBox_2.setPalette(palette)
        font = QtGui.QFont()
        font.setPointSize(14)
        self.groupBox_2.setFont(font)
        self.groupBox_2.setAutoFillBackground(True)
        self.groupBox_2.setObjectName("groupBox_2")

        self.groupBox_2.setTitle(
            QtWidgets.QApplication.translate("MainWindow", "Audio Recorder",
                                             None, -1))

        # Recorder tab -> recorder groupbox -> stop button
        self.pushButton_7 = QtWidgets.QPushButton(self.groupBox_2)
        self.pushButton_7.setGeometry(QtCore.QRect(180, 50, 75, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.pushButton_7.setFont(font)
        self.pushButton_7.setObjectName("pushButton_7")

        self.pushButton_7.setText(
            QtWidgets.QApplication.translate("MainWindow", "Stop", None, -1))

        self.pushButton_7.clicked.connect(self.recorder_stop_click)

        # Recorder tab -> recorder groupbox -> record button
        self.pushButton_6 = QtWidgets.QPushButton(self.groupBox_2)
        self.pushButton_6.setGeometry(QtCore.QRect(10, 50, 75, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.pushButton_6.setFont(font)
        self.pushButton_6.setObjectName("pushButton_6")

        self.pushButton_6.setText(
            QtWidgets.QApplication.translate("MainWindow", "Record", None, -1))

        self.pushButton_6.clicked.connect(self.recorder_record_click)

        # Recorder tab -> recorder groupbox -> play button
        self.pushButton_8 = QtWidgets.QPushButton(self.groupBox_2)
        self.pushButton_8.setGeometry(QtCore.QRect(10, 120, 75, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.pushButton_8.setFont(font)
        self.pushButton_8.setObjectName("pushButton_8")

        self.pushButton_8.setText(
            QtWidgets.QApplication.translate("MainWindow", "Play", None, -1))

        self.pushButton_8.clicked.connect(self.recorder_play_click)

        # Recorder tab -> recorder groupbox -> destination label
        self.label_10 = QtWidgets.QLabel(self.groupBox_2)
        self.label_10.setGeometry(QtCore.QRect(10, 170, 81, 21))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.label_10.setFont(font)
        self.label_10.setObjectName("label_10")

        self.label_10.setText(
            QtWidgets.QApplication.translate("MainWindow", "Destination:",
                                             None, -1))

        # Recorder tab -> recorder groupbox -> destination id dropdown
        self.comboBox_3 = QtWidgets.QComboBox(self.groupBox_2)
        self.comboBox_3.setGeometry(QtCore.QRect(100, 165, 161, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.comboBox_3.setFont(font)
        self.comboBox_3.setObjectName("comboBox_3")

        # Recorder tab -> recorder groupbox -> description label
        self.label_11 = QtWidgets.QLabel(self.groupBox_2)
        self.label_11.setGeometry(QtCore.QRect(10, 210, 101, 21))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.label_11.setFont(font)
        self.label_11.setObjectName("label_11")

        self.label_11.setText(
            QtWidgets.QApplication.translate("MainWindow", "Description:",
                                             None, -1))

        # Recorder tab -> recorder groupbox -> description textbox
        self.plainTextEdit_5 = QtWidgets.QPlainTextEdit(self.groupBox_2)
        self.plainTextEdit_5.setGeometry(QtCore.QRect(10, 240, 251, 71))
        self.plainTextEdit_5.setObjectName("plainTextEdit_5")

        self.plainTextEdit_5.setToolTip(
            QtWidgets.QApplication.translate(
                "MainWindow",
                "<html><head/><body><p>Enter text</p></body></html>", None,
                -1))

        # Recorder tab -> recorder groupbox -> send button
        self.pushButton_10 = QtWidgets.QPushButton(self.groupBox_2)
        self.pushButton_10.setGeometry(QtCore.QRect(170, 330, 75, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.pushButton_10.setFont(font)
        self.pushButton_10.setObjectName("pushButton_10")

        self.pushButton_10.setText(
            QtWidgets.QApplication.translate("MainWindow", "Send", None, -1))

        self.pushButton_10.clicked.connect(self.recorder_send_click)

        # Recorder tab -> recorder groupbox -> reset button
        self.pushButton_9 = QtWidgets.QPushButton(self.groupBox_2)
        self.pushButton_9.setGeometry(QtCore.QRect(180, 120, 75, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.pushButton_9.setFont(font)
        self.pushButton_9.setObjectName("pushButton_9")

        self.pushButton_9.setText(
            QtWidgets.QApplication.translate("MainWindow", "Reset", None, -1))

        self.pushButton_9.clicked.connect(self.recorder_reset_click)

        # Recorder tab -> recorder groupbox -> cancel button
        self.pushButton_11 = QtWidgets.QPushButton(self.groupBox_2)
        self.pushButton_11.setGeometry(QtCore.QRect(20, 330, 75, 31))
        font = QtGui.QFont()
        font.setPointSize(11)
        self.pushButton_11.setFont(font)
        self.pushButton_11.setObjectName("pushButton_11")

        self.pushButton_11.setText(
            QtWidgets.QApplication.translate("MainWindow", "Cancel", None, -1))

        self.pushButton_11.clicked.connect(self.recorder_cancel_click)

        self.tabWidget.setTabEnabled(self.tabWidget.indexOf(self.tab_5), False)

        #-----------------------------------------------------------------------------

        self.tabWidget.setCurrentIndex(0)

        self.update_message_tab()
        self.update_admin_tab()
        self.update_audio_tab()
        self.update_record_tab()

        QtCore.QMetaObject.connectSlotsByName(MainWindow)