BinEditor: Clean up translation contexts

Change-Id: Ibeb8c93ad1dfa816ccf1160abae8aac6781157d9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2022-09-29 17:46:03 +02:00
parent 479403e320
commit 191815e974
14 changed files with 86 additions and 330 deletions

View File

@@ -3754,7 +3754,7 @@ F.eks., vil &quot;Revision: 15&quot; efterlade grenen ved revision 15.</translat
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorDocument</name>
<name>BinEditor</name>
<message>
<source>The Binary Editor cannot open empty files.</source>
<translation>Binær-redigeringen kan ikke åbne tomme filer.</translation>
@@ -3771,9 +3771,6 @@ F.eks., vil &quot;Revision: 15&quot; efterlade grenen ved revision 15.</translat
<source>Cannot open %1: %2</source>
<translation>Kan ikke åbne %1: %2</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorWidget</name>
<message>
<source>Memory at 0x%1</source>
<translation>Hukommelse ved 0x%1</translation>
@@ -3876,7 +3873,7 @@ F.eks., vil &quot;Revision: 15&quot; efterlade grenen ved revision 15.</translat
</message>
</context>
<context>
<name>BinEditorWidget::TextEditorWidget</name>
<name>BinEditor</name>
<message>
<source>Zoom: %1%</source>
<translation>Zoom: %1%</translation>
@@ -42916,7 +42913,7 @@ Spordataene er tabt.</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorPluginPrivate</name>
<name>BinEditor</name>
<message>
<source>&amp;Undo</source>
<translation>&amp;Fortryd</translation>

View File

@@ -28146,7 +28146,7 @@ Der vom Kit mindestens benötigte API-Level ist %1.</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorDocument</name>
<name>BinEditor</name>
<message>
<source>The Binary Editor cannot open empty files.</source>
<translation>Der Binäreditor kann keine leeren Dateien öffnen.</translation>
@@ -37451,7 +37451,7 @@ Fehler: %5</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorWidget</name>
<name>BinEditor</name>
<message>
<source>Memory at 0x%1</source>
<translation>Speicher bei 0x%1</translation>
@@ -37562,7 +37562,7 @@ Fehler: %5</translation>
</message>
</context>
<context>
<name>BinEditorWidget::TextEditorWidget</name>
<name>BinEditor</name>
<message>
<source>Zoom: %1%</source>
<translation>Vergrößerung: %1%</translation>
@@ -42482,7 +42482,7 @@ Die Dateien aus dem Quellverzeichnis des Android-Pakets werden in das Verzeichni
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorPlugin</name>
<name>BinEditor</name>
<message>
<source>&amp;Undo</source>
<translation>&amp;Rückgängig</translation>

View File

