From f239cfcd0d9d9fbced9a5bf28b235dbb9418c8ff Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 24 Mar 2013 18:21:23 -0400 Subject: [PATCH] Removed Cocoa's fairware dialogs. ... as well as a dangling core fairware notice. --- build.py | 8 ++++---- cocoa/controllers/PMAppDelegate.m | 22 ---------------------- cocoa/inter/app.py | 8 ++++---- cocoa/pyplugin.py | 2 +- cocoa/wscript | 2 +- core/gui/build_pane.py | 24 ------------------------ 6 files changed, 10 insertions(+), 56 deletions(-) diff --git a/build.py b/build.py index cb7082a..873fb27 100755 --- a/build.py +++ b/build.py @@ -51,7 +51,7 @@ def build_cocoa(dev): filereplace('cocoa/InfoTemplate.plist', 'cocoa/Info.plist', version=app_version) app.create('cocoa/Info.plist') print("Building the cocoa layer") - build_cocoalib_xibless() + build_cocoalib_xibless(withfairware=False) build_xibless() pydep_folder = op.join(app.resources, 'py') if not op.exists(pydep_folder): @@ -104,18 +104,18 @@ def build_cocoa_bridging_interfaces(): add_to_pythonpath('cocoa') add_to_pythonpath('cocoalib') from cocoa.inter import (PyGUIObject, GUIObjectView, PyTable, TableView, PyColumns, - ColumnsView, PyFairware, FairwareView, PyTextField) + ColumnsView, PyBaseApp, BaseAppView, PyTextField) from inter.app import PyPdfMasher, PdfMasherView from inter.build_pane import PyBuildPane from inter.edit_pane import PyEditPane, EditPaneView from inter.element_table import PyElementTable from inter.page_controller import PyPageController, PageControllerView from inter.page_repr import PyPageRepr, PageReprView - allclasses = [PyGUIObject, PyTable, PyColumns, PyFairware, PyTextField, PyPdfMasher, + allclasses = [PyGUIObject, PyTable, PyColumns, PyBaseApp, PyTextField, PyPdfMasher, PyBuildPane, PyEditPane, PyElementTable, PyPageController, PyPageRepr] for class_ in allclasses: objp.o2p.generate_objc_code(class_, 'cocoa/autogen', inherit=True) - allclasses = [GUIObjectView, TableView, ColumnsView, FairwareView, EditPaneView, + allclasses = [GUIObjectView, TableView, ColumnsView, BaseAppView, EditPaneView, PageControllerView, PageReprView, PdfMasherView] clsspecs = [objp.o2p.spec_from_python_class(class_) for class_ in allclasses] objp.p2o.generate_python_proxy_code_from_clsspec(clsspecs, 'build/CocoaViews.m') diff --git a/cocoa/controllers/PMAppDelegate.m b/cocoa/controllers/PMAppDelegate.m index 72d84cc..1a90ea0 100644 --- a/cocoa/controllers/PMAppDelegate.m +++ b/cocoa/controllers/PMAppDelegate.m @@ -10,7 +10,6 @@ #import "Utils.h" #import "HSPyUtil.h" #import "Dialogs.h" -#import "HSFairwareReminder.h" #import "ProgressController.h" @implementation PMAppDelegate @@ -60,33 +59,12 @@ - (void)showAboutBox [[aboutBox window] makeKeyAndOrderFront:nil]; } -/* Delegate */ -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification -{ - [[self model] initialRegistrationSetup]; -} - /* Python --> Cocoa */ -- (void)setupAsRegistered -{ - // Nothing to do. -} - - (void)showMessage:(NSString *)msg { [Dialogs showMessage:msg]; } -- (void)showFairwareNagWithPrompt:(NSString *)prompt -{ - [HSFairwareReminder showFairwareNagWithApp:[self model] prompt:prompt]; -} - -- (void)showDemoNagWithPrompt:(NSString *)prompt -{ - [HSFairwareReminder showDemoNagWithApp:[self model] prompt:prompt]; -} - - (NSString *)queryLoadPathWithPrompt:(NSString *)prompt { NSOpenPanel *op = [NSOpenPanel openPanel]; diff --git a/cocoa/inter/app.py b/cocoa/inter/app.py index 80be4d6..f1501d5 100644 --- a/cocoa/inter/app.py +++ b/cocoa/inter/app.py @@ -11,18 +11,18 @@ from objp.util import pyref, dontwrap import cocoa from cocoa import proxy -from cocoa.inter import PyFairware, FairwareView +from cocoa.inter import PyBaseApp, BaseAppView from jobprogress import job from core.app import JOBID2TITLE from core.app import App -class PdfMasherView(FairwareView): +class PdfMasherView(BaseAppView): def queryLoadPathWithPrompt_(self, prompt: str) -> str: pass def querySavePathWithPrompt_allowedExts_(self, prompt: str, allowedExts: list) -> str: pass -class PyPdfMasher(PyFairware): +class PyPdfMasher(PyBaseApp): FOLLOW_PROTOCOLS = ['Worker'] def __init__(self): @@ -31,7 +31,7 @@ def __init__(self): cocoa.install_cocoa_logger() self.progress = cocoa.ThreadedJobPerformer() model = App(self) - PyFairware.__init__(self, model) + PyBaseApp.__init__(self, model) def elementTable(self) -> pyref: return self.model.element_table diff --git a/cocoa/pyplugin.py b/cocoa/pyplugin.py index 8be0d98..4792a40 100644 --- a/cocoa/pyplugin.py +++ b/cocoa/pyplugin.py @@ -6,7 +6,7 @@ # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/gplv3_license -from cocoa.inter import PyGUIObject, PyTable, PyColumns, PyFairware, PyTextField +from cocoa.inter import PyGUIObject, PyTable, PyColumns, PyBaseApp, PyTextField from inter.app import PyPdfMasher from inter.edit_pane import PyEditPane from inter.build_pane import PyBuildPane diff --git a/cocoa/wscript b/cocoa/wscript index 8b9cfdf..7381e6d 100644 --- a/cocoa/wscript +++ b/cocoa/wscript @@ -37,7 +37,7 @@ def build(ctx): cocoalib_node = ctx.srcnode.find_dir('..').find_dir('cocoalib') cocoalib_folders = ['controllers', 'views'] cocoalib_includes = [cocoalib_node] + [cocoalib_node.find_dir(folder) for folder in cocoalib_folders] - cocoalib_uses = ['HSGeometry', 'Dialogs', 'HSAboutBox', 'HSFairwareReminder', 'NSEventAdditions', + cocoalib_uses = ['HSGeometry', 'Dialogs', 'HSAboutBox', 'NSEventAdditions', 'Utils', 'HSPyUtil', 'ProgressController', 'views/HSTableView', 'controllers/HSColumns', 'controllers/HSGUIController', 'controllers/HSTable', 'controllers/HSTextField'] cocoalib_src = [cocoalib_node.find_node(usename + '.m') for usename in cocoalib_uses] diff --git a/core/gui/build_pane.py b/core/gui/build_pane.py index c489d96..bfedb44 100644 --- a/core/gui/build_pane.py +++ b/core/gui/build_pane.py @@ -22,28 +22,6 @@ class EbookType: MOBI = 1 EPUB = 2 -FAIRWARE_NOTICE = """ -Fairware Notice -=== - -This document was generated with an unregistered version of PdfMasher at a moment when development -hours invested in it were not fully funded. - -Although PdfMasher is open source, it's also [fairware](http://open.hardcoded.net/about/) and -contributions are *expected* when there are development hours to compensate. I'm sorry to have to -nag you like this, but despite high usage of PdfMasher, I can't seem to get adequate funding for it. -I'm not a volunteer, I expect my development time to be paid. Without funding, PdfMasher development -and support will stop. - -If you're just trying PdfMasher to see if it works for you, no problem, go ahead. However, if -PdfMasher is useful to you, please [contribute](http://open.hardcoded.net/contribute/). If you can't -afford to contribute, [let me know](mailto:hsoft@hardcoded.net), I'll send you a key. - -This message doesn't show up when you have a valid contribution key or when there are no development -hours to compensate. - -""" - class BuildPane(GUIObject): #--- model -> view calls: # refresh() (for generation label and post processing buttons) @@ -70,8 +48,6 @@ def _generate_html(self): md_path = self._current_path('txt') with open(md_path, 'rt', encoding='utf-8') as fp: md_contents = fp.read() - if not self.app.registered and self.app.unpaid_hours >= 1: - md_contents = FAIRWARE_NOTICE + md_contents html_body = markdown.markdown(md_contents) dest_path = self._current_path('htm') with open(dest_path, 'wt', encoding='utf-8') as fp: