Adding a few new Tracker add-ons for setting emails to a status of "New" and

"Read".  Others could be added fairly easily since I just use one source file
and a new Jam code generation rule to set the appropriate status in the source
file. I feel this is better than bugging the user with some GUI dialog where
they pick the status they want in a single add-on.

For now I'm using the BeMail icon for both.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19482 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ryan Leavengood 2006-12-13 08:09:56 +00:00
parent dd481a03fc
commit 141674aa8c
4 changed files with 221 additions and 0 deletions

View File

@ -0,0 +1,33 @@
SubDir HAIKU_TOP src add-ons tracker mark_as ;
SetSubDirSupportedPlatformsBeOSCompatible ;
AddResources MarkAsNew-N : MarkAsNew.rdef ;
AddResources MarkAsRead-R : MarkAsRead.rdef ;
SearchAndReplace MarkAsNew.cpp :
MarkAs.cpp
: !!!STATUS_HERE!!!
: New
;
SearchAndReplace MarkAsRead.cpp :
MarkAs.cpp
: !!!STATUS_HERE!!!
: Read
;
Addon MarkAsNew-N : Tracker :
MarkAsNew.cpp
: false
: be tracker
;
Addon MarkAsRead-R : Tracker :
MarkAsRead.cpp
: false
: be tracker
;

View File

@ -0,0 +1,30 @@
/*
* Copyright 2006, Ryan Leavengood, leavengood@gmail.com. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#include <Entry.h>
#include <Message.h>
#include <Node.h>
#include <String.h>
#include <TrackerAddon.h>
extern "C" void
process_refs(entry_ref dir, BMessage* msg, void* /*reserved*/)
{
int32 refs;
entry_ref ref;
BString status("!!!STATUS_HERE!!!");
BString type;
for (refs = 0; msg->FindRef("refs", refs, &ref) == B_NO_ERROR; refs++) {
BNode node(&ref);
if ((node.InitCheck() == B_NO_ERROR)
&& (node.ReadAttrString("BEOS:TYPE", &type) == B_NO_ERROR)
&& (type == "text/x-email"))
node.WriteAttrString("MAIL:status", &status);
}
}

View File

@ -0,0 +1,79 @@
/*
* MarkAsNew.rdef
*/
resource app_signature "application/x-vnd.Haiku-MarkAsNew";
resource app_flags B_MULTIPLE_LAUNCH;
resource file_types message {
"types" = "text/x-email"
};
resource app_version {
major = 1,
middle = 0,
minor = 0,
/* 0 = development 1 = alpha 2 = beta
3 = gamma 4 = golden master 5 = final */
variety = 0,
internal = 1,
short_info = "MarkAsNew",
long_info = "MarkAsNew, Copyright 2006 Haiku Inc."
};
resource mini_icon array {
$"FFFFFFFFF900F9FFFFF9FFF9F9FFFFFF"
$"F9FFFFF9001B0000F9FFF9FFFFFFF9FF"
$"FFF9F9003F3F3F1B0000F9FFF9F9FFFF"
$"FFF9003F3F3F1B3F3F1B0000F9FFFFFF"
$"F9003F3F3F0000111B3F3F1B0000F9FF"
$"001B3F3F0011000000113F2B3F1B0000"
$"0000001C00001100111B7B2B2C1C00F9"
$"FFF90000FAFA0000113F3F7B1B00F9FF"
$"F90000FAFAFAFA00003F3F1B00F9FFFF"
$"FF00F9F9F9FAF95D001B1C00F9F9F9F9"
$"00F9F90000F95D5D000000F9FFFFFFFF"
$"00F9F99D00F95D0000F9F9FFF9FFFFFF"
$"00F90000F9F9009D000EF9FFFFF9FFFF"
$"FF00F99D00009D00000EF9FFFFFFFFFF"
$"FF0000F9F9F900000E0FFFFFFFFFFFFF"
$"FFFFFF000000000E0FFFFFFFFFFFFFFF"
};
resource large_icon array {
$"FFFFFFFFFFFFFFFFFFFFF9F9FFFFFFFFFFFFF9FFFFFFFFFFF9FFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFF90000F9F9FFFFFFFFF9FFFFFFFFF9FFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFF9001B1C0000F9F9FFFFFFFFFFFFF9FFFFFFFFFFFFFFFFFF"
$"FFFFF9FFFFFFFFF9003F3F3F1B1C0000F9F9FFFFFFF9FFFFFFFFFFFFF9F9FFFF"
$"FFFFFFF9FFFFF9003F3F3F3F3F3F1B1C0000F9F9FFFFFFFFFFFFF9F9FFFFFFFF"
$"FFFFFFFFFFF9003F3F3F3F3F3F3F3F3F1B1C0000F9F9FFFFFFF9FFFFFFFFFFFF"
$"FFFFFFFFF9003F3F3F3F3F3F3F3F3F3F3F3F1B1C0000F9F9FFFFFFFFFFFFFFFF"
$"FFFFFFF9003F3F3F3F3F3F3F1B1C3F3F3F3F3F3F1B1C0000F9F9FFFFFFFFFFFF"
$"FFFFF9003F3F3F3F3F3F3F3F00001B1C3F3F3F3F3F3F1B1C0000F9F9FFFFFFFF"
$"FFF9003F3F3F3F3F3F3F3F001B1C00001B1C3F3F3F3F3F3F1B1C0000F9F9FFFF"
$"F9003F3F3F3F3F3F3F001B1C00001B1C00001C1B3F3F3F3F2B7B1B1C0000F9F9"
$"001B1C3F3F3F3F3F3F3F00001B1C00001B1C00003F3F3F2B2C2B2B3F1B1C00F9"
$"F900001B1C3F3F3F3F3F3F3F00001B1C3F3F3F1B3F3F2B2C2B2B3F3F1B00F9F9"
$"FFF9F900001B1C3F000000003F3F11001B1C3F3F3F3F3F7B2B3F3F1B00F9F9FF"
$"FFFFFFF9F9000000FAFAFAFA00003F3F00003F3F3F3F3F3F3F3F1B00F9F9FFFF"
$"FFFFFFFFFF00FAFAFAFAFAFAFAFA00001B3F3F3F3F3F3F3F3F1B00F9F9FFFFFF"
$"FFFFFFFF00FAFAFAFAFAFAFAFAFAFA0000003F3F3F3F3F3F1B00F9F9FFFFFFFF"
$"F9F9FF003F3F3F3FFAFAFAFAFAFAF9F9003F3F3F3F3F3F1B00F9F9FFFFFFFFFF"
$"FFFF00F9F9F9F9F93F3FFAFAFAF9F95D003F3F3F3F3F1B00F9F9FFF9F9FFFFFF"
$"FFFF00F9F9F9F9F9F9F93FFAF9F95D5D001B1C3F3F1B00F9F9FFFFFFFFF9F9FF"
$"FF00F9F9F9F90000F9F9F93FF95D5D5D0000001B1C00F9F9FFFFFFFFFFFFFFFF"
$"FF00F9F9F9009D9D00F9F9F95D5D5D5D00F9F90000F9F9FFFFFFFFFFFFFFFFFF"
$"FF00F9F9F900002D00F9F9F95D5D5D00FFFFFFF9F9FFFFFFFFF9FFFFFFFFFFFF"
$"FF00F9F9F9F9F90000F9F9F95D5D009D00FFFFFFFFF9FFFFFFFFF9FFFFFFFFFF"
$"FF00F9F9F90000F9F9F9F9F95D009D5D000F0FFFFFF9FFFFFFFFFFF9FFFFFFFF"
$"FF00F9F9F9009D0000F9F9F9009D5D5D000E0F0FFFF9FFFFFFFFFFFFFFFFFFFF"
$"FFFF00F9F9009D7D9D9D00009D5D5D5D000E0F0FFFF9FFFFFFFFFFFFFFFFFFFF"
$"FFFF00F9F9F9007D7D003F3F5D5D5D000E0F0F0FFFF9FFFFFFFFFFFFFFFFFFFF"
$"FFFFFF00F9F9F90000F9F9F95D5D00080F0F0FFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFF0000F9F9F9F9F95D5D00080F0F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFF0000F9F95D0000080F0F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFF00000008090E0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
};

View File

