1
0
mirror of https://github.com/arsenetar/dupeguru-cocoa.git synced 2026-01-22 14:41:40 +00:00

Fix some deprecation warnings update submodules

This commit is contained in:
2020-12-29 20:40:44 -06:00
parent 99b98db93a
commit 2eada16210
13 changed files with 67 additions and 47 deletions

View File

@@ -197,7 +197,7 @@ http://www.gnu.org/licenses/gpl-3.0.html
[op setAllowsMultipleSelection:NO];
[op setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]];
[op setTitle:NSLocalizedString(@"Select a results file to load", @"")];
if ([op runModal] == NSOKButton) {
if ([op runModal] == NSModalResponseOK) {
NSString *filename = [[[op URLs] objectAtIndex:0] path];
[model loadResultsFrom:filename];
[[self recentResults] addFile:filename];
@@ -354,7 +354,7 @@ http://www.gnu.org/licenses/gpl-3.0.html
[op setCanCreateDirectories:YES];
[op setAllowsMultipleSelection:NO];
[op setTitle:prompt];
if ([op runModal] == NSOKButton) {
if ([op runModal] == NSModalResponseOK) {
return [[[op URLs] objectAtIndex:0] path];
}
else {
@@ -368,7 +368,7 @@ http://www.gnu.org/licenses/gpl-3.0.html
[sp setCanCreateDirectories:YES];
[sp setAllowedFileTypes:[NSArray arrayWithObject:extension]];
[sp setTitle:prompt];
if ([sp runModal] == NSOKButton) {
if ([sp runModal] == NSModalResponseOK) {
return [[sp URL] path];
}
else {

View File

@@ -33,19 +33,19 @@ http://www.gnu.org/licenses/gpl-3.0.html
- (IBAction)updateOptions:(id)sender
{
[model setLinkDeleted:[linkButton state] == NSOnState];
[model setLinkDeleted:[linkButton state] == NSControlStateValueOn];
[model setUseHardlinks:[linkTypeRadio selectedColumn] == 1];
[model setDirect:[directButton state] == NSOnState];
[model setDirect:[directButton state] == NSControlStateValueOn];
}
- (IBAction)proceed:(id)sender
{
[NSApp stopModalWithCode:NSOKButton];
[NSApp stopModalWithCode:NSModalResponseOK];
}
- (IBAction)cancel:(id)sender
{
[NSApp stopModalWithCode:NSCancelButton];
[NSApp stopModalWithCode:NSModalResponseCancel];
}
/* model --> view */
@@ -56,16 +56,16 @@ http://www.gnu.org/licenses/gpl-3.0.html
- (BOOL)show
{
[linkButton setState:NSOffState];
[directButton setState:NSOffState];
[linkButton setState:NSControlStateValueOff];
[directButton setState:NSControlStateValueOff];
[linkTypeRadio selectCellAtRow:0 column:0];
NSInteger r = [NSApp runModalForWindow:[self window]];
[[self window] close];
return r == NSOKButton;
return r == NSModalResponseOK;
}
- (void)setHardlinkOptionEnabled:(BOOL)enabled
{
[linkTypeRadio setEnabled:enabled];
}
@end
@end

View File

@@ -113,7 +113,7 @@ http://www.gnu.org/licenses/gpl-3.0.html
[op setAllowsMultipleSelection:YES];
[op setTitle:NSLocalizedString(@"Select a folder to add to the scanning list", @"")];
[op setDelegate:self];
if ([op runModal] == NSOKButton) {
if ([op runModal] == NSModalResponseOK) {
for (NSURL *directoryURL in [op URLs]) {
[self addDirectory:[directoryURL path]];
}

View File

@@ -165,7 +165,7 @@ http://www.gnu.org/licenses/gpl-3.0.html
- (BOOL)previewPanel:(QLPreviewPanel *)panel handleEvent:(NSEvent *)event
{
// redirect all key down events to the table view
if ([event type] == NSKeyDown) {
if ([event type] == NSEventTypeKeyDown) {
[[self view] keyDown:event];
return YES;
}
@@ -177,4 +177,4 @@ http://www.gnu.org/licenses/gpl-3.0.html
{
[[self view] setNeedsDisplay:YES];
}
@end
@end

View File

@@ -59,7 +59,7 @@ http://www.gnu.org/licenses/gpl-3.0.html
BOOL marked = n2b([pair objectAtIndex:1]);
NSMenuItem *mi = [[app columnsMenu] addItemWithTitle:display action:@selector(toggleColumn:) keyEquivalent:@""];
[mi setTarget:self];
[mi setState:marked ? NSOnState : NSOffState];
[mi setState:marked ? NSControlStateValueOn : NSControlStateValueOff];
[mi setTag:i];
}
[[app columnsMenu] addItem:[NSMenuItem separatorItem]];
@@ -118,10 +118,10 @@ http://www.gnu.org/licenses/gpl-3.0.html
};
[[aTable columns] initializeColumns:defs];
NSTableColumn *c = [[aTable view] tableColumnWithIdentifier:@"marked"];
[[c dataCell] setButtonType:NSSwitchButton];
[[c dataCell] setControlSize:NSSmallControlSize];
[[c dataCell] setButtonType:NSButtonTypeSwitch];
[[c dataCell] setControlSize:NSControlSizeSmall];
c = [[aTable view] tableColumnWithIdentifier:@"size"];
[[c dataCell] setAlignment:NSRightTextAlignment];
[[c dataCell] setAlignment:NSTextAlignmentRight];
}
else if (appMode == AppModeMusic) {
HSColumnDef defs[] = {
@@ -148,14 +148,14 @@ http://www.gnu.org/licenses/gpl-3.0.html
};
[[aTable columns] initializeColumns:defs];
NSTableColumn *c = [[aTable view] tableColumnWithIdentifier:@"marked"];
[[c dataCell] setButtonType:NSSwitchButton];
[[c dataCell] setControlSize:NSSmallControlSize];
[[c dataCell] setButtonType:NSButtonTypeSwitch];
[[c dataCell] setControlSize:NSControlSizeSmall];
c = [[aTable view] tableColumnWithIdentifier:@"size"];
[[c dataCell] setAlignment:NSRightTextAlignment];
[[c dataCell] setAlignment:NSTextAlignmentRight];
c = [[aTable view] tableColumnWithIdentifier:@"duration"];
[[c dataCell] setAlignment:NSRightTextAlignment];
[[c dataCell] setAlignment:NSTextAlignmentRight];
c = [[aTable view] tableColumnWithIdentifier:@"bitrate"];
[[c dataCell] setAlignment:NSRightTextAlignment];
[[c dataCell] setAlignment:NSTextAlignmentRight];
}
else {
HSColumnDef defs[] = {
@@ -172,10 +172,10 @@ http://www.gnu.org/licenses/gpl-3.0.html
};
[[aTable columns] initializeColumns:defs];
NSTableColumn *c = [[aTable view] tableColumnWithIdentifier:@"marked"];
[[c dataCell] setButtonType:NSSwitchButton];
[[c dataCell] setControlSize:NSSmallControlSize];
[[c dataCell] setButtonType:NSButtonTypeSwitch];
[[c dataCell] setControlSize:NSControlSizeSmall];
c = [[aTable view] tableColumnWithIdentifier:@"size"];
[[c dataCell] setAlignment:NSRightTextAlignment];
[[c dataCell] setAlignment:NSTextAlignmentRight];
}
[[aTable columns] restoreColumns];
}
@@ -305,7 +305,7 @@ http://www.gnu.org/licenses/gpl-3.0.html
{
PrioritizeDialog *dlg = [[PrioritizeDialog alloc] initWithApp:model];
NSInteger result = [NSApp runModalForWindow:[dlg window]];
if (result == NSRunStoppedResponse) {
if (result == NSModalResponseStop ) {
[[dlg model] performReprioritization];
}
[dlg release];
@@ -329,7 +329,7 @@ http://www.gnu.org/licenses/gpl-3.0.html
[sp setCanCreateDirectories:YES];
[sp setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]];
[sp setTitle:NSLocalizedString(@"Select a file to save your results to", @"")];
if ([sp runModal] == NSOKButton) {
if ([sp runModal] == NSModalResponseOK) {
[model saveResultsAs:[[sp URL] path]];
[[app recentResults] addFile:[[sp URL] path]];
}
@@ -344,7 +344,7 @@ http://www.gnu.org/licenses/gpl-3.0.html
{
NSMenuItem *mi = sender;
BOOL checked = [[[table columns] model] toggleMenuItem:[mi tag]];
[mi setState:checked ? NSOnState : NSOffState];
[mi setState:checked ? NSControlStateValueOn : NSControlStateValueOff];
}
- (IBAction)toggleDetailsPanel:(id)sender

View File

@@ -23,7 +23,6 @@ int main(int argc, char *argv[])
Py_SetPath(wPythonPath);
Py_SetPythonHome(wPythonPath);
Py_Initialize();
PyEval_InitThreads();
PyGILState_STATE gilState = PyGILState_Ensure();
FILE* fp = fopen([mainpy UTF8String], "r");
PyRun_SimpleFile(fp, [mainpy UTF8String]);