mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-26 23:05:25 +00:00
b95620907a
Wrong path separators have been used. The fix makes them consistent and correspond the Operating System.
39 lines
918 B
C++
39 lines
918 B
C++
#include "OpenFileDialog.h"
|
|
#include "ui_OpenFileDialog.h"
|
|
|
|
#include <QFileDialog>
|
|
|
|
OpenFileDialog::OpenFileDialog(QWidget *parent):
|
|
QDialog(parent),
|
|
ui(new Ui::OpenFileDialog)
|
|
{
|
|
ui->setupUi(this);
|
|
}
|
|
|
|
OpenFileDialog::~OpenFileDialog() {}
|
|
|
|
void OpenFileDialog::on_selectFileButton_clicked()
|
|
{
|
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Select file"), QDir::homePath());
|
|
|
|
if (!fileName.isEmpty()) {
|
|
ui->filenameLineEdit->setText(fileName);
|
|
}
|
|
}
|
|
|
|
void OpenFileDialog::on_buttonBox_accepted()
|
|
{
|
|
const QString &filePath = QDir::toNativeSeparators(ui->filenameLineEdit->text());
|
|
RVA mapAddress = RVA_INVALID;
|
|
QString mapAddressStr = ui->mapAddressLineEdit->text();
|
|
if (!mapAddressStr.isEmpty()) {
|
|
mapAddress = Core()->math(mapAddressStr);
|
|
}
|
|
Core()->openFile(filePath, mapAddress);
|
|
}
|
|
|
|
void OpenFileDialog::on_buttonBox_rejected()
|
|
{
|
|
close();
|
|
}
|