@ -0,0 +1,79 @@
/*
* MarkAsRead.rdef
*/
resource app_signature "application/x-vnd.Haiku-MarkAsRead";
resource app_flags B_MULTIPLE_LAUNCH;
resource file_types message {
"types" = "text/x-email"
};
resource app_version {
major = 1,
middle = 0,
minor = 0,
/* 0 = development 1 = alpha 2 = beta
3 = gamma 4 = golden master 5 = final */
variety = 0,
internal = 1,
short_info = "MarkAsRead",
long_info = "MarkAsRead, Copyright 2006 Haiku Inc."
};
resource mini_icon array {
$"FFFFFFFFF900F9FFFFF9FFF9F9FFFFFF"
$"F9FFFFF9001B0000F9FFF9FFFFFFF9FF"
$"FFF9F9003F3F3F1B0000F9FFF9F9FFFF"
$"FFF9003F3F3F1B3F3F1B0000F9FFFFFF"
$"F9003F3F3F0000111B3F3F1B0000F9FF"
$"001B3F3F0011000000113F2B3F1B0000"
$"0000001C00001100111B7B2B2C1C00F9"
$"FFF90000FAFA0000113F3F7B1B00F9FF"
$"F90000FAFAFAFA00003F3F1B00F9FFFF"
$"FF00F9F9F9FAF95D001B1C00F9F9F9F9"
$"00F9F90000F95D5D000000F9FFFFFFFF"
$"00F9F99D00F95D0000F9F9FFF9FFFFFF"
$"00F90000F9F9009D000EF9FFFFF9FFFF"
$"FF00F99D00009D00000EF9FFFFFFFFFF"
$"FF0000F9F9F900000E0FFFFFFFFFFFFF"
$"FFFFFF000000000E0FFFFFFFFFFFFFFF"
};
resource large_icon array {
$"FFFFFFFFFFFFFFFFFFFFF9F9FFFFFFFFFFFFF9FFFFFFFFFFF9FFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFFFF90000F9F9FFFFFFFFF9FFFFFFFFF9FFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFFF9001B1C0000F9F9FFFFFFFFFFFFF9FFFFFFFFFFFFFFFFFF"
$"FFFFF9FFFFFFFFF9003F3F3F1B1C0000F9F9FFFFFFF9FFFFFFFFFFFFF9F9FFFF"
$"FFFFFFF9FFFFF9003F3F3F3F3F3F1B1C0000F9F9FFFFFFFFFFFFF9F9FFFFFFFF"
$"FFFFFFFFFFF9003F3F3F3F3F3F3F3F3F1B1C0000F9F9FFFFFFF9FFFFFFFFFFFF"
$"FFFFFFFFF9003F3F3F3F3F3F3F3F3F3F3F3F1B1C0000F9F9FFFFFFFFFFFFFFFF"
$"FFFFFFF9003F3F3F3F3F3F3F1B1C3F3F3F3F3F3F1B1C0000F9F9FFFFFFFFFFFF"
$"FFFFF9003F3F3F3F3F3F3F3F00001B1C3F3F3F3F3F3F1B1C0000F9F9FFFFFFFF"
$"FFF9003F3F3F3F3F3F3F3F001B1C00001B1C3F3F3F3F3F3F1B1C0000F9F9FFFF"
$"F9003F3F3F3F3F3F3F001B1C00001B1C00001C1B3F3F3F3F2B7B1B1C0000F9F9"
$"001B1C3F3F3F3F3F3F3F00001B1C00001B1C00003F3F3F2B2C2B2B3F1B1C00F9"
$"F900001B1C3F3F3F3F3F3F3F00001B1C3F3F3F1B3F3F2B2C2B2B3F3F1B00F9F9"
$"FFF9F900001B1C3F000000003F3F11001B1C3F3F3F3F3F7B2B3F3F1B00F9F9FF"
$"FFFFFFF9F9000000FAFAFAFA00003F3F00003F3F3F3F3F3F3F3F1B00F9F9FFFF"
$"FFFFFFFFFF00FAFAFAFAFAFAFAFA00001B3F3F3F3F3F3F3F3F1B00F9F9FFFFFF"
$"FFFFFFFF00FAFAFAFAFAFAFAFAFAFA0000003F3F3F3F3F3F1B00F9F9FFFFFFFF"
$"F9F9FF003F3F3F3FFAFAFAFAFAFAF9F9003F3F3F3F3F3F1B00F9F9FFFFFFFFFF"
$"FFFF00F9F9F9F9F93F3FFAFAFAF9F95D003F3F3F3F3F1B00F9F9FFF9F9FFFFFF"
$"FFFF00F9F9F9F9F9F9F93FFAF9F95D5D001B1C3F3F1B00F9F9FFFFFFFFF9F9FF"
$"FF00F9F9F9F90000F9F9F93FF95D5D5D0000001B1C00F9F9FFFFFFFFFFFFFFFF"
$"FF00F9F9F9009D9D00F9F9F95D5D5D5D00F9F90000F9F9FFFFFFFFFFFFFFFFFF"
$"FF00F9F9F900002D00F9F9F95D5D5D00FFFFFFF9F9FFFFFFFFF9FFFFFFFFFFFF"
$"FF00F9F9F9F9F90000F9F9F95D5D009D00FFFFFFFFF9FFFFFFFFF9FFFFFFFFFF"
$"FF00F9F9F90000F9F9F9F9F95D009D5D000F0FFFFFF9FFFFFFFFFFF9FFFFFFFF"
$"FF00F9F9F9009D0000F9F9F9009D5D5D000E0F0FFFF9FFFFFFFFFFFFFFFFFFFF"
$"FFFF00F9F9009D7D9D9D00009D5D5D5D000E0F0FFFF9FFFFFFFFFFFFFFFFFFFF"
$"FFFF00F9F9F9007D7D003F3F5D5D5D000E0F0F0FFFF9FFFFFFFFFFFFFFFFFFFF"
$"FFFFFF00F9F9F90000F9F9F95D5D00080F0F0FFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFF0000F9F9F9F9F95D5D00080F0F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFF0000F9F95D0000080F0F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFFFFFFFFFF00000008090E0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
};