First shot at fixing bug 155882: Tasks (ToDo) need an Alarm (just like Events)

This commit is contained in:
mostafah%oeone.com 2003-08-15 18:08:48 +00:00
Родитель 05b377eb6b
Коммит ad333820df
16 изменённых файлов: 1738 добавлений и 326 удалений

Просмотреть файл

@ -1053,6 +1053,11 @@ oeICalContainerFilter::~oeICalContainerFilter()
NS_RELEASE( m_completed ); NS_RELEASE( m_completed );
} }
NS_IMETHODIMP oeICalContainerFilter::GetType(Componenttype *aRetVal)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP oeICalContainerFilter::GetId(char **aRetVal) NS_IMETHODIMP oeICalContainerFilter::GetId(char **aRetVal)
{ {
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;

Просмотреть файл

@ -259,6 +259,7 @@ oeICalEventImpl::oeICalEventImpl()
m_stamp->m_datetime.second = ext.tm_sec; m_stamp->m_datetime.second = ext.tm_sec;
m_stamp->m_datetime.is_utc = true; m_stamp->m_datetime.is_utc = true;
} }
m_type = ICAL_VEVENT_COMPONENT;
m_id = nsnull; m_id = nsnull;
m_title.SetIsVoid(true); m_title.SetIsVoid(true);
m_description.SetIsVoid(true); m_description.SetIsVoid(true);
@ -347,6 +348,23 @@ NS_IMETHODIMP oeICalEventImpl::GetParent( oeIICal **calendar )
return NS_OK; return NS_OK;
} }
/* readonly attribute Componenttype type; */
NS_IMETHODIMP oeICalEventImpl::GetType(Componenttype *aRetVal)
{
#ifdef ICAL_DEBUG_ALL
printf( "GetType() = " );
#endif
*aRetVal= m_type;
#ifdef ICAL_DEBUG_ALL
printf( "\"%d\"\n", *aRetVal );
#endif
return NS_OK;
}
void oeICalEventImpl::SetType(Componenttype aNewVal) {
m_type = aNewVal;
}
/* attribute string Id; */ /* attribute string Id; */
NS_IMETHODIMP oeICalEventImpl::GetId(char **aRetVal) NS_IMETHODIMP oeICalEventImpl::GetId(char **aRetVal)
{ {
@ -2710,6 +2728,9 @@ oeICalEventDisplayImpl::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (aIID.Equals(NS_GET_IID(oeIICalEvent))) { if (aIID.Equals(NS_GET_IID(oeIICalEvent))) {
return mEvent->QueryInterface( aIID, aInstancePtr ); return mEvent->QueryInterface( aIID, aInstancePtr );
} }
if (aIID.Equals(NS_GET_IID(oeIICalTodo))) {
return mEvent->QueryInterface( aIID, aInstancePtr );
}
return NS_NOINTERFACE; return NS_NOINTERFACE;
} }

Просмотреть файл

@ -118,7 +118,10 @@ public:
icaltimetype CalculateEventTime( icaltimetype alarmtime ); icaltimetype CalculateEventTime( icaltimetype alarmtime );
void ChopAndAddEventToEnum( struct icaltimetype startdate, nsISimpleEnumerator **eventlist, void ChopAndAddEventToEnum( struct icaltimetype startdate, nsISimpleEnumerator **eventlist,
bool isallday, bool isbeginning ); bool isallday, bool isbeginning );
void SetType( Componenttype type );
private: private:
Componenttype m_type;
char *m_id; char *m_id;
char *m_syncid; char *m_syncid;
nsCString m_title; nsCString m_title;

Просмотреть файл

