Changeset 116

Show
Ignore:
Timestamp:
02/07/08 03:44:15 (1 year ago)
Author:
mike
Message:

[new] smaller antialiased thumbnails
[new] VM name is taken from filename
[fix] Q Browser resizable

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/English.lproj/MainMenu.nib/info.nib

    r106 r116  
    1111        <key>IBOpenObjects</key> 
    1212        <array> 
    13                 <integer>216</integer> 
     13                <integer>221</integer> 
    1414        </array> 
    1515        <key>IBSystem Version</key> 
  • trunk/English.lproj/QEditVM.nib/info.nib

    r106 r116  
    1111        <key>IBOpenObjects</key> 
    1212        <array> 
    13                 <integer>10</integer> 
     13                <integer>12</integer> 
    1414        </array> 
    1515        <key>IBSystem Version</key> 
  • trunk/QControl/QControlController.m

    r112 r116  
    256256    if (create) { 
    257257        while ( (object = [enumerator nextObject]) ) { 
    258             if ([[[object objectForKey:@"PC Data"] objectForKey:@"name"] isEqual: name] ) 
     258            if ([[[object objectForKey:@"Temporary"] objectForKey:@"name"] isEqual: name] ) 
    259259                return 0; 
    260260        } 
    261261    } else { 
    262262        while ( (object = [enumerator nextObject]) ) { 
    263             if ([[[object objectForKey:@"PC Data"] objectForKey:@"name"] isEqual: name]) { 
    264                 if ( ![[[thisPC objectForKey:@"PC Data"] objectForKey:@"name"] isEqual:name]) 
     263            if ([[[object objectForKey:@"Temporary"] objectForKey:@"name"] isEqual: name]) { 
     264                if ( ![[[thisPC objectForKey:@"Temporary"] objectForKey:@"name"] isEqual:name]) 
    265265                    return 0; 
    266266            } 
     
    293293        // do not allow deleting a running VM 
    294294    if ([[[VM objectForKey:@"PC Data"] objectForKey:@"state"] isEqual:@"running"]) { 
    295         [self standardAlert: [NSString stringWithFormat: NSLocalizedStringFromTable(@"deleteVM:standardAlert", @"Localizable", @"QControlController"),[[VM objectForKey:@"PC Data"] objectForKey:@"name"]] 
    296              informativeText: [NSString stringWithFormat: NSLocalizedStringFromTable(@"deleteVM:informativeText", @"Localizable", @"QControlController"), [[VM objectForKey:@"PC Data"] objectForKey:@"name"]]]; 
     295        [self standardAlert: [NSString stringWithFormat: NSLocalizedStringFromTable(@"deleteVM:standardAlert", @"Localizable", @"QControlController"),[[VM objectForKey:@"Temporary"] objectForKey:@"name"]] 
     296             informativeText: [NSString stringWithFormat: NSLocalizedStringFromTable(@"deleteVM:informativeText", @"Localizable", @"QControlController"), [[VM objectForKey:@"Temporary"] objectForKey:@"name"]]]; 
    297297        return; 
    298298    } 
     
    303303                    alternateButton: NSLocalizedStringFromTable(@"deleteVM:alternateButton", @"Localizable", @"QControlController") 
    304304                        otherButton:nil 
    305                   informativeTextWithFormat:[NSString stringWithFormat: NSLocalizedStringFromTable(@"deleteVM:informativeTextWithFormat", @"Localizable", @"QControlController"),[[VM objectForKey:@"PC Data"] objectForKey:@"name"]]]; 
     305                  informativeTextWithFormat:[NSString stringWithFormat: NSLocalizedStringFromTable(@"deleteVM:informativeTextWithFormat", @"Localizable", @"QControlController"),[[VM objectForKey:@"Temporary"] objectForKey:@"name"]]]; 
    306306     
    307307    // display alert 
  • trunk/QControl/QControlTableViewController.m

    r113 r116  
    145145        } 
    146146         
    147         NSMutableAttributedString *attrString = [[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat: @"%@\n", [[VM objectForKey:@"Temporary"] objectForKey:@"name"]] attributes:[NSDictionary dictionaryWithObject: [NSFont boldSystemFontOfSize:[NSFont systemFontSize]] forKey:NSFontAttributeName]] autorelease]; 
     147        NSMutableAttributedString *attrString = [[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat: @"%@\n", [[[[VM objectForKey:@"Temporary"] objectForKey:@"URL"] path] lastPathComponent]] attributes:[NSDictionary dictionaryWithObject: [NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]] forKey:NSFontAttributeName]] autorelease]; 
    148148        [attrString appendAttributedString: [[[NSAttributedString alloc] initWithString:state attributes:[NSDictionary dictionaryWithObject:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]] forKey:NSFontAttributeName]] autorelease]]; 
    149149         
     
    254254                savedImage = [[[NSImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/QuickLook/Thumbnail.png", [[[VM objectForKey:@"Temporary"] objectForKey:@"URL"] path]]] autorelease]; 
    255255                if (savedImage) { // try screen.png 
    256                         thumbnail = [[[NSImage alloc] initWithSize:NSMakeSize(100.0,  75.0)] autorelease]; 
     256                        thumbnail = [[[NSImage alloc] initWithSize:NSMakeSize(80.0,  60.0)] autorelease]; 
    257257                        [thumbnail lockFocus]; 
    258                         [savedImage drawInRect:NSMakeRect(0.0, 0.0, 100.0, 75.0) fromRect:NSMakeRect(0.0, 0.0, [savedImage size].width, [savedImage size].height) operation:NSCompositeSourceOver fraction:1.0]; 
     258                        [savedImage drawInRect:NSMakeRect(0.0, 0.0, 80.0, 60.0) fromRect:NSMakeRect(0.0, 0.0, [savedImage size].width, [savedImage size].height) operation:NSCompositeSourceOver fraction:1.0]; 
    259259                        [thumbnail unlockFocus]; 
    260260                        return thumbnail; 
     
    293293                                case QDocumentRunning: 
    294294                                case QDocumentSaving: 
    295                                         thumbnail = [(QDocumentOpenGLView *)[qDocument screenView] screenshot:NSMakeSize(100.0, 75.0)]; 
     295                                        thumbnail = [(QDocumentOpenGLView *)[qDocument screenView] screenshot:NSMakeSize(80.0, 60.0)]; 
    296296                                        [VMsImages replaceObjectAtIndex:i withObject:thumbnail]; 
    297297                                        break; 
  • trunk/QDocument/QDocument.m

    r115 r116  
    240240- (IBAction) newDocument:(id)sender 
    241241{ 
     242        Q_DEBUG(@"saveDocument"); 
     243 
     244        // Todo: 
     245        // either create a "new document" (immediately create the files) or show a assistent 
     246        // the -name argument is created by the document name 
     247 
    242248    NSLog(@"We should create a now Document now"); 
    243249} 
     
    246252{ 
    247253        Q_DEBUG(@"saveDocument"); 
     254         
     255        // Todo: 
     256        // implement saving as following: 
     257        // if VM is shutdown/saved: 
     258        //     - save the .qvm package with the save name 
     259        //     - save configuration.plist 
     260        // if the VM is running 
     261        //     - save a snapshot 
    248262 
    249263    [distributedObject setCommand:'W' arg1:0 arg2:0 arg3:0 arg4:0]; 
     
    253267{ 
    254268        Q_DEBUG(@"revertDocumentToSaved"); 
     269         
     270        // Todo 
     271        // only revert running machines 
    255272 
    256273    [distributedObject setCommand:'X' arg1:0 arg2:0 arg3:0 arg4:0]; 
  • trunk/QDocument/QDocumentEditVMController.h

    r106 r116  
    3838         
    3939        // Tab 1 
    40         IBOutlet NSTextField *vMName; 
    4140        IBOutlet NSButton *grabless; 
    4241        IBOutlet NSButton *qDrivers; 
  • trunk/QDocument/QDocumentEditVMController.m

    r106 r116  
    7878         
    7979        // Tab 1 
    80         [vMName setStringValue:@""]; 
    8180        [grabless setState:NSOffState]; 
    8281        [qDrivers setState:NSOffState]; 
     
    120119        Q_DEBUG(@"setOption:%@ withArgument:%@", key, argument); 
    121120         
    122         // -name TODO: convert -name from 0.2.0.Q profile 
    123         if ([key isEqual:@"-name"]) { 
    124                 [vMName setStringValue:argument]; 
    125                 return TRUE; 
    126  
    127121        // grabless (-usbdevice tablet) 
    128         } else if ([key isEqual:@"-usbdevice"] && [argument isEqual:@"tablet"]) { 
     122        if ([key isEqual:@"-usbdevice"] && [argument isEqual:@"tablet"]) { 
    129123                [grabless setState:NSOffState]; 
    130124                return TRUE; 
  • trunk/QDocument/QDocumentOpenGLView.m

    r114 r116  
    574574        // setup CG 
    575575        CGContextRef viewContextRef = [[NSGraphicsContext currentContext] graphicsPort]; 
    576         CGContextSetInterpolationQuality (viewContextRef, kCGInterpolationNone); 
    577         CGContextSetShouldAntialias (viewContextRef, NO); 
     576        CGContextSetInterpolationQuality (viewContextRef, kCGInterpolationLow); 
     577        CGContextSetShouldAntialias (viewContextRef, YES); 
    578578 
    579579        // draw screen bitmap directly to Core Graphics context 
  • trunk/QShared/QQvmManager.m

    r106 r116  
    6666        Q_DEBUG(@"saveVMConfiguration %@", VM); 
    6767 
    68         //NSURL *URL; 
    69         //URL = [[[VM objectForKey:@"Temporary"] objectForKey:@"URL"] copy]; 
    70         //[[VM objectForKey:@"Temporary"] removeObjectForKey:@"URL"]; // can't be stored in Propertylist 
    71  
    7268        NSMutableDictionary *temporary; 
    7369 
    7470        temporary = [[VM objectForKey:@"Temporary"] copy]; 
     71        [temporary autorelease]; 
    7572        [VM removeObjectForKey:@"Temporary"]; // don't store temporary items (URL can't be stored in Propertylist anyways) 
    76          
    7773 
    7874    NSData *data = [NSPropertyListSerialization 
     
    188184                // exploded arguments 
    189185                [[tempVM objectForKey:@"Temporary"] setObject:[[QQvmManager sharedQvmManager] explodeVMArguments:[tempVM objectForKey:@"Arguments"]] forKey:@"explodedArguments"]; 
    190                  
    191                 // name 
    192                 nameIndex = [[[tempVM objectForKey:@"Temporary"] objectForKey:@"explodedArguments"] indexOfObject:@"-name"]; 
    193                 if (nameIndex == NSNotFound) { 
    194                         name = @"Unknown"; 
    195                         NSLog(@"name: %@", name); 
    196                 } else { 
    197                         name = [[[tempVM objectForKey:@"Temporary"] objectForKey:@"explodedArguments"] objectAtIndex:(nameIndex + 1)]; 
    198                 } 
    199                 [[tempVM objectForKey:@"Temporary"] setObject:name forKey:@"name"]; 
    200                  
     186 
    201187                // url 
    202188                [[tempVM objectForKey:@"Temporary"] setObject:[NSURL fileURLWithPath:filename] forKey:@"URL"];