Exemplo n.º 1
0
class PopOutView(QWidget):
    def __init__(self, project, filename, view):
        super(PopOutView, self).__init__()
        self.setWindowTitle(filename)
        self.setMinimumSize(350, 300)
        self.project = project
        self.filename = filename
        
        project_window = [w for w in get_app_singleton()\
            .windows if w.project == self.project][0]
        self.toolbar = ProjectToolbar(project_window)
        self.toolbar.update_for_file(self.filename)

        self.current_file_view = view
        
        layout = QVBoxLayout()
        layout.setContentsMargins(1, 1, 1, 1)
        layout.addWidget(self.toolbar)
        layout.addWidget(view)
        self.setLayout(layout)
        self.update_title()

    def update_language(self):
        self.current_file_view.update_language()
        self.update_title()

    def update_title(self):
        if self.project.changestracker.file_has_changes(self.filename):
            self.setWindowTitle(self.current_file_view.pop_out_title_name() \
                + "*")
        else:
            self.setWindowTitle(self.current_file_view.pop_out_title_name())
    def update_toolbar(self):
        self.toolbar.update_toolbar()
Exemplo n.º 2
0
    def __init__(self, project, filename, view):
        super(PopOutView, self).__init__()
        self.setWindowTitle(filename)
        self.setMinimumSize(350, 300)
        self.project = project
        self.filename = filename
        
        project_window = [w for w in get_app_singleton()\
            .windows if w.project == self.project][0]
        self.toolbar = ProjectToolbar(project_window)
        self.toolbar.update_for_file(self.filename)

        self.current_file_view = view
        
        layout = QVBoxLayout()
        layout.setContentsMargins(1, 1, 1, 1)
        layout.addWidget(self.toolbar)
        layout.addWidget(view)
        self.setLayout(layout)
        self.update_title()