예제 #1
0
    def initGui(self):
        '''
        Initialize widget
        '''
        self.loadEntityConfig()
        #Hook up signals
        self.connect(self.tbSTREntity, SIGNAL("currentChanged(int)"),
                     self.entityTabIndexChanged)
        self.connect(self.btnSearch, SIGNAL("clicked()"),
                     self.searchEntityRelations)
        self.connect(self.btnClearSearch, SIGNAL("clicked()"),
                     self.clearSearch)
        self.connect(self.tvSTRResults, SIGNAL("expanded(const QModelIndex&)"),
                     self.onTreeViewItemExpanded)

        #Configure notification bars
        self.notifSearchConfig = NotificationBar(self.vlSearchEntity)

        #Set the results treeview to accept requests for context menus
        self.tvSTRResults.setContextMenuPolicy(Qt.CustomContextMenu)
        self.connect(self.tvSTRResults,
                     SIGNAL("customContextMenuRequested(const QPoint&)"),
                     self.onResultsContextMenuRequested)

        #Load async for the current widget
        self.entityTabIndexChanged(0)
예제 #2
0
    def __init__(self, parent=None, selectMode=True):
        QDialog.__init__(self, parent)
        self.setupUi(self)

        self.notifBar = NotificationBar(self.vlNotification)

        if selectMode:
            self.buttonBox.setVisible(True)
            self.manageButtonBox.setVisible(False)
            currHeight = self.size().height()
            self.resize(200, currHeight)

        else:
            self.buttonBox.setVisible(False)
            self.manageButtonBox.setVisible(True)
            self.setWindowTitle(
                QApplication.translate("TemplateDocumentSelector",
                                       "Template Manager"))

        #Configure manage buttons
        btnEdit = self.manageButtonBox.button(QDialogButtonBox.Ok)
        btnEdit.setText(
            QApplication.translate("TemplateDocumentSelector", "Edit..."))
        btnEdit.setIcon(QIcon(":/plugins/stdm/images/icons/edit.png"))

        btnDelete = self.manageButtonBox.button(QDialogButtonBox.Save)
        btnDelete.setText(
            QApplication.translate("TemplateDocumentSelector", "Delete"))
        btnDelete.setIcon(QIcon(":/plugins/stdm/images/icons/delete.png"))

        #Connect signals
        self.buttonBox.accepted.connect(self.onAccept)
        btnEdit.clicked.connect(self.onEditTemplate)
        btnDelete.clicked.connect(self.onDeleteTemplate)

        #Get saved document templates then add to the model
        templates = documentTemplates()

        self._docItemModel = QStandardItemModel(parent)
        self._docItemModel.setColumnCount(2)

        for name, path in templates.iteritems():
            docNameItem = self._createDocNameItem(name)
            filePathItem = QStandardItem(path)
            self._docItemModel.appendRow([docNameItem, filePathItem])

        self.lstDocs.setModel(self._docItemModel)
예제 #3
0
 def __init__(self, parent=None):
     """
     This class checks if the user has accepted the
     license terms and conditions or not . It shows the
     terms and conditions if not.
     :param parent: The container of the dialog
     :type parent: QMainWindow or None
     :return: None
     :rtype: NoneType
     """
     QDialog.__init__(self, parent)
     self.setupUi(self)
     self.reg_config = RegistryConfig()
     self.notice_bar = NotificationBar(self.notifBar)
     self.accepted = False
     self.btnAccept.clicked.connect(self.accept_action)
     self.btnDecline.clicked.connect(self.decline_action)
     self.label.setStyleSheet('''
         QLabel {
             font: bold;
         }
         ''')