コード例 #1
0
ファイル: Teacher.py プロジェクト: SDSMT-CSC/dancesoft
class Teacher_window(QtGui.QMainWindow):
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_Teacher_Landing()
        self.ui.setupUi(self)

        self.ui.Quit_btn.clicked.connect(self.close)
        self.ui.Student_btn.clicked.connect(
            partial(self.change_window, index=1))
        self.ui.Class_btn.clicked.connect(partial(self.change_window, index=2))
        self.ui.Personal_btn.clicked.connect(
            partial(self.change_window, index=3))
        self.ui.Student_back_btn.clicked.connect(
            partial(self.change_window, index=0))
        self.ui.Class_back_btn.clicked.connect(
            partial(self.change_window, index=0))
        self.ui.Personal_back_btn.clicked.connect(
            partial(self.change_window, index=0))

        self.ui.Student_quit_btn.clicked.connect(self.close)
        self.ui.Class_quit_btn.clicked.connect(self.close)
        self.ui.Personal_quit_btn.clicked.connect(self.close)

    def change_window(self, index):
        self.ui.stackedWidget.setCurrentIndex(index)
コード例 #2
0
ファイル: Teacher.py プロジェクト: SDSMT-CSC464-F15/dancesoft
 def __init__(self, name):
     QtGui.QMainWindow.__init__(self)
     self.ui = Ui_Teacher_Landing()
     self.ui.setupUi(self)
     self.ui.name = name
     self.ui.Quit_btn.clicked.connect(self.close)
     self.ui.Student_btn.clicked.connect(partial(self.change_window, index = 1))
     self.ui.Class_btn.clicked.connect(partial(self.change_window, index = 2))
     self.ui.Personal_btn.clicked.connect(partial(self.change_window, index = 3))
     self.ui.Student_back_btn.clicked.connect(partial(self.change_window, index = 0))
     self.ui.Class_back_btn.clicked.connect(partial(self.change_window, index = 0))
     self.ui.Personal_back_btn.clicked.connect(partial(self.change_window, index = 0))
     self.ui.Logout_btn.clicked.connect(self.logout)
     
     self.ui.Search_student_btn.clicked.connect(self.search_student)
     self.ui.See_student_schedule_btn.clicked.connect(self.See_student_schedule)
     self.ui.Add_class_btn.clicked.connect(self.Add_student_class)
     self.ui.See_class_schedule_btn.clicked.connect(self.See_teacher_schedule)
     self.ui.See_class_info_btn.clicked.connect(self.search_class)
     self.ui.See_class_role_btn.clicked.connect(self.roll_sheet)
     self.ui.Modify_personal_info.clicked.connect(self.update_teacher)
     self.ui.Change_Username_btn.clicked.connect(self.reset_user)
     self.ui.Reset_password.clicked.connect(self.reset_password)
     self.ui.Student_quit_btn.clicked.connect(self.close)
     self.ui.Class_quit_btn.clicked.connect(self.close)
     self.ui.Personal_quit_btn.clicked.connect(self.close)
     self.ui.Enter_hours_btn.clicked.connect(self.enter_hour)
     self.num = True
コード例 #3
0
ファイル: Teacher.py プロジェクト: SDSMT-CSC464-F15/dancesoft
class Teacher_window(QtGui.QMainWindow):
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_Teacher_Landing()
        self.ui.setupUi(self)

        self.ui.Quit_btn.clicked.connect(self.close)
        self.ui.Student_btn.clicked.connect(partial(self.change_window, index = 1))
        self.ui.Class_btn.clicked.connect(partial(self.change_window, index = 2))
        self.ui.Personal_btn.clicked.connect(partial(self.change_window, index = 3))
        self.ui.Student_back_btn.clicked.connect(partial(self.change_window, index = 0))
        self.ui.Class_back_btn.clicked.connect(partial(self.change_window, index = 0))
        self.ui.Personal_back_btn.clicked.connect(partial(self.change_window, index = 0))
        
        self.ui.Student_quit_btn.clicked.connect(self.close)
        self.ui.Class_quit_btn.clicked.connect(self.close)
        self.ui.Personal_quit_btn.clicked.connect(self.close)
        
    def change_window(self, index):
        self.ui.stackedWidget.setCurrentIndex(index)
コード例 #4
0
ファイル: Teacher.py プロジェクト: SDSMT-CSC/dancesoft
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_Teacher_Landing()
        self.ui.setupUi(self)

        self.ui.Quit_btn.clicked.connect(self.close)
        self.ui.Student_btn.clicked.connect(
            partial(self.change_window, index=1))
        self.ui.Class_btn.clicked.connect(partial(self.change_window, index=2))
        self.ui.Personal_btn.clicked.connect(
            partial(self.change_window, index=3))
        self.ui.Student_back_btn.clicked.connect(
            partial(self.change_window, index=0))
        self.ui.Class_back_btn.clicked.connect(
            partial(self.change_window, index=0))
        self.ui.Personal_back_btn.clicked.connect(
            partial(self.change_window, index=0))

        self.ui.Student_quit_btn.clicked.connect(self.close)
        self.ui.Class_quit_btn.clicked.connect(self.close)
        self.ui.Personal_quit_btn.clicked.connect(self.close)
