buglistcomponent.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "buglistcomponent.h"
00019 #include "buglist.h"
00020
00021 #include <qvbox.h>
00022 #include <qwhatsthis.h>
00023 #include <kdebug.h>
00024 #include <klocale.h>
00025 #include <kiconloader.h>
00026 #include <kdialogbase.h>
00027
00028
00029
00030
00031 typedef KGenericFactory<BugListComponent> BugListFactory;
00032 K_EXPORT_COMPONENT_FACTORY( libkdevbuglist, BugListFactory( "kdevbuglist" ) );
00033
00034
00035 BugListComponent::BugListComponent (QObject *parent, const char *name, const QStringList &)
00036 : KDevPlugin ("BugList", "buglist", parent, name ? name : "BugListComponent")
00037 {
00038 setInstance(BugListFactory::instance());
00039 setXMLFile("kdevbuglist.rc");
00040
00041
00042 m_pBugList = NULL;
00043
00044 setupGUI();
00045 }
00046
00047 BugListComponent::~BugListComponent()
00048 {
00049
00050 if (m_pBugList)
00051 delete m_pBugList;
00052 }
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 void BugListComponent::slotStopButtonClicked()
00066 {
00067 kdDebug(9040) << "BugList::stopButtonClicked()" << endl;
00068
00069
00070
00071
00072
00073
00074
00075 }
00076
00077
00078 void BugListComponent::setupGUI()
00079 {
00080 kdDebug(9040) << "SetupGUI BugList" << endl;
00081
00082 m_pMenuAction = new KAction(i18n("&Bug Tracking"), CTRL+ALT+Key_B, this, SLOT(slotActivate()),
00083 actionCollection(), "bug_tracking");
00084 m_pMenuAction->setStatusText (i18n("Provides bug tracking features for your project."));
00085 m_pMenuAction->setWhatsThis (i18n("Provides bug tracking features for your project."));
00086 core()->insertNewItem( m_pMenuAction );
00087
00088
00089 m_pMenuAction->setEnabled (FALSE);
00090 }
00091
00092
00093 void BugListComponent::slotProjectSpaceOpened()
00094 {
00095 uint Count;
00096 QString LastProject;
00097
00098 kdDebug(9040) << "BugList::projectSpaceOpened()" << endl;
00099
00100
00101 m_pMenuAction->setEnabled (TRUE);
00102
00103
00104
00105
00106
00107
00108
00109
00110 QDomDocument doc ;
00111 QDomElement psElement = doc.documentElement();
00112
00113
00114 QDomNodeList projNodes = doc.elementsByTagName("Project");
00115 if (projNodes.count () > 1)
00116 {
00117
00118 LastProject = psElement.attribute("lastActiveProject");
00119 for (Count = 0;Count < projNodes.count ();Count++)
00120 {
00121 QDomElement projElement = projNodes.item(Count).toElement();
00122 if (LastProject == projElement.attribute("name"))
00123 {
00124
00125
00126 }
00127 }
00128 }
00129 else
00130 {
00131
00132 QDomElement projElement = projNodes.item(0).toElement();
00133
00134 }
00135
00136
00137 kdDebug(9040) << "BugList::BugFile = " << m_FileName << endl;
00138 kdDebug(9040) << "BugList::m_Initials = " << m_Initials << endl;
00139 kdDebug(9040) << "BugList::m_UserName = " << m_UserName << endl;
00140 kdDebug(9040) << "BugList::m_UserEMail = " << m_UserEMail << endl;
00141
00142
00143 m_Initials = "ILH";
00144 m_UserName = "Ivan Hawkes";
00145 m_UserEMail = "linuxgroupie@ivanhawkes.com";
00146
00147
00148 if (m_pBugList)
00149 {
00150 m_pBugList->m_FileName = m_FileName;
00151 m_pBugList->m_Initials = m_Initials;
00152 m_pBugList->m_UserName = m_UserName;
00153 m_pBugList->m_UserEMail = m_UserEMail;
00154 }
00155 }
00156
00157
00158
00159
00160
00161
00162 void BugListComponent::slotProjectSpaceClosed()
00163 {
00164 kdDebug(9040) << "BugList::closeProjectSpace" << endl;
00165
00166
00167 m_pMenuAction->setEnabled (FALSE);
00168
00169
00170 if (m_pBugList)
00171 {
00172 m_pBugList->slotCloseClicked ();
00173 m_pBugList = NULL;
00174 }
00175
00176
00177 }
00178
00179
00180
00181
00182
00183 void BugListComponent::slotProjectChanged()
00184 {
00185 kdDebug(9040) << "BugList::projectChanged" << endl;
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196 }
00197
00198
00199
00200
00201
00202
00203
00204 void BugListComponent::slotActivate()
00205 {
00206 kdDebug(9040) << "BugList Activated" << endl;
00207
00208 if (!m_pBugList)
00209 {
00210 m_pBugList = new BugList (NULL,"BugList",m_FileName,m_Initials,m_UserName,m_UserEMail);
00211 connect (m_pBugList, SIGNAL(signalDeactivate()), this, SLOT(slotWidgetClosed()));
00212 m_pBugList->show ();
00213 }
00214 else
00215 {
00216 m_pBugList->setActiveWindow ();
00217 }
00218 }
00219
00220
00221
00222
00223
00224
00225 void BugListComponent::slotWidgetClosed ()
00226 {
00227 kdDebug(9040) << "BugList Deactivate" << endl;
00228
00229
00230 if (m_pBugList)
00231 {
00232 delete m_pBugList;
00233 m_pBugList = NULL;
00234 }
00235 }
00236
00237 #include "buglistcomponent.moc"
This file is part of the documentation for KDevelop Version 3.1.2.