예제 #1
0
    def __init__(self, parent=None):
        super(TeacherView, self).__init__(parent)

        self.broadcastServer = None
        self.broadcastPort = 65535
        self.multicastServer = None
        self.multicastPort = 65532
        self.publisher = None
        self.publisherPort = 65534
        self.reply = None
        self.replyPort = 65533

        self.ip = None

        protocolSignal.callAttention.connect(self.callAttention)

        self.setWindowTitle('Guanandy Teacher')

        self.guanandy = QtWidgets.QWidget(self)

        self.studentModel = StudentModel(self.guanandy)

        self.sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                QtWidgets.QSizePolicy.Expanding)
        self.sizePolicy.setHorizontalStretch(0)
        self.sizePolicy.setVerticalStretch(0)
        self.sizePolicy.setHeightForWidth(
                self.guanandy.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(self.sizePolicy)

        self.guanandyLayout = QtWidgets.QGridLayout(self.guanandy)

        # Header layout
        self.headerLayout = QtWidgets.QHBoxLayout()
        self.guanandyLogo = QtWidgets.QLabel(self.guanandy)
        self.guanandyLogo.setText('')
        self.guanandyLogo.setPixmap(
                QtGui.QPixmap('Images/guanandy32x180.png'))
        self.headerLayout.addWidget(self.guanandyLogo)

        #self.headerSpacer = QtWidgets.QSpacerItem(40, 20,
        #        QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        #self.headerLayout.addItem(self.headerSpacer)

        self.guanandyLayout.addLayout(self.headerLayout, 0, 0, 1, 1)

        # Commands layout
        self.commandsLayout = QtWidgets.QHBoxLayout()
        self.sendScreenButton = QtWidgets.QToolButton(self.guanandy)
        self.sendScreenIcon = QtGui.QIcon()
        self.sendScreenIcon.addPixmap(
                QtGui.QPixmap('Images/sendScreen.png'),
                QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.sendScreenButton.setIcon(self.sendScreenIcon)
        self.sendScreenButton.setIconSize(QtCore.QSize(64, 64))
        self.sendScreenButton.setToolButtonStyle(
                QtCore.Qt.ToolButtonTextUnderIcon)
        self.sendScreenButton.setText('Send screen')
        self.commandsLayout.addWidget(self.sendScreenButton)

        self.lockScreensButton = QtWidgets.QToolButton(self.guanandy)
        self.lockScreensIcon = QtGui.QIcon()
        self.lockScreensIcon.addPixmap(
                QtGui.QPixmap('Images/lockScreen.png'),
                QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.lockScreensButton.setIcon(self.lockScreensIcon)
        self.lockScreensButton.setIconSize(QtCore.QSize(64, 64))
        self.lockScreensButton.setToolButtonStyle(
                QtCore.Qt.ToolButtonTextUnderIcon)
        self.lockScreensButton.setText('Lock screen')
        self.commandsLayout.addWidget(self.lockScreensButton)

        self.shareFilesButton = QtWidgets.QToolButton(self.guanandy)
        self.shareFilesIcon = QtGui.QIcon()
        self.shareFilesIcon.addPixmap(
                QtGui.QPixmap('Images/shareFiles.png'),
                QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.shareFilesButton.setIcon(self.shareFilesIcon)
        self.shareFilesButton.setIconSize(QtCore.QSize(64, 64))
        self.shareFilesButton.setToolButtonStyle(
                QtCore.Qt.ToolButtonTextUnderIcon)
        self.shareFilesButton.setText('Share files')
        self.shareFilesButton.clicked.connect(self.shareFile)
        self.commandsLayout.addWidget(self.shareFilesButton)

        self.shareWebPageButton = QtWidgets.QToolButton(self.guanandy)
        self.shareWebPageIcon = QtGui.QIcon()
        self.shareWebPageIcon.addPixmap(
                QtGui.QPixmap('Images/shareWebPage.png'),
                QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.shareWebPageButton.setIcon(self.shareWebPageIcon)
        self.shareWebPageButton.setIconSize(QtCore.QSize(64, 64))
        self.shareWebPageButton.setToolButtonStyle(
                QtCore.Qt.ToolButtonTextUnderIcon)
        self.shareWebPageButton.setText('Share web page')
        self.commandsLayout.addWidget(self.shareWebPageButton)

        self.sendMessageButton = QtWidgets.QToolButton(self.guanandy)
        self.sendMessageIcon = QtGui.QIcon()
        self.sendMessageIcon.addPixmap(
                QtGui.QPixmap('Images/sendMessage.png'),
                QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.sendMessageButton.setIcon(self.sendMessageIcon)
        self.sendMessageButton.setIconSize(QtCore.QSize(64, 64))
        self.sendMessageButton.setToolButtonStyle(
                QtCore.Qt.ToolButtonTextUnderIcon)
        self.sendMessageButton.setText('Send message')
        self.commandsLayout.addWidget(self.sendMessageButton)

        self.openApplicationButton = QtWidgets.QToolButton(self.guanandy)
        self.openApplicationIcon = QtGui.QIcon()
        self.openApplicationIcon.addPixmap(
                QtGui.QPixmap('Images/openApplication.png'),
                QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.openApplicationButton.setIcon(self.openApplicationIcon)
        self.openApplicationButton.setIconSize(QtCore.QSize(64, 64))
        self.openApplicationButton.setToolButtonStyle(
                QtCore.Qt.ToolButtonTextUnderIcon)
        self.openApplicationButton.setText('Open application')
        self.commandsLayout.addWidget(self.openApplicationButton)

        self.turnOffStudentsButton = QtWidgets.QToolButton(self.guanandy)
        self.turnOffStudentsIcon = QtGui.QIcon()
        self.turnOffStudentsIcon.addPixmap(
                QtGui.QPixmap('Images/turnOffStudents.png'),
                QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.turnOffStudentsButton.setIcon(self.turnOffStudentsIcon)
        self.turnOffStudentsButton.setIconSize(QtCore.QSize(64, 64))
        self.turnOffStudentsButton.setToolButtonStyle(
                QtCore.Qt.ToolButtonTextUnderIcon)
        self.turnOffStudentsButton.setText('Turn off students')
        self.commandsLayout.addWidget(self.turnOffStudentsButton)
        self.guanandyLayout.addLayout(self.commandsLayout, 1, 0, 1, 1)

        # Students layout
        self.studentsLayout = QtWidgets.QVBoxLayout()
        self.studentListView = QtWidgets.QListView(self.guanandy)
        self.studentListView.setModel(self.studentModel)
        self.studentListView.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
        self.studentsLayout.addWidget(self.studentListView)
        self.guanandyLayout.addLayout(self.studentsLayout, 3, 0, 1, 1)

        # Footer layout
        self.footerLayout = QtWidgets.QHBoxLayout()

        self.historyButton = QtWidgets.QToolButton(self.guanandy)
        self.historyIcon = QtGui.QIcon()
        self.historyIcon.addPixmap(
                QtGui.QPixmap('Images/history.png'),
                QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.historyButton.setIcon(self.historyIcon)
        self.historyButton.setIconSize(QtCore.QSize(32, 32))
        self.historyButton.setToolButtonStyle(
                QtCore.Qt.ToolButtonTextBesideIcon)
        self.historyButton.setText('History')
        self.footerLayout.addWidget(self.historyButton)

        self.footerLabel = QtWidgets.QLabel(self.guanandy)
        self.footerLabel.setText('Version:')
        self.footerLayout.addWidget(self.footerLabel)

        self.systemVersion = QtWidgets.QLabel(self.guanandy)
        self.systemVersion.setText(getVersion())
        self.footerLayout.addWidget(self.systemVersion)

        self.footerSpacer = QtWidgets.QSpacerItem(32, 32,
                QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.footerLayout.addItem(self.footerSpacer)

        self.exitSystemButton = QtWidgets.QToolButton(self.guanandy)
        self.exitSystemIcon = QtGui.QIcon()
        self.exitSystemIcon.addPixmap(
                QtGui.QPixmap('Images/exit.png'),
                QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.exitSystemButton.setIcon(self.exitSystemIcon)
        self.exitSystemButton.setIconSize(QtCore.QSize(32, 32))
        self.exitSystemButton.setToolButtonStyle(
                QtCore.Qt.ToolButtonTextBesideIcon)
        self.exitSystemButton.setText('Exit')
        self.exitSystemButton.clicked.connect(self.close)
        self.footerLayout.addWidget(self.exitSystemButton)

        self.guanandyLayout.addLayout(self.footerLayout, 4, 0, 1, 1)
        self.setCentralWidget(self.guanandy)
예제 #2
0
파일: setup.py 프로젝트: bhdn/guanandy
            pkg = pkg.replace(os.path.altsep, ".")
        packages.append(pkg)
    elif filenames:
        for f in filenames:
            full = os.path.join(dirpath, f)
            data_dirpath.append(os.path.split(full)[0])
            data_fullpath.append(full)
    other_files.extend(zip(data_dirpath, [data_fullpath]))

data_files = [("", glob.glob("teacher.py")), ("", glob.glob("student.py"))]

data_files.extend(other_files)

setup(
    name="guanandy",
    version=getVersion().replace(" ", "-"),
    description="Guanandy",
    author="Wiliam Souza",
    author_email="*****@*****.**",
    url="",
    download_url="",
    package_dir={"Guanandy": "Guanandy"},
    packages=packages,
    data_files=data_files,
    classifiers=[
        "Development Status :: 1 - Planning",
        "Intended Audience :: Developers",
        "License :: GPL",
        "Operating System :: POSIX :: Linux",
        "Programming Language :: Python",
        "Topic :: Libraries :: Python Modules",