'''
Label spécial pour l'affichage du ou des chemins d'accès aux fichiers générés

@author: olivier.massot, sept. 2017
'''
from PyQt5.QtWidgets import QFrame
from path import Path

from ui.qt.filename_label_ui import Ui_Frame


class FilenameLabel(QFrame):
    def __init__(self, filename):
        filename = Path(filename)
        self._filename = filename

        super(FilenameLabel, self).__init__()
        self.createWidgets()
        self.ui.txtFilename.setText("...\\" + filename.parent.name + "\\" + filename.name)

    def createWidgets(self):
        self.ui = Ui_Frame()
        self.ui.setupUi(self)

    def filename(self):
        return self._filename
