"""Subclass of DialogSavePDF, which is generated by wxFormBuilder."""

import wx
from coreapps.views.pdfsavedialog import DialogSavePDF
import pathlib
import shutil
from shutil import copyfile


# Implementing DialogSavePDF
class TurunanDialogSavePDF( DialogSavePDF ):
	def __init__( self, parent ):
		super().__init__(parent)
		self.m_direktori_pdf.GetPath()
		self.m_filepdf
		pass

	def m_button_simpanPDFFile( self, event ):
		print ("ini tekan simpan")
		# path = pathlib.Path()
		self.src = str(pathlib.Path.cwd()/"controllers/reporting/tuto1d.pdf")
		self.simpan_file_pdf = str(pathlib.Path(self.m_direktori_pdf.GetPath()+"/"+self.m_filepdf.GetValue()+".pdf"))
		copyfile(self.src,self.simpan_file_pdf)
		self.Close()


		event.Skip()

	def m_button_batal_simpanPDF( self, event ):
		print ("init tekan batal")
		self.Close()
		event.Skip()

