<commit_before>#!/usr/bin/env python
##
## Author(s):
##  - <NAME> <<EMAIL>>
##

from phyui.qt.dock import ViewDockWidget, DockTitleBar

from phyui.qt.qtversion import QtCore, QtGui

import phyui
from phy.plot.waveforms import WaveformView, add_waveform_view

from vispy import app

app.use_app("pyqt4")
from vispy.app.qt import QtCanvas




class ManualClusteringMainWindow(QtGui.QMainWindow):
    def __init__(self, parent=None):
        super(ManualClusteringMainWindow, self).__init__(parent)

        self.settings = QtCore.QSettings()
        self.setObjectName("MainWindow")
        self.resize(128, 64)
        self.centralwidget = QtGui.QWidget(self)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtGui.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(self.centralwidget)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        self.setCentralWidget(self.centralwidget)

        self.menubar = QtGui.QMenuBar(self)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 82, 21))
        self.menubar.setObjectName("menubar")
        self.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(self)
        self.statusbar.setObjectName("statusbar")
        self.setStatusBar(self.statusbar)

        self.retranslateUi()
        QtCore.QMetaObject.connectSlotsByName(self)

        # Dock widgets options
        #self.setDockNestingEnabled(True)

        la = QtGui.QLabel()
        la.setText("fried eggs");
        self.create_view(la, "Test 1", position=QtCore.Qt.LeftDockWidgetArea)

        la2 = QtGui.QLabel()
        la2.setText("chicken wings");
        self.create_view(la2, "Test 2", position=QtCore.Qt.LeftDockWidgetArea)


        canv = add_waveform_view(phyui.session())
        c = canv.native #QtCanvas(canvas=canv)
        self.create_view(c, "Waveform", position=QtCore.Qt.RightDockWidgetArea)



        from PyQt4 import QtWebKit
        wv = QtWebKit.QWebView()
        wv.setUrl(QtCore.QUrl("http://localhost:8888"))
        self.create_view(wv, "Clusters", position=QtCore.Qt.LeftDockWidgetArea)

        self.restore_geometry()

    def retranslateUi(self):
        self.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Manual Clustering", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setText(QtGui.QApplication.translate("MainWindow", "Hello World!", None, QtGui.QApplication.UnicodeUTF8))


    # View methods.
    # -------------
    def create_view(self, view, title, position=None,
        closable=True, floatable=True, index=0, floating=None, **kwargs):
        """Add a widget to the main window."""

        # Create the dock widget.
        dockwidget = ViewDockWidget()
        #TODO: title is not a name
        dockwidget.setObjectName(title)<commit_msg>qt: add the feature view<commit_after>#!/usr/bin/env python
##
## Author(s):
##  - <NAME> <<EMAIL>>
##

from phyui.qt.dock import ViewDockWidget, DockTitleBar

from phyui.qt.qtversion import QtCore, QtGui

import phyui
from phy.plot.waveforms import WaveformView, add_waveform_view
from phy.plot.features import add_feature_view

from vispy import app

app.use_app("pyqt4")
from vispy.app.qt import QtCanvas




class ManualClusteringMainWindow(QtGui.QMainWindow):
    def __init__(self, parent=None):
        super(ManualClusteringMainWindow, self).__init__(parent)

        self.settings = QtCore.QSettings()
        self.setObjectName("MainWindow")
        self.resize(128, 64)
        self.centralwidget = QtGui.QWidget(self)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtGui.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(self.centralwidget)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        self.setCentralWidget(self.centralwidget)

        self.menubar = QtGui.QMenuBar(self)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 82, 21))
        self.menubar.setObjectName("menubar")
        self.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(self)
        self.statusbar.setObjectName("statusbar")
        self.setStatusBar(self.statusbar)

        self.retranslateUi()
        QtCore.QMetaObject.connectSlotsByName(self)

        # Dock widgets options
        #self.setDockNestingEnabled(True)

        la = QtGui.QLabel()
        la.setText("fried eggs");
        self.create_view(la, "Test 1", position=QtCore.Qt.LeftDockWidgetArea)

        la2 = QtGui.QLabel()
        la2.setText("chicken wings");
        self.create_view(la2, "Test 2", position=QtCore.Qt.LeftDockWidgetArea)


        canv = add_waveform_view(phyui.session())
        self.create_view(canv.native, "Waveform", position=QtCore.Qt.RightDockWidgetArea)

        feat = add_feature_view(phyui.session())
        self.create_view(feat.native, "Features", position=QtCore.Qt.RightDockWidgetArea)


        from PyQt4 import QtWebKit
        wv = QtWebKit.QWebView()
        wv.setUrl(QtCore.QUrl("http://localhost:8888"))
        self.create_view(wv, "Clusters", position=QtCore.Qt.LeftDockWidgetArea)

        self.restore_geometry()

    def retranslateUi(self):
        self.setWindowTitle(QtGui.QApplication.translate("MainWindow", "Manual Clustering", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setText(QtGui.QApplication.translate("MainWindow", "Hello World!", None, QtGui.QApplication.UnicodeUTF8))


    # View methods.
    # -------------
    def create_view(self, view, title, position=None,
        closable=True, floatable=True, index=0, floating=None, **kwargs):
        """Add a widget to the main window."""

        # Create the dock widget.
        dockwidget = ViewDockWidget()
        #TODO: title is not a name
        dockwidget.setObjectName(title)
{'fraction_non_alphanumeric': 0.12024890682811974, 'fraction_numerical': 0.009754456777665657, 'mean_word_length': 3.223721590909091, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5246212', 'n_tokens_mistral': 1985, 'n_tokens_neox': 1874, 'n_words': 319}