mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-23 07:01:39 +00:00
Modernized progress window GUI
Following the refactoring that has been initiated in pdfmasher's "vala" branch, I pushed more progress window logic into the core. The UI code is now a bit dumber than it used to be, and the core now directly decides when the progress window is shown and hidden. The "job finished" notification is also directly sent by the core. Job description update logic is handled by a core gui textfield. Job description contsants also moved to the core, triggering a localisation migration from "ui" to "core".
This commit is contained in:
@@ -15,6 +15,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
#import "IgnoreListDialog.h"
|
||||
#import "HSFairwareAboutBox.h"
|
||||
#import "HSRecentFiles.h"
|
||||
#import "HSProgressWindow.h"
|
||||
|
||||
@interface AppDelegateBase : NSObject
|
||||
{
|
||||
@@ -27,6 +28,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
DirectoryPanel *_directoryPanel;
|
||||
DetailsPanel *_detailsPanel;
|
||||
IgnoreListDialog *_ignoreListDialog;
|
||||
HSProgressWindow *_progressWindow;
|
||||
NSWindowController *_preferencesPanel;
|
||||
HSFairwareAboutBox *_aboutBox;
|
||||
HSRecentFiles *_recentResults;
|
||||
|
||||
@@ -74,6 +74,8 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
_directoryPanel = [self createDirectoryPanel];
|
||||
_detailsPanel = [self createDetailsPanel];
|
||||
_ignoreListDialog = [[IgnoreListDialog alloc] initWithPyRef:[model ignoreListDialog]];
|
||||
_progressWindow = [[HSProgressWindow alloc] initWithPyRef:[[self model] progressWindow] view:nil];
|
||||
[_progressWindow setParentWindow:[_resultWindow window]];
|
||||
_aboutBox = nil; // Lazily loaded
|
||||
_preferencesPanel = nil; // Lazily loaded
|
||||
[[[self directoryPanel] window] makeKeyAndOrderFront:self];
|
||||
@@ -197,7 +199,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
/* Delegate */
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||
{
|
||||
[[ProgressController mainProgressController] setWorker:model];
|
||||
[model initialRegistrationSetup];
|
||||
[model loadSession];
|
||||
}
|
||||
|
||||
@@ -42,9 +42,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[matches setTarget:self];
|
||||
[matches setDoubleAction:@selector(openClicked)];
|
||||
[self adjustUIToLocalization];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobStarted:) name:JobStarted object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jobInProgress:) name:JobInProgress object:nil];
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -340,22 +337,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
previewPanel = nil;
|
||||
}
|
||||
|
||||
- (void)jobInProgress:(NSNotification *)aNotification
|
||||
{
|
||||
[Dialogs showMessage:NSLocalizedString(@"A previous action is still hanging in there. You can't start a new one yet. Wait a few seconds, then try again.", @"")];
|
||||
}
|
||||
|
||||
- (void)jobStarted:(NSNotification *)aNotification
|
||||
{
|
||||
[[self window] makeKeyAndOrderFront:nil];
|
||||
NSDictionary *ui = [aNotification userInfo];
|
||||
NSString *desc = [ui valueForKey:@"desc"];
|
||||
[[ProgressController mainProgressController] setJobDesc:desc];
|
||||
NSString *jobid = [ui valueForKey:@"jobid"];
|
||||
[[ProgressController mainProgressController] setJobId:jobid];
|
||||
[[ProgressController mainProgressController] showSheetForParent:[self window]];
|
||||
}
|
||||
|
||||
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem
|
||||
{
|
||||
return ![[ProgressController mainProgressController] isShown];
|
||||
|
||||
Reference in New Issue
Block a user