Skip to content

Commit

Permalink
Add possibility that GIF never changes in directory mode
Browse files Browse the repository at this point in the history
Ass for feature request #36 .
Also include license file now automatic into bundle file.
  • Loading branch information
Waitsnake committed May 8, 2018
1 parent 18d698e commit c1ce7b6
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 42 deletions.
6 changes: 6 additions & 0 deletions AnimatedGif.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
CC1777EB20A1E8C40043C210 /* LICENSE.md in Sources */ = {isa = PBXBuildFile; fileRef = CC1777E920A1E7DF0043C210 /* LICENSE.md */; };
CC1777EC20A1E95D0043C210 /* LICENSE.md in Resources */ = {isa = PBXBuildFile; fileRef = CC1777E920A1E7DF0043C210 /* LICENSE.md */; };
CC24BA9B1BF124350045BDC7 /* AnimatedGifView.h in Headers */ = {isa = PBXBuildFile; fileRef = CC24BA9A1BF124350045BDC7 /* AnimatedGifView.h */; };
CC24BA9D1BF124350045BDC7 /* AnimatedGifView.m in Sources */ = {isa = PBXBuildFile; fileRef = CC24BA9C1BF124350045BDC7 /* AnimatedGifView.m */; };
CC4486F21C8A3A50008520D2 /* thumbnail.png in Resources */ = {isa = PBXBuildFile; fileRef = CC4486F01C8A3A50008520D2 /* thumbnail.png */; };
Expand All @@ -16,6 +18,7 @@

