def load_presentation(self): """ Called when a presentation is added to the SlideController. It builds the environment, starts communication with the background PptView task started earlier. """ log.debug('LoadPresentation') size = ScreenList().current['size'] rect = RECT(size.x(), size.y(), size.right(), size.bottom()) filepath = str(self.filepath.replace('/', '\\')) if not os.path.isdir(self.get_temp_folder()): os.makedirs(self.get_temp_folder()) self.ppt_id = self.controller.process.OpenPPT(filepath, None, rect, str(self.get_temp_folder()) + '\\slide') if self.ppt_id >= 0: self.create_thumbnails() self.stop_presentation() return True else: return False
def load_presentation(self): """ Called when a presentation is added to the SlideController. It builds the environment, starts communication with the background PptView task started earlier. """ log.debug('LoadPresentation') temp_folder = self.get_temp_folder() size = ScreenList().current['size'] rect = RECT(size.x(), size.y(), size.right(), size.bottom()) self.file_path = os.path.normpath(self.file_path) preview_path = os.path.join(temp_folder, 'slide') # Ensure that the paths are null terminated byte_file_path = self.file_path.encode('utf-16-le') + b'\0' preview_path = preview_path.encode('utf-16-le') + b'\0' if not os.path.isdir(temp_folder): os.makedirs(temp_folder) self.ppt_id = self.controller.process.OpenPPT(byte_file_path, None, rect, preview_path) if self.ppt_id >= 0: self.create_thumbnails() self.stop_presentation() return True else: return False
def load_presentation(self): """ Called when a presentation is added to the SlideController. It builds the environment, starts communication with the background PptView task started earlier. """ log.debug('LoadPresentation') temp_folder = self.get_temp_folder() size = ScreenList().current['size'] rect = RECT(size.x(), size.y(), size.right(), size.bottom()) self.file_path = os.path.normpath(self.file_path) preview_path = os.path.join(temp_folder, 'slide') # Ensure that the paths are null terminated byte_file_path = self.file_path.encode('utf-16-le') + b'\0' preview_path = preview_path.encode('utf-16-le') + b'\0' if not os.path.isdir(temp_folder): os.makedirs(temp_folder) self.ppt_id = self.controller.process.OpenPPT(byte_file_path, None, rect, preview_path) if self.ppt_id >= 0: self.create_thumbnails() self.stop_presentation() return True else: return False