mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-17 08:01:24 +00:00
* Framework/PCProjectBrowser.m:
(-nameOfSelectedCategory): Return 'nil' if name of subproject selected. Add comments. (-nameOfSelectedFile): Check if category is selected. (-click:): check if category is selected. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@31105 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
18efb7552d
commit
c1c7f004d4
2 changed files with 30 additions and 8 deletions
|
@ -1,3 +1,10 @@
|
|||
2010-08-10 Sergii Stoian <stoyan255@ukr.net>
|
||||
* Framework/PCProjectBrowser.m:
|
||||
(-nameOfSelectedCategory): Return 'nil' if name of subproject
|
||||
selected. Add comments.
|
||||
(-nameOfSelectedFile): Check if category is selected.
|
||||
(-click:): check if category is selected.
|
||||
|
||||
2010-07-31 Sergii Stoian <stoyan255@ukr.net>
|
||||
* Framework/PCProject.m:
|
||||
(-assignProjectDict:): Fix setting projectPath to project
|
||||
|
|
|
@ -107,8 +107,9 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
|||
|
||||
// NSLog(@"---> Selected: %@: category: %@", name, category);
|
||||
|
||||
if ([[browser selectedCells] count] != 1
|
||||
|| [name isEqualToString:category])
|
||||
if ([[browser selectedCells] count] != 1 ||
|
||||
!category ||
|
||||
[name isEqualToString:category])
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
@ -142,7 +143,12 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
|||
return path;
|
||||
}
|
||||
|
||||
// Returns nil of multiple categories selected
|
||||
// Returns 'nil' if selected:
|
||||
// - root project (browser path is @"/")
|
||||
// - multiple categories
|
||||
// - name of subproject
|
||||
// Should not call any of the nameOf... or pathTo... methods to prevent
|
||||
// cyclic recursion.
|
||||
- (NSString *)nameOfSelectedCategory
|
||||
{
|
||||
NSArray *pathArray = [[browser path] componentsSeparatedByString:@"/"];
|
||||
|
@ -157,12 +163,14 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
|||
// But: path '/Subproject/Foo' and '/Subprojects/Foo/Subprojects' will
|
||||
// return the same category 'Subprojects' and active project will be 'Foo'
|
||||
// in both cases
|
||||
if ([lastPathElement isEqualToString:[activeProject projectName]])
|
||||
// ![[self nameOfSelectedFile] isEqualToString:lastPathElement])
|
||||
/* if ([lastPathElement isEqualToString:[activeProject projectName]])
|
||||
{
|
||||
activeProject = [activeProject superProject];
|
||||
rootCategories = [activeProject rootCategories];
|
||||
}
|
||||
}*/
|
||||
|
||||
// Multiple categories selected
|
||||
if (([rootCategories containsObject:lastPathElement]
|
||||
&& [[browser selectedCells] count] > 1))
|
||||
{
|
||||
|
@ -177,6 +185,13 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Subproject's name selected
|
||||
if ([name isEqualToString:@"Subprojects"] &&
|
||||
[lastPathElement isEqualToString:[activeProject projectName]])
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
@ -382,13 +397,13 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
|||
filePath = [self pathToSelectedFile];
|
||||
fileName = [self nameOfSelectedFile];
|
||||
|
||||
NSLog(@"[click]category: %@ forProject: %@ fileName: %@",
|
||||
NSLog(@"[click] category: %@ forProject: %@ fileName: %@",
|
||||
category, [activeProject projectName], fileName);
|
||||
|
||||
// ![fileName isEqualToString:[activeProject projectName]] &&
|
||||
if (filePath &&
|
||||
[filePath isEqualToString:browserPath] &&
|
||||
![fileName isEqualToString:[activeProject projectName]] &&
|
||||
![category isEqualToString:@"Subprojects"] &&
|
||||
category &&
|
||||
![category isEqualToString:@"Libraries"]
|
||||
)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue