mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Localized Fairware dialogs to french and made a few fixes here and there.
This commit is contained in:
parent
8a0d31f612
commit
6c60e76b55
2
build.py
2
build.py
@ -88,7 +88,7 @@ def build_cocoa(edition, dev):
|
|||||||
|
|
||||||
def build_qt(edition, dev):
|
def build_qt(edition, dev):
|
||||||
print("Building .ts files")
|
print("Building .ts files")
|
||||||
build_all_qt_locs(op.join('qt', 'lang'))
|
build_all_qt_locs(op.join('qt', 'lang'), extradirs=[op.join('qtlib', 'lang')])
|
||||||
print("Building Qt stuff")
|
print("Building Qt stuff")
|
||||||
print_and_do("pyrcc4 -py3 {0} > {1}".format(op.join('qt', 'base', 'dg.qrc'), op.join('qt', 'base', 'dg_rc.py')))
|
print_and_do("pyrcc4 -py3 {0} > {1}".format(op.join('qt', 'base', 'dg.qrc'), op.join('qt', 'base', 'dg_rc.py')))
|
||||||
print("Creating the run.py file")
|
print("Creating the run.py file")
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
"30.title" = "Directement à la destination";
|
"30.title" = "Directement à la destination";
|
||||||
|
|
||||||
/* Class = "NSButtonCell"; title = "Match scaled pictures together"; ObjectID = "31"; */
|
/* Class = "NSButtonCell"; title = "Match scaled pictures together"; ObjectID = "31"; */
|
||||||
"31.title" = "Comparer les images de taille différente";
|
"31.title" = "Comparer les images de tailles différentes";
|
||||||
|
|
||||||
/* Class = "NSButtonCell"; title = "Automatically check for updates"; ObjectID = "32"; */
|
/* Class = "NSButtonCell"; title = "Automatically check for updates"; ObjectID = "32"; */
|
||||||
"32.title" = "Vérifier automatiquement les mises à jour";
|
"32.title" = "Vérifier automatiquement les mises à jour";
|
||||||
|
28
core/app.py
28
core/app.py
@ -18,7 +18,7 @@ from hscommon.reg import RegistrableApplication
|
|||||||
from hscommon.notify import Broadcaster
|
from hscommon.notify import Broadcaster
|
||||||
from hscommon.path import Path
|
from hscommon.path import Path
|
||||||
from hscommon.conflict import smart_move, smart_copy
|
from hscommon.conflict import smart_move, smart_copy
|
||||||
from hscommon.util import delete_if_empty, first, escape
|
from hscommon.util import delete_if_empty, first, escape, nonone
|
||||||
from hscommon.trans import tr
|
from hscommon.trans import tr
|
||||||
|
|
||||||
from . import directories, results, scanner, export, fs
|
from . import directories, results, scanner, export, fs
|
||||||
@ -29,6 +29,8 @@ JOB_MOVE = 'job_move'
|
|||||||
JOB_COPY = 'job_copy'
|
JOB_COPY = 'job_copy'
|
||||||
JOB_DELETE = 'job_delete'
|
JOB_DELETE = 'job_delete'
|
||||||
|
|
||||||
|
HAD_FIRST_LAUNCH_PREFERENCE = 'HadFirstLaunch'
|
||||||
|
|
||||||
class NoScannableFileError(Exception):
|
class NoScannableFileError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -36,6 +38,9 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
|||||||
def __init__(self, data_module, appdata):
|
def __init__(self, data_module, appdata):
|
||||||
RegistrableApplication.__init__(self, appid=1)
|
RegistrableApplication.__init__(self, appid=1)
|
||||||
Broadcaster.__init__(self)
|
Broadcaster.__init__(self)
|
||||||
|
self.is_first_run = not self.get_default(HAD_FIRST_LAUNCH_PREFERENCE, False)
|
||||||
|
if self.is_first_run:
|
||||||
|
self.set_default(HAD_FIRST_LAUNCH_PREFERENCE, True)
|
||||||
self.appdata = appdata
|
self.appdata = appdata
|
||||||
if not op.exists(self.appdata):
|
if not op.exists(self.appdata):
|
||||||
os.makedirs(self.appdata)
|
os.makedirs(self.appdata)
|
||||||
@ -50,6 +55,7 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
|||||||
}
|
}
|
||||||
self.selected_dupes = []
|
self.selected_dupes = []
|
||||||
|
|
||||||
|
#--- Private
|
||||||
def _do_delete(self, j, replace_with_hardlinks):
|
def _do_delete(self, j, replace_with_hardlinks):
|
||||||
def op(dupe):
|
def op(dupe):
|
||||||
j.add_progress()
|
j.add_progress()
|
||||||
@ -129,6 +135,13 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
|||||||
# func(j, *args)
|
# func(j, *args)
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def _get_default(self, key_name, fallback_value=None):
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def _set_default(self, key_name, value):
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
#--- Public
|
||||||
def add_directory(self, d):
|
def add_directory(self, d):
|
||||||
try:
|
try:
|
||||||
self.directories.add_path(Path(d))
|
self.directories.add_path(Path(d))
|
||||||
@ -350,6 +363,19 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
|||||||
def without_ref(self, dupes):
|
def without_ref(self, dupes):
|
||||||
return [dupe for dupe in dupes if self.results.get_group_of_duplicate(dupe).ref is not dupe]
|
return [dupe for dupe in dupes if self.results.get_group_of_duplicate(dupe).ref is not dupe]
|
||||||
|
|
||||||
|
def get_default(self, key, fallback_value=None):
|
||||||
|
result = nonone(self._get_default(key), fallback_value)
|
||||||
|
if fallback_value is not None and not isinstance(result, type(fallback_value)):
|
||||||
|
# we don't want to end up with garbage values from the prefs
|
||||||
|
try:
|
||||||
|
result = type(fallback_value)(result)
|
||||||
|
except Exception:
|
||||||
|
result = fallback_value
|
||||||
|
return result
|
||||||
|
|
||||||
|
def set_default(self, key, value):
|
||||||
|
self._set_default(key, value)
|
||||||
|
|
||||||
#--- Properties
|
#--- Properties
|
||||||
@property
|
@property
|
||||||
def stat_line(self):
|
def stat_line(self):
|
||||||
|
@ -11,7 +11,7 @@ import os.path as op
|
|||||||
|
|
||||||
from jobprogress import job
|
from jobprogress import job
|
||||||
from hscommon import cocoa
|
from hscommon import cocoa
|
||||||
from hscommon.cocoa import install_exception_hook
|
from hscommon.cocoa import install_exception_hook, pythonify
|
||||||
from hscommon.cocoa.objcmin import (NSNotificationCenter, NSUserDefaults,
|
from hscommon.cocoa.objcmin import (NSNotificationCenter, NSUserDefaults,
|
||||||
NSSearchPathForDirectoriesInDomains, NSApplicationSupportDirectory, NSUserDomainMask,
|
NSSearchPathForDirectoriesInDomains, NSApplicationSupportDirectory, NSUserDomainMask,
|
||||||
NSWorkspace)
|
NSWorkspace)
|
||||||
@ -29,7 +29,7 @@ JOBID2TITLE = {
|
|||||||
|
|
||||||
class DupeGuru(app.DupeGuru):
|
class DupeGuru(app.DupeGuru):
|
||||||
def __init__(self, data_module, appdata_subdir):
|
def __init__(self, data_module, appdata_subdir):
|
||||||
LOGGING_LEVEL = logging.DEBUG if NSUserDefaults.standardUserDefaults().boolForKey_('debug') else logging.WARNING
|
LOGGING_LEVEL = logging.DEBUG if self.get_default('debug') else logging.WARNING
|
||||||
logging.basicConfig(level=LOGGING_LEVEL, format='%(levelname)s %(message)s')
|
logging.basicConfig(level=LOGGING_LEVEL, format='%(levelname)s %(message)s')
|
||||||
logging.debug('started in debug mode')
|
logging.debug('started in debug mode')
|
||||||
install_exception_hook()
|
install_exception_hook()
|
||||||
@ -58,7 +58,15 @@ class DupeGuru(app.DupeGuru):
|
|||||||
ud = {'desc': JOBID2TITLE[jobid], 'jobid':jobid}
|
ud = {'desc': JOBID2TITLE[jobid], 'jobid':jobid}
|
||||||
NSNotificationCenter.defaultCenter().postNotificationName_object_userInfo_('JobStarted', self, ud)
|
NSNotificationCenter.defaultCenter().postNotificationName_object_userInfo_('JobStarted', self, ud)
|
||||||
|
|
||||||
#---Public
|
def _get_default(self, key_name):
|
||||||
|
raw = NSUserDefaults.standardUserDefaults().objectForKey_(key_name)
|
||||||
|
result = pythonify(raw)
|
||||||
|
return result
|
||||||
|
|
||||||
|
def _set_default(self, key_name, value):
|
||||||
|
NSUserDefaults.standardUserDefaults().setObject_forKey_(value, key_name)
|
||||||
|
|
||||||
|
#--- Public
|
||||||
def start_scanning(self):
|
def start_scanning(self):
|
||||||
self._select_dupes([])
|
self._select_dupes([])
|
||||||
try:
|
try:
|
||||||
|
@ -18,10 +18,6 @@ from .gui.problem_table import ProblemTable
|
|||||||
from .gui.result_table import ResultTable
|
from .gui.result_table import ResultTable
|
||||||
from .gui.stats_label import StatsLabel
|
from .gui.stats_label import StatsLabel
|
||||||
|
|
||||||
# Fix py2app's problems on relative imports
|
|
||||||
from core import app, app_cocoa, data, directories, engine, export, ignore, results, fs, scanner
|
|
||||||
from hscommon import conflict
|
|
||||||
|
|
||||||
class PyDupeGuruBase(PyFairware):
|
class PyDupeGuruBase(PyFairware):
|
||||||
#---Directories
|
#---Directories
|
||||||
def addDirectory_(self, directory):
|
def addDirectory_(self, directory):
|
||||||
|
@ -32,7 +32,7 @@ Préférences
|
|||||||
|
|
||||||
**Seuil du filtre:** Plus il est élevé, plus les images doivent être similaires pour être considérées comme des doublons. Le défaut de 95% permet quelques petites différence, comme par exemple une différence de qualité ou bien une légère modification des couleurs.
|
**Seuil du filtre:** Plus il est élevé, plus les images doivent être similaires pour être considérées comme des doublons. Le défaut de 95% permet quelques petites différence, comme par exemple une différence de qualité ou bien une légère modification des couleurs.
|
||||||
|
|
||||||
**Comparer les images de taille différente:** Le nom dit tout. Sans cette option, les images de taille différentes ne sont pas comparées.
|
**Comparer les images de tailles différentes:** Le nom dit tout. Sans cette option, les images de tailles différentes ne sont pas comparées.
|
||||||
|
|
||||||
**Comparer les fichiers de différents types:** Sans cette option, seulement les fichiers du même type seront comparés.
|
**Comparer les fichiers de différents types:** Sans cette option, seulement les fichiers du même type seront comparés.
|
||||||
|
|
||||||
|
@ -49,6 +49,8 @@ class DupeGuru(DupeGuruBase, QObject):
|
|||||||
os.makedirs(appdata)
|
os.makedirs(appdata)
|
||||||
# For basicConfig() to work, we have to be sure that no logging has taken place before this call.
|
# For basicConfig() to work, we have to be sure that no logging has taken place before this call.
|
||||||
logging.basicConfig(filename=op.join(appdata, 'debug.log'), level=logging.WARNING)
|
logging.basicConfig(filename=op.join(appdata, 'debug.log'), level=logging.WARNING)
|
||||||
|
self.prefs = self._create_preferences()
|
||||||
|
self.prefs.load()
|
||||||
DupeGuruBase.__init__(self, data_module, appdata)
|
DupeGuruBase.__init__(self, data_module, appdata)
|
||||||
QObject.__init__(self)
|
QObject.__init__(self)
|
||||||
self._setup()
|
self._setup()
|
||||||
@ -56,8 +58,6 @@ class DupeGuru(DupeGuruBase, QObject):
|
|||||||
#--- Private
|
#--- Private
|
||||||
def _setup(self):
|
def _setup(self):
|
||||||
self._setupActions()
|
self._setupActions()
|
||||||
self.prefs = self._create_preferences()
|
|
||||||
self.prefs.load()
|
|
||||||
self._update_options()
|
self._update_options()
|
||||||
self.recentResults = Recent(self, 'recentResults')
|
self.recentResults = Recent(self, 'recentResults')
|
||||||
self.recentResults.mustOpenItem.connect(self.load_from)
|
self.recentResults.mustOpenItem.connect(self.load_from)
|
||||||
@ -147,6 +147,12 @@ class DupeGuru(DupeGuruBase, QObject):
|
|||||||
msg = trmsg("TaskHangingMsg")
|
msg = trmsg("TaskHangingMsg")
|
||||||
QMessageBox.information(self.resultWindow, 'Action in progress', msg)
|
QMessageBox.information(self.resultWindow, 'Action in progress', msg)
|
||||||
|
|
||||||
|
def _get_default(self, key):
|
||||||
|
return self.prefs.get_value(key)
|
||||||
|
|
||||||
|
def _set_default(self, key, value):
|
||||||
|
self.prefs.set_value(key, value)
|
||||||
|
|
||||||
def add_selected_to_ignore_list(self):
|
def add_selected_to_ignore_list(self):
|
||||||
dupes = self.without_ref(self.selected_dupes)
|
dupes = self.without_ref(self.selected_dupes)
|
||||||
if not dupes:
|
if not dupes:
|
||||||
|
@ -512,7 +512,7 @@
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Match scaled pictures together</source>
|
<source>Match scaled pictures together</source>
|
||||||
<translation>Comparer les images de taille différente</translation>
|
<translation>Comparer les images de tailles différentes</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Clear Picture Cache</source>
|
<source>Clear Picture Cache</source>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user