コード例 #5
0
ファイル: Teacher.py プロジェクト: SDSMT-CSC464-F15/dancesoft
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_Teacher_Landing()
        self.ui.setupUi(self)

        self.ui.Quit_btn.clicked.connect(self.close)
        self.ui.Student_btn.clicked.connect(partial(self.change_window, index = 1))
        self.ui.Class_btn.clicked.connect(partial(self.change_window, index = 2))
        self.ui.Personal_btn.clicked.connect(partial(self.change_window, index = 3))
        self.ui.Student_back_btn.clicked.connect(partial(self.change_window, index = 0))
        self.ui.Class_back_btn.clicked.connect(partial(self.change_window, index = 0))
        self.ui.Personal_back_btn.clicked.connect(partial(self.change_window, index = 0))
        
        self.ui.Student_quit_btn.clicked.connect(self.close)
        self.ui.Class_quit_btn.clicked.connect(self.close)
        self.ui.Personal_quit_btn.clicked.connect(self.close)
コード例 #6
0
ファイル: Teacher.py プロジェクト: SDSMT-CSC464-F15/dancesoft
class Teacher_window(QtGui.QMainWindow):
    def __init__(self, name):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_Teacher_Landing()
        self.ui.setupUi(self)
        self.ui.name = name
        self.ui.Quit_btn.clicked.connect(self.close)
        self.ui.Student_btn.clicked.connect(partial(self.change_window, index = 1))
        self.ui.Class_btn.clicked.connect(partial(self.change_window, index = 2))
        self.ui.Personal_btn.clicked.connect(partial(self.change_window, index = 3))
        self.ui.Student_back_btn.clicked.connect(partial(self.change_window, index = 0))
        self.ui.Class_back_btn.clicked.connect(partial(self.change_window, index = 0))
        self.ui.Personal_back_btn.clicked.connect(partial(self.change_window, index = 0))
        self.ui.Logout_btn.clicked.connect(self.logout)
        
        self.ui.Search_student_btn.clicked.connect(self.search_student)
        self.ui.See_student_schedule_btn.clicked.connect(self.See_student_schedule)
        self.ui.Add_class_btn.clicked.connect(self.Add_student_class)
        self.ui.See_class_schedule_btn.clicked.connect(self.See_teacher_schedule)
        self.ui.See_class_info_btn.clicked.connect(self.search_class)
        self.ui.See_class_role_btn.clicked.connect(self.roll_sheet)
        self.ui.Modify_personal_info.clicked.connect(self.update_teacher)
        self.ui.Change_Username_btn.clicked.connect(self.reset_user)
        self.ui.Reset_password.clicked.connect(self.reset_password)
        self.ui.Student_quit_btn.clicked.connect(self.close)
        self.ui.Class_quit_btn.clicked.connect(self.close)
        self.ui.Personal_quit_btn.clicked.connect(self.close)
        self.ui.Enter_hours_btn.clicked.connect(self.enter_hour)
        self.num = True

    def logout(self):
        self.num = False
        self.close()

    def enter_hour(self):
        id_query = QSqlQuery()
        id_query.exec_("select Teacher_id from Account where User_name = '%s'" % self.ui.name)
        id_query.next()
        teacher_query = QSqlQuery()
        teacher_query.exec_("select Teacher_name from Teacher where Teacher_id = '%s'" % id_query.value(0))
        teacher_query.next()
        self.ui.enter_hour = show_hours_dialog(teacher_query.value(0))
        self.ui.enter_hour.show()

        

    def reset_user(self):
        self.ui.reset_user = username_window(self.ui.name)
        if self.ui.reset_user.exec():
            self.ui.name = self.ui.reset_user.getName()
            name = self.ui.name
            

    def reset_password(self):
        self.ui.reset_password = password_window(self.ui.name)
        self.ui.reset_password.show()

    def update_teacher(self):
        self.ui.my_info = modify_My_Information(self.ui.name)
        self.ui.my_info.show()
        
    def roll_sheet(self):
        self.ui.roll_sheet = Role_window(self.ui.name)
        self.ui.roll_sheet.show()

    def search_class(self):
        self.ui.search_class = Search_class_window()
        self.ui.search_class.show()


    def See_teacher_schedule(self):
        self.ui.See_teacher_schedule = Teacher_schedule_window()
        self.ui.See_teacher_schedule.show()

    def Add_student_class(self):
        self.ui.Add_student_class = Addstu_window(self.ui.name)
        self.ui.Add_student_class.show()
        
    def See_student_schedule(self):
        self.ui.See_student_schedule = Student_schedule_window()
        self.ui.See_student_schedule.show()
        
    def search_student(self):
        self.ui.search_student = Search_window()
        self.ui.search_student.show()

        
    def change_window(self, index):
        self.ui.stackedWidget.setCurrentIndex(index)