Example #1
0
    def get_an_email(self):
        email_id = ''
        email_key = ''
        temp = self.get_select_tree_node_info()
        if (temp[0] == 0):
            QMessageBox(QMessageBox.Critical, '错误', '请先选中一个目录').exec()
            return
        folder_path = temp[1]
        folder_id = temp[2]
        folder_key = temp[3]
        temp = self.get_select_list_node_info()
        if (temp == 0):
            QMessageBox(QMessageBox.Critical, '错误', '请选中一封邮件').exec()
            return
        email_id = temp[1]
        email_key = temp[2]

        waitwindow = ShowWaitWindow.ShowWaitWindow('获取目标邮件内容中,请稍候...')
        waitwindow.show_wait_window()
        self.anemail = GetAnEmail.GetAnEmail(self.token_handler, folder_path, email_id, email_key)
        self.anemail.clear_dir('../temp')
        email_infos = self.anemail.get_an_email()
        # print(email_infos)
        self.modelattach = QStandardItemModel()
        self.listView_2.setModel(self.modelattach)
        self.show_an_email(email_infos)
        waitwindow.close_wait_window()
Example #2
0
 def refresh_dir_tree(self):
     waitwindow = ShowWaitWindow.ShowWaitWindow('正在更新目录树,请稍候...')
     waitwindow.show_wait_window()
     self.clear_interface()
     self.qtwiget = QtWidgets.QWidget()
     self.model = QStandardItemModel(0, 2, self.qtwiget)
     self.model.setHorizontalHeaderLabels(['文件夹', 'id', 'changekey', '绝对路径'])
     self.treeView.setModel(self.model)
     refreshdir = RefreshDirTree.RefreshDirTree(self.model, self.token_handler)
     refreshdir.refresh_dir_tree()
     waitwindow.close_wait_window()
Example #3
0
 def archive_all_attachment(self):
     self.listView_2.selectAll()
     indexs = self.listView_2.selectedIndexes()
     if (indexs):
         waitwindow = ShowWaitWindow.ShowWaitWindow('附件下载中,请稍候...')
         waitwindow.show_wait_window()
         arc = ArchiveAttachment.ArchiveAttachment(self.modelattach, indexs)
         arc.archive_attachment()
         self.listView_2.clearSelection()
         self.listView_2.clearFocus()
         waitwindow.close_wait_window()
         return
     QMessageBox(QMessageBox.Critical, '操作错误', '不存在任何目标附件!').exec()
Example #4
0
 def refresh_mail_list(self):
     self.clear_interface()
     temp = self.get_select_tree_node_info()
     if (temp[0] == 0):
         QMessageBox(QMessageBox.Critical, '错误', '请先选中一个目录').exec()
         return
     path = temp[1]
     id = temp[2]
     changekey = temp[3]
     waitwindow = ShowWaitWindow.ShowWaitWindow('正在获取邮件列表,请稍候...')
     waitwindow.show_wait_window()
     getemaillist = GetEmailList.GetEmailList(path, self.token_handler)
     list = getemaillist.get_email_list()
     refreshmaillist = RefreshMailList.RefreshMailList(self.modelmodel, self.token_handler, list)
     refreshmaillist.refresh_mail_list()
     self.modelattach = QStandardItemModel()
     self.listView_2.setModel(self.modelattach)
     self.listView.clearSelection()
     self.listView_2.clearSelection()
     waitwindow.close_wait_window()
Example #5
0
 def batch_send(self):
     indexs = self.treeView.selectedIndexes()
     path = ''
     j = 0
     for i in indexs:
         if (j == 1):
             id = str(self.treeView.model().itemData(i)[0])
         if (j == 2):
             changekey = str(self.treeView.model().itemData(i)[0])
         if (j == 3):
             path = str(self.treeView.model().itemData(i)[0])
         j += 1
     if (path == ''):
         QMessageBox(QMessageBox.Critical, '操作错误', '请先选择一个目录!').exec()
         return
     waitwindow = ShowWaitWindow.ShowWaitWindow('批量转发中,请稍候...')
     waitwindow.show_wait_window()
     batchsend = BatchSend.BatchSend(path, self.token_handler)
     prompt = batchsend.batch_forward()
     waitwindow.close_wait_window()
     self.logwin = ShowLogWindow.ShowLogWindow(prompt)
     self.logwin.show_log_window()