Removed fairware

This commit is contained in:
Virgil Dupras 2013-11-30 17:54:40 -05:00
parent 42be49da83
commit 01403a3f92
42 changed files with 18 additions and 1465 deletions

View File

@ -264,7 +264,7 @@ def build_cocoa_bridging_interfaces(edition):
add_to_pythonpath('cocoalib')
from cocoa.inter import (PyGUIObject, GUIObjectView, PyColumns, ColumnsView, PyOutline,
OutlineView, PySelectableList, SelectableListView, PyTable, TableView, PyBaseApp,
PyFairware, PyTextField, ProgressWindowView, PyProgressWindow)
PyTextField, ProgressWindowView, PyProgressWindow)
from inter.deletion_options import PyDeletionOptions, DeletionOptionsView
from inter.details_panel import PyDetailsPanel, DetailsPanelView
from inter.directory_outline import PyDirectoryOutline, DirectoryOutlineView
@ -276,7 +276,7 @@ def build_cocoa_bridging_interfaces(edition):
from inter.stats_label import PyStatsLabel, StatsLabelView
from inter.app import PyDupeGuruBase, DupeGuruView
appmod = importlib.import_module('inter.app_{}'.format(edition))
allclasses = [PyGUIObject, PyColumns, PyOutline, PySelectableList, PyTable, PyBaseApp, PyFairware,
allclasses = [PyGUIObject, PyColumns, PyOutline, PySelectableList, PyTable, PyBaseApp,
PyDetailsPanel, PyDirectoryOutline, PyPrioritizeDialog, PyPrioritizeList, PyProblemDialog,
PyIgnoreListDialog, PyDeletionOptions, PyResultTable, PyStatsLabel, PyDupeGuruBase,
PyTextField, PyProgressWindow, appmod.PyDupeGuru]

View File

@ -13,7 +13,7 @@ http://www.hardcoded.net/licenses/bsd_license
#import "DetailsPanel.h"
#import "DirectoryPanel.h"
#import "IgnoreListDialog.h"
#import "HSFairwareAboutBox.h"
#import "HSAboutBox.h"
#import "HSRecentFiles.h"
#import "HSProgressWindow.h"
@ -30,7 +30,7 @@ http://www.hardcoded.net/licenses/bsd_license
IgnoreListDialog *_ignoreListDialog;
HSProgressWindow *_progressWindow;
NSWindowController *_preferencesPanel;
HSFairwareAboutBox *_aboutBox;
HSAboutBox *_aboutBox;
HSRecentFiles *_recentResults;
}
@ -73,6 +73,4 @@ http://www.hardcoded.net/licenses/bsd_license
/* model --> view */
- (void)showMessage:(NSString *)msg;
- (void)setupAsRegistered;
- (void)showDemoNagWithPrompt:(NSString *)prompt;
@end

View File

@ -8,7 +8,6 @@ http://www.hardcoded.net/licenses/bsd_license
#import "AppDelegateBase.h"
#import "ProgressController.h"
#import "HSFairwareReminder.h"
#import "HSPyUtil.h"
#import "Consts.h"
#import "Dialogs.h"
@ -162,7 +161,7 @@ http://www.hardcoded.net/licenses/bsd_license
- (void)showAboutBox
{
if (_aboutBox == nil) {
_aboutBox = [[HSFairwareAboutBox alloc] initWithApp:model];
_aboutBox = [[HSAboutBox alloc] initWithApp:model];
}
[[_aboutBox window] makeKeyAndOrderFront:nil];
}
@ -199,7 +198,6 @@ http://www.hardcoded.net/licenses/bsd_license
/* Delegate */
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[model initialRegistrationSetup];
[model loadSession];
}
@ -261,16 +259,6 @@ http://www.hardcoded.net/licenses/bsd_license
[[self resultWindow] showProblemDialog];
}
- (void)setupAsRegistered
{
// Nothing to do.
}
- (void)showDemoNagWithPrompt:(NSString *)prompt
{
[HSFairwareReminder showDemoNagWithApp:[self model] prompt:prompt];
}
- (NSString *)selectDestFolderWithPrompt:(NSString *)prompt
{
NSOpenPanel *op = [NSOpenPanel openPanel];

View File

@ -2,15 +2,15 @@ import logging
from objp.util import pyref, dontwrap
from cocoa import install_exception_hook, install_cocoa_logger, patch_threaded_job_performer, proxy
from cocoa.inter import PyFairware, FairwareView
from cocoa.inter import PyBaseApp, BaseAppView
class DupeGuruView(FairwareView):
class DupeGuruView(BaseAppView):
def askYesNoWithPrompt_(self, prompt: str) -> bool: pass
def showProblemDialog(self): pass
def selectDestFolderWithPrompt_(self, prompt: str) -> str: pass
def selectDestFileWithPrompt_extension_(self, prompt: str, extension: str) -> str: pass
class PyDupeGuruBase(PyFairware):
class PyDupeGuruBase(PyBaseApp):
@dontwrap
def _init(self, modelclass):
logging.basicConfig(level=logging.WARNING, format='%(levelname)s %(message)s')

View File

@ -44,7 +44,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 = ['NSEventAdditions', 'Dialogs', 'HSFairwareAboutBox', 'HSFairwareReminder', 'Utils',
cocoalib_uses = ['NSEventAdditions', 'Dialogs', 'HSAboutBox', 'Utils',
'HSPyUtil', 'ProgressController', 'HSRecentFiles', 'HSQuicklook', 'ValueTransformers',
'NSImageAdditions', 'NSNotificationAdditions',
'views/HSTableView', 'views/HSOutlineView', 'views/NSIndexPathAdditions',

View File

@ -14,8 +14,6 @@ http://www.hardcoded.net/licenses/bsd_license
NSTextField *titleTextField;
NSTextField *versionTextField;
NSTextField *copyrightTextField;
NSTextField *registeredTextField;
NSButton *registerButton;
PyBaseApp *app;
}

View File

@ -1,19 +0,0 @@
/*
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
This software is licensed under the "BSD" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
http://www.hardcoded.net/licenses/bsd_license
*/
#import <Cocoa/Cocoa.h>
#import "HSFairwareProtocol.h"
@interface HSFairware : NSObject <HSFairwareProtocol>
{
NSInteger appId;
NSString *name;
BOOL registered;
}
- (id)initWithAppId:(NSInteger)aAppId name:(NSString *)aName;
@end

View File

@ -1,150 +0,0 @@
/*
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
This software is licensed under the "BSD" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
http://www.hardcoded.net/licenses/bsd_license
*/
#import "HSFairware.h"
#import <CommonCrypto/CommonDigest.h>
#import "HSFairwareReminder.h"
#import "Dialogs.h"
#import "Utils.h"
NSString* md5str(NSString *source)
{
const char *cSource = [source UTF8String];
unsigned char result[16];
CC_MD5(cSource, strlen(cSource), result);
return fmt(@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7],
result[8], result[9], result[10], result[11], result[12], result[13], result[14], result[15]
);
}
BOOL validateCode(NSString *code, NSString *email, NSInteger appId)
{
if ([code length] != 32) {
return NO;
}
NSInteger i;
for (i=0; i<=100; i++) {
NSString *blob = fmt(@"%i%@%iaybabtu", appId, email, i);
if ([md5str(blob) isEqualTo:code]) {
return YES;
}
}
return NO;
}
NSString* normalizeString(NSString *str)
{
return [[str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] lowercaseString];
}
@implementation HSFairware
- (id)initWithAppId:(NSInteger)aAppId name:(NSString *)aName;
{
self = [super init];
appId = aAppId;
name = [aName retain];
registered = NO;
return self;
}
- (void)dealloc
{
[name release];
[super dealloc];
}
/* Private */
- (void)setRegistrationCode:(NSString *)aCode email:(NSString *)aEmail
{
registered = validateCode(aCode, aEmail, appId);
}
/* Public */
- (void)initialRegistrationSetup
{
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
NSString *code = [ud stringForKey:@"RegistrationCode"];
NSString *email = [ud stringForKey:@"RegistrationEmail"];
if (code && email) {
[self setRegistrationCode:code email:email];
}
if (!registered) {
BOOL fairwareMode = [ud boolForKey:@"FairwareMode"];
if (!fairwareMode) {
NSString *prompt = @"%@ 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\n"
"So I won't bother you and will be very straightforward: You can try %@ for "
"free but you have to buy it in order to use it without limitations. In demo mode, "
"%@ will show this dialog on startup."
"\n\n"
"So 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.";
[HSFairwareReminder showDemoNagWithApp:self prompt:fmt(prompt, name, name, name)];
}
}
}
- (NSString *)appName
{
return name;
}
- (NSString *)appLongName
{
return name;
}
- (BOOL)isRegistered
{
return registered;
}
- (BOOL)setRegisteredCode:(NSString *)code andEmail:(NSString *)email
{
code = normalizeString(code);
email = normalizeString(email);
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
if (([code isEqualTo:@"fairware"]) || ([email isEqualTo:@"fairware"])) {
[ud setBool:YES forKey:@"FairwareMode"];
[Dialogs showMessage:@"Fairware mode enabled."];
return YES;
}
[self setRegistrationCode:code email:email];
if (registered) {
[ud setObject:code forKey:@"RegistrationCode"];
[ud setObject:email forKey:@"RegistrationEmail"];
[Dialogs showMessage:@"Your code is valid, thanks!"];
return YES;
}
else {
[Dialogs showMessage:@"Your code is invalid. Make sure that you wrote the good code. Also "
"make sure that the e-mail you gave is the same as the e-mail you used for your purchase."];
return NO;
}
}
- (void)contribute
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://open.hardcoded.net/contribute/"]];
}
- (void)buy
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.hardcoded.net/purchase.htm"]];
}
- (void)aboutFairware
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://open.hardcoded.net/about/"]];
}
@end

View File

@ -1,33 +0,0 @@
/*
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
This software is licensed under the "BSD" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
http://www.hardcoded.net/licenses/bsd_license
*/
#import <Cocoa/Cocoa.h>
#import "PyFairware.h"
@interface HSFairwareAboutBox : NSWindowController
{
NSTextField *titleTextField;
NSTextField *versionTextField;
NSTextField *copyrightTextField;
NSTextField *registeredTextField;
NSButton *registerButton;
PyFairware *app;
}
@property (readwrite, retain) NSTextField *titleTextField;
@property (readwrite, retain) NSTextField *versionTextField;
@property (readwrite, retain) NSTextField *copyrightTextField;
@property (readwrite, retain) NSTextField *registeredTextField;
@property (readwrite, retain) NSButton *registerButton;
- (id)initWithApp:(PyFairware *)app;
- (void)updateFields;
- (void)showRegisterDialog;
@end

View File

@ -1,60 +0,0 @@
/*
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
This software is licensed under the "BSD" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
http://www.hardcoded.net/licenses/bsd_license
*/
#import "HSFairwareAboutBox.h"
#import "HSFairwareAboutBox_UI.h"
#import "HSFairwareReminder.h"
@implementation HSFairwareAboutBox
@synthesize titleTextField;
@synthesize versionTextField;
@synthesize copyrightTextField;
@synthesize registeredTextField;
@synthesize registerButton;
- (id)initWithApp:(PyFairware *)aApp
{
self = [super initWithWindow:nil];
[self setWindow:createHSFairwareAboutBox_UI(self)];
app = [aApp retain];
[self updateFields];
return self;
}
- (void)dealloc
{
[app release];
[super dealloc];
}
- (void)updateFields
{
[titleTextField setStringValue:[app appLongName]];
NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
[versionTextField setStringValue:[NSString stringWithFormat:@"Version: %@",version]];
NSString *copyright = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSHumanReadableCopyright"];
[copyrightTextField setStringValue:copyright];
if ([app isRegistered]) {
[registeredTextField setHidden:NO];
[registerButton setHidden:YES];
}
else {
[registeredTextField setHidden:YES];
[registerButton setHidden:NO];
}
}
- (void)showRegisterDialog
{
HSFairwareReminder *fr = [[HSFairwareReminder alloc] initWithApp:app];
[fr enterCode];
[fr release];
[self updateFields];
}
@end

View File

@ -1,20 +0,0 @@
/*
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
This software is licensed under the "BSD" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
http://www.hardcoded.net/licenses/bsd_license
*/
#import <Cocoa/Cocoa.h>
@protocol HSFairwareProtocol
- (void)initialRegistrationSetup;
- (NSString *)appName;
- (NSString *)appLongName;
- (BOOL)isRegistered;
- (BOOL)setRegisteredCode:(NSString *)code andEmail:(NSString *)email;
- (void)contribute;
- (void)buy;
- (void)aboutFairware;
@end

View File

@ -1,46 +0,0 @@
/*
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
This software is licensed under the "BSD" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
http://www.hardcoded.net/licenses/bsd_license
*/
#import <Cocoa/Cocoa.h>
#import "HSFairwareProtocol.h"
@interface HSFairwareReminder : NSObject
{
NSWindow *codePanel;
NSTextField *codePromptTextField;
NSTextField *codeTextField;
NSTextField *emailTextField;
NSWindow *demoNagPanel;
NSTextField *demoPromptTextField;
id <HSFairwareProtocol> app;
}
@property (readwrite, retain) NSWindow *codePanel;
@property (readwrite, retain) NSTextField *codePromptTextField;
@property (readwrite, retain) NSTextField *codeTextField;
@property (readwrite, retain) NSTextField *emailTextField;
@property (readwrite, retain) NSWindow *demoNagPanel;
@property (readwrite, retain) NSTextField *demoPromptTextField;
//Show nag only if needed
+ (BOOL)showDemoNagWithApp:(id <HSFairwareProtocol>)app prompt:(NSString *)prompt;
- (id)initWithApp:(id <HSFairwareProtocol>)app;
- (void)contribute;
- (void)buy;
- (void)moreInfo;
- (void)cancelCode;
- (void)showEnterCode;
- (void)submitCode;
- (void)closeDialog;
- (BOOL)showNagPanel:(NSWindow *)panel; //YES: The code has been sucessfully submitted NO: The use wan't to try the demo.
- (BOOL)showDemoNagPanelWithPrompt:(NSString *)prompt;
- (NSInteger)enterCode; //returns the modal code.
@end

View File

@ -1,115 +0,0 @@
/*
Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
This software is licensed under the "BSD" License as described in the "LICENSE" file,
which should be included with this package. The terms are also available at
http://www.hardcoded.net/licenses/bsd_license
*/
#import "HSFairwareReminder.h"
#import "HSDemoReminder_UI.h"
#import "HSEnterCode_UI.h"
#import "Dialogs.h"
#import "Utils.h"
@implementation HSFairwareReminder
@synthesize codePanel;
@synthesize codePromptTextField;
@synthesize codeTextField;
@synthesize emailTextField;
@synthesize demoNagPanel;
@synthesize demoPromptTextField;
+ (BOOL)showDemoNagWithApp:(id <HSFairwareProtocol>)app prompt:(NSString *)prompt
{
HSFairwareReminder *fr = [[HSFairwareReminder alloc] initWithApp:app];
BOOL r = [fr showDemoNagPanelWithPrompt:prompt];
[fr release];
return r;
}
- (id)initWithApp:(id <HSFairwareProtocol>)aApp
{
self = [super init];
app = aApp;
[self setDemoNagPanel:createHSDemoReminder_UI(self)];
[self setCodePanel:createHSEnterCode_UI(self)];
[codePanel update];
[codePromptTextField setStringValue:fmt([codePromptTextField stringValue],[app appName])];
return self;
}
- (void)contribute
{
[app contribute];
}
- (void)buy
{
[app buy];
}
- (void)moreInfo
{
[app aboutFairware];
}
- (void)cancelCode
{
[codePanel close];
[NSApp stopModalWithCode:NSCancelButton];
}
- (void)showEnterCode
{
[demoNagPanel close];
[NSApp stopModalWithCode:NSOKButton];
}
- (void)submitCode
{
NSString *code = [codeTextField stringValue];
NSString *email = [emailTextField stringValue];
if ([app setRegisteredCode:code andEmail:email]) {
[codePanel close];
[NSApp stopModalWithCode:NSOKButton];
}
}
- (void)closeDialog
{
[demoNagPanel close];
[NSApp stopModalWithCode:NSCancelButton];
}
- (BOOL)showNagPanel:(NSWindow *)panel;
{
NSInteger r;
while (YES) {
r = [NSApp runModalForWindow:panel];
if (r == NSOKButton) {
r = [self enterCode];
if (r == NSOKButton) {
return YES;
}
}
else {
return NO;
}
}
}
- (BOOL)showDemoNagPanelWithPrompt:(NSString *)prompt
{
[demoNagPanel setTitle:fmt([demoNagPanel title],[app appName])];
[demoPromptTextField setStringValue:prompt];
return [self showNagPanel:demoNagPanel];
}
- (NSInteger)enterCode
{
return [NSApp runModalForWindow:codePanel];
}
@end

View File

@ -302,37 +302,3 @@ class PyBaseApp(PyGUIObject):
def show_message(self, msg):
self.callback.showMessage_(msg)
class FairwareView(BaseAppView):
def setupAsRegistered(self): pass
def showDemoNagWithPrompt_(self, prompt: str): pass
class PyFairware(PyBaseApp):
FOLLOW_PROTOCOLS = ['HSFairwareProtocol']
def initialRegistrationSetup(self):
self.model.initial_registration_setup()
def isRegistered(self) -> bool:
return self.model.registered
def setRegisteredCode_andEmail_(self, code: str, email: str) -> bool:
return self.model.set_registration(code, email, False)
def contribute(self):
self.model.contribute()
def buy(self):
self.model.buy()
def aboutFairware(self):
self.model.about_fairware()
#--- Python --> Cocoa
@dontwrap
def setup_as_registered(self):
self.callback.setupAsRegistered()
@dontwrap
def show_demo_nag(self, prompt):
self.callback.showDemoNagWithPrompt_(prompt)

View File

@ -1,32 +0,0 @@
ownerclass = 'HSFairwareReminder'
ownerimport = 'HSFairwareReminder.h'
result = Window(528, 253, "%@ is Fairware")
result.canClose = False
result.canResize = False
result.canMinimize = False
demoPromptLabel = Label(result, NLSTR("<demo prompt>"))
tryButton = Button(result, "Try")
enterKeyButton = Button(result, "Enter Key")
buyButton = Button(result, "Buy")
fairwareButton = Button(result, "Fairware?")
owner.demoPromptTextField = demoPromptLabel
result.initialFirstResponder = tryButton
demoPromptLabel.font = Font(FontFamily.Label, FontSize.SmallControl)
tryButton.action = Action(owner, 'closeDialog')
tryButton.keyEquivalent = "\\r"
enterKeyButton.action = Action(owner, 'showEnterCode')
buyButton.action = Action(owner, 'buy')
fairwareButton.action = Action(owner, 'moreInfo')
for button in (tryButton, enterKeyButton, buyButton, fairwareButton):
button.width = 113
demoPromptLabel.height = 185
demoPromptLabel.packToCorner(Pack.UpperLeft)
demoPromptLabel.fill(Pack.Right)
tryButton.packRelativeTo(demoPromptLabel, Pack.Below, Pack.Left)
enterKeyButton.packRelativeTo(tryButton, Pack.Right, Pack.Middle)
buyButton.packRelativeTo(enterKeyButton, Pack.Right, Pack.Middle)
fairwareButton.packRelativeTo(buyButton, Pack.Right, Pack.Middle)

View File

@ -1,52 +0,0 @@
ownerclass = 'HSFairwareReminder'
ownerimport = 'HSFairwareReminder.h'
result = Window(450, 185, "Enter Key")
result.canClose = False
result.canResize = False
result.canMinimize = False
titleLabel = Label(result, "Enter your key")
promptLabel = Label(result, "Type the key you received when you contributed to %@, as well as the e-mail used as a reference for the purchase.")
regkeyLabel = Label(result, "Registration key:")
regkeyField = TextField(result, "")
regemailLabel = Label(result, "Registration e-mail:")
regemailField = TextField(result, "")
contributeButton = Button(result, "Contribute")
cancelButton = Button(result, "Cancel")
submitButton = Button(result, "Submit")
owner.codePromptTextField = promptLabel
owner.codeTextField = regkeyField
owner.emailTextField = regemailField
result.initialFirstResponder = regkeyField
titleLabel.font = Font(FontFamily.Label, FontSize.RegularControl, traits=[FontTrait.Bold])
smallerFont = Font(FontFamily.Label, FontSize.SmallControl)
for control in (promptLabel, regkeyLabel, regemailLabel):
control.font = smallerFont
regkeyField.usesSingleLineMode = regemailField.usesSingleLineMode = True
contributeButton.action = Action(owner, 'contribute')
cancelButton.action = Action(owner, 'cancelCode')
cancelButton.keyEquivalent = "\\E"
submitButton.action = Action(owner, 'submitCode')
submitButton.keyEquivalent = "\\r"
for button in (contributeButton, cancelButton, submitButton):
button.width = 100
regkeyLabel.width = 128
regemailLabel.width = 128
promptLabel.height = 32
titleLabel.packToCorner(Pack.UpperLeft)
titleLabel.fill(Pack.Right)
promptLabel.packRelativeTo(titleLabel, Pack.Below, Pack.Left)
promptLabel.fill(Pack.Right)
regkeyField.packRelativeTo(promptLabel, Pack.Below, Pack.Right)
regkeyLabel.packRelativeTo(regkeyField, Pack.Left, Pack.Middle)
regkeyField.fill(Pack.Left)
regemailField.packRelativeTo(regkeyField, Pack.Below, Pack.Right)
regemailLabel.packRelativeTo(regemailField, Pack.Left, Pack.Middle)
regemailField.fill(Pack.Left)
contributeButton.packRelativeTo(regemailLabel, Pack.Below, Pack.Left)
submitButton.packRelativeTo(regemailField, Pack.Below, Pack.Right)
cancelButton.packRelativeTo(submitButton, Pack.Left, Pack.Middle)

View File

@ -1,46 +0,0 @@
ownerclass = 'HSFairwareAboutBox'
ownerimport = 'HSFairwareAboutBox.h'
result = Window(259, 217, "")
result.canResize = False
result.canMinimize = False
image = ImageView(result, "NSApplicationIcon")
titleLabel = Label(result, NLSTR("AppTitle"))
versionLabel = Label(result, NLSTR("AppVersion"))
copyrightLabel = Label(result, NLSTR("AppCopyright"))
registeredLabel = Label(result, "This app is registered, thanks!")
registerButton = Button(result, "Register")
owner.window = result
owner.titleTextField = titleLabel
owner.versionTextField = versionLabel
owner.copyrightTextField = copyrightLabel
owner.registeredTextField = registeredLabel
owner.registerButton = registerButton
for label in (titleLabel, versionLabel, copyrightLabel, registeredLabel):
label.alignment = const.NSCenterTextAlignment
titleLabel.font = Font(FontFamily.Label, FontSize.RegularControl, traits=[FontTrait.Bold])
for label in (versionLabel, copyrightLabel, registeredLabel):
label.font = Font(FontFamily.Label, FontSize.SmallControl)
label.height = 14
registerButton.bezelStyle = const.NSRoundRectBezelStyle
registerButton.action = Action(owner, 'showRegisterDialog')
image.height = 96
image.packToCorner(Pack.UpperLeft)
image.y = result.height - 10 - image.height
image.fill(Pack.Right)
image.setAnchor(Pack.UpperLeft, growX=True)
titleLabel.packRelativeTo(image, Pack.Below, Pack.Left)
titleLabel.fill(Pack.Right)
titleLabel.setAnchor(Pack.UpperLeft, growX=True)
versionLabel.packRelativeTo(titleLabel, Pack.Below, Pack.Left)
versionLabel.fill(Pack.Right)
versionLabel.setAnchor(Pack.UpperLeft, growX=True)
copyrightLabel.packRelativeTo(versionLabel, Pack.Below, Pack.Left)
copyrightLabel.fill(Pack.Right)
copyrightLabel.setAnchor(Pack.UpperLeft, growX=True)
registeredLabel.packRelativeTo(copyrightLabel, Pack.Below, Pack.Left)
registeredLabel.fill(Pack.Right)
registeredLabel.setAnchor(Pack.UpperLeft, growX=True)
registerButton.packRelativeTo(copyrightLabel, Pack.Below, Pack.Middle)

View File

