Exemple #1
0
    def helpButtonClicked(self):
        instructionsWidget = QtGui.QDialog(self)
        instructionsWidget.setModal(True)
        instructionsWidget.setWindowTitle("Plugin Manager Help")
        instructionsLayout = QtGui.QVBoxLayout()
        instructionsWidget.setLayout(instructionsLayout)
        instructionsTextEdit = QtGui.QTextEdit()
        instructionsTextEdit.setAlignment(Qt.Qt.AlignJustify)
        instructionsTextEdit.setReadOnly(True)
        instructionsLayout.addWidget(instructionsTextEdit)
        instructionsWidget.resize(750, 500)
        instructionsTextEdit.setPlainText("""
Welcome to Plugin Manager!

Introduction:
- Plugin manager is the client front-end for a enumeration of local plugins and retrieval of remote plugins
- Remote plugins on a server, in a location specified by a URL
- All plugin URLs of an organization are listed in a repository index file on a server, in a location indicated by a repo URL
- Repository URLs of different organization are listed in a repository list on a knossos server, in a location indicated by the repo list URL
- In addition to remote plugins, local plugins can be developed independently of any repository

Operation:
- The plugin GUI includes a plugin table, metadata table, log table and options
- Upon startup of knossos, a default plugin directory is used. This can be reconfigured by "Plugin Dir"
- The default knossos repo list URL is used. Chnage it by editing "Repo List URL"
- Press "Refresh" to enumerate local plugins and retrieve remote repository indices
- Check "Offline" to avoid remote listing: local plugins would be enumerated, no remote plugins would be listed, hence no updates would be available
- Press "Update All" to to retrieve all updated remote plugins, or "Update Selected" for those plugins selected in the table
- Python files (.py extension) are defined as Knossos plugins by metadata lines of format
#KNOSSOS_PLUGIN\\t<Key>\\t<Value>
- Mandatory metadata fields are Version and Description. Absence of any disqualifies the file as plugin
- All metadata fields are shown at the metadata table when a plugin is clicked
- Double-click a plugin in the table to open the local version, if available
- Press "Defaults" to restore default plugin dir, repo list URL and other options
- Repo index and repo list file format is a header line of <First Field Name>\\t<Second Field Name>\\t<Third Field Name> etc.,
while the rest of the files is lines of <First Field>\\t<Second Field>\\t<Third Field> etc.
Mandatory fields for repo index - URL,Version,Description ; for repo list - Name,URL

Notes:
- The plugin directory requires refreshing every time a local or remote plugin is added or removed,
in order for knossos to correctly reflect available local and remote plugins in the plugin menu
- Version numbers are compared from major to minor, using . as hierarchy separator: 3 > 2.2 > 2.1.9 > 1.10 > 1.9
Each version component has to be the pythonic string representation of a number. For example, 1.02 is not supported, use 1.2 instead.
- Check "Overwrite Same Version" to overwrite local with remote even when version number is identical
- Check "Quiet" to skip errors and make default choices for questions
- Press "Save Log" to save the current log into a tab-separated text file
- Press "Clear Log" to clear the log
                    """)
        instructionsWidget.show()
        return
Exemple #2
0
    def showDialog(self):

        self.d = QtGui.QDialog()

        buttons = QtGui.QDialogButtonBox()
        buttons.addButton('Yes', QtGui.QDialogButtonBox.AcceptRole)
        buttons.addButton('No', QtGui.QDialogButtonBox.RejectRole)
        buttons.connect('accepted()', self.d.accept)
        buttons.connect('rejected()', self.d.reject)

        l = QtGui.QVBoxLayout(self.d)
        l.addWidget(QtGui.QLabel(self.properties.message))
        l.addWidget(buttons)

        self.d.setAttribute(QtCore.Qt.WA_QuitOnClose, False)
        self.d.show()
        self.d.raise_()
        self.d.connect('accepted()', self.accept)
        self.d.connect('rejected()', self.reject)
