Skip to content

Commit 032e5c2

Browse files
committed
Some small work
- Implement a bit additional search locations - Add SaveThemes window
1 parent 895cd24 commit 032e5c2

File tree

8 files changed

+589
-174
lines changed

8 files changed

+589
-174
lines changed

Manage Conky.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
77B9EFFB1F64295100C375FE /* ConkyThemesSheetController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77B9EFFA1F64295100C375FE /* ConkyThemesSheetController.m */; };
1919
77E6DBCB1F648B92001DEBB1 /* AboutSheetController.m in Sources */ = {isa = PBXBuildFile; fileRef = 77E6DBCA1F648B92001DEBB1 /* AboutSheetController.m */; };
2020
77F6D6D51F65EB2E00A61645 /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77F6D6D41F65EB2E00A61645 /* ServiceManagement.framework */; };
21+
EC89E7F52060503900152AB3 /* SaveTheme.xib in Resources */ = {isa = PBXBuildFile; fileRef = EC89E7F42060503900152AB3 /* SaveTheme.xib */; };
2122
EC9EFB91205555C900C6BAAF /* NSAlert+runModalSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = EC9EFB90205555C800C6BAAF /* NSAlert+runModalSheet.m */; };
2223
ECAF6F652024ADC900715D72 /* PFMoveApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = ECAF6F642024ADC900715D72 /* PFMoveApplication.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
2324
ECB76D56205D713900A3BB22 /* ConkyThemes.xib in Resources */ = {isa = PBXBuildFile; fileRef = ECB76D52205D713900A3BB22 /* ConkyThemes.xib */; };
@@ -84,6 +85,7 @@
8485
77E6DBCA1F648B92001DEBB1 /* AboutSheetController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AboutSheetController.m; sourceTree = "<group>"; };
8586
77F6D6D41F65EB2E00A61645 /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; };
8687
EB4CD18A379F8DE15EBD610F /* Pods_Manage_Conky.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Manage_Conky.framework; sourceTree = BUILT_PRODUCTS_DIR; };
88+
EC89E7F42060503900152AB3 /* SaveTheme.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SaveTheme.xib; sourceTree = "<group>"; };
8789
EC9EFB8F205555B200C6BAAF /* NSAlert+runModalSheet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "NSAlert+runModalSheet.h"; path = "Extensions/NSAlert+runModalSheet.h"; sourceTree = "<group>"; };
8890
EC9EFB90205555C800C6BAAF /* NSAlert+runModalSheet.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "NSAlert+runModalSheet.m"; path = "Extensions/NSAlert+runModalSheet.m"; sourceTree = "<group>"; };
8991
ECAF6F632024ADC900715D72 /* PFMoveApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFMoveApplication.h; sourceTree = "<group>"; };
@@ -205,6 +207,7 @@
205207
ECB76D53205D713900A3BB22 /* ConkyInstaller.xib */,
206208
ECB76D55205D713900A3BB22 /* ConkyPreferences.xib */,
207209
ECB76D52205D713900A3BB22 /* ConkyThemes.xib */,
210+
EC89E7F42060503900152AB3 /* SaveTheme.xib */,
208211
);
209212
name = Sheets;
210213
sourceTree = "<group>";
@@ -331,6 +334,7 @@
331334
ECB76D5E205D716C00A3BB22 /* dsa_pub.pem in Resources */,
332335
ECB76D61205D725100A3BB22 /* Credits.rtf in Resources */,
333336
77B847451F62C2B600AF8BCA /* Main.storyboard in Resources */,
337+
EC89E7F52060503900152AB3 /* SaveTheme.xib in Resources */,
334338
ECB76D56205D713900A3BB22 /* ConkyThemes.xib in Resources */,
335339
ECB76D57205D713900A3BB22 /* ConkyInstaller.xib in Resources */,
336340
ECB76D5F205D716C00A3BB22 /* InstallLibraries.sh in Resources */,

Manage Conky/Base.lproj/Main.storyboard

Lines changed: 213 additions & 35 deletions
Large diffs are not rendered by default.

Manage Conky/ConkyPreferencesSheetController.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
@end
2121

2222

