Skip to content

Commit

Permalink
Issues #18 an #19
Browse files Browse the repository at this point in the history
#18: The confusing GUI element for file / directory mode is removed.
Therefore when opening the file dialog not the last file or directory
is open, but one or two levels above, so that user see more of the path
structure with makes use of file OSX dialog more intuitive in my
opinion.

#19: The slider for selecting fps is now from 1 to 60 fps extended (old
was 1 to 30 fps). Remember if you disable manual selecting of fps it
uses the value of the GIF file, what ever this is (maybe 70 fps).
  • Loading branch information
Waitsnake committed Aug 6, 2017
1 parent 5bc39ca commit 9233b5e
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 111 deletions.
Binary file not shown.
3 changes: 0 additions & 3 deletions AnimatedGif/AnimatedGifView.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

#define LOAD_BTN 0
#define UNLOAD_BTN 1
#define FILE_MODE 0
#define FOLDER_MODE 1

#define VIEW_OPT_STRETCH_OPTIMAL 0
#define VIEW_OPT_STRETCH_MAXIMAL 1
Expand Down Expand Up @@ -68,7 +66,6 @@
@property (assign) IBOutlet NSColorWell *colorWellBackgrColor;
@property (assign) IBOutlet NSSegmentedControl *segmentButtonLaunchAgent;
@property (assign) IBOutlet NSPopUpButton *popupButtonViewOptions;
@property (assign) IBOutlet NSSegmentedControl *segmentFileOrFolderMode;

@property (assign) IBOutlet NSSlider *sliderChangeInterval;
@property (assign) IBOutlet NSTextField *labelChangeInterval;
Expand Down
23 changes: 12 additions & 11 deletions AnimatedGif/AnimatedGifView.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ - (instancetype)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview
// initialize screensaver defaults with an default value
ScreenSaverDefaults *defaults = [ScreenSaverDefaults defaultsForModuleWithName:[[NSBundle bundleForClass: [self class]] bundleIdentifier]];
[defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
@"file:///please/select/an/gif/animation.gif", @"GifFileName", @"15.0", @"GifFrameRate", @"NO", @"GifFrameRateManual", @"0", @"ViewOpt", @"0.0", @"BackgrRed", @"0.0", @"BackgrGreen", @"0.0", @"BackgrBlue", @"NO", @"LoadAniToMem", @"5", @"ChangeInterval",nil]];
@"file:///please/select/an/gif/animation.gif", @"GifFileName", @"30.0", @"GifFrameRate", @"NO", @"GifFrameRateManual", @"0", @"ViewOpt", @"0.0", @"BackgrRed", @"0.0", @"BackgrGreen", @"0.0", @"BackgrBlue", @"NO", @"LoadAniToMem", @"5", @"ChangeInterval",nil]];

if (self) {
self.glView = [self createGLView];
Expand Down Expand Up @@ -495,8 +495,6 @@ - (NSWindow*)configureSheet

// enable time interval slider only in case that an directory is selected
[self enableSliderChangeInterval:YES];
// show folder mode
self.segmentFileOrFolderMode.selectedSegment = FOLDER_MODE;
}
else
{
Expand All @@ -521,8 +519,6 @@ - (NSWindow*)configureSheet

// disable time interval slider in case an file is selected
[self enableSliderChangeInterval:NO];
// show file mode
self.segmentFileOrFolderMode.selectedSegment = FILE_MODE;
}


Expand Down Expand Up @@ -723,8 +719,17 @@ - (IBAction)sendFileButtonAction:(id)sender
// Disable the selection of more than one file
[openDlg setAllowsMultipleSelection:NO];

// set dialog to last selected file
[openDlg setDirectoryURL:[NSURL URLWithString:[self.textFieldFileUrl stringValue]]];
// set dialog to one levele obove of last selected file/directory
if ([self isDir:[self.textFieldFileUrl stringValue]])
{
// in case of an directory remove one level of path before open it
[openDlg setDirectoryURL:[[NSURL URLWithString:[self.textFieldFileUrl stringValue]] URLByDeletingLastPathComponent]];
}
else
{
// in case of an file remove two level of path before open it
[openDlg setDirectoryURL:[[[NSURL URLWithString:[self.textFieldFileUrl stringValue]] URLByDeletingLastPathComponent] URLByDeletingLastPathComponent]];
}

// try to 'focus' only on GIF files (Yes, I know all image types are working with NSImage)
[openDlg setAllowedFileTypes:[[NSArray alloc] initWithObjects:@"gif", @"GIF", nil]];
Expand Down Expand Up @@ -752,8 +757,6 @@ - (IBAction)sendFileButtonAction:(id)sender

