Changeset 40

Show
Ignore:
Timestamp:
06/20/06 00:22:32 (3 years ago)
Author:
ngerakines
Message:

* Added growl notification on service connect
* Changed the language used in login and prefs
* On enter from password field a login is performed
* Made several adjustments throughout the app

Location:
trunk
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • trunk/AtomApi.m

    r35 r40  
    149149 
    150150- (void) makerequest:(NSString *) reqtype { 
    151         NSLog(@"Making request to url '%@'\n", apiurl); 
     151// NSLog(@"Making request to url '%@'\n", apiurl); 
    152152        NSURL *aURL = [NSURL URLWithString:apiurl]; 
    153153        [aURL URLHandleUsingCache:NO]; 
     
    157157        // set auth if we need it. 
    158158        if ([self requiresAuth]) { 
    159                 NSLog(@" XXX Auth required\n"); 
     159// NSLog(@" XXX Auth required\n"); 
    160160                NSString *login = [self authuser]; 
    161161                NSString *password = [self authpass]; 
  • trunk/ImageDragArea.m

    r35 r40  
    2424 
    2525- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender { 
    26         NSLog(@"- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender - called\n"); 
     26// NSLog$1(@"- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender - called\n"); 
    2727        TypePad *tp = [[[TypePad alloc] init] autorelease]; 
    2828        [tp dispatchAction:[sender draggingPasteboard]]; 
  • trunk/LoginWindowController.m

    r38 r40  
    9898        if ([tp addAccount:[usernamelist stringValue] pass:[password stringValue]]) { 
    9999                [tp saveAccounts]; 
     100                [tp appNotify:@"You are now connected to TypePad" title:@"Connected"]; 
    100101                [NSBundle loadNibNamed:@"TypePad.nib" owner:self]; 
    101102                [mywindow close]; 
    102103        } else { 
    103                 NSRunAlertPanel(@"Alert", @"No blogs were loaded", @"OK", nil, nil); 
     104                NSRunAlertPanel(@"Alert", @"Login Failed", @"OK", nil, nil); 
    104105        } 
    105106} 
     
    109110        if ([vx addAccount:[usernamelist stringValue] pass:[password stringValue]]) { 
    110111                [vx saveAccounts]; 
     112                [vx appNotify:@"You are now connected to Vox" title:@"Connected"]; 
    111113                [NSBundle loadNibNamed:@"Vox.nib" owner:self]; 
    112114                [mywindow close]; 
    113115        } else { 
    114                 NSRunAlertPanel(@"Alert", @"No blogs were loaded", @"OK", nil, nil); 
     116                NSRunAlertPanel(@"Alert", @"Login Failed", @"OK", nil, nil); 
    115117        } 
    116118} 
  • trunk/PrefController.m

    r39 r40  
    66// 1 
    77- (id)init { 
    8         NSLog(@"PrefController - init -- called \n"); 
     8// NSLog(@"PrefController - init -- called \n"); 
    99    if (self = [super init]) { 
    1010        [self setToolbar:[[NSToolbar alloc] initWithIdentifier:@"preferencePanes"]]; 
     
    142142                VoxCollection *voxcol = key; 
    143143                [myCollections setObject:[voxcol collectionID] forKey:[NSString stringWithFormat:@"Collection: %@", [voxcol collectionTitle]]]; 
    144                 NSLog(@"Mapping collection '%@' to id '%@'", [voxcol collectionTitle], [voxcol collectionID]); 
     144// NSLog(@"Mapping collection '%@' to id '%@'", [voxcol collectionTitle], [voxcol collectionID]); 
    145145                [vx_image_dropdown addItemWithTitle:[NSString stringWithFormat:@"Collection: %@", [voxcol collectionTitle]]]; 
    146146                [vx_text_dropdown addItemWithTitle:[NSString stringWithFormat:@"Collection: %@", [voxcol collectionTitle]]]; 
     
    229229 
    230230- (void) windowWillClose:(id) sender { 
    231         NSLog(@"Window closed\n"); 
     231// NSLog(@"Window closed\n"); 
    232232        [self save_generic]; 
    233233        if ([self service]) { 
     
    308308 
    309309- (void) save_typepad { 
    310         NSLog(@"- (void) save_typepad -- called\n"); 
     310// NSLog(@"- (void) save_typepad -- called\n"); 
    311311        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 
    312312        if ([tp_image_dropdown numberOfItems] > 0) { 
  • trunk/Preferences.nib/info.nib

    r38 r40  
    1616                <string>485 586 470 119 0 0 1440 938 </string> 
    1717                <key>7</key> 
    18                 <string>311 316 470 122 0 0 1440 938 </string> 
     18                <string>485 585 470 122 0 0 1440 938 </string> 
    1919                <key>8</key> 
    2020                <string>485 586 470 119 0 0 1440 938 </string> 
  • trunk/TypePadAtomAPI.m

    r35 r40  
    1414 
    1515- (void) newpost:(NSString *) to args:(NSMutableDictionary *) args { 
    16         NSLog(@"-(void) newpost:(NSString *)to - called\n"); 
     16// NSLog(@"-(void) newpost:(NSString *)to - called\n"); 
    1717        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 
    1818        NSString *reqtype; 
    1919        if ([to isEqualToString:@"weblog"] || [to isEqualToString:@"0"]) { 
    20                 NSLog(@"set as weblog post type\n"); 
     20// NSLog(@"set as weblog post type\n"); 
    2121                reqtype = @"POST"; 
    2222                [self setApiurl:[NSString stringWithFormat:@"%@weblog/blog_id=%@",@"http://www.typepad.com/t/atom/", [args objectForKey:@"destinationid"]]]; 
     
    2424        } 
    2525        if ([to isEqualToString:@"gallery"] || [to isEqualToString:@"1"]) { 
    26                 NSLog(@"set as gallery post type\n"); 
     26// NSLog(@"set as gallery post type\n"); 
    2727                reqtype = @"POST"; 
    2828                [self setApiurl:[NSString stringWithFormat:@"%@gallery/set_id=%@", @"http://www.typepad.com/t/atom/", [args objectForKey:@"destinationid"]]]; 
     
    3030        } 
    3131        if ([to isEqualToString:@"quickpost"] || [to isEqualToString:@"2"]) { 
    32                 NSLog(@"set as quickpost post type\n"); 
     32// NSLog(@"set as quickpost post type\n"); 
    3333                reqtype = @"POST"; 
    3434                [self setApiurl:[NSString stringWithFormat:@"%@weblog/blog_id=%@", @"http://www.typepad.com/t/atom/", [args objectForKey:@"destinationid"]]]; 
     
    3636        } 
    3737        if ([to isEqualToString:@"weblogdiscovery"] || [to isEqualToString:@"3"]) { 
    38                 NSLog(@"set as weblogdiscovery post type\n"); 
     38// NSLog(@"set as weblogdiscovery post type\n"); 
    3939                reqtype = @"GET"; 
    4040                [self setApiurl:[NSString stringWithFormat:@"%@weblog", @"http://www.typepad.com/t/atom/"]]; 
     
    4242        }  
    4343        if ([to isEqualToString:@"categorydiscovery"] || [to isEqualToString:@"4"]) { 
    44                 NSLog(@"set as categorydiscovery post type\n"); 
     44// NSLog(@"set as categorydiscovery post type\n"); 
    4545                reqtype = @"GET"; 
    4646                [self setApiurl:[NSString stringWithFormat:@"%@categories/blog_id=%@", @"http://www.typepad.com/t/atom/", [args objectForKey:@"blog_id"] ]]; 
     
    4848        } 
    4949        if ([to isEqualToString:@"gallerydiscovery"] || [to isEqualToString:@"5"]) { 
    50                 NSLog(@"set as gallerydiscovery post type\n"); 
     50// NSLog(@"set as gallerydiscovery post type\n"); 
    5151                reqtype = @"GET"; 
    5252                [self setApiurl:[NSString stringWithFormat:@"%@gallery", @"http://www.typepad.com/t/atom/"]]; 
    5353                [self weblog_discover]; 
    5454        }  
    55         NSLog(@"Making request with request type %@\n", reqtype); 
     55// NSLog(@"Making request with request type %@\n", reqtype); 
    5656        [self makerequest:reqtype]; 
    5757} 
    5858 
    5959- (NSString *) gallery_upload: (NSString *) file { 
    60         NSLog(@"- (NSString *) gallery_newitem - called"); 
     60// NSLog(@"- (NSString *) gallery_newitem - called"); 
    6161        NSData *data = [NSData dataWithContentsOfFile:file]; 
    6262        NSString *encodedFile = [data base64Encoding]; 
     
    6767 
    6868- (NSString *) weblog_upload: (NSString *) file { 
    69         NSLog(@"- (NSString *) weblog_upload - called"); 
     69// NSLog(@"- (NSString *) weblog_upload - called"); 
    7070        NSData *data = [NSData dataWithContentsOfFile:file]; 
    7171        NSString *encodedFile = [data base64Encoding]; 
     
    7777 
    7878- (NSString *) weblog_newpost: (NSString *) title content: (NSString *) content { 
    79         NSLog(@"- (NSString *) weblog_newpost - called"); 
     79// NSLog(@"- (NSString *) weblog_newpost - called"); 
    8080        atomdata = [NSString stringWithFormat:@"<entry xmlns=\"http://purl.org/atom/ns#\"><title>%@</title><summary></summary><content mode=\"xml\"><div xmlns=\"http://www.w3.org/1999/xhtml\">%@</div></content>%@</entry>", title, content, [self weblog_postcategories]]; 
    8181        // NSLog(@"Atom feed:\n%@\n", atomdata); 
     
    8484 
    8585- (NSString *) weblog_discover { 
    86         NSLog(@"- (NSString *) weblog_newitem - called"); 
     86// NSLog(@"- (NSString *) weblog_newitem - called"); 
    8787        /* atomdata = [NSString stringWithFormat:@"<entry xmlns=\"http://purl.org/atom/ns#\"><title>%@</title><summary></summary><content mode=\"xml\"><div xmlns=\"http://www.w3.org/1999/xhtml\">%@</div></content></entry>", title, content]; */ 
    8888        atomdata = @""; 
  • trunk/TypePadController.m

    r30 r40  
    55 
    66- (void)awakeFromNib { 
    7         NSLog(@"TypePadController - (void)awakeFromNib - called\n"); 
     7// NSLog(@"TypePadController - (void)awakeFromNib - called\n"); 
    88} 
    99 
  • trunk/Vox.m

    r39 r40  
    130130- (void) dispatchAction: (NSPasteboard *) pb { 
    131131        int actionType = [self handleTypes:pb]; 
    132         switch (actionType) { 
    133                 case 1: 
    134                         [self handleTypeOne:[ntypes objectForKey:@"stringForType:_NSStringPboardType"]]; 
    135                         break; 
    136                 case 3: 
    137                         [self handleTypeThree:[pb propertyListForType:@"NSFilenamesPboardType"]]; 
    138                         break; 
    139                 default: 
    140                         NSLog(@"Something went horribly wrong.\n"); 
     132        if (actionType == 3) { 
     133                [self handleTypeThree:[pb propertyListForType:@"NSFilenamesPboardType"]]; 
     134        } 
     135        if (actionType == 1) { 
     136                [self handleTypeOne:[ntypes objectForKey:@"stringForType:_NSStringPboardType"]]; 
    141137        } 
    142138} 
     
    144140// text 
    145141- (void) handleTypeOne: (NSString *) text { 
    146         NSLog(@"- (void) handleTypeOne: (NSString *) text - called\n"); 
     142// NSLog(@"- (void) handleTypeOne: (NSString *) text - called\n"); 
    147143        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 
    148144        NSString *postloc = [userDefaults objectForKey:@"text destination type"]; 
     
    160156// image 
    161157- (void) handleTypeThree: (NSArray *) list { 
    162         NSLog(@"- (void) handleTypeThree: (NSArray *) list - called\n"); 
     158// NSLog(@"- (void) handleTypeThree: (NSArray *) list - called\n"); 
    163159        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; 
    164160        NSString *postloc = [userDefaults objectForKey:@"vox image destination type"]; 
     
    168164                        NSString *path;  
    169165                        while( path = [enumerator nextObject] ) {  
    170                                 NSLog([NSString stringWithFormat:@"Uploading file %@", path]); 
     166// NSLog([NSString stringWithFormat:@"Uploading file %@", path]); 
    171167                                VoxAtomApi *client = [[[VoxAtomApi alloc] init] autorelease]; 
    172168                                [client setAuth:[self defaultaccount] pass:[self defaultAccountPass]]; 
     
    180176 
    181177- (int) handleTypes: (NSPasteboard *) pb { 
    182         NSLog(@"- (int) handleTypes:(NSPasteboard *) pb - called\n"); 
     178// NSLog(@"- (int) handleTypes:(NSPasteboard *) pb - called\n"); 
    183179    NSArray *types = [self allowTypes]; 
    184180        unsigned int i, count = [types count]; 
     
    193189                                totalcount++; 
    194190                                [ntypes setObject:[obj description] forKey:[NSString stringWithFormat:@"%@_%@",  methods[m], type]]; 
    195                                 NSLog(@"%@ - %@ - %@\n",  methods[m], type, [obj description]); 
     191// NSLog(@"%@ - %@ - %@\n",  methods[m], type, [obj description]); 
    196192                        } 
    197193                } 
  • trunk/VoxAtomApi.m

    r36 r40  
    2626        } 
    2727        if ([to isEqualToString:@"collection"] || [to isEqualToString:@"1"]) { 
    28                 NSLog(@"set as weblog post type\n"); 
     28// NSLog(@"set as weblog post type\n"); 
    2929                reqtype = @"POST"; 
    3030                [self setApiurl:[NSString stringWithFormat:@"http://www.vox.com/atom/svc=post/collection_id=%@", [args objectForKey:@"destinationid"]]]; 
     
    3232        } 
    3333        if ([to isEqualToString:@"quickpost"] || [to isEqualToString:@"2"]) { 
    34                 NSLog(@"set as quickpost post type\n"); 
     34// NSLog(@"set as quickpost post type\n"); 
    3535                reqtype = @"POST"; 
    3636                [self setApiurl:[NSString stringWithFormat:@"http://www.vox.com/atom/collection_id=%@", [args objectForKey:@"destinationid"]]]; 
     
    5252 
    5353- (NSString *) weblog_upload: (NSString *) file { 
    54         NSLog(@"- (NSString *) weblog_upload - called"); 
     54// NSLog(@"- (NSString *) weblog_upload - called"); 
    5555        NSData *data = [NSData dataWithContentsOfFile:file]; 
    5656        NSString *encodedFile = [data base64Encoding]; 
     
    6161 
    6262- (NSString *) weblog_newpost: (NSString *) title content: (NSString *) content { 
    63         NSLog(@"- (NSString *) weblog_newpost - called"); 
     63// NSLog(@"- (NSString *) weblog_newpost - called"); 
    6464        atomdata = [NSString stringWithFormat:@"<entry xmlns=\"http://purl.org/atom/ns#\"><title>%@</title><summary></summary><content mode=\"xml\"><div xmlns=\"http://www.w3.org/1999/xhtml\">%@</div></content></entry>", title, content]; 
    6565        return atomdata; 
  • trunk/VoxRoundedView.m

    r36 r40  
    4545         NSPasteboard *pboard = [sender draggingPasteboard]; 
    4646         NSArray *filenames = [pboard propertyListForType:NSFilenamesPboardType]; 
    47          NSLog(@"draggingEntered: filenames: %@\n", [filenames description]); 
     47// NSLog$1(@"draggingEntered: filenames: %@\n", [filenames description]); 
    4848         */ 
    4949