mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Fixed a bug where re-prioritization criteria list would initially be empty.
That was because the dialog was created on launch time rather than on-the-fly. --HG-- branch : objp
This commit is contained in:
parent
29796e87b7
commit
baa2177439
@ -11,6 +11,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
#import "HSPopUpList.h"
|
||||
#import "HSSelectableList.h"
|
||||
#import "PrioritizeList.h"
|
||||
#import "PyDupeGuru.h"
|
||||
|
||||
@interface PrioritizeDialog : NSWindowController
|
||||
{
|
||||
@ -23,7 +24,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
HSSelectableList *criteriaList;
|
||||
PrioritizeList *prioritizationList;
|
||||
}
|
||||
- (id)initWithPyRef:(PyObject *)aPyRef;
|
||||
- (id)initWithApp:(PyDupeGuru *)aApp;
|
||||
- (PyPrioritizeDialog *)model;
|
||||
|
||||
- (IBAction)addSelected:(id)sender;
|
||||
|
@ -10,11 +10,11 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
#import "Utils.h"
|
||||
|
||||
@implementation PrioritizeDialog
|
||||
- (id)initWithPyRef:(PyObject *)aPyRef
|
||||
- (id)initWithApp:(PyDupeGuru *)aApp
|
||||
{
|
||||
self = [super initWithWindowNibName:@"PrioritizeDialog"];
|
||||
[self window];
|
||||
model = [[PyPrioritizeDialog alloc] initWithModel:aPyRef];
|
||||
model = [[PyPrioritizeDialog alloc] initWithApp:[aApp pyRef]];
|
||||
[model bindCallback:createCallback(@"PrioritizeDialogView", self)];
|
||||
categoryPopUp = [[HSPopUpList alloc] initWithPyRef:[[self model] categoryList] popupView:categoryPopUpView];
|
||||
criteriaList = [[HSSelectableList alloc] initWithPyRef:[[self model] criteriaList] tableView:criteriaTableView];
|
||||
|
@ -272,7 +272,7 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
- (IBAction)reprioritizeResults:(id)sender
|
||||
{
|
||||
PrioritizeDialog *dlg = [[PrioritizeDialog alloc] initWithPyRef:[model prioritizeDialog]];
|
||||
PrioritizeDialog *dlg = [[PrioritizeDialog alloc] initWithApp:model];
|
||||
NSInteger result = [NSApp runModalForWindow:[dlg window]];
|
||||
if (result == NSRunStoppedResponse) {
|
||||
[[dlg model] performReprioritization];
|
||||
|
@ -43,9 +43,6 @@ class PyDupeGuruBase(PyFairware):
|
||||
def extraFairwareReminder(self) -> pyref:
|
||||
return self.model.extra_fairware_reminder
|
||||
|
||||
def prioritizeDialog(self) -> pyref:
|
||||
return self.model.prioritize_dialog
|
||||
|
||||
def problemDialog(self) -> pyref:
|
||||
return self.model.problem_dialog
|
||||
|
||||
|
@ -1,10 +1,15 @@
|
||||
from objp.util import pyref
|
||||
from cocoa.inter import PyGUIObject, GUIObjectView
|
||||
from core.gui.prioritize_dialog import PrioritizeDialog
|
||||
|
||||
class PrioritizeDialogView(GUIObjectView):
|
||||
pass
|
||||
|
||||
class PyPrioritizeDialog(PyGUIObject):
|
||||
def __init__(self, app: pyref):
|
||||
model = PrioritizeDialog(app.model)
|
||||
PyGUIObject.__init__(self, model)
|
||||
|
||||
def categoryList(self) -> pyref:
|
||||
return self.model.category_list
|
||||
|
||||
|
@ -27,7 +27,6 @@ from . import directories, results, scanner, export, fs
|
||||
from .gui.details_panel import DetailsPanel
|
||||
from .gui.directory_tree import DirectoryTree
|
||||
from .gui.extra_fairware_reminder import ExtraFairwareReminder
|
||||
from .gui.prioritize_dialog import PrioritizeDialog
|
||||
from .gui.problem_dialog import ProblemDialog
|
||||
from .gui.stats_label import StatsLabel
|
||||
|
||||
@ -109,7 +108,6 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
||||
self.details_panel = DetailsPanel(self)
|
||||
self.directory_tree = DirectoryTree(self)
|
||||
self.extra_fairware_reminder = ExtraFairwareReminder(self)
|
||||
self.prioritize_dialog = PrioritizeDialog(self)
|
||||
self.problem_dialog = ProblemDialog(self)
|
||||
self.stats_label = StatsLabel(self)
|
||||
self.result_table = self._create_result_table()
|
||||
|
Loading…
x
Reference in New Issue
Block a user