Skip to content

Commit bb3beb1

Browse files
committed
[Release] Change the application version to 0.4.0
- Add English plural forms; - Fix an error causing BoolNode not to be formatted; - Fix a build error related to the incomplete renaming of TabbedDocumentInterface. Signed-off-by: IoeCmcomc <[email protected]>
1 parent cb303e8 commit bb3beb1

File tree

10 files changed

+60
-45
lines changed

10 files changed

+60
-45
lines changed

lib/lib.pro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,7 @@ SOURCES += \
4646
nbt-cpp/src/nbt.cpp
4747

4848
INCLUDEPATH += lru-cache/include
49+
INCLUDEPATH += nbt-cpp/include
50+
4951

5052
message($$INCLUDEPATH)

src/MCDatapacker_en_US.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE TS>
3+
<TS version="2.1" language="en_US" sourcelanguage="en_US">
4+
<context>
5+
<name>StatusBar</name>
6+
<message numerus="yes">
7+
<location filename="statusbar.cpp" line="81"/>
8+
<source>%n problem(s)</source>
9+
<translation>
10+
<numerusform>%n problem</numerusform>
11+
<numerusform>%n problems</numerusform>
12+
</translation>
13+
</message>
14+
</context>
15+
</TS>

src/MCDatapacker_vi_VN.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,115 +2846,115 @@ p, li { white-space: pre-wrap; }
28462846
<translation>Minecraft %1</translation>
28472847
</message>
28482848
<message>
2849-
<location filename="statusbar.cpp" line="46"/>
2849+
<location filename="statusbar.cpp" line="49"/>
28502850
<source>Pack format: %1</source>
28512851
<translation>Định dạng gói: %1</translation>
28522852
</message>
28532853
<message>
2854-
<location filename="statusbar.cpp" line="53"/>
2854+
<location filename="statusbar.cpp" line="56"/>
28552855
<source>Tab %1 / %2</source>
28562856
<translation>Thẻ %1 / %2</translation>
28572857
</message>
28582858
<message>
2859-
<location filename="statusbar.cpp" line="77"/>
2859+
<location filename="statusbar.cpp" line="80"/>
28602860
<source>Line %1, row %2</source>
28612861
<translation>Dòng %1, cột %2</translation>
28622862
</message>
28632863
<message numerus="yes">
2864-
<location filename="statusbar.cpp" line="78"/>
2864+
<location filename="statusbar.cpp" line="81"/>
28652865
<source>%n problem(s)</source>
28662866
<translation>
28672867
<numerusform>%n vấn đề</numerusform>
28682868
</translation>
28692869
</message>
28702870
<message>
2871-
<location filename="statusbar.cpp" line="94"/>
2871+
<location filename="statusbar.cpp" line="97"/>
28722872
<source>Zoom: %1%</source>
28732873
<translation>Thu phóng: %1%</translation>
28742874
</message>
28752875
<message>
2876-
<location filename="statusbar.cpp" line="110"/>
2876+
<location filename="statusbar.cpp" line="113"/>
28772877
<source>Binary</source>
28782878
<translation>Nhị phân</translation>
28792879
</message>
28802880
<message>
2881-
<location filename="statusbar.cpp" line="110"/>
2881+
<location filename="statusbar.cpp" line="113"/>
28822882
<source>Structure</source>
28832883
<translation>Cấu trúc</translation>
28842884
</message>
28852885
<message>
2886-
<location filename="statusbar.cpp" line="111"/>
2886+
<location filename="statusbar.cpp" line="114"/>
28872887
<source>Image</source>
28882888
<translation>Ảnh</translation>
28892889
</message>
28902890
<message>
2891-
<location filename="statusbar.cpp" line="111"/>
2891+
<location filename="statusbar.cpp" line="114"/>
28922892
<source>Text</source>
28932893
<translation>Văn bản</translation>
28942894
</message>
28952895
<message>
2896-
<location filename="statusbar.cpp" line="112"/>
2896+
<location filename="statusbar.cpp" line="115"/>
28972897
<source>Function</source>
28982898
<translation>Hàm</translation>
28992899
</message>
29002900
<message>
2901-
<location filename="statusbar.cpp" line="112"/>
2901+
<location filename="statusbar.cpp" line="115"/>
29022902
<source>JSON</source>
29032903
<translation>JSON</translation>
29042904
</message>
29052905
<message>
2906-
<location filename="statusbar.cpp" line="113"/>
2906+
<location filename="statusbar.cpp" line="116"/>
29072907
<source>Advancement</source>
29082908
<translation>Tiến trình</translation>
29092909
</message>
29102910
<message>
2911-
<location filename="statusbar.cpp" line="113"/>
2911+
<location filename="statusbar.cpp" line="116"/>
29122912
<source>Loot table</source>
29132913
<translation>Bảng lợi phẩm</translation>
29142914
</message>
29152915
<message>
2916-
<location filename="statusbar.cpp" line="114"/>
2916+
<location filename="statusbar.cpp" line="117"/>
29172917
<source>Information</source>
29182918
<translation>Thông tin</translation>
29192919
</message>
29202920
<message>
2921-
<location filename="statusbar.cpp" line="114"/>
2921+
<location filename="statusbar.cpp" line="117"/>
29222922
<source>Predicate</source>
29232923
<translation>Xác lập</translation>
29242924
</message>
29252925
<message>
2926-
<location filename="statusbar.cpp" line="115"/>
2926+
<location filename="statusbar.cpp" line="118"/>
29272927
<source>Recipe</source>
29282928
<translation>Công thức</translation>
29292929
</message>
29302930
<message>
2931-
<location filename="statusbar.cpp" line="115"/>
2931+
<location filename="statusbar.cpp" line="118"/>
29322932
<source>Block tag</source>
29332933
<translation>Nhãn khối</translation>
29342934
</message>
29352935
<message>
2936-
<location filename="statusbar.cpp" line="116"/>
2936+
<location filename="statusbar.cpp" line="119"/>
29372937
<source>Entity type tag</source>
29382938
<translation>Nhãn loại thực thể</translation>
29392939
</message>
29402940
<message>
2941-
<location filename="statusbar.cpp" line="116"/>
2941+
<location filename="statusbar.cpp" line="119"/>
29422942
<source>Fluid tag</source>
29432943
<translation>Nhãn chất lỏng</translation>
29442944
</message>
29452945
<message>
2946-
<location filename="statusbar.cpp" line="117"/>
2946+
<location filename="statusbar.cpp" line="120"/>
29472947
<source>Function tag</source>
29482948
<translation>Nhãn hàm</translation>
29492949
</message>
29502950
<message>
2951-
<location filename="statusbar.cpp" line="117"/>
2951+
<location filename="statusbar.cpp" line="120"/>
29522952
<source>Item tag</source>
29532953
<translation>Nhãn vật phẩm</translation>
29542954
</message>
29552955
</context>
29562956
<context>
2957-
<name>TabbedCodeEditorInterface</name>
2957+
<name>TabbedDocumentInterface</name>
29582958
<message>
29592959
<location filename="tabbeddocumentinterface.ui" line="54"/>
29602960
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;No file is opened.&lt;/p&gt;&lt;p&gt;First, open a datapack; then open a file from the left-side tree view.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int main(int argc, char *argv[]) {
2323

2424
QCoreApplication::setOrganizationName("IoeCmcomc");
2525
QCoreApplication::setApplicationName("MCDatapacker");
26-
QCoreApplication::setApplicationVersion("0.3.0-beta");
26+
QCoreApplication::setApplicationVersion("0.4.0");
2727
QCommandLineParser parser;
2828
parser.setApplicationDescription(QCoreApplication::applicationName());
2929
parser.addHelpOption();

src/parsers/command/visitors/nodeformatter.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ namespace Command {
5757
/*m_formatRanges << std::move(range); */
5858
}
5959
virtual void visit(BoolNode *node) {
60-
auto fmt = defaultFormat(node);
60+
/*auto fmt = defaultFormat(node); */
61+
QTextCharFormat fmt;
62+
63+
fmt.setFontWeight(QFont::DemiBold);
64+
fmt.setForeground(
65+
(node->value()) ? QColor(0, 190, 0) : QColor(190, 0, 0));
6166

6267
QTextLayout::FormatRange range{ node->pos(), node->length(),
6368
std::move(fmt) };

src/settingsdialog.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ void SettingsDialog::setupLanguageSetting() {
5959
ui->languageCombo->addItem(lang, locale);
6060
}
6161

62-
63-
ui->languageCombo->addItem(QString("%1 (%2)").arg(
64-
QLocale::languageToString(QLocale("en_US").
65-
language()),
66-
QLocale("en_US").nativeLanguageName()),
67-
"en_US");
68-
6962
auto curLocale =
7063
QLocale(qobject_cast<MainWindow*>(parent())->getCurLocale());
7164
auto currLang = QString("%1 (%2)").arg(

src/src.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ FORMS += \
212212
visualrecipeeditordock.ui
213213

214214
TRANSLATIONS += \
215+
MCDatapacker_en_US.ts \
215216
MCDatapacker_vi_VN.ts
216217

217218
# Default rules for deployment.
@@ -227,7 +228,7 @@ RESOURCES += \
227228

228229
RC_ICONS = ../resource/app/icon/favicon.ico
229230

230-
VERSION = 0.3.0
231+
VERSION = 0.4.0
231232
QMAKE_TARGET_COMPANY = IoeCmcomc
232233
QMAKE_TARGET = MCDatapacker
233234
QMAKE_TARGET_PRODUCT = MCDatapacker

src/tabbeddocumentinterface.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "tabbeddocumentinterface.h"
2-
#include "ui_tabbedcodeeditorinterface.h"
2+
#include "ui_tabbeddocumentinterface.h"
33

44
#include "globalhelpers.h"
55
#include "mainwindow.h"
@@ -18,7 +18,7 @@
1818

1919
TabbedDocumentInterface::TabbedDocumentInterface(QWidget *parent) :
2020
QFrame(parent),
21-
ui(new Ui::TabbedCodeEditorInterface) {
21+
ui(new Ui::TabbedDocumentInterface) {
2222
ui->setupUi(this);
2323

2424
ui->tabBar->setTabsClosable(true);
@@ -365,7 +365,7 @@ void TabbedDocumentInterface::onFileRenamed(const QString &path,
365365
const QString &oldName,
366366
const QString &newName) {
367367
/*
368-
qDebug() << "TabbedCodeEditorInterface::onFileRenamed" << oldName <<
368+
qDebug() << "TabbedDocumentInterface::onFileRenamed" << oldName <<
369369
newName << count();
370370
*/
371371
const QString &&oldpath = path + '/' + oldName;
@@ -592,7 +592,7 @@ void TabbedDocumentInterface::onSwitchPrevFile() {
592592
}
593593

594594
void TabbedDocumentInterface::onCurTextChanged() {
595-
/*qDebug() << "TabbedCodeEditorInterface::onCurTextChanged"; */
595+
/*qDebug() << "TabbedDocumentInterface::onCurTextChanged"; */
596596
if (!hasNoFile() && getCurFile()->data.canConvert<TextFileData>()) {
597597
auto data =
598598
qvariant_cast<TextFileData>(getCurFile()->data);
@@ -605,7 +605,7 @@ void TabbedDocumentInterface::onCurTextChanged() {
605605
}
606606

607607
void TabbedDocumentInterface::onCurTextChangingDone() {
608-
/*qDebug() << "TabbedCodeEditorInterface::onCurTextChangingDone"; */
608+
/*qDebug() << "TabbedDocumentInterface::onCurTextChangingDone"; */
609609
if (const auto *curFile = getCurFile(); curFile &&
610610
curFile->data.canConvert<TextFileData>()) {
611611
auto data = qvariant_cast<TextFileData>(getCurFile()->data);

src/tabbeddocumentinterface.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
#define TABBEDCODEEDITORINTERFACE_H
33

44
#include "codeeditor.h"
5+
#include "imgviewer.h"
56

67
#include <QFrame>
78
#include <QStackedWidget>
89
#include <QTabBar>
910

10-
class ImgViewer;
11-
1211
namespace Ui {
13-
class TabbedCodeEditorInterface;
12+
class TabbedDocumentInterface;
1413
}
1514

1615
class TabbedDocumentInterface : public QFrame
@@ -35,8 +34,8 @@ class TabbedDocumentInterface : public QFrame
3534
QTabBar *getTabBar() const;
3635
QStackedWidget *getStackedWidget();
3736

38-
inline int count() const;
39-
inline bool hasNoFile() const;
37+
int count() const;
38+
bool hasNoFile() const;
4039
void clear();
4140
bool hasUnsavedChanges() const;
4241

@@ -74,7 +73,7 @@ private /*slots*/ :
7473
void onCurFileChanged(const QString &path);
7574

7675
private:
77-
Ui::TabbedCodeEditorInterface *ui;
76+
Ui::TabbedDocumentInterface *ui;
7877

7978
QVector<CodeFile> files;
8079
int prevIndex = -1;

src/tabbeddocumentinterface.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ui version="4.0">
3-
<class>TabbedCodeEditorInterface</class>
4-
<widget class="QFrame" name="TabbedCodeEditorInterface">
3+
<class>TabbedDocumentInterface</class>
4+
<widget class="QFrame" name="TabbedDocumentInterface">
55
<property name="geometry">
66
<rect>
77
<x>0</x>

0 commit comments

Comments
 (0)