@@ -16431,7 +16431,7 @@ Check the test environment.</source>
</message>
</context>
<context>
<name>BinEditor::BinEditorWidget</name>
<name>BinEditor</name>
<message>
<source>Memory at 0x%1</source>
<translation>Memorija pri 0x%1</translation>
@@ -16593,7 +16593,7 @@ Check the test environment.</source>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorDocument</name>
<name>BinEditor</name>
<message>
<source>The Binary Editor cannot open empty files.</source>
<translation>Binarni uređivač ne može otvoriti prazne datoteke.</translation>
@@ -16610,9 +16610,6 @@ Check the test environment.</source>
<source>Cannot open %1: %2</source>
<translation>Nije moguće otvoriti %1: %2</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorPlugin</name>
<message>
<source>&amp;Undo</source>
<translation>&amp;Poništi</translation>
@@ -16621,120 +16618,17 @@ Check the test environment.</source>
<source>&amp;Redo</source>
<translation>Po&amp;novi</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorWidget</name>
<message>
<source>Memory at 0x%1</source>
<translation>Memorija pri 0x%1</translation>
</message>
<message>
<source>Decimal&amp;nbsp;unsigned&amp;nbsp;value:</source>
<translation>Decimalna&amp;nbsp;nepotpisana&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>Decimal&amp;nbsp;signed&amp;nbsp;value:</source>
<translation>Decimalna&amp;nbsp;potpisana&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>Previous&amp;nbsp;decimal&amp;nbsp;unsigned&amp;nbsp;value:</source>
<translation>Prethodna&amp;nbsp;decimalna&amp;nbsp;nepotpisana&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>Previous&amp;nbsp;decimal&amp;nbsp;signed&amp;nbsp;value:</source>
<translation>Prethodna&amp;nbsp;decimalna&amp;nbsp;potpisana&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>%1-bit&amp;nbsp;Integer&amp;nbsp;Type</source>
<translation>%1-bit&amp;nbsp;cjelobrojna&amp;nbsp;vrsta</translation>
</message>
<message>
<source>Little Endian</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Big Endian</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Binary&amp;nbsp;value:</source>
<translation>Binarna&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>Octal&amp;nbsp;value:</source>
<translation>Oktalna&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>Previous&amp;nbsp;binary&amp;nbsp;value:</source>
<translation>Prethodna&amp;nbsp;binarna&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>Previous&amp;nbsp;octal&amp;nbsp;value:</source>
<translation>Prethodna&amp;nbsp;oktalna&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>&lt;i&gt;double&lt;/i&gt;&amp;nbsp;value:</source>
<translation>&lt;i&gt;dupla&lt;/i&gt;&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>Previous &lt;i&gt;double&lt;/i&gt;&amp;nbsp;value:</source>
<translation>Prethodna &lt;i&gt;dupla&lt;/i&gt;&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>&lt;i&gt;float&lt;/i&gt;&amp;nbsp;value:</source>
<translation>&lt;i&gt;pomična&lt;/i&gt;&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>Previous &lt;i&gt;float&lt;/i&gt;&amp;nbsp;value:</source>
<translation>Prethodna &lt;i&gt;pomična&lt;/i&gt;&amp;nbsp;vrijednost:</translation>
</message>
<message>
<source>Copying Failed</source>
<translation>Neuspjelo kopiranje</translation>
</message>
<message>
<source>You cannot copy more than 4 MB of binary data.</source>
<translation>Ne možeš kopirati više od 4 MB binarnih podataka.</translation>
</message>
<message>
<source>Copy Selection as ASCII Characters</source>
<translation>Kopiraj odabir kao ASCII znakove</translation>
</message>
<message>
<source>Copy Selection as Hex Values</source>
<translation>Kopiraj odabir kao heksadecimalne znakove</translation>
</message>
<message>
<source>Set Data Breakpoint on Selection</source>
<translation>Postavi točku prekida podataka na odabiru</translation>
</message>
<message>
<source>Copy 0x%1</source>
<translation>Kopiraj 0x%1</translation>
</message>
<message>
<source>Jump to Address in This Window</source>
<translation>Prijeđi na adresu u ovom prozoru</translation>
</message>
<message>
<source>Jump to Address in New Window</source>
<translation>Prijeđi na adresu u novom prozoru</translation>
</message>
<message>
<source>Copy Value</source>
<translation>Kopiraj vrijednost</translation>
</message>
<message>
<source>Jump to Address 0x%1 in This Window</source>
<translation>Prijeđi na adresu 0x%1 u ovom prozoru</translation>
</message>
<message>
<source>Jump to Address 0x%1 in New Window</source>
<translation>Prijeđi na adresu 0x%1 u novom prozoru</translation>
</message>
</context>
<context>
<name>BinEditorWidget::TextEditorWidget</name>
<name>BinEditor</name>
<message>
<source>Zoom: %1%</source>
<translation>Zumiranje: %1%</translation>

View File

@@ -38674,7 +38674,7 @@ Only desktop kits are supported. Make sure the currently active kit is a desktop
</message>
</context>
<context>
<name>BinEditor::BinEditorWidget</name>
<name>BinEditor</name>
<message>
<source>Memory at 0x%1</source>
<translation>0x%1 </translation>
@@ -38775,9 +38775,6 @@ Only desktop kits are supported. Make sure the currently active kit is a desktop
<source>Jump to Address 0x%1 in New Window</source>
<translation> 0x%1 </translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorDocument</name>
<message>
<source>The Binary Editor cannot open empty files.</source>
<translation></translation>
@@ -38794,9 +38791,6 @@ Only desktop kits are supported. Make sure the currently active kit is a desktop
<source>Cannot open %1: %2</source>
<translation>%1 : %2</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorPlugin</name>
<message>
<source>&amp;Undo</source>
<translation>(&amp;U)</translation>
@@ -48905,118 +48899,18 @@ The name of the release build configuration created by default for a qmake proje
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorWidget</name>
<message>
<source>Memory at 0x%1</source>
<translation>0x%1 </translation>
</message>
<message>
<source>Decimal&amp;nbsp;unsigned&amp;nbsp;value:</source>
<translation>10:</translation>
</message>
<message>
<source>Decimal&amp;nbsp;signed&amp;nbsp;value:</source>
<translation>10:</translation>
</message>
<message>
<source>Previous&amp;nbsp;decimal&amp;nbsp;unsigned&amp;nbsp;value:</source>
<translation>10:</translation>
</message>
<message>
<source>Previous&amp;nbsp;decimal&amp;nbsp;signed&amp;nbsp;value:</source>
<translation>10:</translation>
</message>
<message>
<source>%1-bit&amp;nbsp;Integer&amp;nbsp;Type</source>
<translation>%1 </translation>
</message>
<message>
<source>Little Endian</source>
<translation></translation>
</message>
<message>
<source>Big Endian</source>
<translation></translation>
</message>
<message>
<source>Binary&amp;nbsp;value:</source>
<translation>2:</translation>
</message>
<message>
<source>Octal&amp;nbsp;value:</source>
<translation>8:</translation>
</message>
<message>
<source>Previous&amp;nbsp;binary&amp;nbsp;value:</source>
<translation>2:</translation>
</message>
<message>
<source>Previous&amp;nbsp;octal&amp;nbsp;value:</source>
<translation>8:</translation>
</message>
<message>
<source>&lt;i&gt;double&lt;/i&gt;&amp;nbsp;value:</source>
<translation>&lt;i&gt;&lt;/i&gt;:</translation>
</message>
<message>
<source>Previous &lt;i&gt;double&lt;/i&gt;&amp;nbsp;value:</source>
<translation>&lt;i&gt;&lt;/i&gt;:</translation>
</message>
<message>
<source>&lt;i&gt;float&lt;/i&gt;&amp;nbsp;value:</source>
<translation>&lt;i&gt;&lt;/i&gt;:</translation>
</message>
<message>
<source>Previous &lt;i&gt;float&lt;/i&gt;&amp;nbsp;value:</source>
<translation>&lt;i&gt;&lt;/i&gt;:</translation>
</message>
<message>
<source>Copying Failed</source>
<translation></translation>
</message>
<message>
<source>You cannot copy more than 4 MB of binary data.</source>
<translation>4MB </translation>
</message>
<message>
<source>Copy Selection as ASCII Characters</source>
<translation> ASCII </translation>
</message>
<message>
<source>Copy Selection as Hex Values</source>
<translation>16</translation>
</message>
<message>
<source>Set Data Breakpoint on Selection</source>
<translation></translation>
</message>
<name>BinEditor</name>
<message>
<source>Copy 0x%1</source>
<translation>0x%1</translation>
</message>
<message>
<source>Jump to Address in This Window</source>
<translation></translation>
</message>
<message>
<source>Jump to Address in New Window</source>
<translation></translation>
</message>
<message>
<source>Copy Value</source>
<translation></translation>
</message>
<message>
<source>Jump to Address 0x%1 in This Window</source>
<translation> 0x%1 </translation>
</message>
<message>
<source>Jump to Address 0x%1 in New Window</source>
<translation> 0x%1 </translation>
</message>
</context>
<context>
<name>BinEditorWidget::TextEditorWidget</name>
<name>BinEditor</name>
<message>
<source>Zoom: %1%</source>
<translation>: %1%</translation>

View File