/* Begin PBXFileReference section */
CC1073C41C78947900AC5F63 /* es */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = es; path = es.lproj/Options.xib; sourceTree = "<group>"; };
CC1777E920A1E7DF0043C210 /* LICENSE.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = LICENSE.md; sourceTree = SOURCE_ROOT; };
CC24BA951BF124350045BDC7 /* AnimatedGif.saver */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AnimatedGif.saver; sourceTree = BUILT_PRODUCTS_DIR; };
CC24BA991BF124350045BDC7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CC24BA9A1BF124350045BDC7 /* AnimatedGifView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnimatedGifView.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -68,6 +71,7 @@
CC24BA981BF124350045BDC7 /* Supporting Files */ = {
isa = PBXGroup;
children = (
CC1777E920A1E7DF0043C210 /* LICENSE.md */,
CC4486F01C8A3A50008520D2 /* thumbnail.png */,
CC4486F11C8A3A50008520D2 /* [email protected] */,
CC24BA991BF124350045BDC7 /* Info.plist */,
Expand Down Expand Up @@ -146,6 +150,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CC1777EC20A1E95D0043C210 /* LICENSE.md in Resources */,
CC4486F21C8A3A50008520D2 /* thumbnail.png in Resources */,
CCC3B9991C788F8E00FBE423 /* Options.xib in Resources */,
CC4486F31C8A3A50008520D2 /* [email protected] in Resources */,
Expand All @@ -159,6 +164,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CC1777EB20A1E8C40043C210 /* LICENSE.md in Sources */,
CC24BA9D1BF124350045BDC7 /* AnimatedGifView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
1 change: 1 addition & 0 deletions AnimatedGif/AnimatedGifView.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#define DEFAULT_ANIME_TIME_INTER 1/15.0
#define GL_ALPHA_OPAQUE 1.0f
#define NS_ALPHA_OPAQUE 1.0
#define NEVER_CHANGE_GIF 30


@interface AnimatedGifView : ScreenSaverView {
Expand Down
24 changes: 19 additions & 5 deletions AnimatedGif/AnimatedGifView.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ - (void)startAnimation
backgrRed = [defaults floatForKey:@"BackgrRed"];
backgrGreen = [defaults floatForKey:@"BackgrGreen"];
backgrBlue = [defaults floatForKey:@"BackgrBlue"];
NSInteger changeIntervalInSec = [defaults integerForKey:@"ChangeInterval"] * 60;
NSInteger changeIntervalInMin = [defaults integerForKey:@"ChangeInterval"];

// select a random file from directory or keep the file if it was already a file
NSString *newGifFileName = [self getRandomGifFile:gifFileName];
Expand All @@ -196,11 +196,11 @@ - (void)startAnimation
filter = filterOption;

// check if it is a file or a directory
if ([self isDir:gifFileName])
if ([self isDir:gifFileName] && ((changeIntervalInMin) != NEVER_CHANGE_GIF))
{

// start a one-time timer at end of startAnimation otherwise the time for loading the GIF is part of the timer
[NSTimer scheduledTimerWithTimeInterval:changeIntervalInSec
[NSTimer scheduledTimerWithTimeInterval:(changeIntervalInMin * 60)
target:self
selector:@selector(timerMethod)
userInfo:nil
Expand Down Expand Up @@ -507,7 +507,14 @@ - (NSWindow*)configureSheet
[self.popupButtonViewOptions selectItemWithTag:viewOpt];
[self.popupButtonFilterOptions selectItemWithTag:filterOpt];
[self.sliderChangeInterval setIntegerValue:changeInter];
[self.labelChangeInterval setStringValue:[self.sliderChangeInterval stringValue]];
if ([self.sliderChangeInterval intValue] == NEVER_CHANGE_GIF)
{
[self.labelChangeInterval setStringValue:[self.labelChIntT4 stringValue]];
}
else
{
[self.labelChangeInterval setStringValue:[self.sliderChangeInterval stringValue]];
}
[self enableSliderFpsManual:frameRateManual];
[self.labelFpsManual setStringValue:[self.sliderFpsManual stringValue]];
[self.colorWellBackgrColor setColor:[NSColor colorWithRed:bgrRed green:bgrGreen blue:bgrBlue alpha:NS_ALPHA_OPAQUE]];
Expand Down Expand Up @@ -663,7 +670,14 @@ - (IBAction)selectSliderFpsManual:(id)sender
- (IBAction)selectSliderChangeInterval:(id)sender
{
// update label with actual selected value of slider
[self.labelChangeInterval setStringValue:[self.sliderChangeInterval stringValue]];
if ([self.sliderChangeInterval intValue] == NEVER_CHANGE_GIF)
{
[self.labelChangeInterval setStringValue:[self.labelChIntT4 stringValue]];
}
else
{
[self.labelChangeInterval setStringValue:[self.sliderChangeInterval stringValue]];
}
}

- (void)enableSliderChangeInterval:(BOOL)enable
Expand Down
2 changes: 1 addition & 1 deletion AnimatedGif/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.7</string>
<string>1.3.8</string>
<key>CFBundleSignature</key>
<string>com.waitsnake.animatedgif</string>
<key>CFBundleVersion</key>
Expand Down
18 changes: 9 additions & 9 deletions AnimatedGif/de.lproj/Options.xib
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G19009" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G20015" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
Expand Down Expand Up @@ -186,14 +186,6 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sTK-sE-oMf">
<rect key="frame" x="445" y="225" width="21" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="30" id="hzM-Wj-pPC">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="z6q-HR-xMt">
<rect key="frame" x="424" y="279" width="43" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="5" id="lJ1-KY-AED">
Expand Down Expand Up @@ -332,6 +324,14 @@ DQ
</menu>
</popUpButtonCell>
</popUpButton>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sTK-sE-oMf">
<rect key="frame" x="442" y="225" width="25" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Nie" id="hzM-Wj-pPC">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<connections>
Expand Down
18 changes: 9 additions & 9 deletions AnimatedGif/en.lproj/Options.xib
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G19009" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G20015" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
Expand Down Expand Up @@ -198,14 +198,6 @@ Gw
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iDH-TQ-qwC">
<rect key="frame" x="443" y="225" width="21" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="30" id="ZpP-6P-mSC">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3Ki-Bh-6dB">
<rect key="frame" x="424" y="279" width="43" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="5" id="7H6-sp-V6n">
Expand Down Expand Up @@ -332,6 +324,14 @@ Gw
</menu>
</popUpButtonCell>
</popUpButton>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iDH-TQ-qwC">
<rect key="frame" x="427" y="225" width="40" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Never" id="ZpP-6P-mSC">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<connections>
Expand Down
18 changes: 9 additions & 9 deletions AnimatedGif/es.lproj/Options.xib
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G19009" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G20015" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
Expand Down Expand Up @@ -197,14 +197,6 @@ Gw
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="toF-ZN-R9v">
<rect key="frame" x="446" y="219" width="21" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="30" id="ba0-kp-sOh">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<slider verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GKf-lt-8W8">
<rect key="frame" x="18" y="329" width="446" height="27"/>
<sliderCell key="cell" enabled="NO" alignment="left" minValue="1" maxValue="60" doubleValue="30" tickMarkPosition="below" numberOfTickMarks="60" allowsTickMarkValuesOnly="YES" sliderType="linear" id="ATX-YZ-Fff"/>
Expand Down Expand Up @@ -332,6 +324,14 @@ Gw
<action selector="navigateSegmentButton:" target="-2" id="bCA-Fa-VYE"/>
</connections>
</segmentedControl>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="toF-ZN-R9v">
<rect key="frame" x="425" y="219" width="43" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Nunca" id="ba0-kp-sOh">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<connections>
Expand Down
18 changes: 9 additions & 9 deletions AnimatedGif/ja.lproj/Options.xib
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G19009" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G20015" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
Expand Down Expand Up @@ -202,14 +202,6 @@ Gw
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iDH-TQ-qwC">
<rect key="frame" x="470" y="225" width="21" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="30" id="ZpP-6P-mSC">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<slider verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GKf-lt-8W8">
<rect key="frame" x="18" y="331" width="473" height="27"/>
<sliderCell key="cell" enabled="NO" alignment="left" minValue="1" maxValue="60" doubleValue="30" tickMarkPosition="below" numberOfTickMarks="60" allowsTickMarkValuesOnly="YES" sliderType="linear" id="ATX-YZ-Fff"/>
Expand Down Expand Up @@ -332,6 +324,14 @@ Gw
<rect key="frame" x="127" y="185" width="44" height="23"/>
<color key="color" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</colorWell>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="iDH-TQ-qwC">
<rect key="frame" x="450" y="225" width="41" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="決して" id="ZpP-6P-mSC">
<font key="font" size="13" name=".HiraKakuInterface-W3"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<connections>
Expand Down
Binary file modified Release/AnimatedGif.saver.zip
Binary file not shown.

0 comments on commit c1ce7b6

Please sign in to comment.