Skip to content

Commit 17a915e

Browse files
6AAB238A-0FED-4B83-9409-927D4998AFD7
1 parent 972f11f commit 17a915e

File tree

9 files changed

+118
-32
lines changed

9 files changed

+118
-32
lines changed

WinDiskWriter GUI/AppDelegate.m

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#import "PickerView.h"
1414
#import "TextInputView.h"
1515
#import "CheckBoxView.h"
16-
#import "AutoScrollTextView.h"
16+
#import "AdvancedTextView.h"
1717
#import "ProgressBarView.h"
1818

1919
#import "SynchronizedAlertData.h"
@@ -55,7 +55,7 @@ @implementation AppDelegate {
5555
NSSegmentedControl *filesystemPickerSegmentedControl;
5656
NSSegmentedControl *partitionSchemePickerSegmentedControl;
5757

58-
AutoScrollTextView *logsAutoScrollTextView;
58+
AdvancedTextView *logsAutoScrollTextView;
5959

6060
ButtonView *startStopButtonView;
6161
ProgressBarView *progressBarView;
@@ -627,12 +627,12 @@ - (void)setupWindows {
627627
}
628628

629629
{
630-
NSSize minWindowSize = CGSizeMake(260, 350);
631-
NSSize maxWindowSize = CGSizeMake(340, 455);
630+
NSSize minWindowSize = CGSizeMake(300, 450);
631+
NSSize maxWindowSize = CGSizeMake(360, 560);
632632

633633
aboutWindow = [[AboutWindow alloc] initWithNSRect: CGRectMake(0, 0, minWindowSize.width, minWindowSize.height)
634634
title: [NSString stringWithFormat:@"%@ %@", MENU_ITEM_ABOUT_TITLE, APPLICATION_NAME]
635-
padding: CHILD_CONTENT_SPACING];
635+
padding: CHILD_CONTENT_SPACING * 2];
636636

637637
[aboutWindow setMinSize: minWindowSize];
638638
[aboutWindow setMaxSize: maxWindowSize];
@@ -822,7 +822,9 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
822822

823823
[mainVerticalLayout addView:spacerView width:4 height:4];
824824

825-
logsAutoScrollTextView = [[AutoScrollTextView alloc] init]; {
825+
logsAutoScrollTextView = [[AdvancedTextView alloc] init]; {
826+
[logsAutoScrollTextView setAutomaticallyScroll: YES];
827+
826828
[mainVerticalLayout addView:logsAutoScrollTextView minWidth:0 maxWidth:INFINITY minHeight:120 maxHeight:INFINITY];
827829
}
828830

WinDiskWriter GUI/Extensions/NSMutableAttributedString/NSMutableAttributedString+Common.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ + (NSMutableAttributedString *)attributedStringWithString: (NSString *)string
1616

1717
// TODO: Need a better solution to the dumb Apple Initializers
1818
NSFont *_tempDummyFont = [NSFont systemFontOfSize: NSFont.systemFontSize];
19-
19+
2020
NSDictionary *attributes = @{
2121
NSFontAttributeName: [NSFontManager.sharedFontManager
22-
fontWithFamily: _tempDummyFont.fontName
22+
fontWithFamily: _tempDummyFont.familyName
2323
traits: NSUnboldFontMask
2424
weight: weight
2525
size: size]
@@ -35,7 +35,7 @@ + (NSMutableAttributedString *)attributedStringWithNormalFormatting: (NSString *
3535
NSDictionary *normalAttributes = @{NSFontAttributeName: [NSFont systemFontOfSize: NSFont.systemFontSize]};
3636

3737
NSMutableAttributedString *result = [[NSMutableAttributedString alloc] initWithString: string
38-
attributes: normalAttributes];
38+
attributes: normalAttributes];
3939

4040
return result;
4141
}

WinDiskWriter GUI/Views/AutoScrollTextView/AutoScrollTextView.h renamed to WinDiskWriter GUI/Views/AdvancedTextView/AdvancedTextView.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// AutoScrollTextView.h
2+
// AdvancedTextView.h
33
// WinDiskWriter GUI
44
//
55
// Created by Macintosh on 10.08.2023.
@@ -19,10 +19,12 @@ extern ASLogType const ASLogTypeError;
1919
extern ASLogType const ASLogTypeFatal;
2020
extern ASLogType const ASLogTypeAssertionError;
2121

22-
@interface AutoScrollTextView : NSScrollView
22+
@interface AdvancedTextView : NSScrollView
2323

2424
@property (nonatomic, strong, readonly) VibrantTextView *textViewInstance;
2525

26+
@property (nonatomic, readwrite) BOOL automaticallyScroll;
27+
2628
- (void)appendLine:(NSString *)message;
2729

2830
- (void)appendTimestampedLine: (NSString *)message

WinDiskWriter GUI/Views/AutoScrollTextView/AutoScrollTextView.m renamed to WinDiskWriter GUI/Views/AdvancedTextView/AdvancedTextView.m

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//
2-
// AutoScrollTextView.m
2+
// AdvancedTextView.m
33
// WinDiskWriter GUI
44
//
55
// Created by Macintosh on 10.08.2023.
66
// Copyright © 2023 TechUnRestricted. All rights reserved.
77
//
88

9-
#import "AutoScrollTextView.h"
9+
#import "AdvancedTextView.h"
1010
#import "NSColor+Common.h"
1111

1212
ASLogType const ASLogTypeLog = @"Log";
@@ -16,7 +16,7 @@
1616
ASLogType const ASLogTypeFatal = @"Fatal";
1717
ASLogType const ASLogTypeAssertionError = @"AssertionFailure";
1818

19-
@implementation AutoScrollTextView {
19+
@implementation AdvancedTextView {
2020
NSDateFormatter *dateFormatter;
2121
}
2222

@@ -65,11 +65,14 @@ - (void)appendLine: (NSString *)message {
6565

6666
[self.textViewInstance setString:appendedString];
6767

68-
[NSTimer scheduledTimerWithTimeInterval: 1.0f
69-
target: self
70-
selector: @selector(delayedUpdate)
71-
userInfo: NULL
72-
repeats: NO];
68+
if (self.automaticallyScroll) {
69+
[NSTimer scheduledTimerWithTimeInterval: 1.0f
70+
target: self
71+
selector: @selector(delayedUpdate)
72+
userInfo: NULL
73+
repeats: NO];
74+
}
75+
7376
});
7477
}
7578

WinDiskWriter GUI/Views/AutoScrollTextView/VibrantTextView/VibrantTextView.h renamed to WinDiskWriter GUI/Views/AdvancedTextView/VibrantTextView/VibrantTextView.h

File renamed without changes.

WinDiskWriter GUI/Views/AutoScrollTextView/VibrantTextView/VibrantTextView.m renamed to WinDiskWriter GUI/Views/AdvancedTextView/VibrantTextView/VibrantTextView.m

File renamed without changes.

WinDiskWriter GUI/Windows/AboutWindow/AboutWindow.m

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#import "Constants.h"
1313
#import "CustomImageView.h"
1414
#import "NSMutableAttributedString+Common.h"
15+
#import "AdvancedTextView.h"
1516

1617
@implementation AboutWindow
1718

@@ -34,6 +35,8 @@ - (instancetype)initWithNSRect: (NSRect)nsRect
3435
}
3536

3637
- (void)setupViews {
38+
NSView *spacerView = [[NSView alloc] init];
39+
3740
FrameLayoutVertical *mainVerticalLayout = (FrameLayoutVertical *)self.containerView;
3841

3942
[mainVerticalLayout setHorizontalAlignment: FrameLayoutHorizontalCenter];
@@ -52,7 +55,7 @@ - (void)setupViews {
5255
[customImageView setImageScaling: NSScaleProportionally];
5356
CGFloat minSize = 100;
5457
CGFloat maxSize = 120;
55-
58+
5659
[pictureHolderVerticalLayout addView: customImageView
5760
minWidth: minSize
5861
maxWidth: maxSize
@@ -71,18 +74,94 @@ - (void)setupViews {
7174
[textHolderVerticalLayout setSpacing: 2];
7275

7376
LabelView *applicationNameLabelView = [[LabelView alloc] init]; {
74-
[applicationNameLabelView setStringValue: APPLICATION_NAME];
75-
7677
NSAttributedString *attributedStringResult = [NSMutableAttributedString attributedStringWithString: APPLICATION_NAME
7778
weight: 4
78-
size: NSFont.systemFontSize + 6];
79+
size: NSFont.systemFontSize * 1.5];
7980

8081
[applicationNameLabelView setAttributedStringValue:attributedStringResult];
8182

8283
[textHolderVerticalLayout addView:applicationNameLabelView
8384
width: applicationNameLabelView.cell.cellSize.width
8485
height: applicationNameLabelView.cell.cellSize.height];
8586
}
87+
88+
LabelView *applicationVersionLabelView = [[LabelView alloc] init]; {
89+
90+
NSAttributedString *attributedStringResult = [NSMutableAttributedString attributedStringWithString: [NSString stringWithFormat:@"Version: (%@)", PACKAGE_VERSION]
91+
weight: 3
92+
size: NSFont.systemFontSize];
93+
94+
[applicationVersionLabelView setAttributedStringValue:attributedStringResult];
95+
96+
[textHolderVerticalLayout addView:applicationVersionLabelView
97+
width: applicationVersionLabelView.cell.cellSize.width
98+
height: applicationVersionLabelView.cell.cellSize.height];
99+
}
100+
101+
}
102+
103+
[mainVerticalLayout addView:spacerView width:0 height:14];
104+
105+
FrameLayoutVertical *openSourceLicensesVerticalLayout = [[FrameLayoutVertical alloc] init]; {
106+
[mainVerticalLayout addView:openSourceLicensesVerticalLayout width:INFINITY height:INFINITY];
107+
108+
//[openSourceLicensesVerticalLayout setHugHeightFrame: YES];
109+
110+
[openSourceLicensesVerticalLayout setSpacing: 8];
111+
112+
LabelView *openSourceLicensesLabelView = [[LabelView alloc] init]; {
113+
NSAttributedString *attributedStringResult = [NSMutableAttributedString attributedStringWithString: [NSString stringWithFormat:@"Additional Information"]
114+
weight: 6
115+
size: NSFont.systemFontSize];
116+
117+
[openSourceLicensesLabelView setAttributedStringValue:attributedStringResult];
118+
119+
[openSourceLicensesVerticalLayout addView:openSourceLicensesLabelView
120+
width: openSourceLicensesLabelView.cell.cellSize.width
121+
height: openSourceLicensesLabelView.cell.cellSize.height];
122+
}
123+
124+
AdvancedTextView *openSourceLicensesAdvancedTextView = [[AdvancedTextView alloc] init]; {
125+
[openSourceLicensesAdvancedTextView appendLine:
126+
@"WinDiskWriter is an application for macOS that enables users to create bootable flash drives with the Windows operating system, which belongs to Microsoft Corporation." "\n\n"
127+
"The application is an Open Source product developed by TechUnRestricted." "\n"
128+
129+
"It relies on the wimlib library, which is licensed under the GNU LESSER GENERAL PUBLIC LICENSE Version 3." "\n\n"
130+
"The library has been slightly modified to avoid application crashes caused by assertions." "\n"
131+
"This allowed the integration of wimlib as a part of the project, instead of a separate binary file that is invoked through the console." "\n\n"
132+
133+
"The application is written in Objective-C programming language, with backward compatibility for older operating systems." "\n"
134+
"This is achieved by using legacy code and custom solutions, instead of reinventing the wheel." "\n"
135+
"The user interface and the logic of element placement are coded manually, without using xib and storyboards." "\n\n"
136+
137+
"This software has two versions: GUI and CLI." "\n"
138+
"At the moment, WinDiskWriter supports writing Windows Vista, 7, 8, 8.1, 10 and 11 in UEFI mode." "\n"
139+
"Future improvements will include support for Legacy systems and other features." "\n\n\n"
140+
141+
"[WIMLIB: GNU LESSER GENERAL PUBLIC LICENSE Version 3]" "\n"
142+
143+
];
144+
145+
146+
147+
[openSourceLicensesVerticalLayout addView: openSourceLicensesAdvancedTextView
148+
minWidth: 0
149+
maxWidth: INFINITY
150+
minHeight: 100
151+
maxHeight: INFINITY];
152+
153+
}
154+
155+
}
156+
157+
[mainVerticalLayout addView:spacerView width:0 height:8];
158+
159+
LabelView *developerNameLabelView = [[LabelView alloc] init]; {
160+
[developerNameLabelView setStringValue: DEVELOPER_NAME];
161+
162+
[mainVerticalLayout addView: developerNameLabelView
163+
width: developerNameLabelView.cell.cellSize.width
164+
height: developerNameLabelView.cell.cellSize.height];
86165
}
87166

88167

windiskwriter.xcodeproj/project.pbxproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
E2C5FFD02994599600B394F4 /* ArgumentsHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = E2C5FFCF2994599600B394F4 /* ArgumentsHandler.m */; };
107107
E2C5FFD429945B8C00B394F4 /* ArgumentObject.m in Sources */ = {isa = PBXBuildFile; fileRef = E2C5FFD329945B8C00B394F4 /* ArgumentObject.m */; };
108108
E2C5FFD82994619700B394F4 /* NSArray+Common.m in Sources */ = {isa = PBXBuildFile; fileRef = E2C5FFD72994619700B394F4 /* NSArray+Common.m */; };
109-
E2C73B3B2A855FD5008B9FAC /* AutoScrollTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = E2C73B3A2A855FD5008B9FAC /* AutoScrollTextView.m */; };
109+
E2C73B3B2A855FD5008B9FAC /* AdvancedTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = E2C73B3A2A855FD5008B9FAC /* AdvancedTextView.m */; };
110110
E2C73B422A857C2D008B9FAC /* VibrantTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = E2C73B412A857C2D008B9FAC /* VibrantTextView.m */; };
111111
E2CCB2762982C7A4004EE171 /* DiskWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = E2CCB2752982C7A4004EE171 /* DiskWriter.m */; };
112112
E2CCB27B2982F8C3004EE171 /* HDIUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = E2CCB27A2982F8C3004EE171 /* HDIUtil.m */; };
@@ -436,8 +436,8 @@
436436
E2C5FFD329945B8C00B394F4 /* ArgumentObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ArgumentObject.m; sourceTree = "<group>"; };
437437
E2C5FFD62994619700B394F4 /* NSArray+Common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSArray+Common.h"; sourceTree = "<group>"; };
438438
E2C5FFD72994619700B394F4 /* NSArray+Common.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Common.m"; sourceTree = "<group>"; };
439-
E2C73B392A855FD5008B9FAC /* AutoScrollTextView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AutoScrollTextView.h; sourceTree = "<group>"; };
440-
E2C73B3A2A855FD5008B9FAC /* AutoScrollTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AutoScrollTextView.m; sourceTree = "<group>"; };
439+
E2C73B392A855FD5008B9FAC /* AdvancedTextView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AdvancedTextView.h; sourceTree = "<group>"; };
440+
E2C73B3A2A855FD5008B9FAC /* AdvancedTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AdvancedTextView.m; sourceTree = "<group>"; };
441441
E2C73B402A857C2D008B9FAC /* VibrantTextView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VibrantTextView.h; sourceTree = "<group>"; };
442442
E2C73B412A857C2D008B9FAC /* VibrantTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VibrantTextView.m; sourceTree = "<group>"; };
443443
E2CCB2752982C7A4004EE171 /* DiskWriter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DiskWriter.m; sourceTree = "<group>"; };
@@ -1095,7 +1095,7 @@
10951095
E22E6BE52A75C87400FD4BFD /* ButtonView */,
10961096
E22E6C052A75D73C00FD4BFD /* PickerView */,
10971097
E22E6C092A76B3CA00FD4BFD /* CheckBoxView */,
1098-
E2C73B3C2A855FDA008B9FAC /* AutoScrollTextView */,
1098+
E2C73B3C2A855FDA008B9FAC /* AdvancedTextView */,
10991099
E2F2D2BE2A93E8B200E1B7FF /* CustomImageView */,
11001100
);
11011101
path = Views;
@@ -1307,14 +1307,14 @@
13071307
path = NSArray;
13081308
sourceTree = "<group>";
13091309
};
1310-
E2C73B3C2A855FDA008B9FAC /* AutoScrollTextView */ = {
1310+
E2C73B3C2A855FDA008B9FAC /* AdvancedTextView */ = {
13111311
isa = PBXGroup;
13121312
children = (
13131313
E2C73B432A857C30008B9FAC /* VibrantTextView */,
1314-
E2C73B392A855FD5008B9FAC /* AutoScrollTextView.h */,
1315-
E2C73B3A2A855FD5008B9FAC /* AutoScrollTextView.m */,
1314+
E2C73B392A855FD5008B9FAC /* AdvancedTextView.h */,
1315+
E2C73B3A2A855FD5008B9FAC /* AdvancedTextView.m */,
13161316
);
1317-
path = AutoScrollTextView;
1317+
path = AdvancedTextView;
13181318
sourceTree = "<group>";
13191319
};
13201320
E2C73B432A857C30008B9FAC /* VibrantTextView */ = {
@@ -1639,7 +1639,7 @@
16391639
E2C73B422A857C2D008B9FAC /* VibrantTextView.m in Sources */,
16401640
E249FBA72A5B1A96003B8D24 /* FrameLayoutVertical.m in Sources */,
16411641
E2CCCD872A3A11EE00D101DE /* FrameLayoutBase.m in Sources */,
1642-
E2C73B3B2A855FD5008B9FAC /* AutoScrollTextView.m in Sources */,
1642+
E2C73B3B2A855FD5008B9FAC /* AdvancedTextView.m in Sources */,
16431643
E23298B92A37C23700869736 /* AppDelegate.m in Sources */,
16441644
E22E6C082A76B3C700FD4BFD /* CheckBoxView.m in Sources */,
16451645
E23A953F2A52EF7900C4E869 /* FrameLayoutHorizontal.m in Sources */,

0 commit comments

Comments
 (0)