def __init__(self,parent=None): super(Project_Browser_Widget,self).__init__(parent) self.project_selector = Project_Selector_Widget() self.content_treeview = Content_Treeview_Widget() self.content_manger = Content_Finder_Manager() self.connect(self.project_selector, SIGNAL("item_selected"),self.content_manger.set_context) self.connect(self.project_selector, SIGNAL("clear"),self.content_treeview.clear) self.connect(self.content_manger, SIGNAL("Footage_load_finished"),self.content_treeview.load_finished) self.connect(self.content_manger, SIGNAL("Footage_load_started"),self.content_treeview.load_started) self.connect(self.content_manger, SIGNAL("Footage_load_stoped"),self.content_treeview.load_finished) self.connect(self.content_manger,SIGNAL("work_progress"),self.content_treeview.set_progress) self.connect(self.content_manger,SIGNAL("work_message"),self.content_treeview.set_message) self.connect(self.content_treeview,SIGNAL("context_menu_action"),self.context_menu_action) splitter = QSplitter(Qt.Vertical) splitter.addWidget(self.project_selector) splitter.addWidget(self.content_treeview) splitter.setCollapsible(0,False) splitter.setStretchFactor(1,1) layout = QVBoxLayout() layout.addWidget(splitter) #layout.addWidget(self.project_selector) #layout.addWidget(self.content_treeview) self.setAcceptDrops(True) self.setLayout(layout)
def __init__(self, parent=None): super(Project_Browser_Widget, self).__init__(parent) self.project_selector = Project_Selector_Widget() self.content_treeview = Content_Treeview_Widget() self.content_manger = Content_Finder_Manager() self.connect(self.project_selector, SIGNAL("item_selected"), self.content_manger.set_context) self.connect(self.project_selector, SIGNAL("clear"), self.content_treeview.clear) self.connect(self.content_manger, SIGNAL("Footage_load_finished"), self.content_treeview.load_finished) self.connect(self.content_manger, SIGNAL("Footage_load_started"), self.content_treeview.load_started) self.connect(self.content_manger, SIGNAL("Footage_load_stoped"), self.content_treeview.load_finished) self.connect(self.content_manger, SIGNAL("work_progress"), self.content_treeview.set_progress) self.connect(self.content_manger, SIGNAL("work_message"), self.content_treeview.set_message) self.connect(self.content_treeview, SIGNAL("context_menu_action"), self.context_menu_action) splitter = QSplitter(Qt.Vertical) splitter.addWidget(self.project_selector) splitter.addWidget(self.content_treeview) splitter.setCollapsible(0, False) splitter.setStretchFactor(1, 1) layout = QVBoxLayout() layout.addWidget(splitter) #layout.addWidget(self.project_selector) #layout.addWidget(self.content_treeview) self.setAcceptDrops(True) self.setLayout(layout)
class Project_Browser_Widget(QWidget): def __init__(self, parent=None): super(Project_Browser_Widget, self).__init__(parent) self.project_selector = Project_Selector_Widget() self.content_treeview = Content_Treeview_Widget() self.content_manger = Content_Finder_Manager() self.connect(self.project_selector, SIGNAL("item_selected"), self.content_manger.set_context) self.connect(self.project_selector, SIGNAL("clear"), self.content_treeview.clear) self.connect(self.content_manger, SIGNAL("Footage_load_finished"), self.content_treeview.load_finished) self.connect(self.content_manger, SIGNAL("Footage_load_started"), self.content_treeview.load_started) self.connect(self.content_manger, SIGNAL("Footage_load_stoped"), self.content_treeview.load_finished) self.connect(self.content_manger, SIGNAL("work_progress"), self.content_treeview.set_progress) self.connect(self.content_manger, SIGNAL("work_message"), self.content_treeview.set_message) self.connect(self.content_treeview, SIGNAL("context_menu_action"), self.context_menu_action) splitter = QSplitter(Qt.Vertical) splitter.addWidget(self.project_selector) splitter.addWidget(self.content_treeview) splitter.setCollapsible(0, False) splitter.setStretchFactor(1, 1) layout = QVBoxLayout() layout.addWidget(splitter) #layout.addWidget(self.project_selector) #layout.addWidget(self.content_treeview) self.setAcceptDrops(True) self.setLayout(layout) def context_menu_action(self, description): project_item = self.project_selector.get_selected_item() try: description['func'](project_item, description['content']) except: gui_utilities.error_message( message='%s Error!' % description['name'], info="A error occured when trying to execute %s" % description['name'], details=traceback.format_exc()) def dragEnterEvent(self, event): if event.mimeData().hasFormat( 'application/x-qabstractitemmodeldatalist'): event.ignore() else: event.acceptProposedAction() def dropEvent(self, event): if event.mimeData().hasUrls(): event.accept() l = [] for url in event.mimeData().urls(): l.append(str(url.toLocalFile())) self.project_selector.set_path(os.path.abspath(l[0])) else: event.ignore()
class Project_Browser_Widget(QWidget): def __init__(self,parent=None): super(Project_Browser_Widget,self).__init__(parent) self.project_selector = Project_Selector_Widget() self.content_treeview = Content_Treeview_Widget() self.content_manger = Content_Finder_Manager() self.connect(self.project_selector, SIGNAL("item_selected"),self.content_manger.set_context) self.connect(self.project_selector, SIGNAL("clear"),self.content_treeview.clear) self.connect(self.content_manger, SIGNAL("Footage_load_finished"),self.content_treeview.load_finished) self.connect(self.content_manger, SIGNAL("Footage_load_started"),self.content_treeview.load_started) self.connect(self.content_manger, SIGNAL("Footage_load_stoped"),self.content_treeview.load_finished) self.connect(self.content_manger,SIGNAL("work_progress"),self.content_treeview.set_progress) self.connect(self.content_manger,SIGNAL("work_message"),self.content_treeview.set_message) self.connect(self.content_treeview,SIGNAL("context_menu_action"),self.context_menu_action) splitter = QSplitter(Qt.Vertical) splitter.addWidget(self.project_selector) splitter.addWidget(self.content_treeview) splitter.setCollapsible(0,False) splitter.setStretchFactor(1,1) layout = QVBoxLayout() layout.addWidget(splitter) #layout.addWidget(self.project_selector) #layout.addWidget(self.content_treeview) self.setAcceptDrops(True) self.setLayout(layout) def context_menu_action(self,description): project_item = self.project_selector.get_selected_item() try: description['func'](project_item,description['content']) except: gui_utilities.error_message(message='%s Error!' % description['name'], info="A error occured when trying to execute %s" % description['name'], details=traceback.format_exc()) def dragEnterEvent(self, event): if event.mimeData().hasFormat('application/x-qabstractitemmodeldatalist'): event.ignore() else: event.acceptProposedAction() def dropEvent(self, event): if event.mimeData().hasUrls(): event.accept() l = [] for url in event.mimeData().urls(): l.append(str(url.toLocalFile())) self.project_selector.set_path(os.path.abspath(l[0])) else: event.ignore()