36#include <tqdatetime.h>
40#include <tdestandarddirs.h>
43#include <libkcal/calendarlocal.h>
44#include <libkcal/calendar.h>
45#include <libkcal/event.h>
46#include <libtdepim/kpimprefs.h>
70 kdDebug() <<
"konsolekalendaradd.cpp::addEvent()" << endl;
73 cout << i18n(
"Insert Event <Dry Run>:" ).local8Bit().data()
78 cout << i18n(
"Insert Event <Verbose>:" ).local8Bit().data()
83 Event *
event =
new Event();
87 event->setSummary( m_variables->
getSummary() );
92 if ( m_variables->
getCalendar()->addEvent( event ) ) {
93 cout << i18n(
"Success: \"%1\" inserted" ).
94 arg( m_variables->
getSummary() ).local8Bit().data()
100 cout << i18n(
"Failure: \"%1\" not inserted" ).
101 arg( m_variables->
getSummary() ).local8Bit().data()
107 kdDebug() <<
"konsolekalendaradd.cpp::addEvent() | Done " << endl;
119 fileName = locateLocal(
"data",
"korganizer/std.ics" );
123 CalendarLocal *cal =
new CalendarLocal( KPimPrefs::timezone() );
124 if ( !cal->load( fileName ) ||
126 !cal->save( fileName ) ) {
128 <<
"konsolekalendaradd.cpp::importCalendar() | "
129 <<
"Can't import file: "
135 <<
"konsolekalendaradd.cpp::importCalendar() | "
136 <<
"Successfully imported file: "
142void KonsoleKalendarAdd::printSpecs()
144 cout << i18n(
" What: %1" ).
145 arg( m_variables->
getSummary() ).local8Bit().data()
148 cout << i18n(
" Begin: %1" ).
149 arg( m_variables->
getStartDateTime().toString( TQt::TextDate ) ).local8Bit().data()
152 cout << i18n(
" End: %1" ).
153 arg( m_variables->
getEndDateTime().toString( TQt::TextDate ) ).local8Bit().data()
157 cout << i18n(
" No Time Associated with Event" ).local8Bit().data()
161 cout << i18n(
" Desc: %1" ).
165 cout << i18n(
" Location: %1" ).
166 arg( m_variables->
getLocation() ).local8Bit().data()
bool addEvent()
Add the Event.
~KonsoleKalendarAdd()
Destructor.
bool addImportedCalendar()
Imports calendar file to current Calendar.
This class provides all the variables for the program.
bool getFloating()
Return if Event is floating.
bool isDryRun()
Is this program only in testing mode?
TQString getImportFile()
Return import filename.
TQString getCalendarFile()
Returns fullpath to calendar file.
TQString getDescription()
Return description.
bool isVerbose()
Should program be more verbose?
TQDateTime getStartDateTime()
Get start date.
TQString getLocation()
Return location information.
TQDateTime getEndDateTime()
Get end date.
TQString getSummary()
Get summary.
CalendarResources * getCalendar()
Get global calendar resources.
Provides the KonsoleKalendarAdd class definition.