From 1b855ad64b6cb98141fabe02cfb1c35c0b65fc82 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 26 Sep 2011 11:54:17 -0400 Subject: [PATCH] Adapted to recent fairware changes in hscommon. --- cocoa/base/AppDelegate.h | 3 +++ cocoa/base/AppDelegate.m | 9 +++++++-- cocoa/base/de.lproj/message.strings | 4 ++++ cocoa/base/en.lproj/message.strings | 6 +++++- cocoa/base/fr.lproj/message.strings | 6 +++++- cocoa/base/zh_CN.lproj/message.strings | 6 +++++- cocoa/inter/app.py | 4 ---- core/app.py | 8 ++++---- qt/base/app.py | 11 +++++++++-- 9 files changed, 42 insertions(+), 15 deletions(-) diff --git a/cocoa/base/AppDelegate.h b/cocoa/base/AppDelegate.h index d8062f03..9fc2a93d 100644 --- a/cocoa/base/AppDelegate.h +++ b/cocoa/base/AppDelegate.h @@ -63,4 +63,7 @@ http://www.hardcoded.net/licenses/bsd_license /* model --> view */ - (void)showExtraFairwareReminder; - (void)showMessage:(NSString *)msg; +- (void)setupAsRegistered; +- (void)showFairwareNagWithPrompt:(NSString *)prompt; +- (void)showDemoNagWithPrompt:(NSString *)prompt; @end diff --git a/cocoa/base/AppDelegate.m b/cocoa/base/AppDelegate.m index cd533038..c401c0c9 100644 --- a/cocoa/base/AppDelegate.m +++ b/cocoa/base/AppDelegate.m @@ -233,8 +233,13 @@ http://www.hardcoded.net/licenses/bsd_license // Nothing to do. } -- (void)showFairwareNag +- (void)showFairwareNagWithPrompt:(NSString *)prompt { - [HSFairwareReminder showNagWithApp:[self py]]; + [HSFairwareReminder showFairwareNagWithApp:[self py] prompt:prompt]; +} + +- (void)showDemoNagWithPrompt:(NSString *)prompt +{ + [HSFairwareReminder showDemoNagWithApp:[self py] prompt:prompt]; } @end diff --git a/cocoa/base/de.lproj/message.strings b/cocoa/base/de.lproj/message.strings index de082f00..36f2acd6 100644 --- a/cocoa/base/de.lproj/message.strings +++ b/cocoa/base/de.lproj/message.strings @@ -27,3 +27,7 @@ "IPhotoAppNotFoundMsg" = "The iPhoto application couldn't be found."; "ClearPictureCacheConfirmMsg" = "Möchten Sie wirklich alle zwischengespeicherten Bildanalysen entfernen?"; + +/* hscommon */ +"FairwarePromptMsg" = "{name} ist Fairware, das bedeutet \"Open Source Software, entwickelt in der Hoffnung auf einen fairen Beitrag von den Benutzern\". Viel Zeit wurde in die Software investiert, mit der Erwartung der Nutzer möge fair genug sein die Entwickler für ihren Einsatz zu kompensieren. Die \"Unbezahlte Stunden\" Abbildung zeigt die Anzahl der Stunden die noch nicht bezahlt wurden.\nWenn Sie diese Anwendung mögen, so spenden Sie bitte einen Ihrer Ansicht nach angemessenen Betrag. Danke!\n\nWenn Sie es sich nicht leisten können zu spenden, können Sie diese Erinnerung entweder ignorieren oder mir eine Anfrage an hsoft@hardcoded.net schicken, mit der Bitte für einen Registrierungsschlüssel.\n\nDieser Dialog erscheint nicht, wenn es keine unbezahlten Stunden gibt oder Sie einen gültigen Registrierungsschlüssel besitzen."; +"DemoPromptMsg" = "{name} is fairware, which means \"open source software developed with expectation of fair contributions from users\". It's a very interesting concept, but one year of fairware has shown that most people just want to know how much it costs and not be bothered with theories about intellectual property.\n\nSo I won't bother you and will be very straightforward: You can try {name} for free but you have to buy it in order to use it without limitations. In demo mode, {name} {limitation}.\n\nSo it's as simple as this. If you're curious about fairware, however, I encourage you to read more about it by clicking on the \"Fairware?\" button."; \ No newline at end of file diff --git a/cocoa/base/en.lproj/message.strings b/cocoa/base/en.lproj/message.strings index b42f0bb6..31bea47b 100644 --- a/cocoa/base/en.lproj/message.strings +++ b/cocoa/base/en.lproj/message.strings @@ -26,4 +26,8 @@ "NoDeadTrackMsg" = "You have no dead tracks in your iTunes Library"; "IPhotoAppNotFoundMsg" = "The iPhoto application couldn't be found."; -"ClearPictureCacheConfirmMsg" = "Do you really want to remove all your cached picture analysis?"; \ No newline at end of file +"ClearPictureCacheConfirmMsg" = "Do you really want to remove all your cached picture analysis?"; + +/* hscommon */ +"FairwarePromptMsg" = "{name} is Fairware, which means \"open source software developed with expectation of fair contributions from users\". Hours have been invested in this software with the expectation that users will be fair enough to compensate them. The \"Unpaid hours\" figure you see below is the hours that have yet to be compensated for this project.\n\nIf you like this application, please make a contribution that you consider fair. Thanks!\n\nIf you cannot afford to contribute, you can either ignore this reminder or send an e-mail at support@hardcoded.net so I can send you a registration key.\n\nThis dialog doesn't show when there are no unpaid hours or when you have a valid contribution key."; +"DemoPromptMsg" = "{name} is fairware, which means \"open source software developed with expectation of fair contributions from users\". It's a very interesting concept, but one year of fairware has shown that most people just want to know how much it costs and not be bothered with theories about intellectual property.\n\nSo I won't bother you and will be very straightforward: You can try {name} for free but you have to buy it in order to use it without limitations. In demo mode, {name} {limitation}.\n\nSo it's as simple as this. If you're curious about fairware, however, I encourage you to read more about it by clicking on the \"Fairware?\" button."; \ No newline at end of file diff --git a/cocoa/base/fr.lproj/message.strings b/cocoa/base/fr.lproj/message.strings index b7884644..693e9103 100644 --- a/cocoa/base/fr.lproj/message.strings +++ b/cocoa/base/fr.lproj/message.strings @@ -26,4 +26,8 @@ "NoDeadTrackMsg" = "Votre librairie iTunes ne contient aucune track morte."; "IPhotoAppNotFoundMsg" = "iPhoto n'a pas pu être trouvée dans vos applications."; -"ClearPictureCacheConfirmMsg" = "Voulez-vous vraiment vider la cache de vos analyses précédentes?"; \ No newline at end of file +"ClearPictureCacheConfirmMsg" = "Voulez-vous vraiment vider la cache de vos analyses précédentes?"; + +/* hscommon */ +"FairwarePromptMsg" = "{name} est Fairware, ce qui signifie \"open source développé avec des attentes de contributions justes de la part des utilisateurs\". Les heures investies dans ce programme l'ont été avec l'attente que les utilisateurs seront assez honnêtes pour les compenser. Les \"Heures impayées\" que vous voyez ci-dessous sont le nombre d'heures qui n'ont pas encore été compensées.\n\nSi vous aimez cette application, veuillez faire une contribution qui vous semble juste. Merci!\n\nSi vous n'avez pas les moyens de contribuer, vous pouvez soit ignorer ce message soit envoyer un e-mail à support@hardcoded.net pour avoir une clé d'enregistrement.\n\nCette fenêtre n'apparaît pas lorsque vous avez contribué ou qu'il n'y a aucune heure impayée."; +"DemoPromptMsg" = "{name} is fairware, which means \"open source software developed with expectation of fair contributions from users\". It's a very interesting concept, but one year of fairware has shown that most people just want to know how much it costs and not be bothered with theories about intellectual property.\n\nSo I won't bother you and will be very straightforward: You can try {name} for free but you have to buy it in order to use it without limitations. In demo mode, {name} {limitation}.\n\nSo it's as simple as this. If you're curious about fairware, however, I encourage you to read more about it by clicking on the \"Fairware?\" button."; \ No newline at end of file diff --git a/cocoa/base/zh_CN.lproj/message.strings b/cocoa/base/zh_CN.lproj/message.strings index 73f5308b..b63cd217 100644 --- a/cocoa/base/zh_CN.lproj/message.strings +++ b/cocoa/base/zh_CN.lproj/message.strings @@ -26,4 +26,8 @@ "NoDeadTrackMsg" = "You have no dead tracks in your iTunes Library"; "IPhotoAppNotFoundMsg" = "The iPhoto application couldn't be found."; -"ClearPictureCacheConfirmMsg" = "确定要移除所有缓存图片?"; \ No newline at end of file +"ClearPictureCacheConfirmMsg" = "确定要移除所有缓存图片?"; + +/* hscommon */ +"FairwarePromptMsg" = "{name} 是一款捐助软件,也就是说 \"用户对研发开源软件所花费的时间进行符合用户意愿的捐助\"。用户可以根据研发人员花费在开发软件上的时间进行合理的补偿。用户在下面看到的 \"未支付的时间\" (Unpaid hours)表示需要对该软件进行补偿的时间。\n\n如果您喜欢这款软件,我诚挚的希望您可以进行必要的捐助。谢谢!\n\n如果您无法承担捐助,您也可以忽略此提醒,或者发送电子邮件至 support@hardcoded.net ,我会发送给您一个注册密钥。\n\n当软件没有未支付的时间或您已使用一个有效的注册密钥,此对话框将不会再显示。"; +"DemoPromptMsg" = "{name} is fairware, which means \"open source software developed with expectation of fair contributions from users\". It's a very interesting concept, but one year of fairware has shown that most people just want to know how much it costs and not be bothered with theories about intellectual property.\n\nSo I won't bother you and will be very straightforward: You can try {name} for free but you have to buy it in order to use it without limitations. In demo mode, {name} {limitation}.\n\nSo it's as simple as this. If you're curious about fairware, however, I encourage you to read more about it by clicking on the \"Fairware?\" button."; \ No newline at end of file diff --git a/cocoa/inter/app.py b/cocoa/inter/app.py index faf15509..54eae4d4 100644 --- a/cocoa/inter/app.py +++ b/cocoa/inter/app.py @@ -165,10 +165,6 @@ class PyDupeGuruBase(PyFairware): def jobCompleted_(self, jobid): self.py._job_completed(jobid) - #---Registration - def appName(self): - return self.py.NAME - #--- model --> view def open_path(self, path): NSWorkspace.sharedWorkspace().openFile_(str(path)) diff --git a/core/app.py b/core/app.py index 6d4d190b..5e888591 100644 --- a/core/app.py +++ b/core/app.py @@ -80,7 +80,10 @@ class DupeGuru(RegistrableApplication, Broadcaster): # reveal_path(path) # start_job(jobid, func, args=()) ( func(j, *args) ) # show_extra_fairware_reminder() - # show_message(msg) + + # in fairware prompts, we don't mention the edition, it's too long. + PROMPT_NAME = "dupeGuru" + DEMO_LIMITATION = tr("will only be able to delete, move or copy 10 duplicates at once") def __init__(self, view, appdata): if view.get_default(DEBUG_MODE_PREFERENCE): @@ -88,9 +91,6 @@ class DupeGuru(RegistrableApplication, Broadcaster): logging.debug("Debug mode enabled") RegistrableApplication.__init__(self, view, appid=1) 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 if not op.exists(self.appdata): os.makedirs(self.appdata) diff --git a/qt/base/app.py b/qt/base/app.py index 6ddfca6c..d54d78f0 100644 --- a/qt/base/app.py +++ b/qt/base/app.py @@ -276,9 +276,13 @@ class DupeGuru(QObject): self.about_box.registerButton.hide() self.about_box.registeredEmailLabel.setText(self.model.registration_email) - def show_fairware_nag(self): + def show_fairware_nag(self, prompt): reg = Registration(self.model) - reg.show_nag() + reg.show_fairware_nag(prompt) + + def show_demo_nag(self, prompt): + reg = Registration(self.model) + reg.show_demo_nag(prompt) def show_extra_fairware_reminder(self): dialog = ExtraFairwareReminder(self.directories_dialog, self) @@ -288,3 +292,6 @@ class DupeGuru(QObject): window = QApplication.activeWindow() QMessageBox.information(window, '', msg) + def open_url(self, url): + self.open_path(url) +