Skip to content

Commit d325e30

Browse files
committed
2018-08-28 Release Commit
- This commit adds stuff to build the 2019-08-28 release. - Windows files, Windows layout bugs. - Bump version numbers in Linux and macOS. - Fix building for AppImages on Linux. Squashed commit of the following: commit 1359f44 Author: Aaron Tan <[email protected]> Date: Fri Aug 30 18:43:17 2019 -0400 Bump version number on Linux - Bumps version number for .deb building. commit a54023d Author: Aaron Tan <[email protected]> Date: Fri Aug 30 18:38:25 2019 -0400 Fix Windows layout bug... again - Something changed and the last fix didn't work. Change so that every time the header widget's font is changed, it recalculates the width needed for the JP/PY labels. commit 06675cd Author: Aaron Tan <[email protected]> Date: Fri Aug 30 00:22:43 2019 -0500 Fix analytics PRODUCT_ID - Before, was relying on environment variable, which I didn't realize had to be set on every system that the application was installed on. Now, just define it in a config file. commit c34a875 Author: Aaron Tan <[email protected]> Date: Fri Aug 30 00:19:20 2019 -0500 Add 64-bit versions of build files for Windows commit ac2baf6 Author: Aaron Tan <[email protected]> Date: Thu Aug 29 23:18:53 2019 -0400 Bump version number in macOS Info.plist
1 parent 5daa4ba commit d325e30

26 files changed

+1339
-168
lines changed

src/jyut-dict/components/entryheaderwidget.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ EntryHeaderWidget::~EntryHeaderWidget()
4747

4848
}
4949

50+
void EntryHeaderWidget::changeEvent(QEvent *event)
51+
{
52+
#ifdef Q_OS_WIN
53+
if (event->type() == QEvent::FontChange) {
54+
_jyutpingLabel->setFixedWidth(_jyutpingLabel->fontMetrics().boundingRect("JP").width());
55+
_pinyinLabel->setFixedWidth(_pinyinLabel->fontMetrics().boundingRect("PY").width());
56+
}
57+
#endif
58+
QWidget::changeEvent(event);
59+
}
60+
5061
void EntryHeaderWidget::setEntry(const Entry &entry)
5162
{
5263
_jyutpingLabel->setVisible(true);

src/jyut-dict/components/entryheaderwidget.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "logic/entry/entry.h"
55
#include "logic/entry/entryphoneticoptions.h"
66

7+
#include <QEvent>
78
#include <QGridLayout>
89
#include <QLabel>
910
#include <QWidget>
@@ -17,7 +18,9 @@ class EntryHeaderWidget : public QWidget
1718
{
1819
public:
1920
explicit EntryHeaderWidget(QWidget *parent = nullptr);
20-
~EntryHeaderWidget();
21+
~EntryHeaderWidget() override;
22+
23+
void changeEvent(QEvent *event) override;
2124

2225
void setEntry(const Entry &entry);
2326
void setEntry(std::string word, std::string jyutping, std::string pinyin);

src/jyut-dict/jyut-dict.pro

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ HEADERS += \
9595
components/searchoptionsradiogroupbox.h \
9696
components/settingstab.h \
9797
logic/analytics/analytics.h \
98+
logic/analytics/analyticsconfig.h \
9899
logic/database/sqldatabasemanager.h \
99100
logic/database/sqldatabaseutils.h \
100101
logic/dictionary/dictionarymetadata.h \

src/jyut-dict/logic/analytics/analytics.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef ANALYTICS_H
22
#define ANALYTICS_H
33

4+
#include "logic/analytics/analyticsconfig.h"
5+
46
#include <QtNetwork>
57
#include <QObject>
68
#include <QUrl>
@@ -11,7 +13,6 @@
1113
// using the event API.
1214

1315
constexpr auto ANALYTICS_URL = "https://www.google-analytics.com/collect";
14-
const auto PROPERTY_ID = qEnvironmentVariable("PROPERTY_ID");
1516

1617
class Analytics : public QObject
1718
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef ANALYTICSCONFIG_H
2+
#define ANALYTICSCONFIG_H
3+
4+
constexpr auto PROPERTY_ID = "";
5+
6+
#endif // ANALYTICSCONFIG_H

src/jyut-dict/logic/database/sqldatabasemanager.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ bool SQLDatabaseManager::openDatabase()
5959
QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
6060
+ "/Dictionaries/dict.db"};
6161
#else
62-
QFileInfo bundleFile{QCoreApplication::applicationDirPath() + "/dict.db"};
62+
#ifdef APPIMAGE
63+
QFileInfo bundleFile{QCoreApplication::applicationDirPath()
64+
+ "/../share/jyut-dict/dictionaries/dict.db"};
65+
#else
66+
QFileInfo bundleFile{"/usr/share/jyut-dict/dictionaries/dict.db"};
67+
#endif
6368
QFileInfo localFile{
6469
QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
6570
+ "/dictionaries/dict.db"};

src/jyut-dict/logic/settings/settingsutils.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ bool isCurrentLocaleHan()
7676
{
7777
return currentLocale.script() == QLocale::HanScript
7878
|| currentLocale.script() == QLocale::SimplifiedHanScript
79-
|| currentLocale.script() == QLocale::TraditionalHanScript;
79+
|| currentLocale.script() == QLocale::TraditionalHanScript
80+
|| currentLocale.language() == QLocale::Chinese
81+
|| currentLocale.language() == QLocale::Cantonese;
8082
}
8183

8284
bool isCurrentLocaleTraditionalHan() {

src/jyut-dict/main.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ int main(int argc, char *argv[])
66
{
77
QCoreApplication::setOrganizationName("Aaron Tan");
88
QCoreApplication::setOrganizationDomain("aaronhktan.com");
9+
#ifdef APPIMAGE
10+
QCoreApplication::setApplicationName("Jyut Dictionary");
11+
#else
912
QCoreApplication::setApplicationName("CantoneseDictionary");
13+
#endif
1014

1115
qRegisterMetaType<EntryCharactersOptions>("EntryCharactersOptions");
1216
qRegisterMetaTypeStreamOperators<EntryCharactersOptions>("EntryCharactersOptions");

src/jyut-dict/platform/linux/create-deb.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
cd ../..
44

5-
tar -cvzf ../jyut-dict_0.19.0614.tar.gz * --overwrite
5+
tar -cvzf ../jyut-dict_0.19.0828.tar.gz * --overwrite
66

77
cd ../
88

9-
rm -rf jyut-dict_0.19.0614
10-
mkdir jyut-dict_0.19.0614
9+
rm -rf jyut-dict_0.19.0828
10+
mkdir jyut-dict_0.19.0828
1111

12-
cd jyut-dict_0.19.0614
12+
cd jyut-dict_0.19.0828
1313

14-
tar -xvzf ../jyut-dict_0.19.0614.tar.gz --overwrite
14+
tar -xvzf ../jyut-dict_0.19.0828.tar.gz --overwrite
1515

1616
cp -r ../jyut-dict/platform/linux/debian ./debian
1717

18-
rm ./eng.db
18+
rm ./dict.db
1919
rm ./jyut-dict
2020

21-
dh_make -c mit -s -f ../jyut-dict_0.19.0614.tar.gz -p jyut-dict_0.19.0614
21+
dh_make -c mit -s -f ../jyut-dict_0.19.0828.tar.gz -p jyut-dict_0.19.0828
2222

2323
debuild
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
jyut-dict (0.19.0614-1) bionic; urgency=medium
1+
jyut-dict (0.19.0828-1) bionic; urgency=medium
22

3-
* Initial release
3+
* New version!
4+
* Add ability to change settings.
5+
* Localized!
6+
* Lots of bug fixes.
47

58
-- Aaron Tan <[email protected]> Fri, 14 Jun 2019 00:48:23 -0400
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
jyut-dict-dbgsym_0.19.0614-1_amd64.ddeb debug optional
2-
jyut-dict_0.19.0614-1_amd64.buildinfo utils optional
3-
jyut-dict_0.19.0614-1_amd64.deb utils optional
1+
jyut-dict-dbgsym_0.19.0828-1_amd64.ddeb debug optional
2+
jyut-dict_0.19.0828-1_amd64.buildinfo utils optional
3+
jyut-dict_0.19.0828-1_amd64.deb utils optional

src/jyut-dict/platform/linux/jyut-dict.desktop

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[Desktop Entry]
2-
Version=0.19.0614
32
Type=Application
43
Name=Jyut Dictionary
54
Name[fr]=Dictionnaire Jyut

src/jyut-dict/platform/mac/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.19.0614-alpha</string>
20+
<string>0.19.0828</string>
2121
<key>LSMinimumSystemVersion</key>
2222
<string>10.12</string>
2323
<key>LSBackgroundOnly</key>

0 commit comments

Comments
 (0)