Exemple #3
0
    def showDialog(self):

        self.d = QtGui.QDialog()

        buttons = QtGui.QDialogButtonBox()
        buttons.addButton("Yes", QtGui.QDialogButtonBox.AcceptRole)
        buttons.addButton("No", QtGui.QDialogButtonBox.RejectRole)
        buttons.connect("accepted()", self.d.accept)
        buttons.connect("rejected()", self.d.reject)

        l = QtGui.QVBoxLayout(self.d)
        l.addWidget(QtGui.QLabel(self.message))
        l.addWidget(buttons)

        self.d.setAttribute(QtCore.Qt.WA_QuitOnClose, False)
        self.d.show()
        self.d.raise_()
        self.d.connect("accepted()", self.onYes)
        self.d.connect("rejected()", self.onNo)
Exemple #4
0
    def gui_example(self, object):
        self.set_mdsa(object)
        dialog = QtGui.QDialog()
        dialog.setObjectName("dialog")
        dialog.resize(858, 555)
        
        gridLayout_5 = QtGui.QGridLayout(dialog)
        gridLayout_5.setObjectName("gridLayout_5")

        avatar_groupBox = QtGui.QGroupBox(dialog)
        avatar_groupBox.setObjectName("save_groupBox")

        gridLayout = QtGui.QGridLayout(avatar_groupBox)
        gridLayout.setObjectName("gridLayout")

        avatar_load_toolButton = QtGui.QToolButton(avatar_groupBox)
        avatar_load_toolButton.setObjectName("avatar_load_toolButton")

        gridLayout.addWidget(avatar_load_toolButton, 0, 0, 1, 1)

        avatar_refresh_toolButton = QtGui.QToolButton(avatar_groupBox)
        avatar_refresh_toolButton.setObjectName("avatar_refresh_toolButton")

        gridLayout.addWidget(avatar_refresh_toolButton, 0, 1, 1, 1)

        self.avatar_ext_comboBox = QtGui.QComboBox(avatar_groupBox);
        self.avatar_ext_comboBox.setObjectName("avatar_ext_comboBox");
        self.avatar_ext_comboBox.clear();
        self.avatar_ext_comboBox.insertItem(0, "avt")
        self.avatar_ext_comboBox.insertItem(1, "obj")
        self.avatar_ext_comboBox.insertItem(2, "fbx")
        self.avatar_ext_comboBox.insertItem(3, "dae")

        gridLayout.addWidget(self.avatar_ext_comboBox, 0, 2, 1, 1);


        horizontalSpacer = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)

        gridLayout.addItem(horizontalSpacer, 0, 3, 1, 1)

        self.avatar_listWidget = QtGui.QListWidget(avatar_groupBox)
        self.avatar_listWidget.setObjectName("listWidget")

        gridLayout.addWidget(self.avatar_listWidget, 1, 0, 1, 3)

        gridLayout_5.addWidget(avatar_groupBox, 1, 0, 1, 1)

        garment_groupBox = QtGui.QGroupBox(dialog)
        garment_groupBox.setObjectName("laod_groupBox")
        gridLayout_2 = QtGui.QGridLayout(garment_groupBox);
        gridLayout_2.setObjectName("gridLayout_2")
        garment_load_toolButton = QtGui.QToolButton(garment_groupBox)
        garment_load_toolButton.setObjectName("garment_load_toolButton")

        gridLayout_2.addWidget(garment_load_toolButton, 0, 0, 1, 1)

        garment_refresh_toolButton = QtGui.QToolButton(garment_groupBox)
        garment_refresh_toolButton.setObjectName("garment_refresh_toolButton")

        gridLayout_2.addWidget(garment_refresh_toolButton, 0, 1, 1, 1)

        self.garment_ext_comboBox = QtGui.QComboBox(garment_groupBox);
        self.garment_ext_comboBox.setObjectName("garment_ext_comboBox");

        self.garment_ext_comboBox.clear();
        self.garment_ext_comboBox.insertItem(0, "zpac")
        self.garment_ext_comboBox.insertItem(1, "pac")

        gridLayout_2.addWidget(self.garment_ext_comboBox, 0, 2, 1, 1);

        horizontalSpacer_2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)

        gridLayout_2.addItem(horizontalSpacer_2, 0, 3, 1, 1)

        self.garment_listWidget = QtGui.QListWidget(garment_groupBox)
        self.garment_listWidget.setObjectName("garment_listWidget")

        gridLayout_2.addWidget(self.garment_listWidget, 1, 0, 1, 3)


        gridLayout_5.addWidget(garment_groupBox, 1, 1, 1, 1)

        animation_groupBox = QtGui.QGroupBox(dialog)
        animation_groupBox.setObjectName("animation_groupBox")

        gridLayout_3 = QtGui.QGridLayout(animation_groupBox)
        gridLayout_3.setObjectName("gridLayout_3")

        anim_load_toolButton = QtGui.QToolButton(animation_groupBox)
        anim_load_toolButton.setObjectName("anim_load_toolButton")

        gridLayout_3.addWidget(anim_load_toolButton, 0, 0, 1, 1)

        anim_refresh_toolButton = QtGui.QToolButton(animation_groupBox)
        anim_refresh_toolButton.setObjectName("anim_refresh_toolButton")
        gridLayout_3.addWidget(anim_refresh_toolButton, 0, 1, 1, 1)

        self.animation_ext_comboBox = QtGui.QComboBox(animation_groupBox);
        self.animation_ext_comboBox.setObjectName("animation_ext_comboBox");
        
        self.animation_ext_comboBox.clear();
        self.animation_ext_comboBox.insertItem(0, "pos")
        self.animation_ext_comboBox.insertItem(1, "mtn")
        self.animation_ext_comboBox.insertItem(2, "abc")
        self.animation_ext_comboBox.insertItem(3, "mc")
        self.animation_ext_comboBox.insertItem(4, "pc2")
        self.animation_ext_comboBox.insertItem(5, "mdd")

        gridLayout_3.addWidget(self.animation_ext_comboBox, 0, 2, 1, 1);

        horizontalSpacer_3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)

        gridLayout_3.addItem(horizontalSpacer_3, 0, 3, 1, 1)

        self.animation_listWidget = QtGui.QListWidget(animation_groupBox)
        self.animation_listWidget.setObjectName("animation_listWidget")

        gridLayout_3.addWidget(self.animation_listWidget, 1, 0, 1, 3)


        gridLayout_5.addWidget(animation_groupBox, 1, 2, 1, 1)

        save_groupBox = QtGui.QGroupBox(dialog)
        save_groupBox.setObjectName("save_groupBox")
        gridLayout_4 = QtGui.QGridLayout(save_groupBox)
        gridLayout_4.setObjectName("gridLayout_4")
        save_toolButton = QtGui.QToolButton(save_groupBox)
        save_toolButton.setObjectName("save_toolButton")

        gridLayout_4.addWidget(save_toolButton, 0, 0, 1, 1)

        self.save_ext_comboBox = QtGui.QComboBox(save_groupBox);
        self.save_ext_comboBox.setObjectName("save_ext_comboBox");

        self.save_ext_comboBox.clear();
        self.save_ext_comboBox.insertItem(0, "zprj")
        self.save_ext_comboBox.insertItem(1, "zpac")
        self.save_ext_comboBox.insertItem(2, "obj")
        self.save_ext_comboBox.insertItem(3, "fbx")
        self.save_ext_comboBox.insertItem(4, "abc")
        self.save_ext_comboBox.insertItem(5, "mc")
        self.save_ext_comboBox.insertItem(6, "pc2")
        self.save_ext_comboBox.insertItem(7, "mdd")

        gridLayout_4.addWidget(self.save_ext_comboBox, 0, 1, 1, 1);

        self.save_listWidget = QtGui.QListWidget(save_groupBox)
        self.save_listWidget.setObjectName("save_listWidget")

        gridLayout_4.addWidget(self.save_listWidget, 1, 0, 1, 2)

        horizontalSpacer_4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)

        gridLayout_4.addItem(horizontalSpacer_4, 0, 2, 1, 1)

        gridLayout_5.addWidget(save_groupBox, 2, 0, 1, 3)

        horizontalSpacer_5 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        gridLayout_5.addItem(horizontalSpacer_5, 3, 0, 1, 1);
        
        process_button = QtGui.QPushButton(dialog)
        process_button.setObjectName("process_button")

        gridLayout_5.addWidget(process_button, 3, 1, 1, 1)

        cancel_button = QtGui.QPushButton(dialog)
        cancel_button.setObjectName("cancel_button")
        gridLayout_5.addWidget(cancel_button, 3, 2, 1, 1)

        horizontalSpacer_6 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        gridLayout_5.addItem(horizontalSpacer_6, 3, 3, 1, 1);

        sync_button = QtGui.QToolButton(dialog);
        sync_button.setObjectName("sync_button");

        gridLayout_5.addWidget(sync_button, 0, 0, 1, 2);

        dialog.setWindowTitle("Dialog")
        avatar_groupBox.setTitle("Avatar")
        avatar_load_toolButton.setText("Load")
        avatar_refresh_toolButton.setText("Refresh")
        garment_groupBox.setTitle("Garement")
        garment_load_toolButton.setText("Load")
        garment_refresh_toolButton.setText("Refresh")
        animation_groupBox.setTitle("Animation")
        anim_refresh_toolButton.setText("Refresh")
        anim_load_toolButton.setText("Load")
        save_groupBox.setTitle("Save File")
        save_toolButton.setText("Save")
        process_button.setText("Process")
        cancel_button.setText("Cancel")
        sync_button.setText("Sync File List")

        process_button.connect("clicked(bool)", self.run_process)
        avatar_load_toolButton.connect("clicked(bool)", self.set_avatar_path_list)
        garment_load_toolButton.connect("clicked(bool)", self.set_garment_path_list)
        anim_load_toolButton.connect("clicked(bool)", self.set_animation_path_list)
        sync_button.connect("clicked(bool)", self.sync_file_list)
        avatar_refresh_toolButton.connect("clicked(bool)", self.refresh_avatar_list)
        garment_refresh_toolButton.connect("clicked(bool)", self.refresh_garment_list)
        anim_refresh_toolButton.connect("clicked(bool)", self.refresh_animation_list)
        save_toolButton.connect("clicked(bool)", self.set_save_path_list)
        cancel_button.connect("clicked(bool)", self.cancel)

        self.widget = dialog
        return dialog
            pythonQtCode = makeReplacements(
                tmpPyfile,
                self.addPyrunBox.checkState())  #, ui.addPyrunBox.checkState())
            q.insertText(pythonQtCode)
            if (ui.keepPyBox.checkState() == False):
                os.remove(tmpPyfile)
        else:
            QtGui.QMessageBox.critical(
                0, "Error", "Could not execute " + pyuic4Command +
                " with ui file" + uiFile)

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(
            _translate("Dialog", "Create UI with QtDesigner", None))
        self.keepPyBox.setText(_translate("Dialog", "Keep PyQt4 file", None))
        self.addPyrunBox.setText(
            _translate("Dialog", "Add pyrun {{ ... }}", None))
        self.convertButton.setText(
            _translate("Dialog", "Convert and insert", None))
        self.label.setText(_translate("Dialog", "UI file:", None))
        self.newButton.setText(_translate("Dialog", "New", None))
        self.openButton.setText(_translate("Dialog", "Select", None))
        self.designButton.setText(_translate("Dialog", "Design", None))


if __name__ == "__main__":
    Dialog = QtGui.QDialog()
    ui = Ui_Dialog()
    ui.setupUi(Dialog)
    Dialog.show()