1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-03-12 03:31:37 +00:00

Compare commits

...

13 Commits

Author SHA1 Message Date
e4a142fe60 Add update check function and call from about
- Implement a update check against the github releases via the api
- Add semantic-version dependency
- Add automatic check when opening about dialog
2022-03-20 01:01:38 -05:00
d40e32a143 Update transifex config & pull latest updates
- Update transifex configuration to new format
- Pull translation updates
2022-03-19 20:21:14 -05:00
1bc206e62d Bump version to 4.2.1 2022-03-19 19:02:41 -05:00
106a0feaba Add sponsor information 2022-03-19 17:46:12 -05:00
984e0c4094 Fix help path for local files and some help doc updates 2022-03-19 17:43:11 -05:00
9321e811d7 Enforce minimum Windows version ref #983 2022-03-19 17:01:54 -05:00
a64fcbfb5c Fix deprecation warning from sqlite 2022-03-19 17:01:53 -05:00
cff07a12d6 Black formatter changes 2022-03-19 17:01:53 -05:00
Alfonso Montero
b9c7832c4a Apply @arsenetar's proposed change to fix for errors on window change event. Solves #937. (#980) 2022-03-15 20:47:48 -05:00
b9dfeac2f3 Drop Python 3.6 Support 2022-03-15 05:10:41 -05:00
efc99eee96 Merge pull request #978 from glubsy/fix_zoom_scrollbar
Fix image viewer scrollbar zoom
2022-03-14 20:43:40 -05:00
glubsy
ff7733bb73 Fix image viewer
When zooming in or out, the value computed might be a float instead
of an int, which is what the QScrollBar expect for its setValue method.
Simply casting to int should be enough here.
2022-03-12 22:36:17 +01:00
4b2fbe87ea Default to English on unsupported system language Fix #976
- Add check for supported language to system locale detection
- Fall-back to English when not a supported locale
2022-03-12 04:36:13 -06:00
26 changed files with 235 additions and 134 deletions

13
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
# These are supported funding model platforms
github: arsenetar
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -45,20 +45,20 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9, '3.10'] python-version: [3.7, 3.8, 3.9, '3.10']
exclude: exclude:
- os: macos-latest
python-version: 3.6
- os: macos-latest - os: macos-latest
python-version: 3.7 python-version: 3.7
- os: macos-latest - os: macos-latest
python-version: 3.8 python-version: 3.8
- os: windows-latest - os: macos-latest
python-version: 3.6 python-version: 3.9
- os: windows-latest - os: windows-latest
python-version: 3.7 python-version: 3.7
- os: windows-latest - os: windows-latest
python-version: 3.8 python-version: 3.8
- os: windows-latest
python-version: 3.9
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@@ -1 +1 @@
sonar.python.version=3.6, 3.7, 3.8, 3.9, 3.10 sonar.python.version=3.7, 3.8, 3.9, 3.10

View File

@@ -1,26 +1,27 @@
[main] [main]
host = https://www.transifex.com host = https://www.transifex.com
[dupeguru-1.core] [o:voltaicideas:p:dupeguru-1:r:columns]
file_filter = locale/<lang>/LC_MESSAGES/core.po
source_file = locale/core.pot
source_lang = en
type = PO
[dupeguru-1.columns]
file_filter = locale/<lang>/LC_MESSAGES/columns.po file_filter = locale/<lang>/LC_MESSAGES/columns.po
source_file = locale/columns.pot source_file = locale/columns.pot
source_lang = en source_lang = en
type = PO type = PO
[dupeguru-1.ui] [o:voltaicideas:p:dupeguru-1:r:core]
file_filter = locale/<lang>/LC_MESSAGES/core.po
source_file = locale/core.pot
source_lang = en
type = PO
[o:voltaicideas:p:dupeguru-1:r:qtlib]
file_filter = qtlib/locale/<lang>/LC_MESSAGES/qtlib.po
source_file = qtlib/locale/qtlib.pot
source_lang = en
type = PO
[o:voltaicideas:p:dupeguru-1:r:ui]
file_filter = locale/<lang>/LC_MESSAGES/ui.po file_filter = locale/<lang>/LC_MESSAGES/ui.po
source_file = locale/ui.pot source_file = locale/ui.pot
source_lang = en source_lang = en
type = PO type = PO
[dupeguru-1.qtlib]
file_filter = qtlib/locale/<lang>/LC_MESSAGES/qtlib.po
source_file = qtlib/locale/qtlib.pot
source_lang = en
type = PO

