equal
deleted
inserted
replaced
251 isVisible: allowFileOperations |
251 isVisible: allowFileOperations |
252 shortcutKey: Rename |
252 shortcutKey: Rename |
253 ) |
253 ) |
254 (MenuItem |
254 (MenuItem |
255 enabled: hasSelection |
255 enabled: hasSelection |
|
256 label: 'Rename each to Include Directory in Name' |
|
257 itemValue: renameToIncludeDirectoryInNameInTreeView |
|
258 translateLabel: true |
|
259 isVisible: allowFileOperations |
|
260 ) |
|
261 (MenuItem |
|
262 enabled: hasSelection |
256 label: 'Properties...' |
263 label: 'Properties...' |
257 itemValue: doShowProperties |
264 itemValue: doShowProperties |
258 translateLabel: true |
265 translateLabel: true |
259 ) |
266 ) |
260 (MenuItem |
267 (MenuItem |
558 browser openEditorAction:nil. |
565 browser openEditorAction:nil. |
559 ]. |
566 ]. |
560 ]. |
567 ]. |
561 ! |
568 ! |
562 |
569 |
|
570 renameToIncludeDirectoryInNameInTreeView |
|
571 |numAffected| |
|
572 |
|
573 numAffected := 0. |
|
574 self withWaitCursorDo:[ |
|
575 self selectedDirectories do:[:eachDirectory | |
|
576 |prefix| |
|
577 |
|
578 prefix := eachDirectory baseName , '_'. |
|
579 eachDirectory directoryContentsAsFilenamesDo:[:eachFile | |
|
580 (eachFile baseName startsWith:prefix) ifFalse:[ |
|
581 numAffected := numAffected + 1. |
|
582 ]. |
|
583 ]. |
|
584 ]. |
|
585 ]. |
|
586 numAffected == 0 ifTrue:[ |
|
587 Dialog information:(resources string:'No files to rename'). |
|
588 ^ self. |
|
589 ]. |
|
590 (Dialog confirm:(resources stringWithCRs:'Continue renaming %1 files?' with:numAffected)) ifFalse:[^ self]. |
|
591 |
|
592 self withWaitCursorDo:[ |
|
593 self selectedDirectories do:[:eachDirectory | |
|
594 |prefix| |
|
595 |
|
596 prefix := eachDirectory baseName , '_'. |
|
597 eachDirectory directoryContentsAsFilenamesDo:[:eachFile | |
|
598 (eachFile baseName startsWith:prefix) ifFalse:[ |
|
599 eachFile renameTo:(eachDirectory construct:(prefix,eachFile baseName)). |
|
600 ]. |
|
601 ]. |
|
602 ]. |
|
603 ]. |
|
604 ! |
|
605 |
563 setMatchBlockInList:list |
606 setMatchBlockInList:list |
564 |
607 |
565 | selection matchBlock filterBlock viewFiles| |
608 | selection matchBlock filterBlock viewFiles| |
566 |
609 |
567 selection := self selectedItems. |
610 selection := self selectedItems. |
1333 ! ! |
1376 ! ! |
1334 |
1377 |
1335 !DirectoryTreeBrowser class methodsFor:'documentation'! |
1378 !DirectoryTreeBrowser class methodsFor:'documentation'! |
1336 |
1379 |
1337 version |
1380 version |
1338 ^ '$Header: /cvs/stx/stx/libtool/DirectoryTreeBrowser.st,v 1.113 2009-10-28 18:53:04 cg Exp $' |
1381 ^ '$Header: /cvs/stx/stx/libtool/DirectoryTreeBrowser.st,v 1.114 2010-02-02 13:15:13 cg Exp $' |
1339 ! |
1382 ! |
1340 |
1383 |
1341 version_CVS |
1384 version_CVS |
1342 ^ '$Header: /cvs/stx/stx/libtool/DirectoryTreeBrowser.st,v 1.113 2009-10-28 18:53:04 cg Exp $' |
1385 ^ '$Header: /cvs/stx/stx/libtool/DirectoryTreeBrowser.st,v 1.114 2010-02-02 13:15:13 cg Exp $' |
1343 ! ! |
1386 ! ! |