1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Converted registration system to Fairware.

This commit is contained in:
Virgil Dupras
2010-09-29 16:49:50 +02:00
parent 491279b7a8
commit 7360f57beb
23 changed files with 71 additions and 202 deletions

View File

@@ -17,15 +17,12 @@ http://www.hardcoded.net/licenses/hs_license
{
IBOutlet PyDupeGuruBase *py;
IBOutlet RecentDirectories *recentDirectories;
IBOutlet NSMenuItem *unlockMenuItem;
IBOutlet ResultWindowBase *result;
DirectoryPanel *_directoryPanel;
DetailsPanel *_detailsPanel;
BOOL _savedResults;
}
- (IBAction)unlockApp:(id)sender;
- (PyDupeGuruBase *)py;
- (RecentDirectories *)recentDirectories;
- (DirectoryPanel *)directoryPanel;

View File

@@ -8,25 +8,12 @@ http://www.hardcoded.net/licenses/hs_license
#import "AppDelegate.h"
#import "ProgressController.h"
#import "RegistrationInterface.h"
#import "HSFairwareReminder.h"
#import "Utils.h"
#import "Consts.h"
#import <Sparkle/SUUpdater.h>
@implementation AppDelegateBase
- (IBAction)unlockApp:(id)sender
{
if ([[self py] isRegistered])
return;
RegistrationInterface *ri = [[RegistrationInterface alloc] initWithApp:[self py]];
if ([ri enterCode] == NSOKButton)
{
NSString *menuTitle = [NSString stringWithFormat:@"Thanks for buying %@!",[py appName]];
[unlockMenuItem setTitle:menuTitle];
}
[ri release];
}
- (PyDupeGuruBase *)py { return py; }
- (RecentDirectories *)recentDirectories { return recentDirectories; }
- (DirectoryPanel *)directoryPanel
@@ -65,9 +52,7 @@ http://www.hardcoded.net/licenses/hs_license
[result restoreColumnsPosition:columnsOrder widths:columnsWidth];
else
[result resetColumnsToDefault:nil];
//Reg stuff
if ([RegistrationInterface showNagWithApp:[self py]])
[unlockMenuItem setTitle:[NSString stringWithFormat:@"Thanks for buying %@!",[py appName]]];
[HSFairwareReminder showNagWithApp:[self py]];
//Restore results
[py loadIgnoreList];
[py loadResults];

View File

@@ -8,7 +8,6 @@ http://www.hardcoded.net/licenses/hs_license
#import <Cocoa/Cocoa.h>
#define RegistrationRequired @"RegistrationRequired"
#define JobStarted @"JobStarted"
#define JobInProgress @"JobInProgress"

View File

@@ -10,7 +10,6 @@ http://www.hardcoded.net/licenses/hs_license
#import "Dialogs.h"
#import "ProgressController.h"
#import "Utils.h"
#import "RegistrationInterface.h"
#import "AppDelegate.h"
#import "Consts.h"
@@ -31,7 +30,6 @@ http://www.hardcoded.net/licenses/hs_license
[matches setTarget:self];
[matches setDoubleAction:@selector(openClicked:)];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationRequired:) name:RegistrationRequired object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobCompleted:) name:JobCompletedNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobStarted:) name:JobStarted object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobInProgress:) name:JobInProgress object:nil];
@@ -464,12 +462,6 @@ http://www.hardcoded.net/licenses/hs_license
[[ProgressController mainProgressController] showSheetForParent:[self window]];
}
- (void)registrationRequired:(NSNotification *)aNotification
{
NSString *msg = @"This is a demo version, which only allows you 10 delete/copy/move actions per session. You cannot continue.";
[Dialogs showMessage:msg];
}
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem
{
return ![[ProgressController mainProgressController] isShown];

View File

@@ -12,8 +12,8 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1147"/>
<integer value="598"/>
<integer value="21"/>
<integer value="57"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -87,6 +87,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{7, 14}, {67, 25}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="431579725">
<int key="NSCellFlags">67239424</int>
@@ -182,6 +183,7 @@
<int key="NSvFlags">258</int>
<string key="NSFrame">{{0, 14}, {81, 22}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSearchFieldCell" key="NSCell" id="484816507">
<int key="NSCellFlags">343014976</int>
@@ -327,6 +329,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{1, 14}, {40, 25}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="436420677">
<int key="NSCellFlags">-2076049856</int>
@@ -512,7 +515,6 @@
</object>
</object>
</object>
<int key="NSSelectedIndex">2</int>
<bool key="NSPullDown">YES</bool>
<int key="NSPreferredEdge">3</int>
<bool key="NSUsesItemFromMenu">YES</bool>
@@ -543,6 +545,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{4, 14}, {67, 25}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="211272396">
<int key="NSCellFlags">67239424</int>
@@ -948,15 +951,6 @@
<reference key="NSOnImage" ref="852972005"/>
<reference key="NSMixedImage" ref="218295580"/>
</object>
<object class="NSMenuItem" id="29406775">
<reference key="NSMenu" ref="7402560"/>
<string key="NSTitle">Unlock dupeGuru</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="852972005"/>
<reference key="NSMixedImage" ref="218295580"/>
</object>
<object class="NSMenuItem" id="688262014">
<reference key="NSMenu" ref="7402560"/>
<string key="NSTitle">Check for update...</string>
@@ -1938,22 +1932,6 @@
</object>
<int key="connectionID">748</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">unlockApp:</string>
<reference key="source" ref="91622651"/>
<reference key="destination" ref="29406775"/>
</object>
<int key="connectionID">755</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">unlockMenuItem</string>
<reference key="source" ref="91622651"/>
<reference key="destination" ref="29406775"/>
</object>
<int key="connectionID">756</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">app</string>
@@ -2469,7 +2447,6 @@
<reference ref="873971427"/>
<reference ref="941940359"/>
<reference ref="234345427"/>
<reference ref="29406775"/>
<reference ref="688262014"/>
</object>
<reference key="parent" ref="162097048"/>
@@ -2519,11 +2496,6 @@
<reference key="object" ref="234345427"/>
<reference key="parent" ref="7402560"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">754</int>
<reference key="object" ref="29406775"/>
<reference key="parent" ref="7402560"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">950</int>
<reference key="object" ref="688262014"/>
@@ -3404,8 +3376,6 @@
<string>739.ImportedFromIB2</string>
<string>740.IBPluginDependency</string>
<string>740.ImportedFromIB2</string>
<string>754.IBPluginDependency</string>
<string>754.ImportedFromIB2</string>
<string>872.IBPluginDependency</string>
<string>872.ImportedFromIB2</string>
<string>880.IBPluginDependency</string>
@@ -3492,7 +3462,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{294, 462}, {617, 227}}</string>
<string>{{294, 689}, {617, 0}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3572,7 +3542,7 @@
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{152, 575}, {221, 193}}</string>
<string>{{152, 595}, {221, 173}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3676,8 +3646,6 @@
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
@@ -3827,17 +3795,6 @@
<object class="IBPartialClassDescription">
<string key="className">AppDelegateBase</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">unlockApp:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">unlockApp:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">unlockApp:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
@@ -3845,14 +3802,12 @@
<string>py</string>
<string>recentDirectories</string>
<string>result</string>
<string>unlockMenuItem</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>PyDupeGuruBase</string>
<string>RecentDirectories</string>
<string>ResultWindowBase</string>
<string>NSMenuItem</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
@@ -3862,7 +3817,6 @@
<string>py</string>
<string>recentDirectories</string>
<string>result</string>
<string>unlockMenuItem</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -3878,10 +3832,6 @@
<string key="name">result</string>
<string key="candidateClassName">ResultWindowBase</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">unlockMenuItem</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -3975,14 +3925,6 @@
<string key="minorKey">../base/PyDupeGuru.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">PyRegistrable</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">../PyRegistrable.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">RecentDirectories</string>
<string key="superclassName">NSObject</string>