Пример #1
0
    def __init__(self, parent=None):
        super(HoneyMain, self).__init__(parent)
        self.__title = "Honey"
        self.setWindowTitle(self.__title)
        self.resize(1000, 700)

        self.__layout = QtGui.QVBoxLayout()
        self.__layout.setContentsMargins(0, 0, 0, 0)
        self.__layout.setSpacing(0)
        self.setLayout(self.__layout)

        self.nav_bar = NavBar()
        self.nav_bar.status_changed.connect(self.set_workspace)
        self.__layout.addWidget(self.nav_bar)

        self.main_area = QtGui.QStackedWidget()
        self.__layout.addWidget(self.main_area)

        self.project_workspace = ProjectWorkspace()
        self.main_area.addWidget(self.project_workspace)
        self.plan_workspace = PlanWorkspace()
        self.main_area.addWidget(self.plan_workspace)
        self.daily_workspace = DailyWorkspace()
        self.main_area.addWidget(self.daily_workspace)
        self.report_workspace = ReportWorkspace()
        self.main_area.addWidget(self.report_workspace)
        self.setting_workspace = SettingWorkspace()
        self.main_area.addWidget(self.setting_workspace)
Пример #2
0
class HoneyMain(QtGui.QWidget):
    def __init__(self, parent=None):
        super(HoneyMain, self).__init__(parent)
        self.__title = "Honey"
        self.setWindowTitle(self.__title)
        self.resize(1000, 700)

        self.__layout = QtGui.QVBoxLayout()
        self.__layout.setContentsMargins(0, 0, 0, 0)
        self.__layout.setSpacing(0)
        self.setLayout(self.__layout)

        self.nav_bar = NavBar()
        self.nav_bar.status_changed.connect(self.set_workspace)
        self.__layout.addWidget(self.nav_bar)

        self.main_area = QtGui.QStackedWidget()
        self.__layout.addWidget(self.main_area)

        self.project_workspace = ProjectWorkspace()
        self.main_area.addWidget(self.project_workspace)
        self.plan_workspace = PlanWorkspace()
        self.main_area.addWidget(self.plan_workspace)
        self.daily_workspace = DailyWorkspace()
        self.main_area.addWidget(self.daily_workspace)
        self.report_workspace = ReportWorkspace()
        self.main_area.addWidget(self.report_workspace)
        self.setting_workspace = SettingWorkspace()
        self.main_area.addWidget(self.setting_workspace)

    def set_workspace(self, workspace):
        """The workspaces are: Project Plan Daily Report Setting"""
        if workspace == "project":
            self.main_area.setCurrentWidget(self.project_workspace)
        if workspace == "plan":
            self.main_area.setCurrentWidget(self.plan_workspace)
        if workspace == "daily":
            self.daily_workspace.loadDaily()
            self.main_area.setCurrentWidget(self.daily_workspace)
        if workspace == "report":
            self.main_area.setCurrentWidget(self.report_workspace)
        if workspace == "setting":
            self.main_area.setCurrentWidget(self.setting_workspace)