mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-23 21:35:28 +00:00
Load radare script from Options Dialoh (#464)
* Initial implementation of radare script loading from OptionsDialog * Fixed and removed redundant function
This commit is contained in:
parent
63788c1715
commit
5e4dff9639
@ -106,6 +106,10 @@ void AnalThread::run()
|
|||||||
core->loadPDB(ui->pdbLineEdit->text());
|
core->loadPDB(ui->pdbLineEdit->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ui->scriptCheckBox->isChecked()) {
|
||||||
|
core->loadScript(ui->scriptLineEdit->text());
|
||||||
|
}
|
||||||
|
|
||||||
if (optionsDialog->getSelectedEndianness() != OptionsDialog::Endianness::Auto) {
|
if (optionsDialog->getSelectedEndianness() != OptionsDialog::Endianness::Auto) {
|
||||||
core->setEndianness(optionsDialog->getSelectedEndianness() == OptionsDialog::Endianness::Big);
|
core->setEndianness(optionsDialog->getSelectedEndianness() == OptionsDialog::Endianness::Big);
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,10 @@ OptionsDialog::OptionsDialog(MainWindow *main):
|
|||||||
|
|
||||||
connect(ui->pdbCheckBox, SIGNAL(stateChanged(int)), this, SLOT(updatePDBLayout()));
|
connect(ui->pdbCheckBox, SIGNAL(stateChanged(int)), this, SLOT(updatePDBLayout()));
|
||||||
|
|
||||||
|
updateScriptLayout();
|
||||||
|
|
||||||
|
connect(ui->scriptCheckBox, SIGNAL(stateChanged(int)), this, SLOT(updateScriptLayout()));
|
||||||
|
|
||||||
// Add this so the dialog resizes when widgets are shown/hidden
|
// Add this so the dialog resizes when widgets are shown/hidden
|
||||||
//this->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
//this->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
|
|
||||||
@ -343,6 +347,30 @@ void OptionsDialog::on_pdbSelectButton_clicked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void OptionsDialog::updateScriptLayout()
|
||||||
|
{
|
||||||
|
ui->scriptWidget->setEnabled(ui->scriptCheckBox->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
|
void OptionsDialog::on_scriptSelectButton_clicked()
|
||||||
|
{
|
||||||
|
QFileDialog dialog(this);
|
||||||
|
dialog.setWindowTitle(tr("Select radare2 script file"));
|
||||||
|
dialog.setNameFilters({ tr("Script file (*.r2)"), tr("All files (*)") });
|
||||||
|
|
||||||
|
if (!dialog.exec()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString fileName = dialog.selectedFiles().first();
|
||||||
|
|
||||||
|
if (!fileName.isEmpty()) {
|
||||||
|
ui->scriptLineEdit->setText(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void OptionsDialog::reject()
|
void OptionsDialog::reject()
|
||||||
{
|
{
|
||||||
done(0);
|
done(0);
|
||||||
|
@ -33,10 +33,12 @@ private slots:
|
|||||||
void on_analCheckBox_clicked(bool checked);
|
void on_analCheckBox_clicked(bool checked);
|
||||||
void on_archComboBox_currentIndexChanged(int index);
|
void on_archComboBox_currentIndexChanged(int index);
|
||||||
void on_pdbSelectButton_clicked();
|
void on_pdbSelectButton_clicked();
|
||||||
|
void on_scriptSelectButton_clicked();
|
||||||
|
|
||||||
void updateProgressTimer();
|
void updateProgressTimer();
|
||||||
|
|
||||||
void updatePDBLayout();
|
void updatePDBLayout();
|
||||||
|
void updateScriptLayout();
|
||||||
|
|
||||||
void anal_finished();
|
void anal_finished();
|
||||||
|
|
||||||
|
@ -885,7 +885,51 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
|
<widget class="QCheckBox" name="scriptCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Load script file</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QWidget" name="scriptWidget" native="true">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="scriptLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="scriptLineEdit">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Path to radare2 script file</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="scriptSelectButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Select</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="analbbLabel">
|
<widget class="QLabel" name="analbbLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
@ -904,7 +948,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="4" column="1">
|
||||||
<widget class="QLineEdit" name="entry_analbb">
|
<widget class="QLineEdit" name="entry_analbb">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>1024</string>
|
<string>1024</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user