Adium

Changeset 25555

Show
Ignore:
Timestamp:
11/09/2008 12:50:54 PM (2 months ago)
Author:
zacw
Message:

Patch from tarragon to hide the "stop" button on a successful transfer, and replace it with a "resend" button on an outgoing unsuccessful transfer. Fixes #9446. Thanks!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Adium.xcodeproj/project.pbxproj

    r25554 r25555  
    44        classes = { 
    55        }; 
    6         objectVersion = 45
     6        objectVersion = 44
    77        objects = { 
    88 
     
    9393                1172FBD80CDAA8D400B8E233 /* libmeanwhile.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1172FBC80CDAA8D400B8E233 /* libmeanwhile.framework */; }; 
    9494                1172FBD90CDAA8D400B8E233 /* libpurple.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1172FBC90CDAA8D400B8E233 /* libpurple.framework */; }; 
     95                117866DE0EC759B9003E9B97 /* FTProgressResend_Selected.tif in Resources */ = {isa = PBXBuildFile; fileRef = 117866D80EC759B9003E9B97 /* FTProgressResend_Selected.tif */; }; 
     96                117866DF0EC759B9003E9B97 /* FTProgressResend.tif in Resources */ = {isa = PBXBuildFile; fileRef = 117866D90EC759B9003E9B97 /* FTProgressResend.tif */; }; 
     97                117866E00EC759B9003E9B97 /* FTProgressResendPressed_Selected.tif in Resources */ = {isa = PBXBuildFile; fileRef = 117866DA0EC759B9003E9B97 /* FTProgressResendPressed_Selected.tif */; }; 
     98                117866E10EC759B9003E9B97 /* FTProgressResendPressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 117866DB0EC759B9003E9B97 /* FTProgressResendPressed.tif */; }; 
     99                117866E20EC759B9003E9B97 /* FTProgressResendRollover_Selected.tif in Resources */ = {isa = PBXBuildFile; fileRef = 117866DC0EC759B9003E9B97 /* FTProgressResendRollover_Selected.tif */; }; 
     100                117866E30EC759B9003E9B97 /* FTProgressResendRollover.tif in Resources */ = {isa = PBXBuildFile; fileRef = 117866DD0EC759B9003E9B97 /* FTProgressResendRollover.tif */; }; 
    95101                117D6DC00BC5F0C40080D02B /* notify.png in Resources */ = {isa = PBXBuildFile; fileRef = 117D6DBF0BC5F0C40080D02B /* notify.png */; }; 
    96102                11AA1EFA0BCAE9C3003DDA66 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 11AA1EF90BCAE9C3003DDA66 /* Quartz.framework */; }; 
     
    18831889                1172FBC80CDAA8D400B8E233 /* libmeanwhile.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libmeanwhile.framework; path = Frameworks/libmeanwhile.framework; sourceTree = "<group>"; }; 
    18841890                1172FBC90CDAA8D400B8E233 /* libpurple.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libpurple.framework; path = Frameworks/libpurple.framework; sourceTree = "<group>"; }; 
     1891                117866D80EC759B9003E9B97 /* FTProgressResend_Selected.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FTProgressResend_Selected.tif; path = Resources/FTProgressResend_Selected.tif; sourceTree = "<group>"; }; 
     1892                117866D90EC759B9003E9B97 /* FTProgressResend.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FTProgressResend.tif; path = Resources/FTProgressResend.tif; sourceTree = "<group>"; }; 
     1893                117866DA0EC759B9003E9B97 /* FTProgressResendPressed_Selected.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FTProgressResendPressed_Selected.tif; path = Resources/FTProgressResendPressed_Selected.tif; sourceTree = "<group>"; }; 
     1894                117866DB0EC759B9003E9B97 /* FTProgressResendPressed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FTProgressResendPressed.tif; path = Resources/FTProgressResendPressed.tif; sourceTree = "<group>"; }; 
     1895                117866DC0EC759B9003E9B97 /* FTProgressResendRollover_Selected.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FTProgressResendRollover_Selected.tif; path = Resources/FTProgressResendRollover_Selected.tif; sourceTree = "<group>"; }; 
     1896                117866DD0EC759B9003E9B97 /* FTProgressResendRollover.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FTProgressResendRollover.tif; path = Resources/FTProgressResendRollover.tif; sourceTree = "<group>"; }; 
    18851897                117D6DBF0BC5F0C40080D02B /* notify.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = notify.png; path = Resources/notify.png; sourceTree = SOURCE_ROOT; }; 
    18861898                11AA1EF90BCAE9C3003DDA66 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = /System/Library/Frameworks/Quartz.framework; sourceTree = "<absolute>"; }; 
     
    54425454                                34D2E8670758BB0B0054C56D /* ESFileTransferPreferences.h */, 
    54435455                                34D2E8680758BB0B0054C56D /* ESFileTransferPreferences.m */, 
     5456                                117866D80EC759B9003E9B97 /* FTProgressResend_Selected.tif */, 
     5457                                117866D90EC759B9003E9B97 /* FTProgressResend.tif */, 
     5458                                117866DA0EC759B9003E9B97 /* FTProgressResendPressed_Selected.tif */, 
     5459                                117866DB0EC759B9003E9B97 /* FTProgressResendPressed.tif */, 
     5460                                117866DC0EC759B9003E9B97 /* FTProgressResendRollover_Selected.tif */, 
     5461                                117866DD0EC759B9003E9B97 /* FTProgressResendRollover.tif */, 
    54445462                                34D8324807CBD53A006466F2 /* FTProgressRevealRollover.tif */, 
    54455463                                34D8324907CBD53A006466F2 /* FTProgressRevealRollover_Selected.tif */, 
     
    85758593                        }; 
    85768594                        buildConfigurationList = DADE8E3A085507450062B664 /* Build configuration list for PBXProject "Adium" */; 
    8577                         compatibilityVersion = "Xcode 3.1"; 
     8595                        compatibilityVersion = "Xcode 3.0"; 
    85788596                        hasScannedForEncodings = 1; 
    85798597                        knownRegions = ( 
     
    91369154                                34A1AEEE0DFD4C4A00AC78CF /* AIAdvancedInspectorPane.nib in Resources */, 
    91379155                                317D83680E89F40500298BDB /* bookmark_chat.png in Resources */, 
     9156                                117866DE0EC759B9003E9B97 /* FTProgressResend_Selected.tif in Resources */, 
     9157                                117866DF0EC759B9003E9B97 /* FTProgressResend.tif in Resources */, 
     9158                                117866E00EC759B9003E9B97 /* FTProgressResendPressed_Selected.tif in Resources */, 
     9159                                117866E10EC759B9003E9B97 /* FTProgressResendPressed.tif in Resources */, 
     9160                                117866E20EC759B9003E9B97 /* FTProgressResendRollover_Selected.tif in Resources */, 
     9161                                117866E30EC759B9003E9B97 /* FTProgressResendRollover.tif in Resources */, 
    91389162                        ); 
    91399163                        runOnlyForDeploymentPostprocessing = 0; 
     
    1252112545                                PREBINDING = NO; 
    1252212546                                PRECOMP_DESTINATION_DIR = "/Library/Caches/com.apple.Xcode.$(UID)/PrefixHeaders"; 
    12523                                 SDKROOT = macosx10.5
     12547                                SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"
    1252412548                                STRIP_INSTALLED_PRODUCT = NO; 
    1252512549                                VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64"; 
     
    1253112555                        isa = XCBuildConfiguration; 
    1253212556                        buildSettings = { 
    12533                                 ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 
     12557                                ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; 
     12558                                ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; 
    1253412559                                COPY_PHASE_STRIP = YES; 
    1253512560                                DEBUG_INFORMATION_FORMAT = dwarf; 
     
    1255912584                                PREBINDING = NO; 
    1256012585                                PRECOMP_DESTINATION_DIR = "/Library/Caches/com.apple.Xcode.$(UID)/PrefixHeaders"; 
    12561                                 SDKROOT = macosx10.5
     12586                                SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"
    1256212587                                VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64"; 
    1256312588                                WARNING_CFLAGS = "-Wall"; 
     
    1256812593                        isa = XCBuildConfiguration; 
    1256912594                        buildSettings = { 
    12570                                 ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 
     12595                                ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; 
     12596                                ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; 
    1257112597                                COPY_PHASE_STRIP = NO; 
    1257212598                                DEBUG_INFORMATION_FORMAT = dwarf; 
     
    1259912625                                PREBINDING = NO; 
    1260012626                                PRECOMP_DESTINATION_DIR = "/Library/Caches/com.apple.Xcode.$(UID)/PrefixHeaders"; 
    12601                                 SDKROOT = macosx10.5
     12627                                SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"
    1260212628                                STRIP_INSTALLED_PRODUCT = NO; 
    1260312629                                VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64"; 
  • trunk/Source/ESFileTransferProgressRow.m

    r24803 r25555  
    150150        [self gotUpdateForFileTransfer:inFileTransfer]; 
    151151         
    152         [view setAllowsCancel:![inFileTransfer isStopped]]; 
    153152        [owner progressRowDidChangeStatus:self]; 
    154153         
     
    200199                case Complete_FileTransfer: 
    201200                        [view setProgressVisible:NO]; 
     201            [view setButtonStopResumeVisible:NO]; 
    202202                        transferSpeedStatus = AILocalizedString(@"Complete",nil); 
    203203                        break; 
    204204                case Cancelled_Local_FileTransfer: 
     205                    [view setProgressVisible:NO]; 
     206                        if (type == Outgoing_FileTransfer) { 
     207                    [view setButtonStopResumeIsResend:YES]; 
     208                        } else { 
     209                                //can't resend what wasn't ours 
     210                                [view setButtonStopResumeVisible:NO]; 
     211                        } 
     212                        transferSpeedStatus = AILocalizedString(@"Stopped",nil); 
     213                        break; 
    205214                case Cancelled_Remote_FileTransfer: 
    206215                        [view setProgressVisible:NO]; 
     216                        [view setButtonStopResumeVisible:NO]; 
    207217                        transferSpeedStatus = AILocalizedString(@"Stopped",nil); 
    208218                        break; 
    209219                case Failed_FileTransfer: 
    210220                        [view setProgressVisible:NO]; 
     221                        [view setButtonStopResumeIsResend:YES]; 
    211222                        transferSpeedStatus = AILocalizedString(@"Failed",nil); 
    212223                        break; 
     
    345356- (IBAction)stopResumeAction:(id)sender 
    346357{ 
    347         [fileTransfer cancel]; 
    348 
     358    if ([view buttonStopResumeIsResend]) { 
     359        [adium.fileTransferController sendFile:[fileTransfer localFilename] toListContact:[fileTransfer contact]]; 
     360                [owner _removeFileTransferRow:self]; 
     361    } else { 
     362        [fileTransfer cancel]; 
     363    } 
     364
     365 
    349366- (IBAction)revealAction:(id)sender 
    350367{ 
  • trunk/Source/ESFileTransferProgressView.h

    r20128 r25555  
    3434        IBOutlet AIRolloverButton               *button_stopResume; 
    3535        BOOL                                                    buttonStopResumeIsHovered; 
     36    BOOL                            buttonStopResumeIsResend; 
    3637 
    3738        IBOutlet AIRolloverButton               *button_reveal; 
     
    7172- (void)setProgressVisible:(BOOL)flag; 
    7273 
     74- (void)setButtonStopResumeVisible:(BOOL)flag; 
     75- (void)setButtonStopResumeIsResend:(BOOL)flag; 
     76- (BOOL)buttonStopResumeIsResend; 
     77 
    7378- (void)setTransferBytesStatus:(NSString *)inTransferBytesStatus 
    7479                           remainingStatus:(NSString *)inTransferRemainingStatus 
  • trunk/Source/ESFileTransferProgressView.m

    r24783 r25555  
    5050 
    5151        buttonStopResumeIsHovered = NO; 
     52    buttonStopResumeIsResend = NO; 
    5253        buttonRevealIsHovered = NO; 
    5354} 
     
    156157                [[self window] display]; 
    157158        } 
     159} 
     160 
     161- (void)setButtonStopResumeVisible:(BOOL)flag 
     162{ 
     163    [button_stopResume setHidden:!flag]; 
     164} 
     165 
     166- (void)setButtonStopResumeIsResend:(BOOL)flag 
     167{ 
     168    buttonStopResumeIsResend = flag; 
     169    [self updateButtonStopResume]; 
     170} 
     171 
     172- (BOOL)buttonStopResumeIsResend 
     173{ 
     174    return buttonStopResumeIsResend; 
    158175} 
    159176 
     
    306323- (void)updateButtonStopResume 
    307324{ 
    308         if (isSelected) { 
    309                 [button_stopResume setImage:[NSImage imageNamed:(buttonStopResumeIsHovered ? @"FTProgressStopRollover_Selected" : @"FTProgressStop_Selected") 
    310                                                                                            forClass:[self class]]]; 
    311                  
    312                 [button_stopResume setAlternateImage:[NSImage imageNamed:@"FTProgressStopPressed_Selected" forClass:[self class]]]; 
    313                  
    314         } else { 
    315                 [button_stopResume setImage:[NSImage imageNamed:(buttonStopResumeIsHovered ? @"FTProgressStopRollover" : @"FTProgressStop") 
    316                                                                                            forClass:[self class]]]; 
    317                  
    318                 [button_stopResume setAlternateImage:[NSImage imageNamed:@"FTProgressStopPressed" forClass:[self class]]]; 
     325        if (buttonStopResumeIsResend) { 
     326            if (isSelected) { 
     327                        [button_stopResume setImage:[NSImage imageNamed:(buttonStopResumeIsHovered ? @"FTProgressResendRollover_Selected" : @"FTProgressResend_Selected") 
     328                                                                                                   forClass:[self class]]]; 
     329 
     330                        [button_stopResume setAlternateImage:[NSImage imageNamed:@"FTProgressResendPressed_Selected" forClass:[self class]]]; 
     331                                 
     332                } else { 
     333                        [button_stopResume setImage:[NSImage imageNamed:(buttonStopResumeIsHovered ? @"FTProgressResendRollover" : @"FTProgressResend") 
     334                                                                                                   forClass:[self class]]]; 
     335 
     336                        [button_stopResume setAlternateImage:[NSImage imageNamed:@"FTProgressResendPressed" forClass:[self class]]]; 
     337                } 
     338        } else { 
     339                if (isSelected) { 
     340                        [button_stopResume setImage:[NSImage imageNamed:(buttonStopResumeIsHovered ? @"FTProgressStopRollover_Selected" : @"FTProgressStop_Selected") 
     341                                                                                                        forClass:[self class]]]; 
     342 
     343                        [button_stopResume setAlternateImage:[NSImage imageNamed:@"FTProgressStopPressed_Selected" forClass:[self class]]]; 
     344 
     345                } else { 
     346                        [button_stopResume setImage:[NSImage imageNamed:(buttonStopResumeIsHovered ? @"FTProgressStopRollover" : @"FTProgressStop") 
     347                                                                                                        forClass:[self class]]]; 
     348 
     349                        [button_stopResume setAlternateImage:[NSImage imageNamed:@"FTProgressStopPressed" forClass:[self class]]]; 
     350                } 
    319351        } 
    320352}