@@ -30346,7 +30346,7 @@ Zainstaluj SDK o wersji %1 lub wyższej.</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorDocument</name>
<name>BinEditor</name>
<message>
<source>The Binary Editor cannot open empty files.</source>
<translation>Edytor plików binarnych nie może otwierać pustych plików.</translation>
@@ -30363,9 +30363,6 @@ Zainstaluj SDK o wersji %1 lub wyższej.</translation>
<source>Cannot open %1: %2</source>
<translation>Nie można otworzyć %1: %2</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorPlugin</name>
<message>
<source>&amp;Undo</source>
<translation>&amp;Cofnij</translation>
@@ -39906,7 +39903,7 @@ Uwaga: podczas używania zwykłego formatu tekstowego może brakować niektóryc
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorWidget</name>
<name>BinEditor</name>
<message>
<source>Memory at 0x%1</source>
<translation>Pamięć w 0x%1</translation>
@@ -41618,7 +41615,7 @@ Błąd: %2</translation>
</message>
</context>
<context>
<name>BinEditorWidget::TextEditorWidget</name>
<name>BinEditor</name>
<message>
<source>Zoom: %1%</source>
<translation>Powiększenie:%1%</translation>

View File

@@ -5429,7 +5429,7 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorDocument</name>
<name>BinEditor</name>
<message>
<source>The Binary Editor cannot open empty files.</source>
<translation>Двоичный редактор не может открывать пустые файлы.</translation>
@@ -5446,9 +5446,6 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<source>Cannot open %1: %2</source>
<translation>Не удалось открыть %1: %2</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorPlugin</name>
<message>
<source>&amp;Undo</source>
<translation>&amp;Отменить</translation>
@@ -5457,9 +5454,6 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<source>&amp;Redo</source>
<translation>&amp;Повторить</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorWidget</name>
<message>
<source>Memory at 0x%1</source>
<translation>Память с 0x%1</translation>
@@ -5570,7 +5564,7 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
</message>
</context>
<context>
<name>BinEditorWidget::TextEditorWidget</name>
<name>BinEditor</name>
<message>
<source>Zoom: %1%</source>
<translation>Масштаб: %1%</translation>

View File

@@ -43904,7 +43904,7 @@ Deploying local Qt libraries is incompatible with Android 5.</source>
</message>
</context>
<context>
<name>BinEditor::BinEditorWidget</name>
<name>BinEditor</name>
<message>
<source>Memory at 0x%1</source>
<translation>Пам&apos;ять в 0x%1</translation>
@@ -44005,9 +44005,6 @@ Deploying local Qt libraries is incompatible with Android 5.</source>
<source>Jump to Address 0x%1 in New Window</source>
<translation>Перейти до адреси 0x%1 в новому вікні</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorDocument</name>
<message>
<source>The Binary Editor cannot open empty files.</source>
<translation>Двійковий редактор не може відкривати порожні файли.</translation>
@@ -44024,9 +44021,6 @@ Deploying local Qt libraries is incompatible with Android 5.</source>
<source>Cannot open %1: %2</source>
<translation>Неможливо відкрити %1: %2</translation>
</message>
</context>
<context>
<name>BinEditor::Internal::BinEditorPlugin</name>
<message>
<source>&amp;Undo</source>
<translation>&amp;Повернути</translation>

View File

@@ -3,13 +3,10 @@
#pragma once
namespace BinEditor {
namespace Constants {
namespace BinEditor::Constants {
const char C_BINEDITOR[] = "BinEditor.BinaryEditor";
const char C_BINEDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("OpenWith::Editors", "Binary Editor");
const char C_BINEDITOR_MIMETYPE[] = "application/octet-stream";
const char C_ENCODING_SETTING[] = "BinEditor/TextEncoding";
} // namespace Constants
} // namespace BinEditor
} // BinEditor::Constants

View File

