|
|
#!/usr/bin/python
|
|
|
#-*- coding: utf-8 -*-
|
|
|
from PySide import QtGui, QtCore
|
|
|
|
|
|
from leftmenu import LeftMenu
|
|
|
from statusfield import StatusField
|
|
|
from mainframe import MainFrame
|
|
|
from mainmenu import MainMenu
|
|
|
from helpwidget import HelpWgt
|
|
|
from tools import ToolsWidget
|
|
|
|
|
|
from conf_connection import FrameConnection
|
|
|
|
|
|
#class Example(QtGui.QWidget):
|
|
|
class Example(QtGui.QMainWindow):
|
|
|
|
|
|
def __init__(self, ClientObj):
|
|
|
super(Example, self).__init__()
|
|
|
self.ClientObj = ClientObj
|
|
|
self.initUI()
|
|
|
|
|
|
def initUI(self):
|
|
|
# Создание нижнего статус бара
|
|
|
self.statusbar = self.statusBar()
|
|
|
self.statusbar.showMessage('Ready')
|
|
|
hbox = QtGui.QHBoxLayout(self)
|
|
|
|
|
|
# Создание верхнего главного меню
|
|
|
|
|
|
MainMenu(self)
|
|
|
|
|
|
# левое верхнее меню
|
|
|
self.topleft = LeftMenu(self, self.ClientObj)
|
|
|
# верхнее правое
|
|
|
self.main_frame = FrameConnection(self, self.ClientObj)
|
|
|
self.main_frame.resize(600,700)
|
|
|
|
|
|
# создание нижнего фрейма
|
|
|
bottom = StatusField(self)
|
|
|
bottom.resize(800,100)
|
|
|
# объединение в один виджет
|
|
|
splitter1 = QtGui.QSplitter(QtCore.Qt.Horizontal)
|
|
|
splitter1.addWidget(self.topleft)
|
|
|
splitter1.addWidget(self.main_frame)
|
|
|
splitter1.resize(800,700)
|
|
|
# splitter1.setGeometry(0, 0, 0, 140)
|
|
|
|
|
|
splitter2 = QtGui.QSplitter(QtCore.Qt.Vertical)
|
|
|
splitter2.addWidget(splitter1)
|
|
|
splitter2.addWidget(bottom)
|
|
|
|
|
|
|
|
|
hbox.addWidget(splitter2)
|
|
|
# self.setLayout(hbox)
|
|
|
# QtGui.QApplication.setStyle(QtGui.QStyleFactory.create('Cleanlooks'))
|
|
|
# QtGui.QApplication.setStyle(QtGui.QStyleFactory.create('CDE'))
|
|
|
CentralWidget = QtGui.QWidget()
|
|
|
CentralWidget.setLayout(hbox)
|
|
|
self.setCentralWidget(CentralWidget)
|
|
|
|
|
|
self.move(200, 200)
|
|
|
|
|
|
self.resize(800,800)
|
|
|
self.setWindowTitle(self.ClientObj.WindowTitle)
|
|
|
|
|
|
def onChanged(self, text):
|
|
|
|
|
|
self.lbl.setText(text)
|
|
|
self.lbl.adjustSize()
|
|
|
|
|
|
def help(self):
|
|
|
self.HelpWidget = HelpWgt(self)
|
|
|
self.HelpWidget.show()
|
|
|
|
|
|
def tools(self):
|
|
|
self.ToolsWgt = ToolsWidget(self)
|
|
|
self.ToolsWgt.show()
|
|
|
|
|
|
# def closeEvent(self, event):
|
|
|
## reply = QtGui.QMessageBox.question(self, 'Message',
|
|
|
## "Close your session?", QtGui.QMessageBox.Yes, QtGui.QMessageBox.No,\
|
|
|
## QtGui.QMessageBox.Cancel)
|
|
|
#
|
|
|
# msgBox = QMessageBox()
|
|
|
# msgBox.setText("Close your session?")
|
|
|
# msgBox.setInformativeText('at closing session, '
|
|
|
# 'data all processes will be deleted!')
|
|
|
# msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No | \
|
|
|
# QMessageBox.Cancel)
|
|
|
# msgBox.setDefaultButton(QMessageBox.Save)
|
|
|
# reply = msgBox.exec_()
|
|
|
#
|
|
|
# if reply == QtGui.QMessageBox.Yes:
|
|
|
# '''Closing session...'''
|
|
|
# event.accept()
|
|
|
# elif reply == QtGui.QMessageBox.No:
|
|
|
# event.accept()
|
|
|
# else:
|
|
|
# event.ignore() |