View File

@@ -36,7 +36,7 @@ For windows instructions see the [Windows Instructions](Windows.md).
For macos instructions (qt version) see the [macOS Instructions](macos.md). For macos instructions (qt version) see the [macOS Instructions](macos.md).
### Prerequisites ### Prerequisites
* [Python 3.6+][python] * [Python 3.7+][python]
* PyQt5 * PyQt5
### System Setup ### System Setup

View File

@@ -2,7 +2,7 @@
### Prerequisites ### Prerequisites
- [Python 3.6+][python] - [Python 3.7+][python]
- [Visual Studio 2019][vs] or [Visual Studio Build Tools 2019][vsBuildTools] with the Windows 10 SDK - [Visual Studio 2019][vs] or [Visual Studio Build Tools 2019][vsBuildTools] with the Windows 10 SDK
- [nsis][nsis] (for installer creation) - [nsis][nsis] (for installer creation)
- [msys2][msys2] (for using makefile method) - [msys2][msys2] (for using makefile method)
@@ -16,7 +16,7 @@ After installing python it is recommended to update setuptools before compiling
More details on setting up python for compiling packages on windows can be found on the [python wiki][pythonWindowsCompilers] Take note of the required vc++ versions. More details on setting up python for compiling packages on windows can be found on the [python wiki][pythonWindowsCompilers] Take note of the required vc++ versions.
### With build.py (preferred) ### With build.py (preferred)
To build with a different python version 3.6 vs 3.8 or 32 bit vs 64 bit specify that version instead of -3.8 to the `py` command below. If you want to build additional versions while keeping all virtual environments setup use a different location for each virtual environment. To build with a different python version 3.7 vs 3.8 or 32 bit vs 64 bit specify that version instead of -3.8 to the `py` command below. If you want to build additional versions while keeping all virtual environments setup use a different location for each virtual environment.
$ cd <dupeGuru directory> $ cd <dupeGuru directory>
$ py -3.8 -m venv .\env $ py -3.8 -m venv .\env

View File

@@ -150,8 +150,8 @@ def build_normal():
def main(): def main():
if sys.version_info < (3, 6): if sys.version_info < (3, 7):
sys.exit("Python < 3.6 is unsupported.") sys.exit("Python < 3.7 is unsupported.")
options = parse_args() options = parse_args()
if options.clean and Path("build").exists(): if options.clean and Path("build").exists():
shutil.rmtree("build") shutil.rmtree("build")

View File

@@ -1,2 +1,2 @@
__version__ = "4.2.0" __version__ = "4.2.1"
__appname__ = "dupeGuru" __appname__ = "dupeGuru"

View File

@@ -7,6 +7,12 @@
import time import time
import sys import sys
import os import os
import urllib.request
import urllib.error
import json
import semantic_version
import logging
from typing import Union
from hscommon.util import format_time_decimal from hscommon.util import format_time_decimal
@@ -64,3 +70,34 @@ def fix_surrogate_encoding(s, encoding="utf-8"):
def executable_folder(): def executable_folder():
return os.path.dirname(os.path.abspath(sys.argv[0])) return os.path.dirname(os.path.abspath(sys.argv[0]))
def check_for_update(current_version: str, include_prerelease: bool = False) -> Union[None, dict]:
request = urllib.request.Request(
"https://api.github.com/repos/arsenetar/dupeguru/releases",
headers={"Accept": "application/vnd.github.v3+json"},
)
try:
with urllib.request.urlopen(request) as response:
if response.status != 200:
logging.warn(f"Error retriving updates. Status: {response.status}")
return None
try:
response_json = json.loads(response.read())
except json.JSONDecodeError as ex:
logging.warn(f"Error parsing updates. {ex.msg}")
return None
except urllib.error.URLError as ex:
logging.warn(f"Error retriving updates. {ex.reason}")
return None
new_version = semantic_version.Version(current_version)
new_url = None
for release in response_json:
release_version = semantic_version.Version(release["name"])
if new_version < release_version and (include_prerelease or not release_version.prerelease):
new_version = release_version
new_url = release["html_url"]
if new_url is not None:
return {"version": new_version, "url": new_url}
else:
return None

View File

