korganizer
timespanview.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <tqfile.h>
00021
00022 #include <tdeapplication.h>
00023 #include <tdeconfig.h>
00024 #include <kstandarddirs.h>
00025 #include <tdelocale.h>
00026 #include <kdebug.h>
00027 #include <tdeaction.h>
00028 #include <tdeglobal.h>
00029
00030 #include "kotimespanview.h"
00031
00032 #include "timespanview.h"
00033 using namespace KOrg;
00034 #include "timespanview.moc"
00035
00036 class TimespanViewFactory : public KOrg::PartFactory {
00037 public:
00038 KOrg::Part *create( KOrg::MainWindow *parent, const char *name )
00039 {
00040 return new TimespanView( parent, name );
00041 }
00042 };
00043
00044 K_EXPORT_COMPONENT_FACTORY( libkorg_timespanview, TimespanViewFactory )
00045
00046
00047 TimespanView::TimespanView(KOrg::MainWindow *parent, const char *name) :
00048 KOrg::Part(parent,name), mView(0)
00049 {
00050 setInstance( new TDEInstance( "korganizer" ) );
00051
00052 setXMLFile( "plugins/timespanviewui.rc" );
00053
00054 new TDEAction( i18n("&Timespan"), "timespan", 0, this, TQT_SLOT( showView() ),
00055 actionCollection(), "view_timespan" );
00056 }
00057
00058 TimespanView::~TimespanView()
00059 {
00060 }
00061
00062 TQString TimespanView::info()
00063 {
00064 return i18n("This plugin provides a Gantt-like Timespan view.");
00065 }
00066
00067 TQString TimespanView::shortInfo()
00068 {
00069 return i18n( "Timespan View Plugin" );
00070 }
00071
00072 void TimespanView::showView()
00073 {
00074 if (!mView) {
00075 mView = new KOTimeSpanView( mainWindow()->view()->calendar(),
00076 mainWindow()->view() );
00077 mainWindow()->view()->addView( mView );
00078 }
00079 mainWindow()->view()->showView( mView );
00080 }
|