@@ -2,26 +2,24 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "bineditorplugin.h"
#include "bineditorwidget.h"
#include "bineditorconstants.h"
#include "bineditorservice.h"
#include "bineditortr.h"
#include "bineditorwidget.h"
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/icore.h>
#include <texteditor/codecchooser.h>
#include <QCoreApplication>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QTextCodec>
#include <QVariant>
#include <QMenu>
#include <QAction>
#include <QMessageBox>
#include <QHBoxLayout>
#include <QLineEdit>
#include <QMenu>
#include <QMessageBox>
#include <QRegularExpressionValidator>
#include <QTextCodec>
#include <QToolBar>
#include <coreplugin/actionmanager/actionmanager.h>
@@ -30,6 +28,7 @@
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/find/ifindsupport.h>
#include <coreplugin/idocument.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/reloadpromptutils.h>
@@ -38,13 +37,16 @@
using namespace Utils;
using namespace Core;
namespace BinEditor {
namespace Internal {
namespace BinEditor::Internal {
class BinEditorFactory final : public IEditorFactory
{
public:
BinEditorFactory();
};
class BinEditorFind : public IFindSupport
{
Q_OBJECT
public:
BinEditorFind(BinEditorWidget *widget)
{
@@ -232,31 +234,31 @@ public:
{
const qint64 size = filePath.fileSize();
if (size < 0) {
QString msg = tr("Cannot open %1: %2").arg(filePath.toUserOutput(), tr("File Error"));
QString msg = Tr::tr("Cannot open %1: %2").arg(filePath.toUserOutput(), Tr::tr("File Error"));
// FIXME: Was: file.errorString(), but we don't have a file anymore.
if (errorString)
*errorString = msg;
else
QMessageBox::critical(ICore::dialogParent(), tr("File Error"), msg);
QMessageBox::critical(ICore::dialogParent(), Tr::tr("File Error"), msg);
return OpenResult::ReadError;
}
if (size == 0) {
QString msg = tr("The Binary Editor cannot open empty files.");
QString msg = Tr::tr("The Binary Editor cannot open empty files.");
if (errorString)
*errorString = msg;
else
QMessageBox::critical(ICore::dialogParent(), tr("File Error"), msg);
QMessageBox::critical(ICore::dialogParent(), Tr::tr("File Error"), msg);
return OpenResult::CannotHandle;
}
if (size / 16 >= qint64(1) << 31) {
// The limit is 2^31 lines (due to QText* interfaces) * 16 bytes per line.
QString msg = tr("The file is too big for the Binary Editor (max. 32GB).");
QString msg = Tr::tr("The file is too big for the Binary Editor (max. 32GB).");
if (errorString)
*errorString = msg;
else
QMessageBox::critical(ICore::dialogParent(), tr("File Error"), msg);
QMessageBox::critical(ICore::dialogParent(), Tr::tr("File Error"), msg);
return OpenResult::CannotHandle;
}
@@ -279,8 +281,8 @@ public:
if (dataSize != blockSize)
data += QByteArray(blockSize - dataSize, 0);
m_widget->addData(address, data);
// QMessageBox::critical(ICore::dialogParent(), tr("File Error"),
// tr("Cannot open %1: %2").arg(
// QMessageBox::critical(ICore::dialogParent(), Tr::tr("File Error"),
// Tr::tr("Cannot open %1: %2").arg(
// fn.toUserOutput(), file.errorString()));
}
@@ -415,7 +417,7 @@ BinEditorPluginPrivate::BinEditorPluginPrivate()
ExtensionSystem::PluginManager::addObject(&m_editorFactory);
m_undoAction = new QAction(BinEditorPlugin::tr("&Undo"), this);
m_redoAction = new QAction(BinEditorPlugin::tr("&Redo"), this);
m_redoAction = new QAction(Tr::tr("&Redo"), this);
m_copyAction = new QAction(this);
m_selectAllAction = new QAction(this);
@@ -442,7 +444,7 @@ static BinEditorPluginPrivate *dd = nullptr;
BinEditorFactory::BinEditorFactory()
{
setId(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::C_BINEDITOR_DISPLAY_NAME));
setDisplayName(QCoreApplication::translate("OpenWith::Editors", "Binary Editor"));
addMimeType(Constants::C_BINEDITOR_MIMETYPE);
setEditorCreator([] {
@@ -510,7 +512,6 @@ bool BinEditorPlugin::initialize(const QStringList &arguments, QString *errorMes
return true;
}
} // namespace Internal
} // namespace BinEditor
} // BinEditor::Internal
#include "bineditorplugin.moc"

View File

@@ -6,10 +6,8 @@
#include "bineditorservice.h"
#include <extensionsystem/iplugin.h>
#include <coreplugin/editormanager/ieditorfactory.h>
namespace BinEditor {
namespace Internal {
namespace BinEditor::Internal {
class BinEditorPlugin : public ExtensionSystem::IPlugin
{
@@ -22,12 +20,6 @@ class BinEditorPlugin : public ExtensionSystem::IPlugin
void extensionsInitialized() final {}
};
class BinEditorFactory final : public Core::IEditorFactory
{
public:
BinEditorFactory();
};
class FactoryServiceImpl : public QObject, public FactoryService
{
Q_OBJECT
@@ -37,5 +29,4 @@ public:
EditorService *createEditorService(const QString &title0, bool wantsEditor) final;
};
} // namespace Internal
} // namespace BinEditor
} // BinEditor::Internal

View File

@@ -12,4 +12,4 @@ struct Tr
Q_DECLARE_TR_FUNCTIONS(BinEditor)
};
} // namespace BinEditor
} // BinEditor

View File

@@ -2,8 +2,10 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "bineditorwidget.h"
#include "bineditorconstants.h"
#include "bineditorservice.h"
#include "bineditortr.h"
#include "markup.h"
#include <coreplugin/coreconstants.h>
@@ -42,8 +44,7 @@
using namespace Core;
using namespace Utils;
namespace BinEditor {
namespace Internal {
namespace BinEditor::Internal {
const QChar MidpointChar(u'\u00B7');
@@ -1218,7 +1219,7 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const
QString msg;
QTextStream str(&msg);
str << "<html><head/><body><p align=\"center\"><b>"
<< tr("Memory at 0x%1").arg(address, 0, 16) << "</b></p>";
<< Tr::tr("Memory at 0x%1").arg(address, 0, 16) << "</b></p>";
for (const Markup &m : qAsConst(m_markup)) {
if (m.covers(address) && !m.toolTip.isEmpty()) {
@@ -1226,16 +1227,16 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const
break;
}
}
const QString msgDecimalUnsigned = tr("Decimal&nbsp;unsigned&nbsp;value:");
const QString msgDecimalSigned = tr("Decimal&nbsp;signed&nbsp;value:");
const QString msgOldDecimalUnsigned = tr("Previous&nbsp;decimal&nbsp;unsigned&nbsp;value:");
const QString msgOldDecimalSigned = tr("Previous&nbsp;decimal&nbsp;signed&nbsp;value:");
const QString msgDecimalUnsigned = Tr::tr("Decimal&nbsp;unsigned&nbsp;value:");
const QString msgDecimalSigned = Tr::tr("Decimal&nbsp;signed&nbsp;value:");
const QString msgOldDecimalUnsigned = Tr::tr("Previous&nbsp;decimal&nbsp;unsigned&nbsp;value:");
const QString msgOldDecimalSigned = Tr::tr("Previous&nbsp;decimal&nbsp;signed&nbsp;value:");
// Table showing little vs. big endian integers for multi-byte
if (intSize > 1) {
str << "<table><tr><th>"
<< tr("%1-bit&nbsp;Integer&nbsp;Type").arg(8 * intSize) << "</th><th>"
<< tr("Little Endian") << "</th><th>" << tr("Big Endian") << "</th></tr>";
<< Tr::tr("%1-bit&nbsp;Integer&nbsp;Type").arg(8 * intSize) << "</th><th>"
<< Tr::tr("Little Endian") << "</th><th>" << Tr::tr("Big Endian") << "</th></tr>";
str << tableRowStartC << msgDecimalUnsigned
<< numericTableRowSepC << littleEndianValue << numericTableRowSepC
<< bigEndianValue << tableRowEndC << tableRowStartC << msgDecimalSigned
@@ -1261,14 +1262,14 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const
str << tableRowStartC << msgDecimalSigned << numericTableRowSepC
<< littleEndianSigned << tableRowEndC;
}
str << tableRowStartC << tr("Binary&nbsp;value:") << numericTableRowSepC;
str << tableRowStartC << Tr::tr("Binary&nbsp;value:") << numericTableRowSepC;
str.setIntegerBase(2);
str.setFieldWidth(8);
str.setPadChar(QLatin1Char('0'));
str << littleEndianValue;
str.setFieldWidth(0);
str << tableRowEndC << tableRowStartC
<< tr("Octal&nbsp;value:") << numericTableRowSepC;
<< Tr::tr("Octal&nbsp;value:") << numericTableRowSepC;
str.setIntegerBase(8);
str.setFieldWidth(3);
str << littleEndianValue << tableRowEndC;
@@ -1281,13 +1282,13 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const
str << tableRowStartC << msgOldDecimalSigned << numericTableRowSepC
<< littleEndianSignedOld << tableRowEndC;
}
str << tableRowStartC << tr("Previous&nbsp;binary&nbsp;value:")
str << tableRowStartC << Tr::tr("Previous&nbsp;binary&nbsp;value:")
<< numericTableRowSepC;
str.setIntegerBase(2);
str.setFieldWidth(8);
str << littleEndianValueOld;
str.setFieldWidth(0);
str << tableRowEndC << tableRowStartC << tr("Previous&nbsp;octal&nbsp;value:")
str << tableRowEndC << tableRowStartC << Tr::tr("Previous&nbsp;octal&nbsp;value:")
<< numericTableRowSepC;
str.setIntegerBase(8);
str.setFieldWidth(3);
@@ -1303,10 +1304,10 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const
double doubleValue, doubleValueOld;
asDouble(selStart, doubleValue, false);
asDouble(selStart, doubleValueOld, true);
str << tableRowStartC << tr("<i>double</i>&nbsp;value:") << numericTableRowSepC
str << tableRowStartC << Tr::tr("<i>double</i>&nbsp;value:") << numericTableRowSepC
<< doubleValue << tableRowEndC;
if (doubleValue != doubleValueOld)
str << tableRowStartC << tr("Previous <i>double</i>&nbsp;value:") << numericTableRowSepC
str << tableRowStartC << Tr::tr("Previous <i>double</i>&nbsp;value:") << numericTableRowSepC
<< doubleValueOld << tableRowEndC;
str << "</table>";
}
@@ -1317,10 +1318,10 @@ QString BinEditorWidget::toolTip(const QHelpEvent *helpEvent) const
float floatValue, floatValueOld;
asFloat(selStart, floatValue, false);
asFloat(selStart, floatValueOld, true);
str << tableRowStartC << tr("<i>float</i>&nbsp;value:") << numericTableRowSepC
str << tableRowStartC << Tr::tr("<i>float</i>&nbsp;value:") << numericTableRowSepC
<< floatValue << tableRowEndC;
if (floatValue != floatValueOld)
str << tableRowStartC << tr("Previous <i>float</i>&nbsp;value:") << numericTableRowSepC
str << tableRowStartC << Tr::tr("Previous <i>float</i>&nbsp;value:") << numericTableRowSepC
<< floatValueOld << tableRowEndC;
str << "</table>";
@@ -1441,8 +1442,7 @@ void BinEditorWidget::keyPressEvent(QKeyEvent *e)
static void showZoomIndicator(QWidget *editor, const int newZoom)
{
Utils::FadingIndicator::showText(editor,
QCoreApplication::translate("BinEditorWidget::TextEditorWidget",
"Zoom: %1%").arg(newZoom),
Tr::tr("Zoom: %1%").arg(newZoom),
Utils::FadingIndicator::SmallText);
}
@@ -1465,8 +1465,8 @@ void BinEditorWidget::copy(bool raw)
int selEnd = selectionEnd();
const int selectionLength = selEnd - selStart + 1;
if (selectionLength >> 22) {
QMessageBox::warning(this, tr("Copying Failed"),
tr("You cannot copy more than 4 MB of binary data."));
QMessageBox::warning(this, Tr::tr("Copying Failed"),
Tr::tr("You cannot copy more than 4 MB of binary data."));
return;
}
QByteArray data = dataMid(selStart, selectionLength);
@@ -1577,15 +1577,15 @@ void BinEditorWidget::contextMenuEvent(QContextMenuEvent *event)
QPointer<QMenu> contextMenu(new QMenu(this));
auto copyAsciiAction = new QAction(tr("Copy Selection as ASCII Characters"), contextMenu);
auto copyHexAction = new QAction(tr("Copy Selection as Hex Values"), contextMenu);
auto copyAsciiAction = new QAction(Tr::tr("Copy Selection as ASCII Characters"), contextMenu);
auto copyHexAction = new QAction(Tr::tr("Copy Selection as Hex Values"), contextMenu);
auto copyBeValue = new QAction(contextMenu);
auto copyLeValue = new QAction(contextMenu);
auto jumpToBeAddressHereAction = new QAction(contextMenu);
auto jumpToBeAddressNewWindowAction = new QAction(contextMenu);
auto jumpToLeAddressHereAction = new QAction(contextMenu);
auto jumpToLeAddressNewWindowAction = new QAction(contextMenu);
auto addWatchpointAction = new QAction(tr("Set Data Breakpoint on Selection"), contextMenu);
auto addWatchpointAction = new QAction(Tr::tr("Set Data Breakpoint on Selection"), contextMenu);
contextMenu->addAction(copyAsciiAction);
contextMenu->addAction(copyHexAction);
contextMenu->addAction(addWatchpointAction);
@@ -1596,11 +1596,11 @@ void BinEditorWidget::contextMenuEvent(QContextMenuEvent *event)
quint64 leAddress = 0;
if (byteCount <= 8) {
asIntegers(selStart, byteCount, beAddress, leAddress);
copyBeValue->setText(tr("Copy 0x%1").arg(QString::number(beAddress, 16)));
copyBeValue->setText(Tr::tr("Copy 0x%1").arg(QString::number(beAddress, 16)));
contextMenu->addAction(copyBeValue);
// If the menu entries would be identical, show only one of them.
if (beAddress != leAddress) {
copyLeValue->setText(tr("Copy 0x%1").arg(QString::number(leAddress, 16)));
copyLeValue->setText(Tr::tr("Copy 0x%1").arg(QString::number(leAddress, 16)));
contextMenu->addAction(copyLeValue);
}
setupJumpToMenuAction(contextMenu, jumpToBeAddressHereAction,
@@ -1611,9 +1611,9 @@ void BinEditorWidget::contextMenuEvent(QContextMenuEvent *event)
jumpToLeAddressNewWindowAction, leAddress);
}
} else {
jumpToBeAddressHereAction->setText(tr("Jump to Address in This Window"));
jumpToBeAddressNewWindowAction->setText(tr("Jump to Address in New Window"));
copyBeValue->setText(tr("Copy Value"));
jumpToBeAddressHereAction->setText(Tr::tr("Jump to Address in This Window"));
jumpToBeAddressNewWindowAction->setText(Tr::tr("Jump to Address in New Window"));
copyBeValue->setText(Tr::tr("Copy Value"));
jumpToBeAddressHereAction->setEnabled(false);
jumpToBeAddressNewWindowAction->setEnabled(false);
copyBeValue->setEnabled(false);
@@ -1650,9 +1650,9 @@ void BinEditorWidget::contextMenuEvent(QContextMenuEvent *event)
void BinEditorWidget::setupJumpToMenuAction(QMenu *menu, QAction *actionHere,
QAction *actionNew, quint64 addr)
{
actionHere->setText(tr("Jump to Address 0x%1 in This Window")
actionHere->setText(Tr::tr("Jump to Address 0x%1 in This Window")
.arg(QString::number(addr, 16)));
actionNew->setText(tr("Jump to Address 0x%1 in New Window")
actionNew->setText(Tr::tr("Jump to Address 0x%1 in New Window")
.arg(QString::number(addr, 16)));
menu->addAction(actionHere);
menu->addAction(actionNew);
@@ -1735,5 +1735,4 @@ void BinEditorWidget::setMarkup(const QList<Markup> &markup)
viewport()->update();
}
} // namespace Internal
} // namespace BinEditor
} // BinEditor::Internal

View File

@@ -31,8 +31,7 @@ namespace Core { class IEditor; }
namespace TextEditor { class FontSettings; }
namespace BinEditor {
namespace Internal {
namespace BinEditor::Internal {
class BinEditorWidgetPrivate;
@@ -228,5 +227,4 @@ private:
QList<Markup> m_markup;
};
} // namespace Internal
} // namespace BinEditor
} // BinEditor::Internal

View File

@@ -23,6 +23,6 @@ public:
QString toolTip;
};
} // namespace BinEditor
} // BinEditor
Q_DECLARE_METATYPE(BinEditor::Markup)