GUI: fixed edit tool and script in FavouriteTools
This commit is contained in:
parent
a455ee2cb4
commit
d12338ccc0
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue