hsoft / moneyguru (http://hardcoded.net/moneyguru)

Future-aware personal finance application for Mac OS X and Windows.

Clone this repository (size: 8.3 MB): HTTPS / SSH
$ hg clone http://hg.hardcoded.net/moneyguru

Changed (Δ55.5 KB):

raw changeset »

cocoa/controllers/MGColumns.h (1 lines added, 0 lines removed)

cocoa/controllers/MGColumns.m (20 lines added, 3 lines removed)

cocoa/controllers/MGReport.h (3 lines added, 1 lines removed)

cocoa/controllers/MGReport.m (12 lines added, 0 lines removed)

cocoa/controllers/account/MGEntryTable.m (10 lines added, 10 lines removed)

cocoa/controllers/networth/MGBalanceSheet.h (1 lines added, 0 lines removed)

cocoa/controllers/networth/MGBalanceSheet.m (31 lines added, 0 lines removed)

cocoa/controllers/transaction/MGTransactionTable.m (8 lines added, 8 lines removed)

cocoa/de.lproj/BalanceSheet.strings

cocoa/de.lproj/BalanceSheet.xib (30 lines added, 410 lines removed)

cocoa/de.lproj/columns.strings (7 lines added, 0 lines removed)

cocoa/en.lproj/BalanceSheet.strings

cocoa/en.lproj/BalanceSheet.xib (28 lines added, 410 lines removed)

cocoa/en.lproj/columns.strings (7 lines added, 0 lines removed)

cocoa/fr.lproj/BalanceSheet.strings

cocoa/fr.lproj/BalanceSheet.xib (30 lines added, 410 lines removed)

cocoa/fr.lproj/columns.strings (7 lines added, 0 lines removed)

Up to file-list cocoa/controllers/MGColumns.h:

@@ -18,6 +18,7 @@ typedef struct {
18
18
    NSUInteger defaultWidth;
19
19
    NSUInteger minWidth;
20
20
    NSUInteger maxWidth;
21
    BOOL sortable;
21
22
    Class cellClass;
22
23
} MGColumnDef;
23
24

Up to file-list cocoa/controllers/MGColumns.m:

@@ -22,18 +22,35 @@ http://www.hardcoded.net/licenses/hs_lic
22
22
    [super dealloc];
23
23
}
24
24
25
/*
26
    It is assumed, when this method is used, that the table/outline is empty *OR* that it is not
27
    defined in the column list.
28
    
29
    Special note about NSOutlineView. You can use MGColumns on outline views, but you be aware that
30
    the "main" column (the one having the tree disclosure buttons) cannot be removed. Therefore,
31
    it has to be defined in the XIB and it must *not* be in column defs.
32
*/
25
33
- (void)initializeColumns:(MGColumnDef *)columns
26
34
{
27
    for (NSTableColumn *c in [[[tableView tableColumns] copy] autorelease]) {
28
        [tableView removeTableColumn:c];
35
    /* Translate the title of columns (needed for outlines) present already */
36
    for (NSTableColumn *c in [tableView tableColumns]) {
37
        NSString *title = NSLocalizedStringFromTable([[c headerCell] stringValue], @"columns", @"");
38
        [[c headerCell] setStringValue:title];
29
39
    }
30
40
    NSUserDefaults *udc = [NSUserDefaultsController sharedUserDefaultsController];
31
41
    MGColumnDef *cdef = columns;
32
42
    while (cdef->attrname != nil) {
43
        if ([tableView tableColumnWithIdentifier:cdef->attrname] != nil) {
44
            cdef++;
45
            continue;
46
        }
33
47
        NSTableColumn *c = [[[NSTableColumn alloc] initWithIdentifier:cdef->attrname] autorelease];
34
48
        NSString *title = NSLocalizedStringFromTable(cdef->title, @"columns", @"");
35
49
        [[c headerCell] setStringValue:title];
36
        [c setSortDescriptorPrototype:[[[NSSortDescriptor alloc] initWithKey:cdef->attrname ascending:YES] autorelease]];
50
        if (cdef->sortable) {
51
            NSSortDescriptor *d = [[[NSSortDescriptor alloc] initWithKey:cdef->attrname ascending:YES] autorelease];
52
            [c setSortDescriptorPrototype:d];
53
        }
37
54
        [c setWidth:cdef->defaultWidth];
38
55
        [c setMinWidth:cdef->minWidth];
39
56
        NSUInteger maxWidth = cdef->maxWidth;

Up to file-list cocoa/controllers/MGReport.h:

@@ -9,13 +9,15 @@ http://www.hardcoded.net/licenses/hs_lic
9
9
#import <Cocoa/Cocoa.h>
10
10
#import "HSOutline.h"
11
11
#import "PyReport.h"
12
12
#import "MGColumns.h"
13
13
14
14
@interface MGReport : HSOutline {
15
    MGColumns *columns;
15
16
    BOOL toggleExcludedIsEnabled;
16
17
}
17
18
- (PyReport *)py;
18
19
19
20
- (IBAction)showSelectedAccount:(id)sender;
20
21
- (BOOL)canShowSelectedAccount;
22
- (MGColumns *)columns;
21
23
@end

Up to file-list cocoa/controllers/MGReport.m:

@@ -16,15 +16,27 @@ http://www.hardcoded.net/licenses/hs_lic
16
16
- (id)initWithPyClassName:(NSString *)aClassName pyParent:(id)aPyParent view:(HSOutlineView *)aOutlineView
17
17
{
18
18
    self = [super initWithPyClassName:aClassName pyParent:aPyParent view:aOutlineView];
19
    columns = [[MGColumns alloc] initWithTableView:aOutlineView];
19
20
    [outlineView registerForDraggedTypes:[NSArray arrayWithObject:MGPathPasteboardType]];
20
21
    return self;
21
22
}
22
23
24
- (void)dealloc
25
{
26
    [columns release];
27
    [super dealloc];
28
}
29
23
30
- (PyReport *)py
24
31
{
25
32
    return (PyReport *)py;
26
33
}
27
34
35
- (MGColumns *)columns
36
{
37
    return columns;
38
}
39
28
40
/* Overrides */
29
41
- (void)refresh
30
42
{

Up to file-list cocoa/controllers/account/MGEntryTable.m:

@@ -37,16 +37,16 @@ http://www.hardcoded.net/licenses/hs_lic
37
37
- (void)initializeColumns
38
38
{
39
39
    MGColumnDef defs[] = {
40
        {@"status", @"", 16, 16, 16, [MGReconciliationCell class]},
41
        {@"date", @"Date", 80, 60, 0, nil},
42
        {@"reconciliation_date", @"Reconciliation Date", 110, 60, 0, nil},
43
        {@"checkno", @"Check #", 72, 40, 0, nil},
44
        {@"description", @"Description", 278, 80, 0, nil},
45
        {@"payee", @"Payee", 80, 80, 0, nil},
46
        {@"transfer", @"Transfer", 140, 80, 0, [MGTextFieldCell class]},
47
        {@"increase", @"Increase", 80, 80, 0, nil},
48
        {@"decrease", @"Decrease", 80, 80, 0, nil},
49
        {@"balance", @"Balance", 90, 90, 0, nil},
40
        {@"status", @"", 16, 16, 16, NO, [MGReconciliationCell class]},
41
        {@"date", @"Date", 80, 60, 0, YES, nil},
42
        {@"reconciliation_date", @"Reconciliation Date", 110, 60, 0, YES, nil},
43
        {@"checkno", @"Check #", 72, 40, 0, YES, nil},
44
        {@"description", @"Description", 278, 80, 0, YES, nil},
45
        {@"payee", @"Payee", 80, 80, 0, YES, nil},
46
        {@"transfer", @"Transfer", 140, 80, 0, YES, [MGTextFieldCell class]},
47
        {@"increase", @"Increase", 80, 80, 0, YES, nil},
48
        {@"decrease", @"Decrease", 80, 80, 0, YES, nil},
49
        {@"balance", @"Balance", 90, 90, 0, YES, nil},
50
50
        nil
51
51
    };
52
52
    [[self columns] initializeColumns:defs];

Up to file-list cocoa/controllers/networth/MGBalanceSheet.h:

@@ -16,5 +16,6 @@ http://www.hardcoded.net/licenses/hs_lic
16
16
    HSTableColumnManager *columnsManager;
17
17
}
18
18
- (id)initWithPyParent:(id)aPyParent view:(HSOutlineView *)aOutlineView;
19
- (void)initializeColumns;
19
20
- (PyBalanceSheet *)py;
20
21
@end

Up to file-list cocoa/controllers/networth/MGBalanceSheet.m:

@@ -8,11 +8,13 @@ http://www.hardcoded.net/licenses/hs_lic
8
8
9
9
#import "MGBalanceSheet.h"
10
10
#import "MGConst.h"
11
#import "MGAmountCell.h"
11
12
12
13
@implementation MGBalanceSheet
13
14
- (id)initWithPyParent:(id)aPyParent view:(HSOutlineView *)aOutlineView
14
15
{
15
16
    self = [super initWithPyClassName:@"PyBalanceSheet" pyParent:aPyParent view:aOutlineView];
17
    [self initializeColumns];
16
18
    columnsManager = [[HSTableColumnManager alloc] initWithTable:aOutlineView];
17
19
    [columnsManager linkColumn:@"delta" toUserDefault:BalanceSheetDeltaColumnVisible];
18
20
    [columnsManager linkColumn:@"delta_perc" toUserDefault:BalanceSheetDeltaPercColumnVisible];
@@ -22,6 +24,35 @@ http://www.hardcoded.net/licenses/hs_lic
22
24
    return self;
23
25
}
24
26
27
- (void)initializeColumns
28
{
29
    MGColumnDef defs[] = {
30
        /* Account column is defined in XIB */
31
        {@"account_number", @"Account #", 64, 10, 0, NO, nil},
32
        {@"end", @"End", 100, 10, 0, NO, [MGAmountCell class]},
33
        {@"delta", @"Change", 100, 10, 0, NO, [MGAmountCell class]},
34
        {@"delta_perc", @"Change %", 60, 10, 0, NO, [MGAmountCell class]},
35
        {@"start", @"Start", 100, 10, 0, NO, [MGAmountCell class]},
36
        {@"budgeted", @"Budgeted", 100, 10, 0, NO, [MGAmountCell class]},
37
        nil
38
    };
39
    [[self columns] initializeColumns:defs];
40
    NSTableColumn *c = [[self outlineView] tableColumnWithIdentifier:@"end"];
41
    [[c dataCell] setAlignment:NSRightTextAlignment];
42
    NSFontManager *fontManager = [NSFontManager sharedFontManager];
43
    NSFont *font = [[c dataCell] font];
44
    font = [fontManager convertFont:font toHaveTrait:NSFontBoldTrait];
45
    [[c dataCell] setFont:font];
46
    c = [[self outlineView] tableColumnWithIdentifier:@"delta"];
47
    [[c dataCell] setAlignment:NSRightTextAlignment];
48
    c = [[self outlineView] tableColumnWithIdentifier:@"delta_perc"];
49
    [[c dataCell] setAlignment:NSRightTextAlignment];
50
    c = [[self outlineView] tableColumnWithIdentifier:@"start"];
51
    [[c dataCell] setAlignment:NSRightTextAlignment];
52
    c = [[self outlineView] tableColumnWithIdentifier:@"budgeted"];
53
    [[c dataCell] setAlignment:NSRightTextAlignment];
54
}
55
25
56
- (void)dealloc
26
57
{
27
58
    [columnsManager release];

Up to file-list cocoa/controllers/transaction/MGTransactionTable.m:

@@ -35,14 +35,14 @@ http://www.hardcoded.net/licenses/hs_lic
35
35
- (void)initializeColumns
36
36
{
37
37
    MGColumnDef defs[] = {
38
        {@"status", @"", 16, 16, 16, [MGReconciliationCell class]},
39
        {@"date", @"Date", 80, 60, 0, nil},
40
        {@"checkno", @"Check #", 72, 40, 0, nil},
41
        {@"description", @"Description", 310, 80, 0, nil},
42
        {@"payee", @"Payee", 85, 80, 0, nil},
43
        {@"from", @"From", 136, 70, 0, [MGTextFieldCell class]},
44
        {@"to", @"To", 135, 70, 0, [MGTextFieldCell class]},
45
        {@"amount", @"Amount", 90, 70, 0, nil},
38
        {@"status", @"", 16, 16, 16, NO, [MGReconciliationCell class]},
39
        {@"date", @"Date", 80, 60, 0, YES, nil},
40
        {@"checkno", @"Check #", 72, 40, 0, YES, nil},
41
        {@"description", @"Description", 310, 80, 0, YES, nil},
42
        {@"payee", @"Payee", 85, 80, 0, YES, nil},
43
        {@"from", @"From", 136, 70, 0, YES, [MGTextFieldCell class]},
44
        {@"to", @"To", 135, 70, 0, YES, [MGTextFieldCell class]},
45
        {@"amount", @"Amount", 90, 70, 0, YES, nil},
46
46
        nil
47
47
    };
48
48
    [[self columns] initializeColumns:defs];

Up to file-list cocoa/de.lproj/BalanceSheet.xib:

-
Diff size exceeds threshold (17.5 KB)view raw?

Up to file-list cocoa/de.lproj/columns.strings:

10
10
"Decrease" = "Soll";
11
11
"Increase" = "Haben";
12
12
"Reconciliation Date" = "Wertstellungsdatum";
13
"Account" = "Konto";
14
"Start" = "Anfang";
15
"End" = "Ende";
16
"Change" = "Variation";
17
"Change %" = "Variation %";
18
"Budgeted" = "Budgetiert";
19
"Account #" = "Konto #";

Up to file-list cocoa/en.lproj/BalanceSheet.xib:

-
Diff size exceeds threshold (17.5 KB)view raw?

Up to file-list cocoa/en.lproj/columns.strings:

10
10
"Decrease" = "Decrease";
11
11
"Increase" = "Increase";
12
12
"Reconciliation Date" = "Reconciliation Date";
13
"Account" = "Account";
14
"Start" = "Start";
15
"End" = "End";
16
"Change" = "Change";
17
"Change %" = "Change %";
18
"Budgeted" = "Budgeted";
19
"Account #" = "Account #";

Up to file-list cocoa/fr.lproj/BalanceSheet.xib:

-
Diff size exceeds threshold (17.5 KB)view raw?

Up to file-list cocoa/fr.lproj/columns.strings:

10
10
"Decrease" = "Retrait";
11
11
"Increase" = "Dépôt";
12
12
"Reconciliation Date" = "Date réconciliation";
13
"Account" = "Compte";
14
"Start" = "Début";
15
"End" = "Fin";
16
"Change" = "Variation";
17
"Change %" = "Variation %";
18
"Budgeted" = "Budgeté";
19
"Account #" = "# Compte";