Skip to content

Commit

Permalink
2018-08-28 Release Commit
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
aaronhktan committed Aug 31, 2019
1 parent 5daa4ba commit d325e30
Show file tree
Hide file tree
Showing 26 changed files with 1,339 additions and 168 deletions.
11 changes: 11 additions & 0 deletions src/jyut-dict/components/entryheaderwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ EntryHeaderWidget::~EntryHeaderWidget()

}

void EntryHeaderWidget::changeEvent(QEvent *event)
{
#ifdef Q_OS_WIN
if (event->type() == QEvent::FontChange) {
_jyutpingLabel->setFixedWidth(_jyutpingLabel->fontMetrics().boundingRect("JP").width());
_pinyinLabel->setFixedWidth(_pinyinLabel->fontMetrics().boundingRect("PY").width());
}
#endif
QWidget::changeEvent(event);
}

void EntryHeaderWidget::setEntry(const Entry &entry)
{
_jyutpingLabel->setVisible(true);
Expand Down
5 changes: 4 additions & 1 deletion src/jyut-dict/components/entryheaderwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "logic/entry/entry.h"
#include "logic/entry/entryphoneticoptions.h"

#include <QEvent>
#include <QGridLayout>
#include <QLabel>
#include <QWidget>
Expand All @@ -17,7 +18,9 @@ class EntryHeaderWidget : public QWidget
{
public:
explicit EntryHeaderWidget(QWidget *parent = nullptr);
~EntryHeaderWidget();
~EntryHeaderWidget() override;

void changeEvent(QEvent *event) override;

void setEntry(const Entry &entry);
void setEntry(std::string word, std::string jyutping, std::string pinyin);
Expand Down
1 change: 1 addition & 0 deletions src/jyut-dict/jyut-dict.pro
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ HEADERS += \
components/searchoptionsradiogroupbox.h \
components/settingstab.h \
logic/analytics/analytics.h \
logic/analytics/analyticsconfig.h \
logic/database/sqldatabasemanager.h \
logic/database/sqldatabaseutils.h \
logic/dictionary/dictionarymetadata.h \
Expand Down
3 changes: 2 additions & 1 deletion src/jyut-dict/logic/analytics/analytics.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef ANALYTICS_H
#define ANALYTICS_H

#include "logic/analytics/analyticsconfig.h"

#include <QtNetwork>
#include <QObject>
#include <QUrl>
Expand All @@ -11,7 +13,6 @@
// using the event API.

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

class Analytics : public QObject
{
Expand Down
6 changes: 6 additions & 0 deletions src/jyut-dict/logic/analytics/analyticsconfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef ANALYTICSCONFIG_H
#define ANALYTICSCONFIG_H

constexpr auto PROPERTY_ID = "";

#endif // ANALYTICSCONFIG_H
7 changes: 6 additions & 1 deletion src/jyut-dict/logic/database/sqldatabasemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ bool SQLDatabaseManager::openDatabase()
QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
+ "/Dictionaries/dict.db"};
#else
QFileInfo bundleFile{QCoreApplication::applicationDirPath() + "/dict.db"};
#ifdef APPIMAGE
QFileInfo bundleFile{QCoreApplication::applicationDirPath()
+ "/../share/jyut-dict/dictionaries/dict.db"};
#else
QFileInfo bundleFile{"/usr/share/jyut-dict/dictionaries/dict.db"};
#endif
QFileInfo localFile{
QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
+ "/dictionaries/dict.db"};
Expand Down
4 changes: 3 additions & 1 deletion src/jyut-dict/logic/settings/settingsutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ bool isCurrentLocaleHan()
{
return currentLocale.script() == QLocale::HanScript
|| currentLocale.script() == QLocale::SimplifiedHanScript
|| currentLocale.script() == QLocale::TraditionalHanScript;
|| currentLocale.script() == QLocale::TraditionalHanScript
|| currentLocale.language() == QLocale::Chinese
|| currentLocale.language() == QLocale::Cantonese;
}

bool isCurrentLocaleTraditionalHan() {
Expand Down
4 changes: 4 additions & 0 deletions src/jyut-dict/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("Aaron Tan");
QCoreApplication::setOrganizationDomain("aaronhktan.com");
#ifdef APPIMAGE
QCoreApplication::setApplicationName("Jyut Dictionary");
#else
QCoreApplication::setApplicationName("CantoneseDictionary");
#endif

qRegisterMetaType<EntryCharactersOptions>("EntryCharactersOptions");
qRegisterMetaTypeStreamOperators<EntryCharactersOptions>("EntryCharactersOptions");
Expand Down
14 changes: 7 additions & 7 deletions src/jyut-dict/platform/linux/create-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

cd ../..

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

cd ../

rm -rf jyut-dict_0.19.0614
mkdir jyut-dict_0.19.0614
rm -rf jyut-dict_0.19.0828
mkdir jyut-dict_0.19.0828

cd jyut-dict_0.19.0614
cd jyut-dict_0.19.0828

tar -xvzf ../jyut-dict_0.19.0614.tar.gz --overwrite
tar -xvzf ../jyut-dict_0.19.0828.tar.gz --overwrite

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

rm ./eng.db
rm ./dict.db
rm ./jyut-dict

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

debuild
7 changes: 5 additions & 2 deletions src/jyut-dict/platform/linux/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
jyut-dict (0.19.0614-1) bionic; urgency=medium
jyut-dict (0.19.0828-1) bionic; urgency=medium

* Initial release
* New version!
* Add ability to change settings.
* Localized!
* Lots of bug fixes.

-- Aaron Tan <[email protected]> Fri, 14 Jun 2019 00:48:23 -0400
6 changes: 3 additions & 3 deletions src/jyut-dict/platform/linux/debian/files
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jyut-dict-dbgsym_0.19.0614-1_amd64.ddeb debug optional
jyut-dict_0.19.0614-1_amd64.buildinfo utils optional
jyut-dict_0.19.0614-1_amd64.deb utils optional
jyut-dict-dbgsym_0.19.0828-1_amd64.ddeb debug optional
jyut-dict_0.19.0828-1_amd64.buildinfo utils optional
jyut-dict_0.19.0828-1_amd64.deb utils optional
1 change: 0 additions & 1 deletion src/jyut-dict/platform/linux/jyut-dict.desktop
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[Desktop Entry]
Version=0.19.0614
Type=Application
Name=Jyut Dictionary
Name[fr]=Dictionnaire Jyut
Expand Down
2 changes: 1 addition & 1 deletion src/jyut-dict/platform/mac/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.19.0614-alpha</string>
<string>0.19.0828</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
<key>LSBackgroundOnly</key>
Expand Down
Loading

0 comments on commit d325e30

Please sign in to comment.