@ -953,6 +953,14 @@ NS_IMETHODIMP oeICalImpl::ModifyEvent(oeIICalEvent *icalevent, char **retid)
#endif #endif
icalset *stream; icalset *stream;
icalcomponent *vcalendar; icalcomponent *vcalendar;
nsresult rv;
//This might be a TODO object. If so then call the appropriate function.
nsCOMPtr<oeIICalTodo> icaltodo;
rv = icalevent->QueryInterface(NS_GET_IID(oeIICalTodo), (void **)&icaltodo);
if( NS_SUCCEEDED( rv ) ) {
return ModifyTodo( icaltodo, retid );
}
stream = icalfileset_new(serveraddr); stream = icalfileset_new(serveraddr);
if ( !stream ) { if ( !stream ) {
@ -982,7 +990,6 @@ NS_IMETHODIMP oeICalImpl::ModifyEvent(oeIICalEvent *icalevent, char **retid)
icalfileset_remove_component( stream, fetchedvcal ); icalfileset_remove_component( stream, fetchedvcal );
icalcomponent_free( fetchedvcal ); icalcomponent_free( fetchedvcal );
} }
nsresult rv;
if( NS_FAILED( rv = NS_NewICalEvent((oeIICalEvent**) &oldevent ))) { if( NS_FAILED( rv = NS_NewICalEvent((oeIICalEvent**) &oldevent ))) {
nsMemory::Free( *retid ); nsMemory::Free( *retid );
*retid = nsnull; *retid = nsnull;
@ -1045,7 +1052,6 @@ NS_IMETHODIMP oeICalImpl::ModifyEvent(oeIICalEvent *icalevent, char **retid)
for( unsigned int i=0; i<observercount; i++ ) { for( unsigned int i=0; i<observercount; i++ ) {
nsCOMPtr<oeIICalObserver>observer; nsCOMPtr<oeIICalObserver>observer;
m_observerlist->QueryElementAt( i, NS_GET_IID(oeIICalObserver), getter_AddRefs(observer)); m_observerlist->QueryElementAt( i, NS_GET_IID(oeIICalObserver), getter_AddRefs(observer));
nsresult rv;
rv = observer->OnModifyItem( icalevent, oldevent ); rv = observer->OnModifyItem( icalevent, oldevent );
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
if( NS_FAILED( rv ) ) { if( NS_FAILED( rv ) ) {
@ -1825,6 +1831,79 @@ void oeICalImpl::SetupAlarmManager() {
tmplistptr = tmplistptr->next; tmplistptr = tmplistptr->next;
} }
TodoList *tmptodolistptr = &m_todolist;
while( tmptodolistptr ) {
oeIICalTodo *todo = tmptodolistptr->todo;
if( todo ) {
oeICalEventImpl *event = ((oeICalTodoImpl *)todo)->GetBaseEvent();
icaltimetype begin=icaltime_null_time();
begin.year = 1970; begin.month=1; begin.day=1;
icaltimetype alarmtime = begin;
do {
alarmtime = event->GetNextAlarmTime( alarmtime );
if( icaltime_is_null_time( alarmtime ) )
break;
if( icaltime_compare( alarmtime, now ) <= 0 ) {
#ifdef ICAL_DEBUG
printf( "ALARM WENT OFF: %s\n", icaltime_as_ical_string( alarmtime ) );
#endif
nsresult rv;
if( processmissed == -1 ) {
nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
if ( NS_SUCCEEDED(rv) && prefBranch ) {
rv = prefBranch->GetBoolPref("calendar.alarms.showmissed", &processmissed);
} else {
processmissed = true; //if anything goes wrong just consider the default setting
}
}
if( !processmissed ) {
time_t timediff = icaltime_as_timet( now ) - icaltime_as_timet( alarmtime );
if( timediff > 30 ) //if alarmtime is older than 30 seconds it won't be processed.
continue;
}
UpdateCalendarIcon( true );
oeIICalEventDisplay* eventDisplay;
rv = NS_NewICalEventDisplay( todo, &eventDisplay );
#ifdef ICAL_DEBUG
if( NS_FAILED( rv ) ) {
printf( "oeICalImpl::SetupAlarmManager() : WARNING Cannot create oeIICalEventDisplay instance: %x\n", rv );
}
#endif
icaltimetype eventtime = event->CalculateEventTime( alarmtime );
eventDisplay->SetDisplayDate( ConvertToPrtime( eventtime ) );
PRUint32 observercount;
//Here we should be using the todo observer list but nothing implements
//alarm handling for todos yet so we'll just use the one for events
m_observerlist->Count( &observercount );
for( unsigned int i=0; i<observercount; i++ ) {
nsCOMPtr<oeIICalObserver>observer;
m_observerlist->QueryElementAt( i, NS_GET_IID(oeIICalObserver), getter_AddRefs(observer));
rv = observer->OnAlarm( eventDisplay );
#ifdef ICAL_DEBUG
if( NS_FAILED( rv ) ) {
printf( "oeICalImpl::SetupAlarmManager() : WARNING Call to observer's onAlarm() unsuccessful: %x\n", rv );
}
#endif
}
NS_RELEASE( eventDisplay );
}
else {
if( icaltime_is_null_time( nextalarm ) )
nextalarm = alarmtime;
else if( icaltime_compare( nextalarm, alarmtime ) > 0 )
nextalarm = alarmtime;
break;
}
} while ( 1 );
}
tmptodolistptr = tmptodolistptr->next;
}
lastcheck = now; lastcheck = now;
if( m_alarmtimer ) { if( m_alarmtimer ) {
@ -1925,7 +2004,7 @@ NS_IMETHODIMP oeICalImpl::AddTodo(oeIICalTodo *icaltodo,char **retid)
#endif #endif
} }
// SetupAlarmManager(); SetupAlarmManager();
return NS_OK; return NS_OK;
} }
@ -1940,14 +2019,14 @@ oeICalImpl::DeleteTodo( const char *id )
stream = icalfileset_new(serveraddr); stream = icalfileset_new(serveraddr);
if ( !stream ) { if ( !stream ) {
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::DeleteEvent() failed: Cannot open stream: %s!\n", serveraddr ); printf( "oeICalImpl::DeleteTodo() failed: Cannot open stream: %s!\n", serveraddr );
#endif #endif
return NS_OK; return NS_OK;
} }
if( id == nsnull ) { if( id == nsnull ) {
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::DeleteEvent() - Invalid Id.\n" ); printf( "oeICalImpl::DeleteTodo() - Invalid Id.\n" );
#endif #endif
icalfileset_free(stream); icalfileset_free(stream);
return NS_OK; return NS_OK;
@ -1958,7 +2037,7 @@ oeICalImpl::DeleteTodo( const char *id )
if( !fetchedvcal ) { if( !fetchedvcal ) {
icalfileset_free(stream); icalfileset_free(stream);
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::DeleteEvent() - WARNING Event not found.\n" ); printf( "oeICalImpl::DeleteTodo() - WARNING Event not found.\n" );
#endif #endif
return NS_OK; return NS_OK;
} }
@ -1967,7 +2046,7 @@ oeICalImpl::DeleteTodo( const char *id )
if( !fetchedvevent ) { if( !fetchedvevent ) {
icalfileset_free(stream); icalfileset_free(stream);
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::DeleteEvent() - WARNING Event not found.\n" ); printf( "oeICalImpl::DeleteTodo() - WARNING Event not found.\n" );
#endif #endif
return NS_OK; return NS_OK;
} }
@ -1982,7 +2061,7 @@ oeICalImpl::DeleteTodo( const char *id )
icalfileset_mark( stream ); //Make sure stream is marked as dirty icalfileset_mark( stream ); //Make sure stream is marked as dirty
if( icalfileset_commit(stream) != ICAL_NO_ERROR ) { if( icalfileset_commit(stream) != ICAL_NO_ERROR ) {
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::DeleteEvent() : WARNING icalfileset_commit() unsuccessful\n" ); printf( "oeICalImpl::DeleteTodo() : WARNING icalfileset_commit() unsuccessful\n" );
#endif #endif
} }
icalfileset_free(stream); icalfileset_free(stream);
@ -2008,7 +2087,7 @@ oeICalImpl::DeleteTodo( const char *id )
icalevent->Release(); icalevent->Release();
// SetupAlarmManager(); SetupAlarmManager();
return NS_OK; return NS_OK;
} }
@ -2020,7 +2099,7 @@ NS_IMETHODIMP oeICalImpl::FetchTodo( const char *id, oeIICalTodo **ev)
if( id == nsnull ) { if( id == nsnull ) {
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::FetchEvent() - Invalid Id.\n" ); printf( "oeICalImpl::FetchTodo() - Invalid Id.\n" );
#endif #endif
*ev = nsnull; *ev = nsnull;
return NS_OK; return NS_OK;
@ -2037,7 +2116,7 @@ NS_IMETHODIMP oeICalImpl::FetchTodo( const char *id, oeIICalTodo **ev)
NS_IMETHODIMP oeICalImpl::ModifyTodo(oeIICalTodo *icalevent, char **retid) NS_IMETHODIMP oeICalImpl::ModifyTodo(oeIICalTodo *icalevent, char **retid)
{ {
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::ModifyEvent()\n" ); printf( "oeICalImpl::ModifyTodo()\n" );
#endif #endif
icalset *stream; icalset *stream;
icalcomponent *vcalendar; icalcomponent *vcalendar;
@ -2045,7 +2124,7 @@ NS_IMETHODIMP oeICalImpl::ModifyTodo(oeIICalTodo *icalevent, char **retid)
stream = icalfileset_new(serveraddr); stream = icalfileset_new(serveraddr);
if ( !stream ) { if ( !stream ) {
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::ModifyEvent() failed: Cannot open stream: %s!\n", serveraddr ); printf( "oeICalImpl::ModifyTodo() failed: Cannot open stream: %s!\n", serveraddr );
#endif #endif
return NS_OK; return NS_OK;
} }
@ -2053,7 +2132,7 @@ NS_IMETHODIMP oeICalImpl::ModifyTodo(oeIICalTodo *icalevent, char **retid)
icalevent->GetId( retid ); icalevent->GetId( retid );
if( *retid == nsnull ) { if( *retid == nsnull ) {
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::ModifyEvent() - Invalid Id.\n" ); printf( "oeICalImpl::ModifyTodo() - Invalid Id.\n" );
#endif #endif
icalfileset_free(stream); icalfileset_free(stream);
return NS_OK; return NS_OK;
@ -2081,7 +2160,7 @@ NS_IMETHODIMP oeICalImpl::ModifyTodo(oeIICalTodo *icalevent, char **retid)
icalcomponent_free( fetchedvevent ); icalcomponent_free( fetchedvevent );
} else { } else {
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::ModifyEvent() - WARNING Event not found.\n" ); printf( "oeICalImpl::ModifyTodo() - WARNING Event not found.\n" );
#endif #endif
nsMemory::Free( *retid ); nsMemory::Free( *retid );
*retid = nsnull; *retid = nsnull;
@ -2090,7 +2169,7 @@ NS_IMETHODIMP oeICalImpl::ModifyTodo(oeIICalTodo *icalevent, char **retid)
} }
} else { } else {
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::ModifyEvent() - WARNING Event not found.\n" ); printf( "oeICalImpl::ModifyTodo() - WARNING Event not found.\n" );
#endif #endif
nsMemory::Free( *retid ); nsMemory::Free( *retid );
*retid = nsnull; *retid = nsnull;
@ -2103,7 +2182,7 @@ NS_IMETHODIMP oeICalImpl::ModifyTodo(oeIICalTodo *icalevent, char **retid)
if( icalfileset_commit(stream) != ICAL_NO_ERROR ) { if( icalfileset_commit(stream) != ICAL_NO_ERROR ) {
#ifdef ICAL_DEBUG #ifdef ICAL_DEBUG
printf( "oeICalImpl::ModifyEvent() : WARNING icalfileset_commit() unsuccessful\n" ); printf( "oeICalImpl::ModifyTodo() : WARNING icalfileset_commit() unsuccessful\n" );
#endif #endif
} }
icalfileset_free(stream); icalfileset_free(stream);
@ -2124,7 +2203,7 @@ NS_IMETHODIMP oeICalImpl::ModifyTodo(oeIICalTodo *icalevent, char **retid)
oldevent->Release(); oldevent->Release();
// SetupAlarmManager(); SetupAlarmManager();
return NS_OK; return NS_OK;
} }
@ -2261,6 +2340,11 @@ oeICalFilter::~oeICalFilter()
m_completed->Release(); m_completed->Release();
} }
NS_IMETHODIMP oeICalFilter::GetType(Componenttype *aRetVal)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP oeICalFilter::GetId(char **aRetVal) NS_IMETHODIMP oeICalFilter::GetId(char **aRetVal)
{ {
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;

Просмотреть файл

@ -54,7 +54,7 @@
#define RECUR_YEARLY 5 #define RECUR_YEARLY 5
/* Implementation file */ /* Implementation file */
NS_IMPL_ISUPPORTS1(oeICalTodoImpl, oeIICalTodo) NS_IMPL_ISUPPORTS2(oeICalTodoImpl, oeIICalTodo, oeIICalEvent)
icaltimetype ConvertFromPrtime( PRTime indate ); icaltimetype ConvertFromPrtime( PRTime indate );
PRTime ConvertToPrtime ( icaltimetype indate ); PRTime ConvertToPrtime ( icaltimetype indate );
@ -83,6 +83,8 @@ oeICalTodoImpl::oeICalTodoImpl()
mEvent = new oeICalEventImpl(); mEvent = new oeICalEventImpl();
NS_ADDREF( mEvent ); NS_ADDREF( mEvent );
mEvent->SetType( XPICAL_VTODO_COMPONENT );
/* member initializers and constructor code */ /* member initializers and constructor code */
nsresult rv; nsresult rv;
if( NS_FAILED( rv = NS_NewDateTime((oeIDateTime**) &m_due ))) { if( NS_FAILED( rv = NS_NewDateTime((oeIDateTime**) &m_due ))) {
@ -315,7 +317,6 @@ icalcomponent* oeICalTodoImpl::AsIcalComponent()
//prodid //prodid
prop = icalproperty_new_prodid( ICALEVENT_PRODID ); prop = icalproperty_new_prodid( ICALEVENT_PRODID );
icalcomponent_add_property( newcalendar, prop ); icalcomponent_add_property( newcalendar, prop );
icalcomponent *vtodo = icalcomponent_new_vtodo(); icalcomponent *vtodo = icalcomponent_new_vtodo();
icalcomponent *vevent = icalcomponent_get_first_component( basevcal, ICAL_VEVENT_COMPONENT ); icalcomponent *vevent = icalcomponent_get_first_component( basevcal, ICAL_VEVENT_COMPONENT );
for( prop = icalcomponent_get_first_property( vevent, ICAL_ANY_PROPERTY ); for( prop = icalcomponent_get_first_property( vevent, ICAL_ANY_PROPERTY );
@ -324,13 +325,12 @@ icalcomponent* oeICalTodoImpl::AsIcalComponent()
icalproperty *newprop; icalproperty *newprop;
icalproperty_kind propkind = icalproperty_isa( prop ); icalproperty_kind propkind = icalproperty_isa( prop );
if( propkind == ICAL_X_PROPERTY ) { if( propkind == ICAL_X_PROPERTY ) {
//do nothing newprop = icalproperty_new_x( icalproperty_get_value_as_string( prop ) );
/* newprop = icalproperty_new_x( icalproperty_get_value_as_string( prop ) ); icalproperty_set_x_name( newprop, icalproperty_get_x_name( prop ));
icalparameter *oldpar = icalproperty_get_first_parameter( prop, ICAL_MEMBER_PARAMETER ); icalparameter *oldpar = icalproperty_get_first_parameter( prop, ICAL_MEMBER_PARAMETER );
icalparameter *newpar = icalparameter_new_clone( oldpar ); icalparameter *newpar = icalparameter_new_member( icalparameter_get_member( oldpar ) );
icalproperty_add_parameter( newprop, newpar );*/ icalproperty_add_parameter( newprop, newpar );
continue; } else if( propkind == ICAL_DTEND_PROPERTY ) {
} else if( propkind == ICAL_DTEND_PROPERTY || propkind == ICAL_RRULE_PROPERTY) {
//do nothing //do nothing
continue; continue;
} else { } else {
@ -338,6 +338,12 @@ icalcomponent* oeICalTodoImpl::AsIcalComponent()
} }
icalcomponent_add_property( vtodo, newprop ); icalcomponent_add_property( vtodo, newprop );
} }
icalcomponent *nestedcomp;
for( nestedcomp = icalcomponent_get_first_component( vevent, ICAL_ANY_COMPONENT );
nestedcomp != 0 ;
nestedcomp = icalcomponent_get_next_component( vevent, ICAL_ANY_COMPONENT ) ) {
icalcomponent_add_component( vtodo, icalcomponent_new_clone(nestedcomp) );
}
icalcomponent_free( basevcal ); icalcomponent_free( basevcal );
//percent //percent
if( m_percent != 0) { if( m_percent != 0) {
@ -381,4 +387,8 @@ icalcomponent* oeICalTodoImpl::AsIcalComponent()
return newcalendar; return newcalendar;
} }
oeICalEventImpl *oeICalTodoImpl::GetBaseEvent() {
return mEvent;
}
/* End of implementation class template. */ /* End of implementation class template. */

Просмотреть файл

@ -67,6 +67,7 @@ public:
NS_IMETHOD Clone(oeIICalTodo **_retval); NS_IMETHOD Clone(oeIICalTodo **_retval);
bool matchId( const char *id ); bool matchId( const char *id );
NS_IMETHODIMP SetParent( oeIICal *parent ); NS_IMETHODIMP SetParent( oeIICal *parent );
oeICalEventImpl *GetBaseEvent();
private: private:
int m_percent; int m_percent;
oeDateTimeImpl *m_completed; oeDateTimeImpl *m_completed;

Просмотреть файл

@ -58,6 +58,7 @@ interface nsISimpleEnumerator;
typedef long eventMethodProperty; typedef long eventMethodProperty;
typedef long eventStatusProperty; typedef long eventStatusProperty;
typedef long Componenttype;
interface oeIICal; interface oeIICal;
@ -95,10 +96,14 @@ interface oeIICalEvent : nsISupports
const eventStatusProperty ICAL_STATUS_FINAL = 10036; const eventStatusProperty ICAL_STATUS_FINAL = 10036;
const eventStatusProperty ICAL_STATUS_NONE = 10037; const eventStatusProperty ICAL_STATUS_NONE = 10037;
const Componenttype XPICAL_VEVENT_COMPONENT = 4;
const Componenttype XPICAL_VTODO_COMPONENT = 5;
readonly attribute oeIDateTime start; readonly attribute oeIDateTime start;
readonly attribute oeIDateTime end; readonly attribute oeIDateTime end;
readonly attribute oeIDateTime stamp; readonly attribute oeIDateTime stamp;
readonly attribute oeIICal parent; readonly attribute oeIICal parent;
readonly attribute Componenttype type;
attribute string id; attribute string id;
attribute AUTF8String title; attribute AUTF8String title;
attribute AUTF8String description; attribute AUTF8String description;
@ -194,7 +199,7 @@ interface oeIICalTodoObserver : nsISupports
void onAddItem( in oeIICalTodo e); void onAddItem( in oeIICalTodo e);
void onModifyItem( in oeIICalTodo e, in oeIICalTodo olde ); void onModifyItem( in oeIICalTodo e, in oeIICalTodo olde );
void onDeleteItem( in oeIICalTodo e); void onDeleteItem( in oeIICalTodo e);
void onAlarm( in oeIICalTodo e); void onAlarm( in oeIICalEventDisplay e);
void onError( in short severity, in unsigned long errorid, in string errorstring ); void onError( in short severity, in unsigned long errorid, in string errorstring );
}; };

Просмотреть файл

@ -272,7 +272,10 @@ function launchEditEvent( Event )
// open the dialog modally // open the dialog modally
window.setCursor( "wait" ); window.setCursor( "wait" );
opener.openDialog("chrome://calendar/content/eventDialog.xul", "caEditEvent", "chrome,modal", args ); if( Event.type == Event.XPICAL_VEVENT_COMPONENT )
opener.openDialog("chrome://calendar/content/eventDialog.xul", "caEditEvent", "chrome,modal", args );
else
opener.openDialog("chrome://calendar/content/toDoDialog.xul", "caEditEvent", "chrome,modal", args );
} }
function modifyEventDialogResponse( calendarEvent ) function modifyEventDialogResponse( calendarEvent )

Просмотреть файл

@ -102,7 +102,7 @@
<!-- NOTE: ALL ITEMS USE name INSTEAD OF id BECAUSE THE BOX IS DUPLICATED FOR EACH EVENT --> <!-- NOTE: ALL ITEMS USE name INSTEAD OF id BECAUSE THE BOX IS DUPLICATED FOR EACH EVENT -->
<vbox align="start" pack="center"> <vbox align="start" pack="center">
<button name="AcknowledgeButton" label="&calendar.alarm.acknowledge.label;" wrap="none" class="alarm-acknowledge-button-class"/> <button name="AcknowledgeButton" label="&calendar.alarm.acknowledge.label;" wrap="none" class="alarm-acknowledge-button-class"/>
<button name="EditEvent" label="&calendar.alarm.editevent.label;" wrap="none" class="alarm-acknowledge-button-class"/> <button name="EditEvent" label="&calendar.edit.button.label;" wrap="none" class="alarm-acknowledge-button-class"/>
<box align="center" pack="center" flex="1"> <box align="center" pack="center" flex="1">
<button name="SnoozeButton" label="&calendar.alarm.snooze.label;" wrap="none" class="alarm-acknowledge-button-class"/> <button name="SnoozeButton" label="&calendar.alarm.snooze.label;" wrap="none" class="alarm-acknowledge-button-class"/>
<textbox name="alarm-length-field" class="alarm-length-field-class"/> <textbox name="alarm-length-field" class="alarm-length-field-class"/>

Просмотреть файл

@ -596,33 +596,35 @@ function newEventCommand( event )
function newToDoCommand() function newToDoCommand()
{ {
var calendarToDo = createToDo(); var calendarToDo = createToDo();
var dueDate = gCalendarWindow.currentView.getNewEventDate(); var startDate = gCalendarWindow.currentView.getNewEventDate();
var Minutes = Math.ceil( startDate.getMinutes() / 5 ) * 5 ;
var Minutes = Math.ceil( dueDate.getMinutes() / 5 ) * 5 ; startDate = new Date( startDate.getFullYear(),
startDate.getMonth(),
dueDate = new Date( dueDate.getFullYear(), startDate.getDate(),
dueDate.getMonth(), startDate.getHours(),
dueDate.getDate(),
dueDate.getHours(),
Minutes, Minutes,
0); 0);
calendarToDo.start.setTime( startDate );
var MinutesToAddOn = getIntPref(gCalendarWindow.calendarPreferences.calendarPref, "event.defaultlength", gCalendarBundle.getString("defaultEventLength" ) );
calendarToDo.due.setTime( dueDate ); var dueDateTime = startDate.getTime() + ( 1000 * 60 * MinutesToAddOn );
calendarToDo.start.setTime( dueDate ); calendarToDo.due.setTime( dueDateTime );
var args = new Object();
args.mode = "new";
args.onOk = self.addToDoDialogResponse;
args.calendarToDo = calendarToDo;
window.setCursor( "wait" ); var args = new Object();
// open the dialog modally args.mode = "new";
openDialog("chrome://calendar/content/toDoDialog.xul", "caEditEvent", "chrome,modal", args ); args.onOk = self.addToDoDialogResponse;
args.calendarEvent = calendarToDo;
window.setCursor( "wait" );
// open the dialog modally
openDialog("chrome://calendar/content/toDoDialog.xul", "caEditEvent", "chrome,modal", args );
} }
@ -774,7 +776,7 @@ function editToDo( calendarToDo )
var args = new Object(); var args = new Object();
args.mode = "edit"; args.mode = "edit";
args.onOk = self.modifyToDoDialogResponse; args.onOk = self.modifyToDoDialogResponse;
args.calendarToDo = calendarToDo; args.calendarEvent = calendarToDo;
window.setCursor( "wait" ); window.setCursor( "wait" );
// open the dialog modally // open the dialog modally

Просмотреть файл

@ -21,8 +21,9 @@
* Contributor(s): Garth Smedley <garths@oeone.com> * Contributor(s): Garth Smedley <garths@oeone.com>
* Mike Potter <mikep@oeone.com> * Mike Potter <mikep@oeone.com>
* Colin Phillips <colinp@oeone.com> * Colin Phillips <colinp@oeone.com>
* Chris Charabaruk <ccharabaruk@meldstar.com> * Chris Charabaruk <coldacid@meldstar.com>
* ArentJan Banck <ajbanck@planet.nl> * ArentJan Banck <ajbanck@planet.nl>
* Mostafa Hosseini <mostafah@oeone.com>
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -40,7 +41,7 @@
/***** calendar/calendarEventDialog.js /***** calendar/eventDialog.js
* AUTHOR * AUTHOR
* Garth Smedley * Garth Smedley
* REQUIRED INCLUDES * REQUIRED INCLUDES
@ -55,8 +56,8 @@
args.mode = "new"; // "new" or "edit" args.mode = "new"; // "new" or "edit"
args.onOk = <function>; // funtion to call when OK is clicked args.onOk = <function>; // funtion to call when OK is clicked
args.calendarEvent = calendarEvent; // newly creatd calendar event to be editted args.calendarEvent = calendarEvent; // newly creatd calendar event to be editted
calendar.openDialog("caNewEvent", "chrome://calendar/content/eventDialog.xul", true, args ); openDialog("chrome://calendar/content/eventDialog.xul", "caEditEvent", "chrome,modal", args );
* *
* Invoke this dialog to edit an existing event as follows: * Invoke this dialog to edit an existing event as follows:
* *
@ -77,6 +78,7 @@
* W I N D O W V A R I A B L E S * W I N D O W V A R I A B L E S
*/ */
var debugenabled=false;
var gEvent; // event being edited var gEvent; // event being edited
var gOnOkFunction; // function to be called when user clicks OK var gOnOkFunction; // function to be called when user clicks OK
@ -85,7 +87,6 @@ var gTimeDifference = 3600000; //when editing an event, we change the end time
var gDateDifference = 3600000; //this is the difference for the dates, not the times. var gDateDifference = 3600000; //this is the difference for the dates, not the times.
var gDefaultAlarmLength = 15; //number of minutes to default the alarm to var gDefaultAlarmLength = 15; //number of minutes to default the alarm to
var gCategoryManager;
var gMode = ''; //what mode are we in? new or edit... var gMode = ''; //what mode are we in? new or edit...
@ -134,7 +135,7 @@ function loadCalendarEventDialog()
var titleString = titleDataItem.getAttribute( "value" ); var titleString = titleDataItem.getAttribute( "value" );
document.getElementById("calendar-new-eventwindow").setAttribute("title", titleString); document.getElementById("calendar-new-eventwindow").setAttribute("title", titleString);
// fill in fields from the event // fill in fields from the event
gStartDate.setTime( gEvent.start.getTime() ); gStartDate.setTime( gEvent.start.getTime() );
document.getElementById( "start-date-picker" ).value = gStartDate; document.getElementById( "start-date-picker" ).value = gStartDate;
@ -148,8 +149,6 @@ function loadCalendarEventDialog()
gTimeDifference = gEndDate.getTime() - gStartDate.getTime(); //the time difference in ms gTimeDifference = gEndDate.getTime() - gStartDate.getTime(); //the time difference in ms
gDateDifference = gTimeDifference; //the time difference in ms gDateDifference = gTimeDifference; //the time difference in ms
var today = new Date();
if ( gEvent.recurForever ) if ( gEvent.recurForever )
{ {
gEvent.recurEnd.setTime( gEndDate ); gEvent.recurEnd.setTime( gEndDate );
@ -252,8 +251,7 @@ function loadCalendarEventDialog()
setFieldValue( "repeat-numberoftimes-radio", (gEvent.recurCount != 0), "selected" ); setFieldValue( "repeat-numberoftimes-radio", (gEvent.recurCount != 0), "selected" );
setFieldValue( "repeat-numberoftimes-textbox", gEvent.recurCount ); setFieldValue( "repeat-numberoftimes-textbox", gEvent.recurCount );
/* Categories stuff */ /* Categories stuff */
// Load categories // Load categories
var categoriesString = opener.GetUnicharPref(opener.gCalendarWindow.calendarPreferences.calendarPref, "categories.names", getDefaultCategories() ); var categoriesString = opener.GetUnicharPref(opener.gCalendarWindow.calendarPreferences.calendarPref, "categories.names", getDefaultCategories() );
@ -267,7 +265,7 @@ function loadCalendarEventDialog()
categoriesList[categoriesList.length] = gEvent.categories; categoriesList[categoriesList.length] = gEvent.categories;
} }
// categoriesList.sort(); categoriesList.sort();
var oldMenulist = document.getElementById( "categories-menulist-menupopup" ); var oldMenulist = document.getElementById( "categories-menulist-menupopup" );
while( oldMenulist.hasChildNodes() ) while( oldMenulist.hasChildNodes() )
@ -358,7 +356,6 @@ function onOKCommand()
gEvent.status = eval( "gEvent."+getFieldValue( "status-field" ) ); gEvent.status = eval( "gEvent."+getFieldValue( "status-field" ) );
gEvent.allDay = getFieldValue( "all-day-event-checkbox", "checked" ); gEvent.allDay = getFieldValue( "all-day-event-checkbox", "checked" );
gEvent.url = getFieldValue( "uri-field" ); gEvent.url = getFieldValue( "uri-field" );
gEvent.privateEvent = getFieldValue( "private-checkbox", "checked" ); gEvent.privateEvent = getFieldValue( "private-checkbox", "checked" );
@ -375,11 +372,9 @@ function onOKCommand()
gEvent.alarmLength = getFieldValue( "alarm-length-field" ); gEvent.alarmLength = getFieldValue( "alarm-length-field" );
gEvent.alarmUnits = getFieldValue( "alarm-length-units", "value" ); gEvent.alarmUnits = getFieldValue( "alarm-length-units", "value" );
dump( "!!!-->in calendarEventDialog.js, alarmUnits is "+gEvent.alarmUnits );
if ( getFieldValue( "alarm-email-checkbox", "checked" ) ) if ( getFieldValue( "alarm-email-checkbox", "checked" ) )
{ {
gEvent.alarmEmailAddress = getFieldValue( "alarm-email-field", "value" ); gEvent.alarmEmailAddress = getFieldValue( "alarm-email-field", "value" );
dump( "!!!-->in calendarEventDialog.js, alarmEmailAddress is "+gEvent.alarmEmailAddress );
} }
else else
{ {
@ -440,7 +435,7 @@ function onOKCommand()
for( i = 0; i < listbox.childNodes.length; i++ ) for( i = 0; i < listbox.childNodes.length; i++ )
{ {
dump( "\n exception added for "+listbox.childNodes[i].value ); debug( "\n exception added for "+listbox.childNodes[i].value );
var dateObj = new Date( ); var dateObj = new Date( );
@ -457,7 +452,6 @@ function onOKCommand()
for( i = 0; i < attachmentListbox.childNodes.length; i++ ) for( i = 0; i < attachmentListbox.childNodes.length; i++ )
{ {
dump( "\n adding attachment to event added for "+attachmentListbox.childNodes[i].getAttribute( "label" ) );
Attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance( Components.interfaces.nsIMsgAttachment ); Attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance( Components.interfaces.nsIMsgAttachment );
Attachment.url = attachmentListbox.childNodes[i].getAttribute( "label" ); Attachment.url = attachmentListbox.childNodes[i].getAttribute( "label" );
@ -489,6 +483,7 @@ function onOKCommand()
var Server = getFieldValue( "server-field" ); var Server = getFieldValue( "server-field" );
// :TODO: REALLY only do this if the alarm or start settings change.?
//if the end time is later than the start time... alert the user using text from the dtd. //if the end time is later than the start time... alert the user using text from the dtd.
// call caller's on OK function // call caller's on OK function
gOnOkFunction( gEvent, Server ); gOnOkFunction( gEvent, Server );
@ -576,7 +571,7 @@ function checkSetRecurTime()
var recur = getFieldValue( "repeat-checkbox", "checked" ); var recur = getFieldValue( "repeat-checkbox", "checked" );
dump(recurForever+ " and "+ recur+ "\n"); debug(recurForever+ " and "+ recur+ "\n");
var state = ( recurEndDate.getTime() < endDate.getTime() && var state = ( recurEndDate.getTime() < endDate.getTime() &&
( recurEndDate.getFullYear() != endDate.getFullYear() || ( recurEndDate.getFullYear() != endDate.getFullYear() ||
recurEndDate.getMonth() != endDate.getMonth() || recurEndDate.getMonth() != endDate.getMonth() ||
@ -738,6 +733,27 @@ function onTimePick( timepopup )
updateOKButton(); updateOKButton();
} }
/**
* Called when an item with a datepicker is clicked, BEFORE the picker is shown.
*/
function prepareDatePicker( dateFieldName )
{
// get the popup and the field we are editing
var datePickerPopup = document.getElementById( "oe-date-picker-popup" );
var dateField = document.getElementById( dateFieldName );
// tell the date picker the date to edit.
setFieldValue( "oe-date-picker-popup", dateField.editDate, "value" );
// remember the date field that is to be updated by adding a
// property "dateField" to the popup.
datePickerPopup.dateField = dateField;
}
/** /**
* Called when the repeat checkbox is clicked. * Called when the repeat checkbox is clicked.
*/ */
@ -1458,7 +1474,6 @@ function getWeekNumberText( weekNumber )
} }
var launch = true; var launch = true;
/* URL */ /* URL */
@ -1666,8 +1681,8 @@ function formatTime( time )
} }
function debug( Text ) function debug( text )
{ {
dump( "\n"+ Text + "\n"); if( debugenabled )
dump( "\n"+ text + "\n");
} }

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -22,6 +22,7 @@
- Contributor(s): Garth Smedley <garths@oeone.com> - Contributor(s): Garth Smedley <garths@oeone.com>
- Mike Potter <mikep@oeone.com> - Mike Potter <mikep@oeone.com>
- Colin Phillips <colinp@oeone.com> - Colin Phillips <colinp@oeone.com>
- Mostafa Hosseini <mostafah@oeone.com>
- -
- Alternatively, the contents of this file may be used under the terms of - Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or - either the GNU General Public License Version 2 or later (the "GPL"), or
@ -49,124 +50,171 @@
<?xml-stylesheet href="chrome://calendar/context/datepicker/datepicker.css" ?> <?xml-stylesheet href="chrome://calendar/context/datepicker/datepicker.css" ?>
<?xml-stylesheet href="chrome://calendar/context/datepicker/calendar.css" ?> <?xml-stylesheet href="chrome://calendar/context/datepicker/calendar.css" ?>
<!-- CSS for selecting contacts to invite to event -->
<?xml-stylesheet href="chrome://calendar/skin/selectAddresses.css" ?>
<!-- DTD File with all strings specific to the calendar --> <!-- DTD File with all strings specific to the calendar -->
<!DOCTYPE dialog <!DOCTYPE dialog
[ [
<!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1; <!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/global.dtd" > %dtd1;
<!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2; <!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd2;
<!ENTITY % dtd3 SYSTEM "chrome://calendar/locale/selectAddresses.dtd" > %dtd3;
]> ]>
<dialog <dialog
id="calendar-new-taskwindow" id="calendar-new-eventwindow"
title="Calendar Event" title="Calendar Event"
onload="loadCalendarEventDialog()"
buttons="accept,cancel" buttons="accept,cancel"
ondialogaccept="return onOKCommand();" ondialogaccept="return onOKCommand();"
ondialogcancel="return true;" ondialogcancel="return true;"
onload="loadCalendarToDoDialog()"
persist="screenX screenY" persist="screenX screenY"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
> xmlns:nc="http://home.netscape.com/NC-rdf#">
<!-- Javascript DTD To Variable -->
<script type="application/x-javascript" src="chrome://communicator/content/utilityOverlay.js"/>
<script type="application/x-javascript">
var DTD_noEmailMessage = "&ab-selectAddressesDialogNoEmailMessage.label;";
var DTD_toPrefix = "&ab-selectAddressesDialogPrefixTo.label;";
</script>
<!-- Select addresses commands -->
<commandset id="selectAddressesCommands">
<command id="addToInviteList" oncommand="addSelectedAddressesIntoInviteBucket( '', '' );" disabled="true" />
<command id="removeFromInviteList" oncommand="removeSelectedFromInviteBucket();" disabled="true" />
</commandset>
<!-- Javascript includes --> <!-- Javascript includes -->
<script type="application/x-javascript" src="chrome://global/content/strres.js"/> <script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/> <script type="application/x-javascript" src="chrome://calendar/content/dateUtils.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/toDoDialog.js"/> <script type="application/x-javascript" src="chrome://calendar/content/toDoDialog.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/selectAddressesDialog.js"/>
<script type="application/x-javascript" src="chrome://calendar/content/attachFile.js"/>
<!-- needed to get the default categories --> <!-- needed to get the default categories -->
<script type="application/x-javascript" src="chrome://calendar/content/pref/rootCalendarPref.js"/> <script type="application/x-javascript" src="chrome://calendar/content/pref/rootCalendarPref.js"/>
<!-- Data used in JS from dtd --> <!-- Data used in JS from dtd -->
<dataset> <dataset>
<data id="data-todo-title-new" value="&todo.title.new;" /> <data id="data-event-title-new" value="&todo.title.new;" />
<data id="data-todo-title-edit" value="&todo.title.edit;" /> <data id="data-event-title-edit" value="&todo.title.edit;" />
<data id="onthe-text" value="&onthe-text;" />
<data id="last-text" value="&last-text;" />
<data id="ofthemonth-text" value="&ofthemonth-text;" />
</dataset> </dataset>
<!-- Picker popups --> <!-- Picker popups -->
<popup id="oe-date-picker-popup" position="after_start" oncommand="onDatePick( this )" value=""/> <popup id="oe-time-picker-popup" position="after_start" oncommand="onTimePick( this )" value=""/>
<keyset id="dialogKeys"/>
<!-- The dialog --> <vbox id="standard-dialog-content" flex="1">
<!-- dialog-box: from dialogOverlay.xul -->
<vbox id="dialog-box" flex="1">
<!-- standard-dialog-content: from dialogOverlay.xul --> <tabbox>
<tabs>
<vbox id="standard-dialog-content" flex="1"> <tab label="&newtodo.newtodo.tab.label;"/>
<tab label="&newevent.recurrence.tab.label;"/>
<!-- Form elements --> <tab label="&newevent.contacts.tab.label;" collapsed="true"/>
<tab label="&newevent.files.tab.label;" collapsed="true"/>
<grid> </tabs>
<tabpanels>
<columns> <tabpanel>
<column /> <grid>
<column flex="1"/> <columns>
</columns> <column />
<column flex="1"/>
<rows> </columns>
<!-- Title --> <rows>
<row align="center"> <!-- Title -->
<row align="center">
<hbox class="field-label-box-class" pack="end"> <hbox class="field-label-box-class" pack="end">
<label for="title-field" value="&newevent.title.label;"/> <label for="title-field" value="&newevent.title.label;"/>
</hbox> </hbox>
<textbox id="title-field"/> <textbox id="title-field"/>
</row> </row>
<!-- Start Date --> <!-- Location -->
<row align="center"> <row align="center">
<hbox class="field-label-box-class" pack="end"> <hbox class="field-label-box-class" pack="end">
<label value="&newtodo.startdate.label;"/> <label for="location-field" value="&newevent.location.label;"/>
</hbox> </hbox>
<hbox id="start-date-box" align="center"> <textbox id="location-field"/>
<datepicker id="start-date-picker" value=""/> </row>
<!-- Start Date -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newevent.startdate.label;"/>
</hbox> </hbox>
</row> <hbox id="start-date-box" align="center">
<datepicker id="start-date-picker" value="" ondatepick="onDatePick( this );"/>
<textbox id="start-time-text" readonly="true" value="" onmousedown="prepareTimePicker('start-time-text')" popup="oe-time-picker-popup" position="after_start"/>
<image id="start-time-button" class="event-time-button-class" onmousedown="prepareTimePicker('start-time-text')" popup="oe-time-picker-popup" position="after_start"/>
</hbox>
</row>
<!-- Due Date --> <!-- Due Date -->
<row align="center"> <row align="center">
<hbox class="field-label-box-class" pack="end"> <hbox class="field-label-box-class" pack="end">
<label value="&newtodo.duedate.label;"/> <label value="&newtodo.duedate.label;"/>
</hbox> </hbox>
<hbox id="due-date-box" align="center"> <hbox id="due-date-box" align="center">
<datepicker id="due-date-picker" value=""/> <datepicker id="due-date-picker" value="" ondatepick="onDatePick( this );"/>
<label id="start-date-warning" class="warning-text-class" value="&newtodo.starttime.warning;" collapsed="true"/> <textbox id="due-time-text" readonly="true" value="" onmousedown="prepareTimePicker('due-time-text')" popup="oe-time-picker-popup" position="after_start"/>
<image id="end-time-button" class="event-time-button-class" onmousedown="prepareTimePicker('due-time-text')" popup="oe-time-picker-popup" position="after_start"/>
</hbox> </hbox>
</row> </row>
<!-- Description --> <!-- End Time Warning -->
<row flex="1" align="start"> <row align="center">
<spacer />
<label id="due-time-warning" class="warning-text-class" value="&newtodo.duetime.warning;" collapsed="true"/>
</row>
<!-- End Date Warning -->
<row align="center">
<spacer />
<label id="due-date-warning" class="warning-text-class" value="&newtodo.duedate.warning;" collapsed="true"/>
</row>
<!-- Description -->
<row flex="1" align="start">
<hbox class="field-label-box-class" pack="end"> <hbox class="field-label-box-class" pack="end">
<label for="description-field" value="&newevent.description.label;"/> <label for="description-field" value="&newevent.description.label;"/>
</hbox> </hbox>
<textbox id="description-field" multiline="true" rows="3" cols="30" /> <textbox id="description-field" multiline="true" rows="3" cols="30" />
</row> </row>
<!-- URI/URL --> <!-- URI/URL -->
<row align="center"> <row align="center">
<hbox class="field-label-box-class" pack="end"> <hbox class="field-label-box-class" pack="end">
<label for="uri-field" value="&newevent.uri.label;"/> <label for="uri-field" value="&newevent.uri.label;"/>
</hbox> </hbox>
<hbox> <hbox>
<textbox id="uri-field" flex="1"/> <textbox id="uri-field" type="autocomplete" searchSessions="history" flex="1"/>
<button label="&newevent.uri.visit.label;" oncommand="launchBrowser()"/> <button label="&newevent.uri.visit.label;" oncommand="launchBrowser()"/>
</hbox> </hbox>
</row> </row>
<!-- Private --> <!-- Private -->
<row collapsed="true" align="center"> <row align="center">
<spacer /> <spacer />
<checkbox id="private-checkbox" checked="false" label="&newevent.private.label;"/> <checkbox id="private-checkbox" checked="false" label="&newevent.private.label;"/>
</row> </row>
<!-- Priority --> <!-- Priority -->
<row align="center"> <row align="center">
@ -185,32 +233,39 @@
</hbox> </hbox>
</row> </row>
<!-- Alarm --> <!-- Alarm -->
<row align="center" collapsed="true"> <row align="center">
<spacer /> <spacer />
<vbox> <vbox>
<hbox id="alarm-box" align="center"> <hbox id="alarm-box" align="center">
<checkbox id="alarm-checkbox" class="proper-align" label="&newevent.alarm.label;" checked="false" oncommand="commandAlarm()"/> <checkbox id="alarm-checkbox" class="proper-align" label="&newevent.alarm.label;" checked="false" oncommand="commandAlarm()"/>
<textbox id="alarm-length-field" oninput="alarmLengthKeyDown( this )"/> <textbox id="alarm-length-field" oninput="alarmLengthKeyDown( this )"/>
<menulist id="alarm-length-units" crop="none" labelnumber="labelplural">
<menulist id="alarm-length-units" flex="1" labelnumber="labelplural"> <menupopup>
<menupopup> <menuitem label="&alarm.units.minutes;" labelplural="&alarm.units.minutes;" labelsingular="&alarm.units.minutes.singular;" value="minutes"/>
<menuitem label="&alarm.units.minutes;" labelplural="&alarm.units.minutes;" labelsingular="&alarm.units.minutes.singular;" value="minutes"/> <menuitem label="&alarm.units.hours;" labelplural="&alarm.units.hours;" labelsingular="&alarm.units.hours.singular;" value="hours" />
<menuitem label="&alarm.units.hours;" labelplural="&alarm.units.hours;" labelsingular="&alarm.units.hours.singular;" value="hours" /> <menuitem label="&alarm.units.days;" labelplural="&alarm.units.days;" labelsingular="&alarm.units.days.singular;" value="days"/>
<menuitem label="&alarm.units.days;" labelplural="&alarm.units.days;" labelsingular="&alarm.units.days.singular;" value="days"/> </menupopup>
</menupopup> </menulist>
</menulist> <label id="alarm-length-text" for="alarm-length-field" value="&newtodo.beforealarm.label;"/>
</hbox>
<label id="alarm-length-text" for="alarm-length-field" value="&newevent.beforealarm.label;"/>
<hbox id="alarm-box-email" align="center">
</hbox> <spacer width="15"/>
<hbox id="alarm-box-email" collapsed="true" align="center"> <checkbox id="alarm-email-checkbox" label="&newevent.email.label;" checked="false" oncommand="commandAlarmEmail()"/>
<checkbox id="alarm-email-checkbox" label="&newevent.email.label;" checked="false" oncommand="commandAlarmEmail()"/> <textbox type="autocomplete" searchSessions="addrbook" id="alarm-email-field" size="39" value="" />
<textbox id="alarm-email-field" disabled="true" size="39" value="" /> </hbox>
</hbox>
</vbox> </vbox>
</row>
<!-- Status -->
<row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.status.label;"/>
</hbox>
<checkbox id="cancelled-checkbox" label="&newtodo.cancelled.label;" checked="false"/>
</row> </row>
<!-- Completed --> <!-- Completed -->
<row align="center"> <row align="center">
<hbox class="field-label-box-class" pack="end"> <hbox class="field-label-box-class" pack="end">
@ -239,28 +294,20 @@
</hbox> </hbox>
</row> </row>
<!-- Task Status --> <!-- Categories -->
<row align="center"> <row align="center">
<hbox class="field-label-box-class" pack="end">
<label value="&newtodo.status.label;"/>
</hbox>
<checkbox id="cancelled-checkbox" label="&newtodo.cancelled.label;" checked="false"/>
</row>
<!-- Categories -->
<row align="center">
<hbox class="field-label-box-class" pack="end"> <hbox class="field-label-box-class" pack="end">
<label value="&newtodo.categories.label;"/> <label value="&newtodo.categories.label;"/>
</hbox> </hbox>
<menulist id="categories-field" label="&newevent.category.label;"> <menulist id="categories-field" label="&newevent.category.label;">
<menupopup id="categories-menulist-menupopup"> <menupopup id="categories-menulist-menupopup">
<menuitem label="&priority.level.none;" value="0"/> <menuitem label="&priority.level.none;" value="0"/>
</menupopup> </menupopup>
</menulist> </menulist>
</row> </row>
<!-- Calendar Server --> <!-- Calendar Server -->
<row align="center"> <row align="center">
<hbox class="field-label-box-class" pack="end"> <hbox class="field-label-box-class" pack="end">
<label id="server-field-label" value="&newevent.server.label;"/> <label id="server-field-label" value="&newevent.server.label;"/>
</hbox> </hbox>
@ -273,11 +320,192 @@
</template> </template>
</menupopup> </menupopup>
</menulist> </menulist>
</row> </row>
</rows> </rows>
</grid> </grid>
</tabpanel>
<tabpanel>
<!-- Repeat -->
<vbox>
<hbox id="repeat-box" align="center">
<checkbox id="repeat-checkbox" class="proper-align" label="&newevent.repeat.label;" checked="false" oncommand="commandRepeat();commandUntil()"/>
<textbox id="repeat-length-field" class="cursor-pointer" disable-controller="repeat" value="1" oninput="repeatLengthKeyDown( this )"/>
<menulist crop="none" oncommand="repeatUnitCommand( this )" labelnumber="labelplural" id="repeat-length-units" disable-controller="repeat">
<menupopup>
<menuitem label="&repeat.units.days;" labelplural="&repeat.units.days;" labelsingular="&repeat.units.days.singular;" id="repeat-length-days" value="days" />
<menuitem label="&repeat.units.weeks;" labelplural="&repeat.units.weeks;" labelsingular="&repeat.units.weeks.singular;" id="repeat-length-weeks" value="weeks"/>
<menuitem label="&repeat.units.months;" labelplural="&repeat.units.months;" labelsingular="&repeat.units.months.singular;" id="repeat-length-months" value="months"/>
<menuitem label="&repeat.units.years;" labelplural="&repeat.units.years;" labelsingular="&repeat.units.years.singular;" id="repeat-length-years" value="years" />
</menupopup>
</menulist>
</hbox>
<hbox id="repeat-extenstions-week" disabled="true" disable-controller="repeat" collapsed="false" align="center">
<checkbox disable-controller="repeat" class="repeat-day-class" label="&day.1.Ddd;" id="advanced-repeat-week-0" value="0" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="&day.2.Ddd;" id="advanced-repeat-week-1" value="1" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="&day.3.Ddd;" id="advanced-repeat-week-2" value="2" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="&day.4.Ddd;" id="advanced-repeat-week-3" value="3" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="&day.5.Ddd;" id="advanced-repeat-week-4" value="4" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="&day.6.Ddd;" id="advanced-repeat-week-5" value="5" checked="false" />
<checkbox disable-controller="repeat" class="repeat-day-class" label="&day.7.Ddd;" id="advanced-repeat-week-6" value="6" checked="false" />
</hbox>
<hbox id="repeat-extenstions-month" diabled="true" collapsed="true" align="center">
<vbox align="center">
<radiogroup id="advanced-repeat-month" disable-controller="repeat">
<radio disable-controller="repeat" id="advanced-repeat-dayofmonth" label="&newevent.advanced.repeat.dayofmonth.label;" selected="true"/>
<radio disable-controller="repeat" id="advanced-repeat-dayofweek" label="&newevent.advanced.repeat.dayofweek.label;"/>
<radio disable-controller="repeat" id="advanced-repeat-dayofweek-last" label="&newevent.advanced.repeat.lastdayofweek.label;" disabled="true"/>
</radiogroup>
</vbox>
</hbox>
<spacer height="10" />
<hbox align="center">
<spacer class="repeat-left-spacer" />
<radiogroup id="repeat-until-group" disable-controller="repeat">
<radio id="repeat-forever-radio" disable-controller="repeat" label="&newevent.forever.label;" oncommand="commandUntil()"/>
<vbox id="repeat-end-box" align="center">
<hbox>
<radio id="repeat-numberoftimes-radio" disable-controller="repeat" label="&newevent.numberoftimes.label;" oncommand=""/>
<textbox id="repeat-numberoftimes-textbox" disable-controller="repeat"/>
</hbox>
</vbox>
<vbox id="repeat-end-box" align="center">
<hbox>
<radio id="repeat-until-radio" disable-controller="repeat" label="&newevent.until.label;" oncommand="commandUntil()"/>
<spacer id="until-spacer"/>
<datepicker id="repeat-end-date-picker" value="" ondatepick="commandUntil()"/>
</hbox>
<label id="repeat-time-warning" class="warning-text-class" value="&newevent.recurend.warning;" collapsed="true"/>
</vbox>
</radiogroup>
</hbox>
<hbox align="center">
<spacer class="repeat-left-spacer" />
<groupbox>
<caption label="&newevent.exceptions.caption;"/>
<grid>
<columns>
<column flex="1"/>
<column/>
</columns>
<rows>
<row>
<hbox align="center">
<datepicker id="exceptions-date-picker" disable-controller="repeat" value=""/>
</hbox>
<button id="exception-add-button" label="&newevent.addexceptions.label;" disable-controller="repeat" oncommand="addException()"/>
</row>
<row>
<listbox id="exception-dates-listbox" disable-controller="repeat" rows="4"/>
<vbox>
<button label="&newevent.deleteexceptions.label;" disable-controller="repeat" oncommand="removeSelectedExceptionDate()"/>
</vbox>
</row>
</rows>
</grid>
</groupbox>
</hbox>
</vbox>
<!-- /Repeat -->
</tabpanel>
<!-- Contacts panel -->
<tabpanel orient="vertical" collapsed="true">
<!-- Invite -->
<vbox collapsed="true">
<hbox id="invite-box" align="center">
<checkbox id="invite-checkbox" label="&newevent.invite.label;" checked="false" oncommand="commandInvite()"/>
<textbox id="invite-email-field" size="39" disabled="true"/>
</hbox>
</vbox>
</vbox> <!-- standard-dialog-content --> <vbox flex="1">
</vbox> <!-- dialog-box --> <hbox id="topBox" align="center">
<label value="&ab-selectAddressesDialogLookIn.label;" />
<!-- Address book chooser -->
<menulist id="addressBookList" oncommand="onChooseAddressBookEventDialog( this );">
<menupopup id="addressBookList-menupopup" ref="moz-abdirectory://" datasources="rdf:addressdirectory">
<template>
<rule nc:IsMailList="false">
<menuitem uri="..."
label="rdf:http://home.netscape.com/NC-rdf#DirName"
value="rdf:http://home.netscape.com/NC-rdf#DirUri"/>
</rule>
</template>
</menupopup>
</menulist>
</hbox>
<hbox flex="1">
<!-- Existing addresses -->
<vbox id="resultsBox" flex="4">
<label value=" " />
<tree id="abResultsTree" flex="1" persist="height" hidecolumnpicker="true" onclick="this.contactsTree.onClick( event );" ondblclick="this.contactsTree.onDblClick( event );">
<treecols id="recipientTreeCols">
<treecol id="GeneratedName" sort-field="GeneratedName" class="sortDirectionIndicator" list-view-sort-field="true"
persist="ordinal width" flex="1" label="&ab-selectAddressesDialogNameColumn.label;" primary="true"/>
<splitter class="tree-splitter"/>
<treecol id="PrimaryEmail" sort-field="PrimaryEmail" class="sortDirectionIndicator" list-view-sort-field="true"
persist="ordinal width" flex="1" label="&ab-selectAddressesDialogEmailColumn.label;"/>
</treecols>
<treechildren />
</tree>
</vbox>
<!-- Add and remove buttons -->
<vbox id="addToBucketButtonBox">
<spacer flex="1" />
<button id="toButton" label="&ab-selectAddressesDialogInvite.label;" command="addToInviteList" />
<spacer />
<button id="remove" label="&ab-selectAddressesDialogUninvite.label;" class="dialog" command="removeFromInviteList" />
<spacer flex="1" />
</vbox>
<!-- Recipient list -->
<vbox id="bucketBox" flex="1">
<label value="&ab-selectAddressesDialogInviteList.label;"/>
<tree id="addressBucket" flex="1" hidecolumnpicker="true" onclick="selectEventRecipient( this );">
<treecols>
<treecol id="addressCol" flex="1" hideheader="true"/>
</treecols>
<treechildren id="bucketBody" flex="1"/>
</tree>
</vbox>
</hbox>
</vbox>
</tabpanel>
<tabpanel>
<listbox id="attachmentBucket" flex="1" rows="8"
onkeypress="if (event.keyCode == 8 || event.keyCode == 46) RemoveSelectedAttachment();"
onclick="AttachmentBucketClicked(event);"
ondragover="nsDragAndDrop.dragOver(event, attachmentBucketObserver);"
ondragdrop="nsDragAndDrop.drop(event, attachmentBucketObserver);"
ondragexit="nsDragAndDrop.dragExit(event, attachmentBucketObserver);"/>
<vbox>
<button onclick="AttachFile()" label="&newevent.choosefile.label;"/>
<button onclick="removeSelectedAttachment()" label="&newevent.removeselectedfile.label;"/>
<spacer flex="1"/>
</vbox>
</tabpanel>
</tabpanels>
</tabbox>
</vbox> <!-- standard-dialog-content -->
</dialog> </dialog>

Просмотреть файл

@ -106,7 +106,7 @@
<!ENTITY newevent.status.label "Status" > <!ENTITY newevent.status.label "Status" >
<!ENTITY newevent.status.longlabel "Event Status"> <!ENTITY newevent.status.longlabel "Event Status">
<!ENTITY newevent.status.needsaction.label "Needs Action" > <!ENTITY newevent.status.needsaction.label "Needs Action" >
<!ENTITY newevent.status.inprogress.label "In Progress" > <!ENTITY newevent.status.inprogress.label "In Process" >
<!ENTITY newevent.status.completed.label "Completed" > <!ENTITY newevent.status.completed.label "Completed" >
<!ENTITY newevent.status.cancelled.label "Cancelled" > <!ENTITY newevent.status.cancelled.label "Cancelled" >
<!ENTITY newevent.status.tentative.label "Tentative" > <!ENTITY newevent.status.tentative.label "Tentative" >
@ -140,6 +140,11 @@
<!ENTITY newtodo.starttime.warning "Your start date occurs after your due date."> <!ENTITY newtodo.starttime.warning "Your start date occurs after your due date.">
<!ENTITY newtodo.cancelled.label "Cancelled"> <!ENTITY newtodo.cancelled.label "Cancelled">
<!ENTITY newtodo.status.label "Status"> <!ENTITY newtodo.status.label "Status">
<!ENTITY newtodo.beforealarm.label "before the task starts" >
<!ENTITY newtodo.newtodo.tab.label "Task" >
<!ENTITY newtodo.status.longlabel "Task Status">
<!ENTITY newtodo.duetime.warning "Your start time is after your due time.">
<!ENTITY newtodo.duedate.warning "Your start date is after your due date.">
<!ENTITY calendar.confirm.deleteevent "Are you sure you want to delete this event titled: " > <!ENTITY calendar.confirm.deleteevent "Are you sure you want to delete this event titled: " >
<!ENTITY calendar.confirm.deleteuntitledevent "Are you sure you want to delete this untitled event?" > <!ENTITY calendar.confirm.deleteuntitledevent "Are you sure you want to delete this untitled event?" >

Просмотреть файл

@ -156,6 +156,11 @@
max-width : 10em; max-width : 10em;
} }
#due-time-text
{
max-width : 10em;
}
#repeat-end-date-text #repeat-end-date-text
{ {
max-width : 10em; max-width : 10em;

Просмотреть файл

@ -156,6 +156,11 @@
max-width : 10em; max-width : 10em;
} }
#due-time-text
{
max-width : 10em;
}
#repeat-end-date-text #repeat-end-date-text
{ {
max-width : 10em; max-width : 10em;