// enable time interval slider only in case that an directory is selected
[self enableSliderChangeInterval:YES];
// show folder mode
self.segmentFileOrFolderMode.selectedSegment = FOLDER_MODE;
}
else
{
Expand All @@ -778,8 +781,6 @@ - (IBAction)sendFileButtonAction:(id)sender

// disable time interval slider only in case that an file is selected
[self enableSliderChangeInterval:NO];
// show file mode
self.segmentFileOrFolderMode.selectedSegment = FILE_MODE;
}

}
Expand Down
35 changes: 12 additions & 23 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="15G1421" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1510" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
Expand All @@ -26,7 +26,6 @@
<outlet property="optionsPanel" destination="QvC-M9-y7g" id="S9j-MZ-x3G"/>
<outlet property="popupButtonViewOptions" destination="Cmf-ro-Be5" id="ivH-C7-la8"/>
<outlet property="segmentButtonLaunchAgent" destination="3xC-QT-NED" id="o8N-nQ-m5L"/>
<outlet property="segmentFileOrFolderMode" destination="QWQ-uS-Ecu" id="DXM-Rz-dyP"/>
<outlet property="sliderChangeInterval" destination="aUW-ml-tfi" id="Azw-7y-zU2"/>
<outlet property="sliderFpsManual" destination="GKf-lt-8W8" id="mrp-yB-xeS"/>
<outlet property="textFieldFileUrl" destination="n2R-8Q-rKI" id="4LH-JE-wZQ"/>
Expand Down Expand Up @@ -195,7 +194,7 @@
</textField>
<slider verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GKf-lt-8W8">
<rect key="frame" x="18" y="330" width="446" height="27"/>
<sliderCell key="cell" enabled="NO" alignment="left" minValue="1" maxValue="30" doubleValue="15" tickMarkPosition="below" numberOfTickMarks="30" allowsTickMarkValuesOnly="YES" sliderType="linear" id="ATX-YZ-Fff"/>
<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"/>
<connections>
<action selector="selectSliderFpsManual:" target="-2" id="bPq-3G-elf"/>
</connections>
Expand All @@ -218,23 +217,15 @@
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yeR-Gc-HfV">
<rect key="frame" x="443" y="315" width="21" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="30" id="Zxp-6N-m2s">
<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="hhA-OU-fO4">
<rect key="frame" x="224" y="315" width="21" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="15" id="oUD-bo-3eZ">
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="60" id="Zxp-6N-m2s">
<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="rLV-9G-B0l">
<rect key="frame" x="163" y="363" width="43" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="15" id="fYk-cV-JLZ">
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="30" id="fYk-cV-JLZ">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -290,20 +281,18 @@ DQ
<action selector="closeConfigOk:" target="-2" id="AKp-yw-amO"/>
</connections>
</button>
<segmentedControl verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="QWQ-uS-Ecu">
<rect key="frame" x="20" y="51" width="234" height="25"/>
<segmentedCell key="cell" enabled="NO" borderStyle="border" alignment="left" style="texturedSquare" trackingMode="selectOne" id="v9T-87-3ME">
<font key="font" metaFont="system"/>
<segments>
<segment label="Einzeldateimodus" enabled="NO" selected="YES"/>
<segment label="Ordnermodus" enabled="NO" tag="1"/>
</segments>
</segmentedCell>
</segmentedControl>
<colorWell fixedFrame="YES" continuous="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bxi-1B-SU5">
<rect key="frame" x="160" y="183" 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="hhA-OU-fO4">
<rect key="frame" x="226" y="315" width="21" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="30" id="oUD-bo-3eZ">
<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
36 changes: 11 additions & 25 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="15G1421" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1510" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
Expand All @@ -26,7 +26,6 @@
<outlet property="optionsPanel" destination="QvC-M9-y7g" id="S9j-MZ-x3G"/>
<outlet property="popupButtonViewOptions" destination="Cmf-ro-Be5" id="6oo-Av-SiB"/>
<outlet property="segmentButtonLaunchAgent" destination="3xC-QT-NED" id="ahL-Y3-Tra"/>
<outlet property="segmentFileOrFolderMode" destination="Bge-Fu-K5T" id="gkX-QR-xo7"/>
<outlet property="sliderChangeInterval" destination="13u-av-974" id="0Aw-UH-NsY"/>
<outlet property="sliderFpsManual" destination="GKf-lt-8W8" id="wDe-bj-c6C"/>
<outlet property="textFieldFileUrl" destination="n2R-8Q-rKI" id="SHG-1D-i5c"/>
Expand Down Expand Up @@ -215,7 +214,7 @@ Gw
</textField>
<slider verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GKf-lt-8W8">
<rect key="frame" x="18" y="331" width="446" height="27"/>
<sliderCell key="cell" enabled="NO" alignment="left" minValue="1" maxValue="30" doubleValue="15" tickMarkPosition="below" numberOfTickMarks="30" allowsTickMarkValuesOnly="YES" sliderType="linear" id="ATX-YZ-Fff"/>
<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"/>
<connections>
<action selector="selectSliderFpsManual:" target="-2" id="wW5-cA-Kvt"/>
</connections>
Expand All @@ -238,23 +237,15 @@ Gw
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yeR-Gc-HfV">
<rect key="frame" x="443" y="316" width="21" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="30" id="Zxp-6N-m2s">
<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="hhA-OU-fO4">
<rect key="frame" x="224" y="316" width="21" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="15" id="oUD-bo-3eZ">
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="60" id="Zxp-6N-m2s">
<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="rLV-9G-B0l">
<rect key="frame" x="163" y="364" width="43" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="15" id="fYk-cV-JLZ">
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="30" id="fYk-cV-JLZ">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -294,19 +285,14 @@ Gw
<action selector="sendFileButtonAction:" target="-2" id="7M8-iE-WnT"/>
</connections>
</button>
<segmentedControl verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Bge-Fu-K5T">
<rect key="frame" x="20" y="51" width="232" height="25"/>
<segmentedCell key="cell" enabled="NO" borderStyle="border" alignment="left" style="texturedSquare" trackingMode="selectOne" id="IHT-kA-Fgm">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hhA-OU-fO4">
<rect key="frame" x="230" y="316" width="21" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="30" id="oUD-bo-3eZ">
<font key="font" metaFont="system"/>
<segments>
<segment label="single file mode" enabled="NO" selected="YES"/>
<segment label="directory mode" enabled="NO" tag="1"/>
</segments>
</segmentedCell>
<connections>
<action selector="navigateSegmentButton:" target="-2" id="Xoj-Aq-On2"/>
</connections>
</segmentedControl>
<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
Loading

0 comments on commit 9233b5e

Please sign in to comment.