mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-20 03:46:11 +00:00
Fix io plugin listing. (#1544)
This commit is contained in:
parent
a38d6707cd
commit
ff0f15605b
@ -1467,16 +1467,19 @@ QList<RIOPluginDescription> CutterCore::getRIOPluginDescriptions()
|
||||
{
|
||||
QList<RIOPluginDescription> ret;
|
||||
|
||||
QJsonArray plugins = cmdj("oLj").object()["IO_Plugins"].toArray();
|
||||
QJsonArray plugins = cmdj("oLj").object()["io_plugins"].toArray();
|
||||
for (const QJsonValue &pluginValue : plugins) {
|
||||
QJsonObject pluginObject = pluginValue.toObject();
|
||||
|
||||
RIOPluginDescription plugin;
|
||||
|
||||
plugin.name = pluginObject["Name"].toString();
|
||||
plugin.description = pluginObject["Description"].toString();
|
||||
plugin.license = pluginObject["License"].toString();
|
||||
plugin.permissions = pluginObject["Permissions"].toString();
|
||||
plugin.name = pluginObject["name"].toString();
|
||||
plugin.description = pluginObject["description"].toString();
|
||||
plugin.license = pluginObject["license"].toString();
|
||||
plugin.permissions = pluginObject["permissions"].toString();
|
||||
for (const auto &uri : pluginObject["uris"].toArray()) {
|
||||
plugin.uris << uri.toString();
|
||||
}
|
||||
|
||||
ret << plugin;
|
||||
}
|
||||
|
@ -165,6 +165,7 @@ struct RIOPluginDescription {
|
||||
QString description;
|
||||
QString license;
|
||||
QString permissions;
|
||||
QList<QString> uris;
|
||||
};
|
||||
|
||||
struct RCorePluginDescription {
|
||||
|
@ -328,7 +328,7 @@ bool NewFileDialog::fillProjectsList()
|
||||
void NewFileDialog::fillIOPluginsList()
|
||||
{
|
||||
ui->ioPlugin->clear();
|
||||
ui->ioPlugin->addItem("file");
|
||||
ui->ioPlugin->addItem("file://");
|
||||
ui->ioPlugin->setItemData(0, tr("Open a file with no extra treatment."), Qt::ToolTipRole);
|
||||
|
||||
int index = 1;
|
||||
@ -338,9 +338,14 @@ void NewFileDialog::fillIOPluginsList()
|
||||
if (plugin.permissions.contains('d')) {
|
||||
continue;
|
||||
}
|
||||
ui->ioPlugin->addItem(plugin.name);
|
||||
ui->ioPlugin->setItemData(index, plugin.description, Qt::ToolTipRole);
|
||||
index++;
|
||||
for (const auto &uri : qAsConst(plugin.uris)) {
|
||||
if (uri == "file://") {
|
||||
continue;
|
||||
}
|
||||
ui->ioPlugin->addItem(uri);
|
||||
ui->ioPlugin->setItemData(index, plugin.description, Qt::ToolTipRole);
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -368,7 +373,7 @@ void NewFileDialog::loadFile(const QString &filename)
|
||||
// Close dialog and open MainWindow/InitialOptionsDialog
|
||||
QString ioFile = "";
|
||||
if (ui->ioPlugin->currentIndex()) {
|
||||
ioFile = ui->ioPlugin->currentText() + "://";
|
||||
ioFile = ui->ioPlugin->currentText();
|
||||
}
|
||||
ioFile += nativeFn;
|
||||
InitialOptions options;
|
||||
|
@ -157,30 +157,7 @@
|
||||
<property name="horizontalSpacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="selectFileButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Select</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLineEdit" name="newFileEdit">
|
||||
<property name="frame">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="newFileLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -193,6 +170,29 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="selectFileButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Select</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="newFileEdit">
|
||||
<property name="frame">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QComboBox" name="ioPlugin"/>
|
||||
</item>
|
||||
@ -203,13 +203,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>://</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
Loading…
Reference in New Issue
Block a user