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