1
0
Fork 0

GUI: fixed edit tool and script in FavouriteTools

This commit is contained in:
mrexodia 2016-11-18 09:39:45 +01:00
parent a455ee2cb4
commit d12338ccc0
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 5 additions and 12 deletions

View File

@ -68,7 +68,6 @@ static QString stringFormatInline(const QString & format)
if(DbgFunctions()->StringFormatInline(format.toUtf8().constData(), MAX_SETTING_SIZE, result))
return result;
return CPUArgumentWidget::tr("[Formatting Error]");
}
void CPUArgumentWidget::refreshData()

View File

@ -141,12 +141,9 @@ void FavouriteTools::on_btnEditFavouriteTool_clicked()
QTableWidget* table = ui->listTools;
if(!table->rowCount())
return;
QString filename;
char buffer[MAX_SETTING_SIZE];
memset(buffer, 0, sizeof(buffer));
BridgeSettingGet("Favourite", "LastToolPath", buffer);
BrowseDialog browse(this, QString("Browse tool"), QString("Enter the path of the tool."), QString("Executable Files (*.exe);;All Files (*.*)"), QString(buffer), false);
if(browse.exec() != QDialog::Accepted && browse.path.length())
QString filename = table->item(table->currentRow(), 0)->text();
BrowseDialog browse(this, QString("Browse tool"), QString("Enter the path of the tool."), QString("Executable Files (*.exe);;All Files (*.*)"), filename, false);
if(browse.exec() != QDialog::Accepted)
return;
filename = browse.path;
BridgeSettingSet("Favourite", "LastToolPath", filename.toUtf8().constData());
@ -240,11 +237,8 @@ void FavouriteTools::on_btnEditFavouriteScript_clicked()
QTableWidget* table = ui->listScript;
if(!table->rowCount())
return;
QString filename;
char buffer[MAX_SETTING_SIZE];
memset(buffer, 0, sizeof(buffer));
BridgeSettingGet("Favourite", "LastScriptPath", buffer);
filename = QFileDialog::getOpenFileName(this, tr("Select script"), QString(buffer), tr("Script files (*.txt *.scr);;All files (*.*)"));
QString filename = table->item(table->currentRow(), 0)->text();
filename = QFileDialog::getOpenFileName(this, tr("Select script"), filename, tr("Script files (*.txt *.scr);;All files (*.*)"));
if(filename.size() == 0)
return;
filename = QDir::toNativeSeparators(filename);