@ -16,7 +16,6 @@ import shutil
from send2trash import send2trash
from jobprogress import job
from hscommon.reg import RegistrableApplication
from hscommon.notify import Broadcaster
from hscommon.path import Path
from hscommon.conflict import smart_move, smart_copy
@ -112,7 +111,7 @@ def fix_surrogate_encoding(s, encoding='utf-8'):
else:
return s
class DupeGuru(RegistrableApplication, Broadcaster):
class DupeGuru(Broadcaster):
"""Holds everything together.
Instantiated once per running application, it holds a reference to every high-level object
@ -144,6 +143,10 @@ class DupeGuru(RegistrableApplication, Broadcaster):
Instance of :mod:`meta-gui <core.gui>` table listing the results from :attr:`results`
"""
#--- View interface
# get_default(key_name)
# set_default(key_name, value)
# show_message(msg)
# open_url(url)
# open_path(path)
# reveal_path(path)
# ask_yes_no(prompt) --> bool
@ -154,14 +157,13 @@ class DupeGuru(RegistrableApplication, Broadcaster):
# 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):
logging.getLogger().setLevel(logging.DEBUG)
logging.debug("Debug mode enabled")
RegistrableApplication.__init__(self, view, appid=1)
Broadcaster.__init__(self)
self.view = view
self.appdata = appdata
if not op.exists(self.appdata):
os.makedirs(self.appdata)
@ -337,13 +339,6 @@ class DupeGuru(RegistrableApplication, Broadcaster):
self.selected_dupes = dupes
self.notify('dupes_selected')
def _check_demo(self):
if self.should_apply_demo_limitation and self.results.mark_count > 10:
msg = tr("You cannot delete, move or copy more than 10 duplicates at once in demo mode.")
self.view.show_message(msg)
return False
return True
#--- Public
def add_directory(self, d):
"""Adds folder ``d`` to :attr:`directories`.
@ -430,8 +425,6 @@ class DupeGuru(RegistrableApplication, Broadcaster):
j.start_job(self.results.mark_count)
self.results.perform_on_marked(op, not copy)
if not self._check_demo():
return
if not self.results.mark_count:
self.view.show_message(MSG_NO_MARKED_DUPES)
return
@ -446,8 +439,6 @@ class DupeGuru(RegistrableApplication, Broadcaster):
def delete_marked(self):
"""Start an async job to send marked duplicates to the trash.
"""
if not self._check_demo():
return
if not self.results.mark_count:
self.view.show_message(MSG_NO_MARKED_DUPES)
return

View File

@ -364,23 +364,14 @@ class OSXFrameworkStructure:
action(op.abspath(path), header_dest)
def build_cocoalib_xibless(dest='cocoa/autogen', withfairware=True):
def build_cocoalib_xibless(dest='cocoa/autogen'):
import xibless
ensure_folder(dest)
FNPAIRS = [
('progress.py', 'ProgressController_UI'),
('error_report.py', 'HSErrorReportWindow_UI'),
('about.py', 'HSAboutBox_UI'),
]
if withfairware:
FNPAIRS += [
('fairware_about.py', 'HSFairwareAboutBox_UI'),
('demo_reminder.py', 'HSDemoReminder_UI'),
('enter_code.py', 'HSEnterCode_UI'),
]
else:
FNPAIRS += [
('about.py', 'HSAboutBox_UI'),
]
for srcname, dstname in FNPAIRS:
srcpath = op.join('cocoalib', 'ui', srcname)
dstpath = op.join(dest, dstname)

View File

@ -1,24 +0,0 @@
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: hscommon\n"
"PO-Revision-Date: 2013-04-28 18:29+0000\n"
"Last-Translator: hsoft <hsoft@hardcoded.net>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: utf-8\n"
"Language: cs\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
#: hscommon/reg.py:32
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""
"{name} je fairware, což znamená \"open source software vyvíjený v očekávání poctivých příspěvků od uživatelů\". Jde o velmi zajímavý nápad, a po roce se ukazuje, že většina lidí se zajímá o cenu vývoje, ale jsou jim ukradené povídačky o duševním vlastnictví.\n"
"\n"
"Takže vás nebudu otravovat a řeknu to bez okolků: {name} si můžete zdarma vyzkoušet, ale pokud ho chcete používat bez omezení, musíte si ho koupit. V demo režimu, {name} {limitation}.\n"
"\n"
"A to je celé. Pokud se o fairware chcete dozvědět více, klepněte na tlačítko \"Fairware?\"."

View File

@ -1,31 +0,0 @@
#
msgid ""
msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: utf-8\n"
#: hscommon/reg.py:39
msgid ""
"{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"
"\n"
"If you like this application, please make a contribution that you consider fair. Thanks!\n"
"\n"
"If 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"
"\n"
"This dialog doesn't show when there are no unpaid hours or when you have a valid contribution key."
msgstr ""
"{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.\n"
"Wenn Sie diese Anwendung mögen, so spenden Sie bitte einen Ihrer Ansicht nach angemessenen Betrag. Danke!\n"
"\n"
"Wenn 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"
"\n"
"Dieser Dialog erscheint nicht, wenn es keine unbezahlten Stunden gibt oder Sie einen gültigen Registrierungsschlüssel besitzen."
#: hscommon/reg.py:51
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""

View File

@ -1,24 +0,0 @@
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: hscommon\n"
"PO-Revision-Date: 2013-04-28 18:29+0000\n"
"Last-Translator: hsoft <hsoft@hardcoded.net>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: utf-8\n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: hscommon/reg.py:32
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""
"{name} es Fairware, es decir \"software de código abierto desarrollado con la expectativa de recibir una retribución justa por parte de los usuarios\". Es una idea muy interesante, aunque tras más de un año de uso es evidente que la mayoría de los usuarios sólo están interesados en el precio del producto y no en teorías sobre la propiedad intelectual.\n"
"\n"
"Así pues seré claro: puede probar {name} gratuitamente pero debe comprarlo para un uso completo sin limitaciones. En el modo de prueba, {name} {limitation}.\n"
"\n"
"En resumen, si tiene curiosidad por conocer fairware le animo a que lea sobre ello pulsando el botón de \"¿Fairware?\"."

View File

@ -1,24 +0,0 @@
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: hscommon\n"
"PO-Revision-Date: 2013-04-28 18:29+0000\n"
"Last-Translator: hsoft <hsoft@hardcoded.net>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: utf-8\n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: hscommon/reg.py:32
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""
"{name} est Fairware, ce qui signifie \"open source développé avec des attentes de contributions justes de la part des utilisateurs\". C'est un concept excessivement intéressant, mais un an de fairware a révélé que la plupart des gens ne sont que peu intéressés à des discours sur la propriété intellectuelle et veulent simplement savoir combien ça coûte.\n"
"\n"
"Donc, je serai bref et direct: Vous pouvez essayer {name} gratuitement, mais un achat est requis pour un usage sans limitation. En mode démo, {name} {limitation}.\n"
"\n"
"C'est aussi simple que ça. Par contre, si vous êtes curieux, je vous encourage à cliquer sur le bouton \"Fairware?\" pour en savoir plus."

View File

@ -1,15 +0,0 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: utf-8\n"
#: hscommon/reg.py:32
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""

View File

@ -1,24 +0,0 @@
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: hscommon\n"
"PO-Revision-Date: 2013-04-28 18:29+0000\n"
"Last-Translator: hsoft <hsoft@hardcoded.net>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: utf-8\n"
"Language: hy\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: hscommon/reg.py:32
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""
"{name}-ը fairware է, ինչը նշանակում է \"ազատ կոդով ծրագիր, որը զարգացվում է՝ ակնկալելով օգտվողների աջակցությունը\": Սա շատ հետաքրքիր սկզբունք է, սակայն մեկ տարվա fairware-ի արդյունքը ցույց է տալիս, որ շատ մարդիկ պարզապես ցանկանում են իմանալ, թե այն ինչ արժե, բայց չեն մտահոգվում ինտելեկտուալ սեփականության մասին:\n"
"\n"
"Ուստի ես չեմ ցանկանում խանգարել Ձեզ և կլինեմ շատ պարզ. Կարող եք փորձել {name}-ը ազատորեն, բայց պետք է գնեք ծրագիրը՝ հանելու համար բոլոր սահմանափակումները: Փորձնական եղանակում {name} {limitation}:\n"
"\n"
"Ամեն ինչ պարզ է, եթե Ձեզ հետաքրքիր է fairware-ը, ապա կարող եք մանրամասն կարդաք՝ սեղմելով այս հղմանը՝ \"Fairware է՞\":"

View File

@ -1,24 +0,0 @@
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: hscommon\n"
"PO-Revision-Date: 2013-04-28 18:29+0000\n"
"Last-Translator: hsoft <hsoft@hardcoded.net>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: utf-8\n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: hscommon/reg.py:32
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""
"{name} è denominato \"Fairware\", che significa \"software 'open source' sviluppato aspettandosi un contributo equo e corretto da parte degli utilizzatori\". E' un concetto molto interessante, ma un anno di 'fairware' ha dimostrato che la maggior parte della gente vuole solo sapere 'quanto costa' e non essere scocciata con delle teorie sulla proprietà intellettuale.\n"
"\n"
"Così non vi disturberò oltre e sarò diretto: potete provare {name} gratuitamente ma dovrete acquistarlo per usarlo senza limitazioni. In modalità 'demo', {name} {limitation}.\n"
"\n"
"In questo modo è semplice. Se siete curiosi e volete approfondire il concetto di 'fairware', vi invito a leggere di più sull'argomento cliccando sul pulsante \"Fairware?\"."

View File

@ -1,24 +0,0 @@
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: hscommon\n"
"PO-Revision-Date: 2013-04-28 18:29+0000\n"
"Last-Translator: hsoft <hsoft@hardcoded.net>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: utf-8\n"
"Language: nl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: hscommon/reg.py:32
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""
"{name} is Fairware, dit betekent \"open source software ontwikkeld in de hoop op een redelijke bijdrage van gebruikers\". Het is een interessant concept, maar na een jaar fairware is gebleken dat de meeste mensen gewoon willen weten wat het kost en niet lastig gevallen willen worden met theorieën over intellectueel eigendom.\n"
"\n"
"Ik zal u dus niet lastig vallen en duidelijk zijn: U kunt {name} gratis proberen, maar moet het kopen om het zonder beperkingen te kunnen gebruiken. In demo mode {name} {limitation}.\n"
"\n"
"Het is dus eigenlijk heel simpel. Als u toch geïnteresseerd bent in fairware, raad ik u aan hier meer over te lezen door op de knop \"Fairware?\" te klikken."

View File

@ -1,24 +0,0 @@
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: hscommon\n"
"PO-Revision-Date: 2013-04-28 18:29+0000\n"
"Last-Translator: hsoft <hsoft@hardcoded.net>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: utf-8\n"
"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: hscommon/reg.py:32
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""
"{name} é fairware, o que quer dizer \"software de código aberto desenvolvido sob a expectativa de contribuição justa de seus usuários\". É um conceito muito interessante, mas um ano de fairware mostrou que a maioria das pessoas só deseja saber quanto o software custa, sem ser incomodada com teorias sobre propriedade intelectual.\n"
"\n"
"Portanto não o incomodarei e serei bem direto: você pode testar {name} de graça, mas deverá comprá-lo para usá-lo sem limitações. Em modo demo, {name} {limitation}.\n"
"\n"
"É simples assim. Caso você tenha curiosidade sobre fairware, recomendo que leia mais sobre o assunto clicando o botão \"Fairware?\"."

View File

@ -1,24 +0,0 @@
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: hscommon\n"
"PO-Revision-Date: 2013-04-28 18:29+0000\n"
"Last-Translator: hsoft <hsoft@hardcoded.net>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: utf-8\n"
"Language: ru\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: hscommon/reg.py:32
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""
"{name} является fairware, что означает \"программное обеспечение с открытым исходным кодом, с ожиданием справедливого вклада от пользователей\". Это очень интересная концепция, но один год fairware показал, что большинство людей просто хотят знать, сколько это стоит, а не возиться с теориями об интеллектуальной собственности.\n"
"\n"
"Так что, я не буду утомлять вас и буду очень краток: вы можете попробовать {name} бесплатно, но вам придётся купить её, чтобы использовать без ограничений. В демо-режиме {name} {limitation}.\n"
"\n"
"То есть, это просто. Если вам интересно, о fairware вы можете больше узнать нажав на кнопку \"Fairware?\"."

View File

@ -1,24 +0,0 @@
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: hscommon\n"
"PO-Revision-Date: 2013-04-28 18:29+0000\n"
"Last-Translator: hsoft <hsoft@hardcoded.net>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: utf-8\n"
"Language: uk\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: hscommon/reg.py:32
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""
"{name} є fairware, що означає \"програмне забезпечення з відкритим вихідним кодом, з очікуванням справедливого вкладу від користувачів\". Це дуже цікава концепція, але один рік fairware показав, що більшість людей просто хочуть знати, скільки це коштує, а не возитися з теоріями про інтелектуальну власність.\n"
"\n"
"Тож я не буду втомлювати Вас і поясню просто: Ви можете спробувати {name} безкоштовно, але Вам доведеться купити його, щоб використовувати її без обмежень. У демо-режимі, {name} {limitation}.\n"
"\n"
"Ось так це просто. Якщо Вас цікавить ідея fairware, то я запрошую Вас дізнатися більше про це, натиснувши на кнопку \"Fairware?\"."

View File

@ -1,20 +0,0 @@
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: hscommon\n"
"PO-Revision-Date: 2013-07-05 11:23+0000\n"
"Last-Translator: hsoft <hsoft@hardcoded.net>\n"
"Language-Team: Vietnamese (http://www.transifex.com/projects/p/hscommon/language/vi/)\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: utf-8\n"
"Language: vi\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: hscommon/reg.py:32
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""

View File

@ -1,32 +0,0 @@
#
msgid ""
msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: utf-8\n"
#: hscommon/reg.py:39
msgid ""
"{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"
"\n"
"If you like this application, please make a contribution that you consider fair. Thanks!\n"
"\n"
"If 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"
"\n"
"This dialog doesn't show when there are no unpaid hours or when you have a valid contribution key."
msgstr ""
"{name} 是一款捐助软件,也就是说 \"用户对研发开源软件所花费的时间进行符合用户意愿的捐助\"。用户可以根据研发人员花费在开发软件上的时间进行合理的补偿。用户在下面看到的 \"未支付的时间\" (Unpaid hours)表示需要对该软件进行补偿的时间。\n"
" \n"
"如果您喜欢这款软件,我诚挚的希望您可以进行必要的捐助。谢谢!\n"
"\n"
"如果您无法承担捐助,您也可以忽略此提醒,或者发送电子邮件至 support@hardcoded.net ,我会发送给您一个注册密钥。\n"
"\n"
"当软件没有未支付的时间或您已使用一个有效的注册密钥,此对话框将不会再显示。"
#: hscommon/reg.py:51
msgid ""
"{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"
"\n"
"So 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"
"\n"
"So 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."
msgstr ""

View File

@ -1,179 +0,0 @@
# Created By: Virgil Dupras
# Created On: 2009-05-16
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
import re
from hashlib import md5
from .trans import trget
tr = trget('hscommon')
ALL_APPS = [
(1, 'dupeGuru'),
(2, 'moneyGuru'),
(3, 'musicGuru'),
(6, 'PdfMasher'),
]
OLDAPPIDS = {
1: {1, 4, 5},
2: {6, },
3: {2, },
}
class InvalidCodeError(Exception):
"""The supplied code is invalid."""
DEMO_PROMPT = tr("{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\n"
"So 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\n"
"So 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.")
class RegistrableApplication:
#--- View interface
# get_default(key_name)
# set_default(key_name, value)
# setup_as_registered()
# show_message(msg)
# show_demo_nag(prompt)
# open_url(url)
PROMPT_NAME = "<undefined>"
DEMO_LIMITATION = "<undefined>"
def __init__(self, view, appid):
self.view = view
self.appid = appid
self.registered = False
self.fairware_mode = False
self.registration_code = ''
self.registration_email = ''
self._unpaid_hours = None
@staticmethod
def _is_code_valid(appid, code, email):
if len(code) != 32:
return False
appid = str(appid)
for i in range(100):
blob = appid + email + str(i) + 'aybabtu'
digest = md5(blob.encode('utf-8')).hexdigest()
if digest == code:
return True
return False
def _set_registration(self, code, email):
self.validate_code(code, email)
self.registration_code = code
self.registration_email = email
self.registered = True
self.view.setup_as_registered()
def initial_registration_setup(self):
# Should be called only after the app is finished launching
if self.registered:
# We've already set registration in a hardcoded way (for example, for the Ubuntu Store)
# Just ignore registration, but not before having set as registered.
self.view.setup_as_registered()
return
code = self.view.get_default('RegistrationCode')
email = self.view.get_default('RegistrationEmail')
if code and email:
try:
self._set_registration(code, email)
except InvalidCodeError:
pass
if not self.registered:
if self.view.get_default('FairwareMode'):
self.fairware_mode = True
if not self.fairware_mode:
prompt = DEMO_PROMPT.format(name=self.PROMPT_NAME, limitation=self.DEMO_LIMITATION)
self.view.show_demo_nag(prompt)
def validate_code(self, code, email):
code = code.strip().lower()
email = email.strip().lower()
if self._is_code_valid(self.appid, code, email):
return
# Check if it's not an old reg code
for oldappid in OLDAPPIDS.get(self.appid, []):
if self._is_code_valid(oldappid, code, email):
return
# let's see if the user didn't mix the fields up
if self._is_code_valid(self.appid, email, code):
msg = "Invalid Code. It seems like you inverted the 'Registration Code' and"\
"'Registration E-mail' field."
raise InvalidCodeError(msg)
# Is the code a paypal transaction id?
if re.match(r'^[a-z\d]{17}$', code) is not None:
msg = "The code you submitted looks like a Paypal transaction ID. Registration codes are "\
"32 digits codes which you should have received in a separate e-mail. If you haven't "\
"received it yet, please visit http://www.hardcoded.net/support/"
raise InvalidCodeError(msg)
# Invalid, let's see if it's a code for another app.
for appid, appname in ALL_APPS:
if self._is_code_valid(appid, code, email):
msg = "This code is a {0} code. You're running the wrong application. You can "\
"download the correct application at http://www.hardcoded.net".format(appname)
raise InvalidCodeError(msg)
DEFAULT_MSG = "Your code is invalid. Make sure that you wrote the good code. Also make sure "\
"that the e-mail you gave is the same as the e-mail you used for your purchase."
raise InvalidCodeError(DEFAULT_MSG)
def set_registration(self, code, email, register_os):
if not self.fairware_mode and 'fairware' in {code.strip().lower(), email.strip().lower()}:
self.fairware_mode = True
self.view.set_default('FairwareMode', True)
self.view.show_message("Fairware mode enabled.")
return True
try:
self._set_registration(code, email)
self.view.show_message("Your code is valid. Thanks!")
if register_os:
self.register_os()
self.view.set_default('RegistrationCode', self.registration_code)
self.view.set_default('RegistrationEmail', self.registration_email)
return True
except InvalidCodeError as e:
self.view.show_message(str(e))
return False
def register_os(self):
# We don't do that anymore.
pass
def contribute(self):
self.view.open_url("http://open.hardcoded.net/contribute/")
def buy(self):
self.view.open_url("http://www.hardcoded.net/purchase.htm")
def about_fairware(self):
self.view.open_url("http://open.hardcoded.net/about/")
@property
def should_show_fairware_reminder(self):
return (not self.registered) and (self.fairware_mode) and (self.unpaid_hours >= 1)
@property
def should_apply_demo_limitation(self):
return (not self.registered) and (not self.fairware_mode)
@property
def unpaid_hours(self):
# We don't bother verifying unpaid hours anymore, the only app that still has fairware
# dialogs is dupeGuru and it has a huge surplus. Now, "fairware mode" really means
# "free mode".
return 0

View File

@ -1,68 +0,0 @@
# Created By: Virgil Dupras
# Created On: 2010-01-31
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
from hashlib import md5
from ..testutil import CallLogger
from ..reg import RegistrableApplication, InvalidCodeError
def md5s(s):
return md5(s.encode('utf-8')).hexdigest()
def assert_valid(appid, code, email):
app = RegistrableApplication(CallLogger(), appid)
try:
app.validate_code(code, email)
except InvalidCodeError as e:
raise AssertionError("Registration failed: {0}".format(str(e)))
def assert_invalid(appid, code, email, msg_contains=None):
app = RegistrableApplication(CallLogger(), appid)
try:
app.validate_code(code, email)
except InvalidCodeError as e:
if msg_contains:
assert msg_contains in str(e)
else:
raise AssertionError("InvalidCodeError not raised")
def test_valid_code():
email = 'foo@bar.com'
appid = 42
code = md5s('42' + email + '43' + 'aybabtu')
assert_valid(appid, code, email)
def test_invalid_code():
email = 'foo@bar.com'
appid = 42
code = md5s('43' + email + '43' + 'aybabtu')
assert_invalid(appid, code, email)
def test_suggest_other_apps():
# If a code is valid for another app, say so in the error message.
email = 'foo@bar.com'
appid = 42
# 2 is moneyGuru's appid
code = md5s('2' + email + '43' + 'aybabtu')
assert_invalid(appid, code, email, msg_contains="moneyGuru")
def test_invert_code_and_email():
# Try inverting code and email during validation in case the user mixed the fields up.
# We still show an error here. It kind of sucks, but if we don't, the email and code fields
# end up mixed up in the preferences. It's not as if this kind of error happened all the time...
email = 'foo@bar.com'
appid = 42
code = md5s('42' + email + '43' + 'aybabtu')
assert_invalid(appid, email, code, msg_contains="inverted")
def test_paypal_transaction():
# If the code looks like a paypal transaction, mention it in the error message.
email = 'foo@bar.com'
appid = 42
code = '2A693827WX9676888'
assert_invalid(appid, code, email, 'Paypal transaction')

View File

@ -18,7 +18,6 @@ from hscommon.plat import ISLINUX
from qtlib.about_box import AboutBox
from qtlib.recent import Recent
from qtlib.reg import Registration
from qtlib.util import createActions, getAppData
from qtlib.progress_window import ProgressWindow
@ -85,7 +84,6 @@ class DupeGuru(QObject):
('actionIgnoreList', '', '', tr("Ignore List"), self.ignoreListTriggered),
('actionShowHelp', 'F1', '', tr("dupeGuru Help"), self.showHelpTriggered),
('actionAbout', '', '', tr("About dupeGuru"), self.showAboutBoxTriggered),
('actionRegister', '', '', tr("Register dupeGuru"), self.registerTriggered),
('actionCheckForUpdate', '', '', tr("Check for Update"), self.checkForUpdateTriggered),
('actionOpenDebugLog', '', '', tr("Open Debug Log"), self.openDebugLogTriggered),
]
@ -108,10 +106,6 @@ class DupeGuru(QObject):
def remove_selected(self):
self.model.remove_selected(self)
def askForRegCode(self):
reg = Registration(self.model)
reg.ask_for_code()
def confirm(self, title, msg, default_button=QMessageBox.Yes):
active = QApplication.activeWindow()
buttons = QMessageBox.Yes | QMessageBox.No
@ -133,7 +127,6 @@ class DupeGuru(QObject):
#--- Events
def finishedLaunching(self):
self.model.initial_registration_setup()
if sys.getfilesystemencoding() == 'ascii':
# No need to localize this, it's a debugging message.
msg = "Something is wrong with the way your system locale is set. If the files you're "\
@ -168,10 +161,6 @@ class DupeGuru(QObject):
def quitTriggered(self):
self.directories_dialog.close()
def registerTriggered(self):
reg = Registration(self.model)
reg.ask_for_code()
def showAboutBoxTriggered(self):
self.about_box.show()
@ -196,15 +185,6 @@ class DupeGuru(QObject):
def set_default(self, key, value):
self.prefs.set_value(key, value)
def setup_as_registered(self):
self.actionRegister.setVisible(False)
self.about_box.registerButton.hide()
self.about_box.registeredEmailLabel.setText(self.model.registration_email)
def show_demo_nag(self, prompt):
reg = Registration(self.model)
reg.show_demo_nag(prompt)
def show_message(self, msg):
window = QApplication.activeWindow()
QMessageBox.information(window, '', msg)

View File

@ -81,7 +81,6 @@ class DirectoriesDialog(QMainWindow):
self.menuView.addAction(self.actionShowResultsWindow)
self.menuView.addAction(self.app.actionIgnoreList)
self.menuHelp.addAction(self.app.actionShowHelp)
self.menuHelp.addAction(self.app.actionRegister)
self.menuHelp.addAction(self.app.actionCheckForUpdate)
self.menuHelp.addAction(self.app.actionOpenDebugLog)
self.menuHelp.addAction(self.app.actionAbout)

View File

@ -111,7 +111,6 @@ class ResultWindow(QMainWindow):
self.menuView.addAction(self.app.actionIgnoreList)
self.menuView.addAction(self.app.actionPreferences)
self.menuHelp.addAction(self.app.actionShowHelp)
self.menuHelp.addAction(self.app.actionRegister)
self.menuHelp.addAction(self.app.actionCheckForUpdate)
self.menuHelp.addAction(self.app.actionOpenDebugLog)
self.menuHelp.addAction(self.app.actionAbout)

View File

@ -37,7 +37,5 @@ if __name__ == "__main__":
from qt.{edition}.app import DupeGuru
app.setWindowIcon(QIcon(QPixmap(":/{0}".format(DupeGuru.LOGO_NAME))))
dgapp = DupeGuru()
if not ISWINDOWS:
dgapp.model.registered = True
install_excepthook()
sys.exit(app.exec_())

View File

@ -15,17 +15,14 @@ from hscommon.trans import trget
tr = trget('qtlib')
class AboutBox(QDialog):
def __init__(self, parent, app, withreg=True):
def __init__(self, parent, app):
flags = Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.MSWindowsFixedSizeDialogHint
QDialog.__init__(self, parent, flags)
self.app = app
self.withreg = withreg
self._setupUi()
self.buttonBox.accepted.connect(self.accept)
self.buttonBox.rejected.connect(self.reject)
if self.withreg:
self.buttonBox.clicked.connect(self.buttonClicked)
def _setupUi(self):
self.setWindowTitle(tr("About {}").format(QCoreApplication.instance().applicationName()))
@ -59,23 +56,12 @@ class AboutBox(QDialog):
font.setBold(True)
self.label.setFont(font)
self.verticalLayout.addWidget(self.label)
self.registeredEmailLabel = QLabel(self)
if self.withreg:
self.registeredEmailLabel.setText(tr("UNREGISTERED"))
self.verticalLayout.addWidget(self.registeredEmailLabel)
self.buttonBox = QDialogButtonBox(self)
self.buttonBox.setOrientation(Qt.Horizontal)
self.buttonBox.setStandardButtons(QDialogButtonBox.Ok)
if self.withreg:
self.registerButton = self.buttonBox.addButton(tr("Register"), QDialogButtonBox.ActionRole)
self.verticalLayout.addWidget(self.buttonBox)
self.horizontalLayout.addLayout(self.verticalLayout)
#--- Events
def buttonClicked(self, button):
if button is self.registerButton:
self.app.askForRegCode()
if __name__ == '__main__':
import sys

View File

@ -1,25 +0,0 @@
# Created By: Virgil Dupras
# Created On: 2009-05-09
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
from PyQt4.QtGui import QDialog
from .reg_submit_dialog import RegSubmitDialog
from .reg_demo_dialog import RegDemoDialog
class Registration:
def __init__(self, app):
self.app = app
def ask_for_code(self):
dialog = RegSubmitDialog(None, self)
return dialog.exec_() == QDialog.Accepted
def show_demo_nag(self, prompt):
dialog = RegDemoDialog(None, self, prompt)
dialog.exec_()

View File

@ -1,80 +0,0 @@
# Created By: Virgil Dupras
# Created On: 2009-05-10
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
import sys
from PyQt4.QtCore import Qt, QCoreApplication
from PyQt4.QtGui import (QDialog, QApplication, QVBoxLayout, QHBoxLayout, QLabel,
QFont, QSpacerItem, QSizePolicy, QPushButton)
from hscommon.plat import ISLINUX
from hscommon.trans import trget
tr = trget('qtlib')
class RegDemoDialog(QDialog):
def __init__(self, parent, reg, prompt):
flags = Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint
QDialog.__init__(self, parent, flags)
self.reg = reg
self._setupUi()
self.descLabel.setText(prompt)
self.enterCodeButton.clicked.connect(self.enterCodeClicked)
self.buyButton.clicked.connect(self.buyClicked)
self.tryButton.clicked.connect(self.accept)
self.moreInfoButton.clicked.connect(self.moreInfoClicked)
def _setupUi(self):
appname = QCoreApplication.instance().applicationName()
title = tr("$appname is Fairware")
title = title.replace('$appname', appname)
self.setWindowTitle(title)
# Workaround for bug at http://bugreports.qt.nokia.com/browse/QTBUG-8212
dlg_height = 370 if ISLINUX else 240
self.resize(400, dlg_height)
self.verticalLayout = QVBoxLayout(self)
self.descLabel = QLabel(self)
self.descLabel.setWordWrap(True)
self.verticalLayout.addWidget(self.descLabel)
spacerItem = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.horizontalLayout = QHBoxLayout()
self.tryButton = QPushButton(self)
self.tryButton.setText(tr("Try"))
self.horizontalLayout.addWidget(self.tryButton)
self.enterCodeButton = QPushButton(self)
self.enterCodeButton.setText(tr("Enter Key"))
self.horizontalLayout.addWidget(self.enterCodeButton)
self.buyButton = QPushButton(self)
self.buyButton.setText(tr("Buy"))
self.horizontalLayout.addWidget(self.buyButton)
self.moreInfoButton = QPushButton(tr("Fairware?"))
self.horizontalLayout.addWidget(self.moreInfoButton)
self.verticalLayout.addLayout(self.horizontalLayout)
#--- Events
def enterCodeClicked(self):
if self.reg.ask_for_code():
self.accept()
def buyClicked(self):
self.reg.app.buy()
def moreInfoClicked(self):
self.reg.app.about_fairware()
if __name__ == '__main__':
app = QApplication([])
app.unpaid_hours = 42.4
class FakeReg:
app = app
dialog = RegDemoDialog(None, FakeReg(), "foo bar baz")
dialog.show()
sys.exit(app.exec_())

View File

@ -1,102 +0,0 @@
# Created By: Virgil Dupras
# Created On: 2009-05-09
# Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
import sys
from PyQt4.QtCore import Qt, QCoreApplication
from PyQt4.QtGui import (QDialog, QApplication, QVBoxLayout, QHBoxLayout, QLabel, QFormLayout,
QLayout, QLineEdit, QPushButton, QSpacerItem, QSizePolicy)
from hscommon.trans import trget
tr = trget('qtlib')
class RegSubmitDialog(QDialog):
def __init__(self, parent, reg):
flags = Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint
QDialog.__init__(self, parent, flags)
self._setupUi()
self.reg = reg
self.submitButton.clicked.connect(self.submitClicked)
self.contributeButton.clicked.connect(self.contributeClicked)
self.cancelButton.clicked.connect(self.reject)
def _setupUi(self):
self.setWindowTitle(tr("Enter your registration key"))
self.resize(365, 126)
self.verticalLayout = QVBoxLayout(self)
self.promptLabel = QLabel(self)
appname = str(QCoreApplication.instance().applicationName())
prompt = tr("Type the key you received when you contributed to $appname, as well as the "
"e-mail used as a reference for the purchase.").replace('$appname', appname)
self.promptLabel.setText(prompt)
self.promptLabel.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
self.promptLabel.setWordWrap(True)
self.verticalLayout.addWidget(self.promptLabel)
self.formLayout = QFormLayout()
self.formLayout.setSizeConstraint(QLayout.SetNoConstraint)
self.formLayout.setFieldGrowthPolicy(QFormLayout.ExpandingFieldsGrow)
self.formLayout.setLabelAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter)
self.formLayout.setFormAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
self.label2 = QLabel(self)
self.label2.setText(tr("Registration key:"))
self.formLayout.setWidget(0, QFormLayout.LabelRole, self.label2)
self.label3 = QLabel(self)
self.label3.setText(tr("Registered e-mail:"))
self.formLayout.setWidget(1, QFormLayout.LabelRole, self.label3)
self.codeEdit = QLineEdit(self)
self.formLayout.setWidget(0, QFormLayout.FieldRole, self.codeEdit)
self.emailEdit = QLineEdit(self)
self.formLayout.setWidget(1, QFormLayout.FieldRole, self.emailEdit)
self.verticalLayout.addLayout(self.formLayout)
self.horizontalLayout = QHBoxLayout()
self.contributeButton = QPushButton(self)
self.contributeButton.setText(tr("Contribute"))
self.contributeButton.setAutoDefault(False)
self.horizontalLayout.addWidget(self.contributeButton)
spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.cancelButton = QPushButton(self)
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.cancelButton.sizePolicy().hasHeightForWidth())
self.cancelButton.setSizePolicy(sizePolicy)
self.cancelButton.setText(tr("Cancel"))
self.cancelButton.setAutoDefault(False)
self.horizontalLayout.addWidget(self.cancelButton)
self.submitButton = QPushButton(self)
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.submitButton.sizePolicy().hasHeightForWidth())
self.submitButton.setSizePolicy(sizePolicy)
self.submitButton.setText(tr("Submit"))
self.submitButton.setAutoDefault(False)
self.submitButton.setDefault(True)
self.horizontalLayout.addWidget(self.submitButton)
self.verticalLayout.addLayout(self.horizontalLayout)
#--- Events
def contributeClicked(self):
self.reg.app.contribute()
def submitClicked(self):
code = self.codeEdit.text()
email = self.emailEdit.text()
if self.reg.app.set_registration(code, email, False):
self.accept()
if __name__ == '__main__':
app = QApplication([])
validate = lambda *args: True
dialog = RegSubmitDialog(None, validate)
dialog.show()
sys.exit(app.exec_())