* Added the "Open Target Folder" Tracker add-on as published on BeBits
to the repository and image. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27927 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
ee0d2e6445
commit
6450ea1855
@ -394,7 +394,8 @@ AddFilesToHaikuImage beos system add-ons mail_daemon system_filters : Inbox New\
|
||||
AddFilesToHaikuImage beos system add-ons media : $(BEOS_ADD_ONS_MEDIA) ;
|
||||
AddFilesToHaikuImage beos system add-ons media plugins
|
||||
: $(BEOS_ADD_ONS_MEDIA_PLUGINS) ;
|
||||
AddFilesToHaikuImage beos system add-ons Tracker : FileType-F ZipOMatic-Z ;
|
||||
AddFilesToHaikuImage beos system add-ons Tracker
|
||||
: FileType-F ZipOMatic-Z Open\ Target\ Folder-T ;
|
||||
AddSymlinkToHaikuImage beos system add-ons Tracker
|
||||
: /boot/beos/preferences/Backgrounds : Background-B ;
|
||||
AddSymlinkToHaikuImage beos system add-ons Tracker
|
||||
|
BIN
data/artwork/icons/App_OpenTargetFolder
Normal file
BIN
data/artwork/icons/App_OpenTargetFolder
Normal file
Binary file not shown.
@ -1,6 +1,7 @@
|
||||
SubDir HAIKU_TOP src add-ons tracker ;
|
||||
|
||||
SubInclude HAIKU_TOP src add-ons tracker zipomatic ;
|
||||
SubInclude HAIKU_TOP src add-ons tracker filetype ;
|
||||
SubInclude HAIKU_TOP src add-ons tracker opentargetfolder ;
|
||||
SubInclude HAIKU_TOP src add-ons tracker mark_as ;
|
||||
SubInclude HAIKU_TOP src add-ons tracker zipomatic ;
|
||||
|
||||
|
8
src/add-ons/tracker/opentargetfolder/Jamfile
Normal file
8
src/add-ons/tracker/opentargetfolder/Jamfile
Normal file
@ -0,0 +1,8 @@
|
||||
SubDir HAIKU_TOP src add-ons tracker opentargetfolder ;
|
||||
|
||||
Application Open\ Target\ Folder-T :
|
||||
opentargetfolder.cpp
|
||||
|
||||
: be tracker
|
||||
: opentargetfolder.rdef
|
||||
;
|
75
src/add-ons/tracker/opentargetfolder/opentargetfolder.cpp
Normal file
75
src/add-ons/tracker/opentargetfolder/opentargetfolder.cpp
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright 2003-2008, Axel Dörfler, axeld@pinc-software.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
//! Open Target Folder - opens the folder of the link target in Tracker
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <Alert.h>
|
||||
#include <Directory.h>
|
||||
#include <Entry.h>
|
||||
#include <Messenger.h>
|
||||
#include <Path.h>
|
||||
#include <SymLink.h>
|
||||
|
||||
|
||||
extern "C" void
|
||||
process_refs(entry_ref directoryRef, BMessage *msg, void *)
|
||||
{
|
||||
BDirectory directory(&directoryRef);
|
||||
if (directory.InitCheck() != B_OK)
|
||||
return;
|
||||
|
||||
int32 errors = 0;
|
||||
entry_ref ref;
|
||||
int32 index;
|
||||
for (index = 0; msg->FindRef("refs", index, &ref) == B_OK; index ++) {
|
||||
BSymLink link(&ref);
|
||||
if (link.InitCheck() != B_OK || !link.IsSymLink()) {
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
|
||||
BEntry targetEntry;
|
||||
BPath path;
|
||||
if (link.MakeLinkedPath(&directory, &path) < B_OK
|
||||
|| targetEntry.SetTo(path.Path()) != B_OK
|
||||
|| targetEntry.GetParent(&targetEntry) != B_OK) {
|
||||
(new BAlert("Open Target Folder",
|
||||
"Cannot open target folder. Maybe this link is broken?",
|
||||
"Ok", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL);
|
||||
continue;
|
||||
}
|
||||
|
||||
// create Tracker message...
|
||||
entry_ref target;
|
||||
targetEntry.GetRef(&target);
|
||||
|
||||
BMessage message(B_REFS_RECEIVED);
|
||||
message.AddRef("refs", &target);
|
||||
|
||||
// ...and send it
|
||||
BMessenger messenger("application/x-vnd.Be-TRAK");
|
||||
messenger.SendMessage(&message);
|
||||
|
||||
// TODO: select entry via scripting?
|
||||
}
|
||||
|
||||
if (errors) {
|
||||
(new BAlert("Open Target Folder",
|
||||
"This add-on can only be used on symbolic links.\n"
|
||||
"It opens the folder of the link target in Tracker.",
|
||||
"Ok"))->Go(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int /*argc*/, char **/*argv*/)
|
||||
{
|
||||
fprintf(stderr, "This can only be used as a Tracker add-on.\n");
|
||||
return -1;
|
||||
}
|
94
src/add-ons/tracker/opentargetfolder/opentargetfolder.rdef
Normal file
94
src/add-ons/tracker/opentargetfolder/opentargetfolder.rdef
Normal file
@ -0,0 +1,94 @@
|
||||
resource app_signature "application/x-vnd.haiku.opentargetfolder";
|
||||
|
||||
resource app_flags B_SINGLE_LAUNCH;
|
||||
|
||||
resource app_version {
|
||||
major = 1,
|
||||
middle = 0,
|
||||
minor = 0,
|
||||
|
||||
variety = B_APPV_FINAL,
|
||||
internal = 1,
|
||||
|
||||
short_info = "Opens the Link Target's Folder",
|
||||
long_info = "Open Target Folder, Copyright 2008 Haiku Inc."
|
||||
};
|
||||
|
||||
resource file_types message {
|
||||
"types" = "application/x-vnd.Be-symlink"
|
||||
};
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
|
||||
resource vector_icon {
|
||||
$"6E636966080500020006023841813C9B3BBEAB393A4F584B254D4A7AEB00FFE2"
|
||||
$"ACFFF49806020016022C60673CAAABBEBB082E6EFB4BBA064A22B000FFFF8E02"
|
||||
$"0006022C25F43C6917BEBB082E6EFB4BAFBF497E0B00FACE79FFBC410503A03D"
|
||||
$"03020016023AE3B43C79DCBE5BC53CC0974B42AC47CA41009AFF5004016503FF"
|
||||
$"8A00080A064A5D505D545958595E53504F0A04232F2D494A5B463E0A04232F46"
|
||||
$"3E4A5BC3233C0A063A282E494A5A5C2C502A4C2C0A04302B30494A5951360A04"
|
||||
$"302B51364A5954BB1E0A0A232F2D494A5B5C2C502A4C2C3A28382D302BB957BA"
|
||||
$"A70607FA2F5C483C5344484448BE4EC20A3A30AEC4C0983A303E323E3228404A"
|
||||
$"3F423D4A3F50360B0A060100000A0001061815FF01178400040A000106180015"
|
||||
$"01178600040A030103000A020104000A050105000A010101000A040102000A07"
|
||||
$"010720B240B2B30A00010738B280B28015FF01178310040A00010738B280B280"
|
||||
$"00150117851004"
|
||||
};
|
||||
|
||||
#else // HAIKU_TARGET_PLATFORM_HAIKU
|
||||
|
||||
resource large_icon array {
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFF00D80000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFF0000FFFF0084D8D80000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFF003F000000848484D8D80000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFF003F3F3F0000ABA48484D8D80000FFFFFF000000FFFFFFFFFFFFFF"
|
||||
$"FFFFFFFFFF003F3F3F3F3F0000ABA48484D8D8000000D8D8D80000FFFFFFFFFF"
|
||||
$"FFFFFFFFFF003F3F3F3F3F3F3F0000ABA48484D8D8D8848484D8D80000FFFFFF"
|
||||
$"FFFFFFFFFF003F3F3F3F3F3F3F3F3F0000ABA48484848484848484D8D800FFFF"
|
||||
$"FF000000FF003F3F3F3F3F3F3F3F3F3F3F0000ABA4848484848484848400FFFF"
|
||||
$"FF003F3F00003F3F3F3F3F3F3F3F3F3F3F3F3F0000ABA484848484848400FFFF"
|
||||
$"FF00D8D83F3F00003F3F3F3F3F3F3F3F3F3F3F3F3F0000ABA48484848400FFFF"
|
||||
$"FF00D8D8D8D83F3F00003F3F3F3F3F3F3F3F3F3F3F3F3F0000AB84848400FFFF"
|
||||
$"FFFF00D8D8D8D8D83F3F0000003F3F3F3F003F3F3F3F3F3F00ABAB848400FFFF"
|
||||
$"FFFF00D8D8D8D8D8D8D83F00F9003F3F3F00003F3F3F3F3F00ABAB8400FFFFFF"
|
||||
$"FFFF00D8D8D8D8D8D8D800F95D5D00003F00F9003F3F3F3F00ABAB8400FFFFFF"
|
||||
$"FFFFFF00D8D8D8D8D800F95D5DF9003F0000F9F9003F3F3F00ABAB8400FFFFFF"
|
||||
$"FFFFFF00D8D8D8D800F95D5DF900D8D83F005DF9F9003F3F00ABAB8400FFFFFF"
|
||||
$"FFFFFF00D8D8D800F95D5DF90000000000005D5DF9F9003F00ABAB8400FFFFFF"
|
||||
$"FFFFFFFF00D800F95D5D5DF9F9F9F9F9F9F95D5D5DF9F90000ABA400FFFFFFFF"
|
||||
$"FFFFFFFF0000F95D5D5D5D5D5D5D5D5D5D5D5D5D5D5DF9F900ABA400FFFFFFFF"
|
||||
$"FFFFFFFF00A5A5A5A5A5A5A5A5A5A5A5A5A5A55D5D5DA50000ABA400FFFFFFFF"
|
||||
$"FFFFFFFFFF00000000000000000000000000A55D5DA5003F00ABA400FFFFFFFF"
|
||||
$"FFFFFFFFFFFFFF00008484D8D8D8D8D8D800A55DA500003F00ABA400FFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFF00008484D8D8D8D800A5A500D8003F00AB00FFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFF00008484D8D800A500D8D8003F00AB00FFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFF000084840000D8D8D8D80000AB00FFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000084D8D8D8D80000AB00FFFFFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00008484D8D80000AB000D0DFFFFFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00008484840000000D0D0D0DFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00008400000D0D0D0D0DFF"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000D0D0DFFFFFFFF"
|
||||
};
|
||||
|
||||
resource mini_icon array {
|
||||
$"FFFFFFFFFF0000FFFFFFFFFFFFFFFFFF"
|
||||
$"FFFFFFFF0084840000FFFF0000FFFFFF"
|
||||
$"FFFFFF000000AA84840000D8D80000FF"
|
||||
$"FFFFFF003F3F0000AA84848484D8D800"
|
||||
$"0000FF003F3F001F0000AA8484848400"
|
||||
$"003F00003F00F9003F000000AA848400"
|
||||
$"00D83F3F00F95DA50000F90000AA8400"
|
||||
$"FF00D800F95DA5000000F9F900AA8400"
|
||||
$"FF0000F95D5DA5F9F9F95DF9F9008400"
|
||||
$"FF00F95D5D5D5D5D5D5D5D5DF9F900FF"
|
||||
$"FF00A5A5A5A5A5A5A5A5A55DA50000FF"
|
||||
$"FFFF0000000000000000A5A500AA00FF"
|
||||
$"FFFFFFFFFF0000848400A50000AA00FF"
|
||||
$"FFFFFFFFFFFFFF000000008400AA0010"
|
||||
$"FFFFFFFFFFFFFFFFFF00008400000010"
|
||||
$"FFFFFFFFFFFFFFFFFFFFFF00000010FF"
|
||||
};
|
||||
|
||||
#endif // HAIKU_TARGET_PLATFORM_HAIKU
|
Loading…
Reference in New Issue
Block a user