@@ -12,7 +12,7 @@ a community around this project.
So, whatever your skills, if you're interested in contributing to dupeGuru, please do so. Normally, So, whatever your skills, if you're interested in contributing to dupeGuru, please do so. Normally,
this documentation should be enough to get you started, but if it isn't, then **please**, this documentation should be enough to get you started, but if it isn't, then **please**,
`let me know`_ because it's a problem that I'm committed to fix. If there's any situation where you'd open a discussion at https://github.com/arsenetar/dupeguru/discussions. If there's any situation where you'd
wish to contribute but some doubt you're having prevent you from going forward, please contact me. wish to contribute but some doubt you're having prevent you from going forward, please contact me.
I'd much prefer to spend the time figuring out with you whether (and how) you can contribute than I'd much prefer to spend the time figuring out with you whether (and how) you can contribute than
taking the chance of missing that opportunity. taking the chance of missing that opportunity.
@@ -82,10 +82,9 @@ agree on what should be added to the documentation.
dupeGuru. For more information about how to do that, you can refer to the `translator guide`_. dupeGuru. For more information about how to do that, you can refer to the `translator guide`_.
.. _been open source: https://www.hardcoded.net/articles/free-as-in-speech-fair-as-in-trade .. _been open source: https://www.hardcoded.net/articles/free-as-in-speech-fair-as-in-trade
.. _let me know: mailto:hsoft@hardcoded.net
.. _Source code repository: https://github.com/arsenetar/dupeguru .. _Source code repository: https://github.com/arsenetar/dupeguru
.. _Issue Tracker: https://github.com/hsoft/arsenetar/issues .. _Issue Tracker: https://github.com/arsenetar/issues
.. _Issue labels meaning: https://github.com/hsoft/arsenetar/wiki/issue-labels .. _Issue labels meaning: https://github.com/arsenetar/wiki/issue-labels
.. _Sphinx: http://sphinx-doc.org/ .. _Sphinx: http://sphinx-doc.org/
.. _reST: http://en.wikipedia.org/wiki/ReStructuredText .. _reST: http://en.wikipedia.org/wiki/ReStructuredText
.. _translator guide: https://github.com/hsoft/arsenetar/wiki/Translator-Guide .. _translator guide: https://github.com/arsenetar/wiki/Translator-Guide

View File

@@ -45,7 +45,7 @@ class _ActualThread(threading.Thread):
self._lock = threading.Lock() self._lock = threading.Lock()
self._run = True self._run = True
self.lastrowid = -1 self.lastrowid = -1
self.setDaemon(True) self.daemon = True
self.start() self.start()
def _query(self, query): def _query(self, query):

View File

@@ -150,7 +150,9 @@ def install_gettext_trans_under_qt(base_folder, lang=None):
if not lang: if not lang:
lang = str(QLocale.system().name())[:2] lang = str(QLocale.system().name())[:2]
localename = get_locale_name(lang) localename = get_locale_name(lang)
if localename is not None: if localename is None:
lang = "en"
localename = get_locale_name(lang)
try: try:
locale.setlocale(locale.LC_ALL, localename) locale.setlocale(locale.LC_ALL, localename)
except locale.Error: except locale.Error:

View File

@@ -1,9 +1,9 @@
# Translators: # Translators:
# Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi (MNH48) <admin@mnh48.moe>, 2021 # Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi (MNH48) <admin@mnh48.moe>, 2022
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Last-Translator: Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi (MNH48) <admin@mnh48.moe>, 2021\n" "Last-Translator: Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi (MNH48) <admin@mnh48.moe>, 2022\n"
"Language-Team: Malay (https://www.transifex.com/voltaicideas/teams/116153/ms/)\n" "Language-Team: Malay (https://www.transifex.com/voltaicideas/teams/116153/ms/)\n"
"Language: ms\n" "Language: ms\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -987,4 +987,4 @@ msgstr "Cache dikosongkan."
#: qt\preferences_dialog.py:173 #: qt\preferences_dialog.py:173
msgid "Use dark style" msgid "Use dark style"
msgstr "" msgstr "Guna gaya gelap"

View File