23-
@interface ConkyPreferencesSheetController : GeneralSheetController<SUUpdaterDelegate>
23+
@interface ConkyPreferencesSheetController : GeneralSheetController<SUUpdaterDelegate, NSTableViewDataSource, NSTableViewDelegate>
2424
{
2525
ConkyInstallerSheetController *ctl;
2626
BOOL conkyXInstalled;
@@ -45,6 +45,12 @@
4545
@property (weak) IBOutlet NSStepper *startupDelayStepper;
4646
@property (weak) IBOutlet NSTextField *startupDelayLabel;
4747

48+
49+
@property (weak) IBOutlet NSTableView *searchLocationsTable;
50+
@property (weak) IBOutlet NSButton *addSearchLocationButton;
51+
@property (weak) IBOutlet NSButton *removeSearchLocationButton;
52+
53+
4854
@property (weak) IBOutlet NSButton *doneButton;
4955

5056

Manage Conky/ConkyPreferencesSheetController.m

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ - (BOOL)isPartialStringValid:(NSString*)partialString newEditingString:(NSString
4949
@end
5050

5151
@implementation ConkyPreferencesSheetController
52+
{
53+
NSMutableArray *_searchLocationsTableContents;
54+
}
5255

5356
- (void)showAlertWithMessageText:(NSString*)msg informativeText:(NSString*)info andAlertStyle:(NSAlertStyle)style
5457
{
@@ -84,6 +87,9 @@ - (IBAction)activatePreferencesSheet:(id)sender
8487
// mustInstallAgent
8588
mustInstallAgent = NO; /* default value */
8689

90+
_searchLocationsTableContents = [[NSMutableArray alloc] init];
91+
NSString * path = @"/User/np/Pictures";
92+
8793
if (conkyXInstalled)
8894
{
8995
/* Is conky agent present? */
@@ -315,4 +321,56 @@ - (void)updaterDidRelaunchApplication:(SUUpdater *)updater
315321
[self helper_installConkyX];
316322
}
317323

324+
//
325+
//
326+
// SEARCH LOCATIONS
327+
//
328+
//
329+
330+
- (IBAction)addSearchLocation:(id)sender
331+
{
332+
NSOpenPanel *panel = [NSOpenPanel openPanel];
333+
334+
panel.canChooseDirectories = NO;
335+
panel.allowsMultipleSelection = NO;
336+
337+
/*
338+
* display the panel
339+
*/
340+
[panel beginSheetModalForWindow:[super sheet] completionHandler:^(NSModalResponse result) {
341+
if (result == NSFileHandlingPanelOKButton)
342+
{
343+
NSURL *theDocument = [[panel URLs] objectAtIndex:0];
344+
NSString *theDocumentInString = [theDocument path];
345+
346+
/* add to table contents array */
347+
[_searchLocationsTableContents addObject:theDocumentInString];
348+
NSLog(@"Path = %@", theDocumentInString);
349+
}
350+
}];
351+
}
352+
353+
- (IBAction)removeSearchLocation:(id)sender
354+
{
355+
}
356+
357+
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
358+
{
359+
return [_searchLocationsTableContents count];
360+
}
361+
362+
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
363+
{
364+
NSString *searchLocation = _searchLocationsTableContents[row];
365+
366+
#define IDENTIFIER_SET_IN_INTERFACE_BUILDER @"MainCell"
367+
368+
NSTableCellView *cellView = [tableView makeViewWithIdentifier:IDENTIFIER_SET_IN_INTERFACE_BUILDER owner:self];
369+
370+
cellView.textField.stringValue = searchLocation;
371+
cellView.imageView.image = [NSImage imageNamed:@"Maintain"];
372+
373+
return cellView;
374+
}
375+
318376
@end

Manage Conky/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
<key>CFBundlePackageType</key>
2222
<string>APPL</string>
2323
<key>CFBundleShortVersionString</key>
24-
<string>0.1</string>
24+
<string>0.2</string>
2525
<key>CFBundleVersion</key>
26-
<string>0.1</string>
26+
<string>0.2</string>
2727
<key>LSMinimumSystemVersion</key>
2828
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2929
<key>NSHumanReadableCopyright</key>

0 commit comments

Comments
 (0)