mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 22:51:39 +00:00
[#189 state:fixed] Added "Export to CSV" feature.
This commit is contained in:
@@ -291,4 +291,18 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)selectDestFileWithPrompt:(NSString *)prompt extension:(NSString *)extension
|
||||
{
|
||||
NSSavePanel *sp = [NSSavePanel savePanel];
|
||||
[sp setCanCreateDirectories:YES];
|
||||
[sp setAllowedFileTypes:[NSArray arrayWithObject:extension]];
|
||||
[sp setTitle:prompt];
|
||||
if ([sp runModal] == NSOKButton) {
|
||||
return [sp filename];
|
||||
}
|
||||
else {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -57,7 +57,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
- (void)changeOptions;
|
||||
- (void)copyMarked;
|
||||
- (void)trashMarked;
|
||||
- (void)exportToXHTML;
|
||||
- (void)filter;
|
||||
- (void)focusOnFilterField;
|
||||
- (void)ignoreSelected;
|
||||
|
||||
@@ -151,12 +151,6 @@ http://www.hardcoded.net/licenses/bsd_license
|
||||
[model deleteMarked];
|
||||
}
|
||||
|
||||
- (void)exportToXHTML
|
||||
{
|
||||
NSString *exported = [model exportToXHTML];
|
||||
[[NSWorkspace sharedWorkspace] openFile:exported];
|
||||
}
|
||||
|
||||
- (void)filter
|
||||
{
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
@@ -28,7 +28,8 @@ appMenu.addItem("Quit dupeGuru", Action(NSApp, 'terminate:'), 'cmd+q')
|
||||
fileMenu.addItem("Load Results...", Action(None, 'loadResults'), 'cmd+o')
|
||||
owner.recentResultsMenu = fileMenu.addMenu("Load Recent Results")
|
||||
fileMenu.addItem("Save Results...", Action(None, 'saveResults'), 'cmd+s')
|
||||
fileMenu.addItem("Export Results to XHTML", Action(None, 'exportToXHTML'), 'cmd+shift+e')
|
||||
fileMenu.addItem("Export Results to XHTML", Action(owner.model, 'exportToXHTML'), 'cmd+shift+e')
|
||||
fileMenu.addItem("Export Results to CSV", Action(owner.model, 'exportToCSV'))
|
||||
if edition == 'pe':
|
||||
fileMenu.addItem("Clear Picture Cache", Action(owner, 'clearPictureCache'), 'cmd+shift+p')
|
||||
elif edition == 'me':
|
||||
|
||||
@@ -23,6 +23,7 @@ class DupeGuruView(FairwareView):
|
||||
def askYesNoWithPrompt_(self, prompt: str) -> bool: pass
|
||||
def showProblemDialog(self): pass
|
||||
def selectDestFolderWithPrompt_(self, prompt: str) -> str: pass
|
||||
def selectDestFileWithPrompt_extension_(self, prompt: str, extension: str) -> str: pass
|
||||
|
||||
class PyDupeGuruBase(PyFairware):
|
||||
FOLLOW_PROTOCOLS = ['Worker']
|
||||
@@ -65,8 +66,11 @@ class PyDupeGuruBase(PyFairware):
|
||||
def doScan(self):
|
||||
self.model.start_scanning()
|
||||
|
||||
def exportToXHTML(self) -> str:
|
||||
return self.model.export_to_xhtml()
|
||||
def exportToXHTML(self):
|
||||
self.model.export_to_xhtml()
|
||||
|
||||
def exportToCSV(self):
|
||||
self.model.export_to_csv()
|
||||
|
||||
def loadSession(self):
|
||||
self.model.load()
|
||||
@@ -217,3 +221,7 @@ class PyDupeGuruBase(PyFairware):
|
||||
def select_dest_folder(self, prompt):
|
||||
return self.callback.selectDestFolderWithPrompt_(prompt)
|
||||
|
||||
@dontwrap
|
||||
def select_dest_file(self, prompt, extension):
|
||||
return self.callback.selectDestFileWithPrompt_extension_(prompt, extension)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user