@@ -1,10 +1,10 @@
# Translators: # Translators:
# Ahmet Haydar Işık <itsahmthydr@gmail.com>, 2021 # Ahmet Haydar Işık <itsahmthydr@gmail.com>, 2021
# Emin Tufan Çetin <etcetin@gmail.com>, 2021 # Emin Tufan Çetin <etcetin@gmail.com>, 2022
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Last-Translator: Emin Tufan Çetin <etcetin@gmail.com>, 2021\n" "Last-Translator: Emin Tufan Çetin <etcetin@gmail.com>, 2022\n"
"Language-Team: Turkish (https://www.transifex.com/voltaicideas/teams/116153/tr/)\n" "Language-Team: Turkish (https://www.transifex.com/voltaicideas/teams/116153/tr/)\n"
"Language: tr\n" "Language: tr\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -983,4 +983,4 @@ msgstr "Önbellek temizlendi."
#: qt\preferences_dialog.py:173 #: qt\preferences_dialog.py:173
msgid "Use dark style" msgid "Use dark style"
msgstr "" msgstr "Karanlık biçem kullan"

View File

@@ -1,6 +1,9 @@
# Translators:
# 太子 VC <taiziccf@gmail.com>, 2021
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Last-Translator: 太子 VC <taiziccf@gmail.com>, 2021\n"
"Language-Team: Chinese (Taiwan) (https://www.transifex.com/voltaicideas/teams/116153/zh_TW/)\n" "Language-Team: Chinese (Taiwan) (https://www.transifex.com/voltaicideas/teams/116153/zh_TW/)\n"
"Language: zh_TW\n" "Language: zh_TW\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -9,53 +12,53 @@ msgstr ""
#: qt/app.py:81 #: qt/app.py:81
msgid "Quit" msgid "Quit"
msgstr "" msgstr "退出"
#: qt/app.py:82 qt/preferences_dialog.py:116 #: qt/app.py:82 qt/preferences_dialog.py:116
#: cocoa/en.lproj/Localizable.strings:0 #: cocoa/en.lproj/Localizable.strings:0
msgid "Options" msgid "Options"
msgstr "" msgstr "选项"
#: qt/app.py:83 qt/ignore_list_dialog.py:32 #: qt/app.py:83 qt/ignore_list_dialog.py:32
#: cocoa/en.lproj/Localizable.strings:0 #: cocoa/en.lproj/Localizable.strings:0
msgid "Ignore List" msgid "Ignore List"
msgstr "" msgstr "忽略列表"
#: qt/app.py:84 qt/app.py:179 cocoa/en.lproj/Localizable.strings:0 #: qt/app.py:84 qt/app.py:179 cocoa/en.lproj/Localizable.strings:0
msgid "Clear Picture Cache" msgid "Clear Picture Cache"
msgstr "" msgstr "清空图片缓存"
#: qt/app.py:85 cocoa/en.lproj/Localizable.strings:0 #: qt/app.py:85 cocoa/en.lproj/Localizable.strings:0
msgid "dupeGuru Help" msgid "dupeGuru Help"
msgstr "" msgstr "dupeGuru 帮助"
#: qt/app.py:86 cocoa/en.lproj/Localizable.strings:0 #: qt/app.py:86 cocoa/en.lproj/Localizable.strings:0
msgid "About dupeGuru" msgid "About dupeGuru"
msgstr "" msgstr "关于 dupeGuru"
#: qt/app.py:87 #: qt/app.py:87
msgid "Open Debug Log" msgid "Open Debug Log"
msgstr "" msgstr "打开调试记录"
#: qt/app.py:180 cocoa/en.lproj/Localizable.strings:0 #: qt/app.py:180 cocoa/en.lproj/Localizable.strings:0
msgid "Do you really want to remove all your cached picture analysis?" msgid "Do you really want to remove all your cached picture analysis?"
msgstr "" msgstr "确定要移除所有缓存分析图片?"
#: qt/app.py:184 #: qt/app.py:184
msgid "Picture cache cleared." msgid "Picture cache cleared."
msgstr "" msgstr "图片缓存已清空。"
#: qt/app.py:251 #: qt/app.py:251
msgid "{} file (*.{})" msgid "{} file (*.{})"
msgstr "" msgstr "{} 文件 (*.{})"
#: qt/deletion_options.py:30 cocoa/en.lproj/Localizable.strings:0 #: qt/deletion_options.py:30 cocoa/en.lproj/Localizable.strings:0
msgid "Deletion Options" msgid "Deletion Options"
msgstr "" msgstr "删除选项"
#: qt/deletion_options.py:35 cocoa/en.lproj/Localizable.strings:0 #: qt/deletion_options.py:35 cocoa/en.lproj/Localizable.strings:0
msgid "Link deleted files" msgid "Link deleted files"
msgstr "" msgstr "链接已删除的文件"
#: qt/deletion_options.py:37 cocoa/en.lproj/Localizable.strings:0 #: qt/deletion_options.py:37 cocoa/en.lproj/Localizable.strings:0
msgid "" msgid ""
@@ -91,20 +94,20 @@ msgstr ""
#: qt/deletion_options.py:60 cocoa/en.lproj/Localizable.strings:0 #: qt/deletion_options.py:60 cocoa/en.lproj/Localizable.strings:0
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr "取消"
#: qt/details_table.py:16 cocoa/en.lproj/Localizable.strings:0 #: qt/details_table.py:16 cocoa/en.lproj/Localizable.strings:0
msgid "Attribute" msgid "Attribute"
msgstr "" msgstr "属性"
#: qt/details_table.py:16 cocoa/en.lproj/Localizable.strings:0 #: qt/details_table.py:16 cocoa/en.lproj/Localizable.strings:0
msgid "Selected" msgid "Selected"
msgstr "" msgstr "已选择"
#: qt/details_table.py:16 qt/directories_model.py:24 #: qt/details_table.py:16 qt/directories_model.py:24
#: cocoa/en.lproj/Localizable.strings:0 #: cocoa/en.lproj/Localizable.strings:0
msgid "Reference" msgid "Reference"
msgstr "" msgstr "源文件"
#: qt/directories_dialog.py:64 cocoa/en.lproj/Localizable.strings:0 #: qt/directories_dialog.py:64 cocoa/en.lproj/Localizable.strings:0
msgid "Load Results..." msgid "Load Results..."
@@ -908,3 +911,43 @@ msgstr ""
#: qt\preferences_dialog.py:286 #: qt\preferences_dialog.py:286
msgid "Display" msgid "Display"
msgstr "" msgstr ""
#: qt\se\preferences_dialog.py:70
msgid "Partially hash files bigger than"
msgstr ""
#: qt\se\preferences_dialog.py:80
msgid "MB"
msgstr ""
#: qt\preferences_dialog.py:163
msgid "Use native OS dialogs"
msgstr ""
#: qt\preferences_dialog.py:166
msgid ""
"For actions such as file/folder selection use the OS native dialogs.\n"
"Some native dialogs have limited functionality."
msgstr ""
#: qt\se\preferences_dialog.py:68
msgid "Ignore files larger than"
msgstr ""
#: qt\app.py:135 qt\app.py:293
msgid "Clear Cache"
msgstr ""
#: qt\app.py:294
msgid ""
"Do you really want to clear the cache? This will remove all cached file "
"hashes and picture analysis."
msgstr ""
#: qt\app.py:299
msgid "Cache cleared."
msgstr ""
#: qt\preferences_dialog.py:173
msgid "Use dark style"
msgstr ""

