Skip to content

Commit

Permalink
Removed Cocoa's fairware dialogs.
Browse files Browse the repository at this point in the history
... as well as a dangling core fairware notice.
  • Loading branch information
Virgil Dupras committed Mar 24, 2013
1 parent 5f9812e commit f239cfc
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 56 deletions.
8 changes: 4 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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')
Expand Down
22 changes: 0 additions & 22 deletions cocoa/controllers/PMAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import "Utils.h"
#import "HSPyUtil.h"
#import "Dialogs.h"
#import "HSFairwareReminder.h"
#import "ProgressController.h"

@implementation PMAppDelegate
Expand Down Expand Up @@ -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];
Expand Down
8 changes: 4 additions & 4 deletions cocoa/inter/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cocoa/pyplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cocoa/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
24 changes: 0 additions & 24 deletions core/gui/build_pane.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]), 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)
Expand All @@ -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:
Expand Down

0 comments on commit f239cfc

Please sign in to comment.