Changeset 38

Show
Ignore:
Timestamp:
06/19/06 17:51:26 (3 years ago)
Author:
ngerakines
Message:

* fixed save/load of general prefs
* cleaned up the language of general prefs
* login now loads up to 10 unique last login ids
* save_login prefs now populate user/pass of last login

Location:
trunk
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/Fence.xcodeproj/project.pbxproj

    r36 r38  
    241241                        isa = PBXGroup; 
    242242                        children = ( 
    243                                 6DF56A6B0A3BDEDE0037EB33 /* logo-vox-32x32.gif */, 
    244243                                6D15B22C0A2FCC7500BFAC0E /* Growl-WithInstaller.framework */, 
    245244                                6DBE119F0A1BA42900F171E5 /* ReadMe */, 
     
    277276                                6D4762920A1E4A0900E16CEE /* Fence Help */, 
    278277                                6D2D03660A19512F005C5AFA /* tplogo.jpg */, 
     278                                6DF56A6B0A3BDEDE0037EB33 /* logo-vox-32x32.gif */, 
    279279                                8D1107310486CEB800E47090 /* Info.plist */, 
    280280                                089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 
  • trunk/LoginWindowController.h

    r35 r38  
    1111    IBOutlet id usernamelist; 
    1212        IBOutlet id mywindow; 
     13        NSMutableArray *recentlogins; 
     14        NSString *lastlogin; 
    1315} 
     16 
     17- (NSMutableArray *) recentlogins; 
     18- (void) setRecentlogins: (NSMutableArray *) Recentlogins; 
     19 
     20- (NSString *) lastlogin; 
     21- (void) setLastlogin: (NSString *) Lastlogin; 
    1422 
    1523- (IBAction)login:(id)sender; 
    1624 
     25- (void) init_login; 
    1726- (void) init_typepad; 
    1827- (void) init_vox; 
  • trunk/LoginWindowController.m

    r35 r38  
    33@implementation LoginWindowController 
    44 
     5// init 
     6- (id)init { 
     7    if (self = [super init]) { 
     8        [self setRecentlogins:[[NSMutableArray alloc] init]]; 
     9        [self setLastlogin:@""]; 
     10    } 
     11    return self; 
     12} 
     13 
    514- (void)awakeFromNib { 
     15        // [usernamelist setCompletes:YES]; 
     16        [self init_login]; 
     17        // clear the service type at awake 
     18        // [userDefaults setObject:nil forKey:@"service type"]; 
     19} 
     20 
     21- (void) init_login { 
    622        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 
    7  
    8         NSMutableArray *recent_users = [userDefaults objectForKey:@"recent usernames"]; 
    9         NSEnumerator *enumerator = [recent_users objectEnumerator]; 
     23        NSEnumerator *enumerator = [[userDefaults objectForKey:@"recent usernames"] objectEnumerator]; 
    1024        id key; 
    1125        while (key = [enumerator nextObject]) { 
    12                 [usernamelist addItemWithObjectValue:key]; 
     26                if ([usernamelist numberOfItems] < 9) { 
     27                        if ([usernamelist indexOfItemWithObjectValue:key] == NSNotFound) { 
     28                                [usernamelist addItemWithObjectValue:key]; 
     29                        } 
     30                } 
    1331        } 
     32        if ([userDefaults objectForKey:@"save_login"]) { 
     33                if ([userDefaults objectForKey:@"username"]) { 
     34                        [usernamelist selectItemWithObjectValue:[userDefaults objectForKey:@"username"]]; 
     35                } 
     36                if ([userDefaults objectForKey:@"password"]) { 
     37                        [password setStringValue:[userDefaults objectForKey:@"password"]]; 
     38                } 
     39        } 
     40} 
     41 
     42/* dealloc */ 
     43- (void) dealloc { 
     44    [recentlogins release]; 
     45    [lastlogin release]; 
     46         
     47    recentlogins = nil; 
     48    lastlogin = nil; 
     49    [super dealloc]; 
     50} 
     51 
     52/* recentlogins */ 
     53- (NSMutableArray *) recentlogins { return recentlogins; } 
     54 
     55/* -setRecentlogins: */ 
     56- (void) setRecentlogins: (NSMutableArray *) Recentlogins { 
     57    //NSLog(@"in -setRecentlogins:, old value of recentlogins: %@, changed to: %@", recentlogins, Recentlogins); 
     58    if (recentlogins != Recentlogins) { 
     59        [recentlogins autorelease]; 
     60        recentlogins = [Recentlogins retain]; 
     61    } 
     62} 
     63 
     64/* lastlogin */ 
     65- (NSString *) lastlogin { return lastlogin; } 
     66 
     67/* -setLastlogin: */ 
     68- (void) setLastlogin: (NSString *) Lastlogin { 
     69    //NSLog(@"in -setLastlogin:, old value of lastlogin: %@, changed to: %@", lastlogin, Lastlogin); 
     70    if (lastlogin != Lastlogin) { 
     71        [lastlogin autorelease]; 
     72        lastlogin = [Lastlogin retain]; 
     73    } 
    1474} 
    1575 
  • trunk/PrefController.h

    r36 r38  
    2525        IBOutlet id PrefsVoxText; 
    2626        /* - */ IBOutlet id vx_text_dropdown; 
     27        // generic pref view // 
     28        IBOutlet id enable_growl; 
     29        IBOutlet id save_login; 
    2730 
    2831        NSToolbar *toolbar; 
     
    3841- (void) windowWillClose:(id) sender; 
    3942 
     43- (void) init_generic; 
    4044- (void) init_typepad; 
    4145- (void) init_vox; 
     
    5862 
    5963/* save methods */ 
     64- (void) save_generic; 
    6065- (void) save_typepad; 
    6166- (void) save_vox; 
  • trunk/PrefController.m

    r36 r38  
    2323        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 
    2424        [self setService:[userDefaults objectForKey:@"service type"]]; 
    25          
    26         if ([[self service] isEqualToString:@"TypePad"]) { 
    27                 [self init_typepad]; 
     25        // Set the general pref view control values 
     26        [enable_growl setObjectValue:[userDefaults objectForKey:@"enable_growl"]]; 
     27        [save_login setObjectValue:[userDefaults objectForKey:@"save_login"]]; 
     28         
     29        if ([self service]) { 
     30                if ([[self service] isEqualToString:@"TypePad"]) { 
     31                        [self init_typepad]; 
     32                } 
     33                if ([[self service] isEqualToString:@"Vox"]) { 
     34                        [self init_vox]; 
     35                } 
    2836        } else { 
    29                 [self init_vox]; 
     37                [self init_generic]; 
    3038        } 
    3139 
     
    5058        [myCollections release]; myCollections = nil; 
    5159    [super dealloc]; 
     60} 
     61 
     62- (void) init_generic { 
     63        [items setObject:[self newItem:@"General" image:@"General"] forKey:@"General"]; 
     64        allowedPanels = [NSArray arrayWithObjects:@"General", NSToolbarFlexibleSpaceItemIdentifier, nil]; 
    5265} 
    5366 
     
    218231- (void) windowWillClose:(id) sender { 
    219232        NSLog(@"Window closed\n"); 
    220         if ([[self service] isEqualToString:@"TypePad"]) { 
    221                 [self save_typepad]; 
    222         } else { 
    223                 [self save_vox]; 
     233        [self save_generic]; 
     234        if ([self service]) { 
     235                if ([[self service] isEqualToString:@"TypePad"]) { 
     236                        [self save_typepad]; 
     237                } 
     238                if ([[self service] isEqualToString:@"Vox"]) { 
     239                        [self save_vox]; 
     240                } 
    224241        } 
    225242} 
     
    285302} 
    286303 
     304- (void) save_generic { 
     305        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 
     306        [userDefaults setObject:[enable_growl objectValue] forKey:@"enable_growl"]; 
     307        [userDefaults setObject:[save_login objectValue] forKey:@"save_login"]; 
     308} 
    287309 
    288310- (void) save_typepad { 
  • trunk/Preferences.nib/classes.nib

    r36 r38  
    2020                PrefsVoxText = id;  
    2121                PrefsVoxVideo = id;  
     22                "enable_growl" = id;  
    2223                myWindow = id;  
     24                "save_login" = id;  
    2325                "tp_image_dropdown" = id;  
    2426                "tp_text_dropdown" = id;  
  • trunk/Preferences.nib/info.nib

    r36 r38  
    88        <dict> 
    99                <key>10</key> 
    10                 <string>389 726 470 119 0 0 1440 938 </string> 
     10                <string>485 586 470 119 0 0 1440 938 </string> 
    1111                <key>11</key> 
    1212                <string>485 586 470 119 0 0 1440 938 </string> 
     
    1616                <string>485 586 470 119 0 0 1440 938 </string> 
    1717                <key>7</key> 
    18                 <string>485 585 470 122 0 0 1440 938 </string> 
     18                <string>311 316 470 122 0 0 1440 938 </string> 
    1919                <key>8</key> 
    2020                <string>485 586 470 119 0 0 1440 938 </string> 
     
    2626        <key>IBOpenObjects</key> 
    2727        <array> 
    28                 <integer>10</integer> 
    29                 <integer>8</integer> 
     28                <integer>7</integer> 
    3029        </array> 
    3130        <key>IBSystem Version</key> 
  • trunk/TODO

    r2 r38  
    11TODO 
    2  - [Prefs] set selectedweblog as selected in blog menu 
    3  - [Prefs] set selectedgallery as selected in gallery menu 
    4  - [Prefs] add option 'Allow mutiple image uploads' 
    5  - [Prefs] add option 'After uploading to my blog, open the entry in edit mode' 
    6  - [Prefs] add option 'When uploading multiple images to my blog, upload them as files and create a single entry with the thumbnails instead of one entry per file' 
    7  - [Prefs] add option 'Bounce the dockbar icon when uploads are complete' 
    82 - [Prefs] use the Growl notification framework 
    93 - [App] add audio file support for blogs 
    104 - [App] add video file support for blogs 
    11  - [App] allow new text posts to be created by dragging blocks of text onto the app 
    125 - [App] add extensive applescript support 
    13  - [App] add a progress indicator or progress bar when uploading files