View File

@@ -2,7 +2,7 @@
### Prerequisites ### Prerequisites
- [Python 3.6+][python] - [Python 3.7+][python]
- [Xcode 12.3][xcode] or just Xcode command line tools (older versions can be used if not interested in arm macs) - [Xcode 12.3][xcode] or just Xcode command line tools (older versions can be used if not interested in arm macs)
- [Homebrew][homebrew] - [Homebrew][homebrew]
- [qt5](https://www.qt.io/) - [qt5](https://www.qt.io/)
@@ -12,7 +12,7 @@
2. Install [Homebrew][homebrew], if not on the path after install (arm based Macs) create `~/.zshrc` 2. Install [Homebrew][homebrew], if not on the path after install (arm based Macs) create `~/.zshrc`
with `export PATH="/opt/homebrew/bin:$PATH"`. Will need to reload terminal or source the file to take with `export PATH="/opt/homebrew/bin:$PATH"`. Will need to reload terminal or source the file to take
effect. effect.
3. Install qt5 with `brew`. If you are using a version of macos without system python 3.6+ then you will 3. Install qt5 with `brew`. If you are using a version of macos without system python 3.7+ then you will
also need to install that via brew or with pyenv. also need to install that via brew or with pyenv.
$ brew install qt5 $ brew install qt5

View File

@@ -10,7 +10,7 @@ Vcs-Git: https://github.com/arsenetar/dupeguru.git
Package: {pkgname} Package: {pkgname}
Architecture: {arch} Architecture: {arch}
Depends: ${shlibs:Depends}, python3 (>=3.6), python3-pyqt5, python3-mutagen Depends: ${shlibs:Depends}, python3 (>=3.7), python3-pyqt5, python3-mutagen
Provides: dupeguru-se, dupeguru-me, dupeguru-pe Provides: dupeguru-se, dupeguru-me, dupeguru-pe
Replaces: dupeguru-se, dupeguru-me, dupeguru-pe Replaces: dupeguru-se, dupeguru-me, dupeguru-pe
Conflicts: dupeguru-se, dupeguru-me, dupeguru-pe Conflicts: dupeguru-se, dupeguru-me, dupeguru-pe

View File

@@ -1049,13 +1049,13 @@ class ScrollAreaImageViewer(QScrollArea):
def adjustScrollBarsScaled(self, delta): def adjustScrollBarsScaled(self, delta):
"""After scaling with the mouse, update relative to mouse position.""" """After scaling with the mouse, update relative to mouse position."""
self._horizontalScrollBar.setValue(self._horizontalScrollBar.value() + delta.x()) self._horizontalScrollBar.setValue(int(self._horizontalScrollBar.value() + delta.x()))
self._verticalScrollBar.setValue(self._verticalScrollBar.value() + delta.y()) self._verticalScrollBar.setValue(int(self._verticalScrollBar.value() + delta.y()))
def adjustScrollBarsAuto(self): def adjustScrollBarsAuto(self):
"""After panning, update accordingly.""" """After panning, update accordingly."""
self.horizontalScrollBar().setValue(self.horizontalScrollBar().value() - self._mousePanningDelta.x()) self.horizontalScrollBar().setValue(int(self.horizontalScrollBar().value() - self._mousePanningDelta.x()))
self.verticalScrollBar().setValue(self.verticalScrollBar().value() - self._mousePanningDelta.y()) self.verticalScrollBar().setValue(int(self.verticalScrollBar().value() - self._mousePanningDelta.y()))
def adjustScrollBarCentered(self): def adjustScrollBarCentered(self):
"""Just center in the middle.""" """Just center in the middle."""

View File

@@ -14,11 +14,11 @@ if op.exists(__file__):
else: else:
# Should be a frozen environment # Should be a frozen environment
if ISOSX: if ISOSX:
BASE_PATH = op.abspath(op.join(op.dirname(__file__), '..', '..', 'Resources')) BASE_PATH = op.abspath(op.join(op.dirname(__file__), "..", "..", "Resources"))
else: else:
# For others our base path is ''. # For others our base path is ''.
BASE_PATH = "" BASE_PATH = ""
HELP_PATH = op.join(BASE_PATH, "help") HELP_PATH = op.join(BASE_PATH, "help", "en")
if ISWINDOWS: if ISWINDOWS:
INITIAL_FOLDER_IN_DIALOGS = "C:\\" INITIAL_FOLDER_IN_DIALOGS = "C:\\"

View File

@@ -221,7 +221,7 @@ class TabWindow(QMainWindow):
super().showEvent(event) super().showEvent(event)
def changeEvent(self, event): def changeEvent(self, event):
if event.type() == QEvent.Type.WindowStateChange and not self.isMaximized(): if event.type() == QEvent.WindowStateChange and not self.isMaximized():
move_to_screen_center(self) move_to_screen_center(self)
super().changeEvent(event) super().changeEvent(event)

View File

@@ -6,18 +6,11 @@
# which should be included with this package. The terms are also available at # which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html # http://www.gnu.org/licenses/gpl-3.0.html
from PyQt5.QtCore import Qt, QCoreApplication from PyQt5.QtCore import Qt, QCoreApplication, QTimer
from PyQt5.QtGui import QPixmap, QFont from PyQt5.QtGui import QPixmap, QFont
from PyQt5.QtWidgets import ( from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QSizePolicy, QHBoxLayout, QVBoxLayout, QLabel
QDialog,
QDialogButtonBox,
QSizePolicy,
QHBoxLayout,
QVBoxLayout,
QLabel,
QApplication,
)
from core.util import check_for_update
from qtlib.util import move_to_screen_center from qtlib.util import move_to_screen_center
from hscommon.trans import trget from hscommon.trans import trget
@@ -31,61 +24,56 @@ class AboutBox(QDialog):
self.app = app self.app = app
self._setupUi() self._setupUi()
self.buttonBox.accepted.connect(self.accept) self.button_box.accepted.connect(self.accept)
self.buttonBox.rejected.connect(self.reject) self.button_box.rejected.connect(self.reject)
def _setupUi(self): def _setupUi(self):
self.setWindowTitle(tr("About {}").format(QCoreApplication.instance().applicationName())) self.setWindowTitle(tr("About {}").format(QCoreApplication.instance().applicationName()))
self.resize(400, 290)
size_policy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) size_policy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
size_policy.setHorizontalStretch(0)
size_policy.setVerticalStretch(0)
size_policy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
self.setSizePolicy(size_policy) self.setSizePolicy(size_policy)
self.horizontalLayout = QHBoxLayout(self) main_layout = QHBoxLayout(self)
self.logoLabel = QLabel(self) logo_label = QLabel()
self.logoLabel.setPixmap(QPixmap(":/%s_big" % self.app.LOGO_NAME)) logo_label.setPixmap(QPixmap(":/%s_big" % self.app.LOGO_NAME))
self.horizontalLayout.addWidget(self.logoLabel) main_layout.addWidget(logo_label)
self.verticalLayout = QVBoxLayout() detail_layout = QVBoxLayout()
self.nameLabel = QLabel(self) name_label = QLabel()
font = QFont() font = QFont()
font.setWeight(75) font.setWeight(75)
font.setBold(True) font.setBold(True)
self.nameLabel.setFont(font) name_label.setFont(font)
self.nameLabel.setText(QCoreApplication.instance().applicationName()) name_label.setText(QCoreApplication.instance().applicationName())
self.verticalLayout.addWidget(self.nameLabel) detail_layout.addWidget(name_label)
self.versionLabel = QLabel(self) version_label = QLabel()
self.versionLabel.setText(tr("Version {}").format(QCoreApplication.instance().applicationVersion())) version_label.setText(tr("Version {}").format(QCoreApplication.instance().applicationVersion()))
self.verticalLayout.addWidget(self.versionLabel) detail_layout.addWidget(version_label)
self.label_3 = QLabel(self) self.update_label = QLabel(tr("Checking for updates..."))
self.verticalLayout.addWidget(self.label_3) self.update_label.setTextInteractionFlags(Qt.TextBrowserInteraction)
self.label_3.setText(tr("Licensed under GPLv3")) self.update_label.setOpenExternalLinks(True)
self.label = QLabel(self) detail_layout.addWidget(self.update_label)
font = QFont() license_label = QLabel()
font.setWeight(75) license_label.setText(tr("Licensed under GPLv3"))
font.setBold(True) detail_layout.addWidget(license_label)
self.label.setFont(font) spacer_label = QLabel()
self.verticalLayout.addWidget(self.label) spacer_label.setFont(font)
self.buttonBox = QDialogButtonBox(self) detail_layout.addWidget(spacer_label)
self.buttonBox.setOrientation(Qt.Horizontal) self.button_box = QDialogButtonBox()
self.buttonBox.setStandardButtons(QDialogButtonBox.Ok) self.button_box.setOrientation(Qt.Horizontal)
self.verticalLayout.addWidget(self.buttonBox) self.button_box.setStandardButtons(QDialogButtonBox.Ok)
self.horizontalLayout.addLayout(self.verticalLayout) detail_layout.addWidget(self.button_box)
main_layout.addLayout(detail_layout)
def _check_for_update(self):
update = check_for_update(QCoreApplication.instance().applicationVersion(), include_prerelease=False)
if update is None:
self.update_label.setText(tr("No update available."))
else:
self.update_label.setText(
tr('New version {} available, download <a href="{}">here</a>.').format(update["version"], update["url"])
)
def showEvent(self, event): def showEvent(self, event):
self.update_label.setText(tr("Checking for updates..."))
# have to do this here as the frameGeometry is not correct until shown # have to do this here as the frameGeometry is not correct until shown
move_to_screen_center(self) move_to_screen_center(self)
super().showEvent(event) super().showEvent(event)
QTimer.singleShot(0, self._check_for_update)
if __name__ == "__main__":
import sys
app = QApplication([])
QCoreApplication.setOrganizationName("Hardcoded Software")
QCoreApplication.setApplicationName("FooApp")
QCoreApplication.setApplicationVersion("1.2.3")
app.LOGO_NAME = ""
dialog = AboutBox(None, app)
dialog.show()
sys.exit(app.exec_())

