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:
@@ -17,10 +17,12 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
NSInteger progress;
|
||||
HSTextField *jobdescTextField;
|
||||
HSTextField *progressdescTextField;
|
||||
NSWindow *parentWindow;
|
||||
}
|
||||
|
||||
- (id)initWithPyRef:(PyObject *)aPyRef view:(NSView *)aView;
|
||||
- (PyProgressWindow *)model;
|
||||
- (void)setParentWindow:(NSWindow *)aParentWindow;
|
||||
|
||||
- (void)setProgress:(NSInteger)aProgress;
|
||||
- (void)showWindow;
|
||||
|
||||
@@ -17,6 +17,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[[ProgressController mainProgressController] setWorker:self];
|
||||
jobdescTextField = [[HSTextField alloc] initWithPyRef:[[self model] jobdescTextField] view:[[ProgressController mainProgressController] descText]];
|
||||
progressdescTextField = [[HSTextField alloc] initWithPyRef:[[self model] progressdescTextField] view:[[ProgressController mainProgressController] statusText]];
|
||||
parentWindow = nil;
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -26,6 +27,11 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
}
|
||||
|
||||
/* Public */
|
||||
- (void)setParentWindow:(NSWindow *)aParentWindow
|
||||
{
|
||||
parentWindow = aParentWindow;
|
||||
}
|
||||
|
||||
- (void)setProgress:(NSInteger)aProgress
|
||||
{
|
||||
progress = aProgress;
|
||||
@@ -33,7 +39,12 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
- (void)showWindow
|
||||
{
|
||||
[[ProgressController mainProgressController] show];
|
||||
if (parentWindow != nil) {
|
||||
[[ProgressController mainProgressController] showSheetForParent:parentWindow];
|
||||
}
|
||||
else {
|
||||
[[ProgressController mainProgressController] show];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)closeWindow
|
||||
|
||||
Reference in New Issue
Block a user