Typos, translations, and style fixing (#879)

This commit is contained in:
xarkes 2018-10-25 23:22:34 +02:00 committed by GitHub
parent d51a674d5d
commit cf43ac9d90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 65 deletions

View File

@ -23,7 +23,7 @@ void AnalTask::interrupt()
void AnalTask::runTask() void AnalTask::runTask()
{ {
log(tr("Loading Binary...\n")); log(tr("Loading the file...\n"));
openFailed = false; openFailed = false;
int perms = R_PERM_RX; int perms = R_PERM_RX;

View File

@ -930,7 +930,7 @@ void MainWindow::on_actionExport_as_code_triggered()
cmdMap[filters.last()] = "pcp"; cmdMap[filters.last()] = "pcp";
filters << tr("Print 'wx' r2 commands (*.r2)"); filters << tr("Print 'wx' r2 commands (*.r2)");
cmdMap[filters.last()] = "pc*"; cmdMap[filters.last()] = "pc*";
filters << tr("GAS .byte blob (*.txt)"); filters << tr("GAS .byte blob (*.asm, *.s)");
cmdMap[filters.last()] = "pca"; cmdMap[filters.last()] = "pca";
filters << tr(".bytes with instructions in comments (*.txt)"); filters << tr(".bytes with instructions in comments (*.txt)");
cmdMap[filters.last()] = "pcA"; cmdMap[filters.last()] = "pcA";

View File

@ -53,8 +53,8 @@ static const QMap<QString, OptionIfo> optionInfoMap = {
}, },
{ {
"fline", { "fline", {
QObject::tr(""), "",
QObject::tr("fline"), false "fline", false
} }
}, },
{ {
@ -63,10 +63,10 @@ static const QMap<QString, OptionIfo> optionInfoMap = {
QObject::tr("Flag"), false QObject::tr("Flag"), false
} }
}, },
{ "label", { QObject::tr(""), QObject::tr("Label"), false } }, { "label", { "", QObject::tr("Label"), false } },
{ "help", { QObject::tr(""), QObject::tr("Help"), false } }, { "help", { "", QObject::tr("Help"), false } },
{ "flow", { QObject::tr(""), QObject::tr("flow"), false } }, { "flow", { "", QObject::tr("flow"), false } },
{ "flow2", { QObject::tr(""), QObject::tr("flow2"), false } }, { "flow2", { "", QObject::tr("flow2"), false } },
{ "prompt", { QObject::tr("Info"), QObject::tr("prompt"), false } }, { "prompt", { QObject::tr("Info"), QObject::tr("prompt"), false } },
{ {
"offset", { "offset", {
@ -81,71 +81,71 @@ static const QMap<QString, OptionIfo> optionInfoMap = {
QObject::tr("invalid"), false QObject::tr("invalid"), false
} }
}, },
{ "other", { QObject::tr(""), QObject::tr("other"), false } }, { "other", { "", QObject::tr("other"), false } },
{ {
"b0x00", { "b0x00", {
QObject::tr("0x00 opcode color"), QObject::tr("0x00 opcode color"),
QObject::tr("b0x00"), false "b0x00", false
} }
}, },
{ {
"b0x7f", { "b0x7f", {
QObject::tr("0x7f opcode color"), QObject::tr("0x7f opcode color"),
QObject::tr("b0x7f"), false "b0x7f", false
} }
}, },
{ {
"b0xff", { "b0xff", {
QObject::tr("0xff opcode color"), QObject::tr("0xff opcode color"),
QObject::tr("b0xff"), false "b0xff", false
} }
}, },
{ {
"math", { "math", {
QObject::tr("arithmetic color (+, -, *, / etc.)"), QObject::tr("arithmetic color (+, -, *, / etc.)"),
QObject::tr("math"), false "math", false
} }
}, },
{ "bin", { QObject::tr(""), QObject::tr("bin"), false } }, { "bin", { "", QObject::tr("bin"), false } },
{ "btext", { QObject::tr(""), QObject::tr("btext"), false } }, { "btext", { "", QObject::tr("btext"), false } },
{ "push", { QObject::tr("push opcode color"), QObject::tr("push"), false } }, { "push", { QObject::tr("push opcode color"), "push", false } },
{ "pop", { QObject::tr("pop opcode color"), QObject::tr("pop"), false } }, { "pop", { QObject::tr("pop opcode color"), "pop", false } },
{ "crypto", { QObject::tr("Cryptographic color"), QObject::tr("crypto"), false } }, { "crypto", { QObject::tr("Cryptographic color"), "crypto", false } },
{ {
"jmp", { "jmp", {
QObject::tr("jmp instructions color"), QObject::tr("jmp instructions color"),
QObject::tr("jmp"), false "jmp", false
} }
}, },
{ {
"cjmp", { "cjmp", {
QObject::tr(""), "",
QObject::tr("cjmp"), false "cjmp", false
} }
}, },
{ {
"call", { "call", {
QObject::tr("call instructions color (ccall, rcall, call etc)"), QObject::tr("call instructions color (ccall, rcall, call etc)"),
QObject::tr("call"), false "call", false
} }
}, },
{ "nop", { QObject::tr("nop opcode color"), QObject::tr("nop"), false } }, { "nop", { QObject::tr("nop opcode color"), "nop", false } },
{ {
"ret", { "ret", {
QObject::tr("ret opcode color"), QObject::tr("ret opcode color"),
QObject::tr("ret"), false "ret", false
} }
}, },
{ {
"trap", { "trap", {
QObject::tr("Color of interrputs"), QObject::tr("Color of interrupts"),
QObject::tr("Interrputs"), false QObject::tr("Interrupts"), false
} }
}, },
{ "swi", { QObject::tr("swi opcode color"), QObject::tr("swi"), false } }, { "swi", { QObject::tr("swi opcode color"), "swi", false } },
{ "cmp", { QObject::tr("cmp opcode color"), QObject::tr("cmp"), false } }, { "cmp", { QObject::tr("cmp opcode color"), "cmp", false } },
{ "reg", { QObject::tr("Registers color"), QObject::tr("Register"), false } }, { "reg", { QObject::tr("Registers color"), QObject::tr("Register"), false } },
{ "creg", { QObject::tr("Info"), QObject::tr("creg"), false } }, { "creg", { QObject::tr("Info"), "creg", false } },
{ "num", { QObject::tr("Numeric constants color"), QObject::tr("Numbers"), false } }, { "num", { QObject::tr("Numeric constants color"), QObject::tr("Numbers"), false } },
{ {
"mov", { "mov", {
@ -171,17 +171,17 @@ static const QMap<QString, OptionIfo> optionInfoMap = {
QObject::tr("Variable address"), false QObject::tr("Variable address"), false
} }
}, },
{ "widget_bg", { QObject::tr(""), QObject::tr("widget_bg"), false } }, { "widget_bg", { "", "widget_bg", false } },
{ "widget_sel", { QObject::tr(""), QObject::tr("widget_sel"), false } }, { "widget_sel", { "", "widget_sel", false } },
{ "ai.read", { QObject::tr(""), QObject::tr("ai.read"), false } }, { "ai.read", { "", "ai.read", false } },
{ "ai.write", { QObject::tr(""), QObject::tr("ai.write"), false } }, { "ai.write", { "", "ai.write", false } },
{ "ai.exec", { QObject::tr(""), QObject::tr("ai.exec"), false } }, { "ai.exec", { "", "ai.exec", false } },
{ "ai.seq", { QObject::tr(""), QObject::tr("ai.seq"), false } }, { "ai.seq", { "", "ai.seq", false } },
{ "ai.ascii", { QObject::tr(""), QObject::tr("ai.ascii"), false } }, { "ai.ascii", { "", "ai.ascii", false } },
{ "graph.box", { QObject::tr(""), QObject::tr("graph.box"), false } }, { "graph.box", { "", "graph.box", false } },
{ "graph.box2", { QObject::tr(""), QObject::tr("graph.box2"), false } }, { "graph.box2", { "", "graph.box2", false } },
{ "graph.box3", { QObject::tr(""), QObject::tr("graph.box3"), false } }, { "graph.box3", { "", "graph.box3", false } },
{ "graph.box4", { QObject::tr(""), QObject::tr("graph.box4"), false } }, { "graph.box4", { "", "graph.box4", false } },
{ {
"graph.true", { "graph.true", {
QObject::tr("In graph view jump arrow true"), QObject::tr("In graph view jump arrow true"),
@ -200,10 +200,10 @@ static const QMap<QString, OptionIfo> optionInfoMap = {
QObject::tr("Arrow"), false QObject::tr("Arrow"), false
} }
}, },
{ "graph.current", { QObject::tr(""), QObject::tr("graph.current"), false } }, { "graph.current", { "", "graph.current", false } },
{ "graph.traced", { QObject::tr(""), QObject::tr("graph.traced"), false } }, { "graph.traced", { "", "graph.traced", false } },
{ "gui.cflow", { QObject::tr(""), QObject::tr("gui.cflow"), true } }, { "gui.cflow", { "", "gui.cflow", true } },
{ "gui.dataoffset", { QObject::tr(""), QObject::tr("gui.dataoffset"), true } }, { "gui.dataoffset", { "", "gui.dataoffset", true } },
{ {
"gui.background", { "gui.background", {
QObject::tr("General background color"), QObject::tr("General background color"),
@ -212,7 +212,7 @@ static const QMap<QString, OptionIfo> optionInfoMap = {
}, },
{ {
"gui.alt_background", { "gui.alt_background", {
QObject::tr(""), "",
QObject::tr("Alt. background"), true QObject::tr("Alt. background"), true
} }
}, },
@ -222,7 +222,7 @@ static const QMap<QString, OptionIfo> optionInfoMap = {
QObject::tr("Current graph node"), true QObject::tr("Current graph node"), true
} }
}, },
{ "gui.border", { QObject::tr(""), QObject::tr("gui.border"), true } }, { "gui.border", { "", "gui.border", true } },
// TODO: find out different // TODO: find out different
{ {
@ -258,11 +258,10 @@ static const QMap<QString, OptionIfo> optionInfoMap = {
QObject::tr("Main"), true QObject::tr("Main"), true
} }
}, },
{ "gui.imports", { QObject::tr(""), QObject::tr("gui.imports"), true } }, { "gui.imports", { "", "gui.imports", true } },
{ "highlightPC", { QObject::tr(""), QObject::tr("highlightPC"), true } }, { "highlightPC", { "", "highlightPC", true } },
{ "gui.navbar.err", { QObject::tr(""), QObject::tr("gui.navbar.err"), true } }, { "gui.navbar.err", { "", "gui.navbar.err", true } },
{ "gui.navbar.sym", { QObject::tr(""), QObject::tr("gui.navbar.sym"), true } }, { "gui.navbar.sym", { "", "gui.navbar.sym", true } },
{ "gui.dataoffset", { QObject::tr(""), QObject::tr("gui.dataoffset"), true } },
{ {
"gui.navbar.code", { "gui.navbar.code", {
QObject::tr("Code section color in navigation bar"), QObject::tr("Code section color in navigation bar"),
@ -275,8 +274,7 @@ static const QMap<QString, OptionIfo> optionInfoMap = {
QObject::tr("Navbar empty"), true QObject::tr("Navbar empty"), true
} }
}, },
{ "angui.navbar.str", { QObject::tr(""), QObject::tr("angui.navbar.str"), true } }, { "gui.breakpoint_background", { "", QObject::tr("Breakpoint background"), true } }
{ "gui.breakpoint_background", { QObject::tr(""), QObject::tr("Breakpoint background"), true } }
}; };
void ColorOptionDelegate::paint(QPainter *painter, void ColorOptionDelegate::paint(QPainter *painter,
@ -317,8 +315,9 @@ void ColorOptionDelegate::paint(QPainter *painter,
ColorOption co = index.data(Qt::UserRole).value<ColorOption>(); ColorOption co = index.data(Qt::UserRole).value<ColorOption>();
txtColor = co.color; txtColor = co.color;
if (optionInfoMap[co.optionName].isUsedStandardTextColor) if (optionInfoMap[co.optionName].isUsedStandardTextColor) {
txtColor = textColor; txtColor = textColor;
}
pal.setColor(QPalette::Text, txtColor); pal.setColor(QPalette::Text, txtColor);
op.palette = pal; op.palette = pal;
@ -352,8 +351,9 @@ void ColorViewButton::setColor(const QColor &c)
void ColorViewButton::mouseReleaseEvent(QMouseEvent *event) void ColorViewButton::mouseReleaseEvent(QMouseEvent *event)
{ {
if (event->button() != Qt::LeftButton) if (event->button() != Qt::LeftButton) {
return; return;
}
emit clicked(); emit clicked();
} }
@ -406,8 +406,9 @@ ColorSchemePrefWidget::~ColorSchemePrefWidget()
void ColorSchemePrefWidget::apply() void ColorSchemePrefWidget::apply()
{ {
if (!isEditable) if (!isEditable) {
return; return;
}
ColorSettingsModel *model = static_cast<ColorSettingsModel *>(ui->preferencesListView->model()); ColorSettingsModel *model = static_cast<ColorSettingsModel *>(ui->preferencesListView->model());
QString scheme = ""; QString scheme = "";
@ -429,8 +430,9 @@ void ColorSchemePrefWidget::apply()
void ColorSchemePrefWidget::newColor() void ColorSchemePrefWidget::newColor()
{ {
if (ui->preferencesListView->currentIndex().row() == -1 || !isEditable) if (ui->preferencesListView->currentIndex().row() == -1 || !isEditable) {
return; return;
}
ColorOption currCO = ui->preferencesListView->model()->data(ui->preferencesListView->currentIndex(), ColorOption currCO = ui->preferencesListView->model()->data(ui->preferencesListView->currentIndex(),
Qt::UserRole).value<ColorOption>(); Qt::UserRole).value<ColorOption>();
@ -464,11 +466,13 @@ ColorSettingsModel::ColorSettingsModel(QObject *parent) : QAbstractListModel (pa
QVariant ColorSettingsModel::data(const QModelIndex &index, int role) const QVariant ColorSettingsModel::data(const QModelIndex &index, int role) const
{ {
if (role == Qt::DisplayRole) if (role == Qt::DisplayRole) {
return QVariant::fromValue(m_data.at(index.row()).displayingText); return QVariant::fromValue(m_data.at(index.row()).displayingText);
}
if (role == Qt::UserRole) if (role == Qt::UserRole) {
return QVariant::fromValue(m_data.at(index.row())); return QVariant::fromValue(m_data.at(index.row()));
}
return QVariant(); return QVariant();
} }
@ -492,9 +496,11 @@ QColor ColorSettingsModel::getBackroundColor() const
return Config()->getColor(standardBackgroundOptionName); return Config()->getColor(standardBackgroundOptionName);
} }
for (auto &it : m_data) for (auto &it : m_data) {
if (it.optionName == standardBackgroundOptionName) if (it.optionName == standardBackgroundOptionName) {
return it.color; return it.color;
}
}
return QColor(); return QColor();
} }
@ -504,9 +510,11 @@ QColor ColorSettingsModel::getTextColor() const
return Config()->getColor(standardTextOptionName); return Config()->getColor(standardTextOptionName);
} }
for (auto &it : m_data) for (auto &it : m_data) {
if (it.optionName == standardTextOptionName) if (it.optionName == standardTextOptionName) {
return it.color; return it.color;
}
}
return QColor(); return QColor();
} }
@ -522,8 +530,9 @@ void ColorSettingsModel::updateScheme()
} }
QMap<QString, QColor> cutterSpecific = ColorSchemeFileWorker().getCutterSpecific(); QMap<QString, QColor> cutterSpecific = ColorSchemeFileWorker().getCutterSpecific();
for (auto &it : cutterSpecific.keys()) for (auto &it : cutterSpecific.keys()) {
m_data.push_back({it, optionInfoMap[it].displayingtext, cutterSpecific[it]}); m_data.push_back({it, optionInfoMap[it].displayingtext, cutterSpecific[it]});
}
qobject_cast<PreferencesListView *>(parent())->setStandardColors(); qobject_cast<PreferencesListView *>(parent())->setStandardColors();
} }