mirror of
https://github.com/zydeco/minivmac4ios.git
synced 2024-06-02 17:41:28 +00:00
reload disk list after importing document
This commit is contained in:
parent
f511efdb0b
commit
222a6d8d8f
|
@ -9,6 +9,8 @@
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
#import "EmulatorProtocol.h"
|
#import "EmulatorProtocol.h"
|
||||||
|
|
||||||
|
extern NSString *DocumentsChangedNotification;
|
||||||
|
|
||||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||||
|
|
||||||
@property (strong, nonatomic) UIWindow *window;
|
@property (strong, nonatomic) UIWindow *window;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
static AppDelegate *sharedAppDelegate = nil;
|
static AppDelegate *sharedAppDelegate = nil;
|
||||||
static NSObject<Emulator> *sharedEmulator = nil;
|
static NSObject<Emulator> *sharedEmulator = nil;
|
||||||
|
NSString *DocumentsChangedNotification = @"documentsChanged";
|
||||||
|
|
||||||
@interface AppDelegate () <UIViewControllerTransitioningDelegate, UIViewControllerAnimatedTransitioning>
|
@interface AppDelegate () <UIViewControllerTransitioningDelegate, UIViewControllerAnimatedTransitioning>
|
||||||
|
|
||||||
|
@ -286,6 +287,8 @@ static NSObject<Emulator> *sharedEmulator = nil;
|
||||||
if (error) {
|
if (error) {
|
||||||
[self showAlertWithTitle:fileName message:error.localizedFailureReason];
|
[self showAlertWithTitle:fileName message:error.localizedFailureReason];
|
||||||
} else {
|
} else {
|
||||||
|
NSDictionary *userInfo = @{@"path": destinationPath};
|
||||||
|
[[NSNotificationCenter defaultCenter] postNotificationName:DocumentsChangedNotification object:self userInfo:userInfo];
|
||||||
[self showAlertWithTitle:@"File Import" message:[NSString stringWithFormat:@"%@ imported to Documents", destinationPath.lastPathComponent]];
|
[self showAlertWithTitle:@"File Import" message:[NSString stringWithFormat:@"%@ imported to Documents", destinationPath.lastPathComponent]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||||
[nc addObserver:self selector:@selector(reloadData:) name:[AppDelegate sharedEmulator].insertDiskNotification object:nil];
|
[nc addObserver:self selector:@selector(reloadData:) name:[AppDelegate sharedEmulator].insertDiskNotification object:nil];
|
||||||
[nc addObserver:self selector:@selector(reloadData:) name:[AppDelegate sharedEmulator].ejectDiskNotification object:nil];
|
[nc addObserver:self selector:@selector(reloadData:) name:[AppDelegate sharedEmulator].ejectDiskNotification object:nil];
|
||||||
|
[nc addObserver:self selector:@selector(reloadData:) name:DocumentsChangedNotification object:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidDisappear:(BOOL)animated {
|
- (void)viewDidDisappear:(BOOL)animated {
|
||||||
|
@ -71,6 +72,7 @@
|
||||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||||
[nc removeObserver:self name:[AppDelegate sharedEmulator].insertDiskNotification object:nil];
|
[nc removeObserver:self name:[AppDelegate sharedEmulator].insertDiskNotification object:nil];
|
||||||
[nc removeObserver:self name:[AppDelegate sharedEmulator].ejectDiskNotification object:nil];
|
[nc removeObserver:self name:[AppDelegate sharedEmulator].ejectDiskNotification object:nil];
|
||||||
|
[nc removeObserver:self name:DocumentsChangedNotification object:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)loadDirectoryContents {
|
- (void)loadDirectoryContents {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user