View File

@@ -4,18 +4,30 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: utf-8\n" "Content-Transfer-Encoding: utf-8\n"
#: qtlib\about_box.py:38 #: qtlib\about_box.py:31
msgid "About {}" msgid "About {}"
msgstr "" msgstr ""
#: qtlib\about_box.py:58 #: qtlib\about_box.py:47
msgid "Version {}" msgid "Version {}"
msgstr "" msgstr ""
#: qtlib\about_box.py:62 #: qtlib\about_box.py:49 qtlib\about_box.py:75
msgid "Checking for updates..."
msgstr ""
#: qtlib\about_box.py:54
msgid "Licensed under GPLv3" msgid "Licensed under GPLv3"
msgstr "" msgstr ""
#: qtlib\about_box.py:68
msgid "No update available."
msgstr ""
#: qtlib\about_box.py:71
msgid "New version {} available, download <a href=\"{}\">here</a>."
msgstr ""
#: qtlib\error_report_dialog.py:50 #: qtlib\error_report_dialog.py:50
msgid "Error Report" msgid "Error Report"
msgstr "" msgstr ""

View File

@@ -1,11 +1,10 @@
# Translators: # Translators:
# Ahmet Haydar Işık <itsahmthydr@gmail.com>, 2021 # Ahmet Haydar Işık <itsahmthydr@gmail.com>, 2021
# Emin Tufan Çetin <etcetin@gmail.com>, 2021 # Emin Tufan Çetin <etcetin@gmail.com>, 2022
# Andrew Senetar <arsenetar@gmail.com>, 2022
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Last-Translator: Andrew Senetar <arsenetar@gmail.com>, 2022\n" "Last-Translator: Emin Tufan Çetin <etcetin@gmail.com>, 2022\n"
"Language-Team: Turkish (https://www.transifex.com/voltaicideas/teams/116153/tr/)\n" "Language-Team: Turkish (https://www.transifex.com/voltaicideas/teams/116153/tr/)\n"
"Language: tr\n" "Language: tr\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -100,7 +99,7 @@ msgstr "Korece"
#: qtlib\preferences.py:34 #: qtlib\preferences.py:34
msgid "Malay" msgid "Malay"
msgstr "Malay dili" msgstr "Malayca"
#: qtlib\preferences.py:35 #: qtlib\preferences.py:35
msgid "Dutch" msgid "Dutch"

