Changeset 2130


Ignore:
Timestamp:
Jun 17, 2007, 2:32:11 PM (15 years ago)
Author:
livings124
Message:

instead of a sheet when creating the torrent file, turn the whole window into the progress bar

Location:
branches/file_selection/macosx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/file_selection/macosx/CreatorWindowController.h

    r2129 r2130  
    3434    IBOutlet NSButton * fPrivateCheck;
    3535   
    36     IBOutlet NSWindow * fProgressWindow;
     36    IBOutlet NSView * fProgressView;
    3737    IBOutlet NSProgressIndicator * fProgressIndicator;
    3838   
     
    4141   
    4242    NSTimer * fTimer;
     43    BOOL fStarted;
    4344}
    4445
  • branches/file_selection/macosx/CreatorWindowController.m

    r2129 r2130  
    5454    if ((self = [super initWithWindowNibName: name]))
    5555    {
     56        fStarted = NO;
     57       
    5658        fPath = [path retain];
    5759        fInfo = tr_metaInfoBuilderCreate(handle, [fPath UTF8String]);
     
    174176    tr_makeMetaInfo(fInfo, [fLocation UTF8String], [trackerString UTF8String], [[fCommentView string] UTF8String],
    175177                    [fPrivateCheck state] == NSOnState);
    176    
     178    #warning delay at first?
    177179    fTimer = [NSTimer scheduledTimerWithTimeInterval: 0.1 target: self selector: @selector(checkProgress)
    178180                        userInfo: nil repeats: YES];
    179     [fTimer fire];
    180181}
    181182
     
    234235        [fTimer invalidate];
    235236        fTimer = nil;
    236        
    237         if ([[self window] attachedSheet])
    238         {
    239             [NSApp endSheet: fProgressWindow];
    240             [fProgressWindow orderOut: nil];
    241         }
    242237       
    243238        if (fInfo->failed)
     
    268263    {
    269264        [fProgressIndicator setDoubleValue: (double)fInfo->pieceIndex / fInfo->pieceCount];
    270         if (![[self window] attachedSheet])
    271             [NSApp beginSheet: fProgressWindow modalForWindow: [self window] modalDelegate: self
    272                     didEndSelector: nil contextInfo: nil];
     265       
     266        if (!fStarted)
     267        {
     268            NSWindow * window = [self window];
     269           
     270            NSRect windowRect = [window frame];
     271            float difference = [fProgressView frame].size.height - [[window contentView] frame].size.height;
     272            windowRect.origin.y -= difference;
     273            windowRect.size.height += difference;
     274           
     275            //don't allow vertical resizing
     276            float height = windowRect.size.height;
     277            [window setMinSize: NSMakeSize([window minSize].width, height)];
     278            [window setMaxSize: NSMakeSize([window maxSize].width, height)];
     279           
     280            [window setContentView: fProgressView];
     281            [window setFrame: windowRect display: YES animate: YES];
     282            [fProgressView setHidden: NO];
     283           
     284            fStarted = YES;
     285        }
    273286    }
    274287}
  • branches/file_selection/macosx/English.lproj/Creator.nib/classes.nib

    r2129 r2130  
    1818                fPrivateCheck = NSButton;
    1919                fProgressIndicator = NSProgressIndicator;
    20                 fProgressWindow = NSWindow;
     20                fProgressView = NSView;
    2121                fStatusField = NSTextField;
    2222                fTrackerField = NSTextField;
  • branches/file_selection/macosx/English.lproj/Creator.nib/info.nib

    r2129 r2130  
    55        <key>IBDocumentLocation</key>
    66        <string>52 61 356 240 0 0 1152 842 </string>
     7        <key>IBEditorPositions</key>
     8        <dict>
     9                <key>56</key>
     10                <string>365 224 368 126 0 0 1152 842 </string>
     11        </dict>
    712        <key>IBFramework Version</key>
    813        <string>446.1</string>
    914        <key>IBOpenObjects</key>
    1015        <array>
    11                 <integer>45</integer>
     16                <integer>56</integer>
    1217                <integer>5</integer>
    1318        </array>
Note: See TracChangeset for help on using the changeset viewer.