korganizer
projectview.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <qfile.h>
00021
00022 #include <kapplication.h>
00023 #include <kconfig.h>
00024 #include <kstandarddirs.h>
00025 #include <klocale.h>
00026 #include <kdebug.h>
00027 #include <kaction.h>
00028 #include <kglobal.h>
00029
00030 #include "koprojectview.h"
00031
00032 #include "projectview.h"
00033 using namespace KOrg;
00034 #include "projectview.moc"
00035
00036 class ProjectViewFactory : public KOrg::PartFactory {
00037 public:
00038 KOrg::Part *create(KOrg::MainWindow *parent, const char *name)
00039 {
00040 KGlobal::locale()->insertCatalogue( "kgantt" );
00041 return new ProjectView(parent,name);
00042 }
00043 };
00044
00045 K_EXPORT_COMPONENT_FACTORY( libkorg_projectview, ProjectViewFactory )
00046
00047
00048 ProjectView::ProjectView(KOrg::MainWindow *parent, const char *name) :
00049 KOrg::Part(parent,name), mView(0)
00050 {
00051 setInstance( new KInstance( "korganizer" ) );
00052
00053 setXMLFile("plugins/projectviewui.rc");
00054
00055 new KAction(i18n("&Project"), "project", 0, this, SLOT(showView()),
00056 actionCollection(), "view_project");
00057 }
00058
00059 ProjectView::~ProjectView()
00060 {
00061 }
00062
00063 QString ProjectView::info()
00064 {
00065 return i18n("This plugin provides a Gantt diagram as project view.");
00066 }
00067
00068 QString ProjectView::shortInfo()
00069 {
00070 return i18n("Project View Plugin");
00071 }
00072
00073 void ProjectView::showView()
00074 {
00075 if (!mView) {
00076 mView = new KOProjectView(mainWindow()->view()->calendar(),
00077 mainWindow()->view());
00078 mainWindow()->view()->addView(mView);
00079 }
00080 mainWindow()->view()->showView(mView);
00081 }
|