View File

@@ -5,3 +5,4 @@ mutagen>=1.44.0
distro>=1.5.0 distro>=1.5.0
PyQt5 >=5.14.1,<6.0; sys_platform != 'linux' PyQt5 >=5.14.1,<6.0; sys_platform != 'linux'
pywin32>=228; sys_platform == 'win32' pywin32>=228; sys_platform == 'win32'
semantic-version>=2.9.0,<3.0.0

View File

@@ -18,16 +18,16 @@ classifiers =
Operating System :: MacOS :: MacOS X Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows Operating System :: Microsoft :: Windows
Operating System :: POSIX Operating System :: POSIX
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 :: Only
Topic :: Desktop Environment :: File Managers Topic :: Desktop Environment :: File Managers
[options] [options]
packages = find: packages = find:
python_requires = >=3.6 python_requires = >=3.7
install_requires = install_requires =
Send2Trash>=1.3.0 Send2Trash>=1.3.0
polib>=1.1.0 polib>=1.1.0

View File

@@ -12,6 +12,8 @@ Unicode true
SetCompressor /SOLID lzma SetCompressor /SOLID lzma
; General Headers ; General Headers
!include "FileFunc.nsh" !include "FileFunc.nsh"
!include "WinVer.nsh"
!include "LogicLib.nsh"
;============================================================================== ;==============================================================================
; Configuration Defines ; Configuration Defines
@@ -279,6 +281,10 @@ SectionEnd
;============================================================================== ;==============================================================================
Function .onInit Function .onInit
${IfNot} ${AtLeastWin7}
MessageBox MB_OK "Windows 7 and above required"
Quit
${EndIf}
!if ${BITS} == "64" !if ${BITS} == "64"
SetRegView 64 SetRegView 64
!else !else