00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
#include "buglist.h"
00019
#include "bugedit.h"
00020
#include <qdatetime.h>
00021
#include <qdom.h>
00022
#include <qfile.h>
00023
#include <qmessagebox.h>
00024
#include <qsortedlist.h>
00025
#include <qxml.h>
00026
#include <fstream.h>
00027
#include <klocale.h>
00028
#include <kpushbutton.h>
00029
#include <kstdguiitem.h>
00030
00031
00032 #define LST_ID 0
00033 #define LST_DESC 1
00034 #define LST_SEVERITY 2
00035 #define LST_PRIORITY 3
00036 #define LST_AGE 4
00037 #define LST_PACKAGE 5
00038 #define LST_ASSIGNEDTO 6
00039
00040
00041 BugList::BugList(
QWidget *parent,
const char *name,
QString FileName,
00042
QString Initials,
QString UserName,
QString UserEMail)
00043 :
QWidget(parent, name)
00044 {
00045
00046
m_FileName = FileName;
00047
m_Initials = Initials;
00048
m_UserName = UserName;
00049
m_UserEMail = UserEMail;
00050
00051
00052 this->setMinimumSize (500,300);
00053
00054
00055
pBugListBox =
new QHBox(
this);
00056
pBugListBox->setMinimumSize (300,200);
00057
00058
00059
pMainBugList =
new QListView (
pBugListBox,
"mainbuglist");
00060
pMainBugList->addColumn (i18n(
"Bug ID"),72);
00061
pMainBugList->addColumn (i18n(
"Description"),190);
00062
pMainBugList->addColumn (i18n(
"Severity"),60);
00063
pMainBugList->addColumn (i18n(
"Priority"),60);
00064
pMainBugList->addColumn (i18n(
"Days Old"),60);
00065
pMainBugList->addColumn (i18n(
"Package"),120);
00066
pMainBugList->addColumn (i18n(
"Assigned To"),100);
00067
00068
00069
00070
pMainBugList->setAllColumnsShowFocus (TRUE);
00071
00072
00073 connect (
pMainBugList, SIGNAL(doubleClicked (
QListViewItem * )),
this, SLOT(
slotListDoubleClicked (QListViewItem *)));
00074
00075
00076
pMaintenanceBox =
new QVBox(
this);
00077
pMaintenanceBox->setMinimumSize (100,200);
00078
pMaintenanceBox->setMaximumSize (100,200);
00079
pMaintenanceBox->setSpacing (10);
00080
pMaintenanceBox->setMargin (0);
00081
00082
00083
QPushButton *Add =
new QPushButton( i18n(
"Add"),
pMaintenanceBox,
"add" );
00084 connect (Add, SIGNAL(clicked()),
this, SLOT(
slotAddClicked()));
00085 Add->setMinimumSize (100,25);
00086 Add->setMaximumSize (100,25);
00087
00088
00089 QPushButton *Edit =
new QPushButton( i18n(
"Edit"),
pMaintenanceBox,
"edit");
00090 connect (Edit, SIGNAL(clicked()),
this, SLOT(
slotEditClicked()));
00091 Edit->setMinimumSize (100,25);
00092 Edit->setMaximumSize (100,25);
00093
00094
00095 QPushButton *Delete =
new QPushButton( i18n(
"Delete"),
pMaintenanceBox,
"delete" );
00096 connect (Delete, SIGNAL(clicked()),
this, SLOT(
slotRemoveClicked()));
00097 Delete->setMinimumSize (100,25);
00098 Delete->setMaximumSize (100,25);
00099
00100
00101 QPushButton *Completed =
new QPushButton( i18n(
"Completed"),
pMaintenanceBox,
"completed");
00102 connect (Completed, SIGNAL(clicked()),
this, SLOT(
slotCompletedClicked()));
00103 Completed->setMinimumSize (100,25);
00104 Completed->setMaximumSize (100,25);
00105
00106
00107 QPushButton *Filter =
new QPushButton( i18n(
"Filter"),
pMaintenanceBox,
"filter");
00108 connect (Filter, SIGNAL(clicked()),
this, SLOT(
slotFilter ()));
00109 Filter->setMinimumSize (100,25);
00110 Filter->setMaximumSize (100,25);
00111
00112
00113 QPushButton *Ownership =
new QPushButton( i18n(
"My Bug"),
pMaintenanceBox,
"Ownership");
00114 connect (Ownership, SIGNAL(clicked()),
this, SLOT(
slotOwnership ()));
00115 Ownership->setMinimumSize (100,25);
00116 Ownership->setMaximumSize (100,25);
00117
00118
00119
pExitBox =
new QVBox(
this);
00120
pExitBox->setMinimumSize (100,60);
00121
pExitBox->setMaximumSize (100,60);
00122
pExitBox->setSpacing (10);
00123
pExitBox->setMargin (0);
00124
00125
00126 QPushButton *Cancel =
new KPushButton( KStdGuiItem::cancel(),
pExitBox,
"cancel" );
00127 connect (Cancel, SIGNAL(clicked()),
this, SLOT(
slotCancelClicked()));
00128 Cancel->setMinimumSize (100,25);
00129 Cancel->setMaximumSize (100,25);
00130
00131
00132 QPushButton *Close =
new KPushButton( KStdGuiItem::close(),
pExitBox,
"close");
00133 connect (Close, SIGNAL(clicked()),
this, SLOT(
slotCloseClicked()));
00134 Close->setMinimumSize (100,25);
00135 Close->setMaximumSize (100,25);
00136
00137
00138
Dirty = FALSE;
00139
00140
00141
BugDictionary.setAutoDelete (TRUE);
00142
00143
00144
Developers.setAutoDelete (TRUE);
00145
00146
00147
ParseFile ();
00148
00149
00150
if (!
Developers [
m_Initials])
00151 {
00152
BugCounter * pBugCounter;
00153
00154
00155 pBugCounter =
new BugCounter;
00156 pBugCounter->
Initials =
m_Initials;
00157 pBugCounter->
LastBugNumber = 0;
00158
Developers.insert (pBugCounter->
Initials, pBugCounter);
00159 }
00160 }
00161
00162
00163 BugList::~BugList()
00164 {
00165 }
00166
00167
00168 void BugList::ParseFile ()
00169 {
00170
QFile file (
m_FileName);
00171
QDomDocument xmlDocument;
00172 uint Count;
00173
00174
00175
if (!
file.open (IO_ReadOnly))
00176 {
00177
QMessageBox (NULL, i18n(
"Unable to read the bug tracking file %1").arg(
m_FileName));
00178
return;
00179 }
00180
00181
00182
if (!xmlDocument.setContent(&
file))
00183 {
00184
QMessageBox (NULL, i18n(
"The file %1 does not contain valid XML").arg(
m_FileName));
00185
return;
00186 }
00187
00188
00189
kdDebug(9040) <<
"BugList::Parsing the bug list" <<
endl;
00190
QDomElement elmMain = xmlDocument.documentElement();
00191
00192
00193
QDomNodeList nodeDevelopers = xmlDocument.elementsByTagName(
"Developer");
00194
for (Count = 0;Count < nodeDevelopers.count ();Count++)
00195 {
00196
BugCounter * pBugCounter;
00197
00198
00199
QDomElement elmDeveloper = nodeDevelopers.item(Count).toElement();
00200
00201
00202 pBugCounter =
new BugCounter;
00203 pBugCounter->
Initials = elmDeveloper.attribute(
"Initials");
00204 pBugCounter->
LastBugNumber = elmDeveloper.attribute(
"Counter").toInt ();
00205
Developers.insert (pBugCounter->
Initials, pBugCounter);
00206 }
00207
00208
00209
QDomNodeList nodeBugs = xmlDocument.elementsByTagName(
"Bug");
00210
for (Count = 0;Count < nodeBugs.count ();Count++)
00211 {
00212
Bug * pBug;
00213
00214
00215
QDomElement elmBug = nodeBugs.item(Count).toElement();
00216
00217
00218 pBug =
new Bug;
00219 pBug->
BugID = elmBug.attribute(
"BugID");
00220 pBug->
Description = elmBug.attribute(
"Description");
00221
00222
00223
QDomNode nodeChild = elmBug.firstChild ();
00224
while (!nodeChild.isNull ())
00225 {
00226
00227
QDomElement elmSubBug = nodeChild.toElement();
00228
00229
00230
if (elmSubBug.nodeName () ==
"Severity")
00231 pBug->
Severity = elmSubBug.text ();
00232
00233
00234
if (elmSubBug.nodeName () ==
"BugClass")
00235 pBug->
BugClass = elmSubBug.text ();
00236
00237
00238
if (elmSubBug.nodeName () ==
"Location")
00239 pBug->
Location = elmSubBug.text ();
00240
00241
00242
if (elmSubBug.nodeName () ==
"AssignedTo")
00243 pBug->
AssignedTo = elmSubBug.text ();
00244
00245
00246
if (elmSubBug.nodeName () ==
"AssignedEMail")
00247 pBug->
AssignedEMail = elmSubBug.text ();
00248
00249
00250
if (elmSubBug.nodeName () ==
"ReportUserName")
00251 pBug->
ReportUserName = elmSubBug.text ();
00252
00253
00254
if (elmSubBug.nodeName () ==
"ReportEMail")
00255 pBug->
ReportEMail = elmSubBug.text ();
00256
00257
00258
if (elmSubBug.nodeName () ==
"Package")
00259 pBug->
Package = elmSubBug.text ();
00260
00261
00262
if (elmSubBug.nodeName () ==
"VersionNo")
00263 pBug->
VersionNo = elmSubBug.text ();
00264
00265
00266
if (elmSubBug.nodeName () ==
"Notes")
00267 pBug->
Notes = elmSubBug.text ();
00268
00269
00270
if (elmSubBug.nodeName () ==
"Workaround")
00271 pBug->
Workaround = elmSubBug.text ();
00272
00273
00274
if (elmSubBug.nodeName () ==
"SysInfo")
00275 pBug->
SysInfo = elmSubBug.text ();
00276
00277
00278
if (elmSubBug.nodeName () ==
"Priority")
00279 pBug->
Priority = elmSubBug.text ();
00280
00281
00282
if (elmSubBug.nodeName () ==
"Repeat")
00283 pBug->
Repeat = elmSubBug.text ();
00284
00285
00286
if (elmSubBug.nodeName () ==
"AssignedDate")
00287 pBug->
AssignedDate.setYMD (elmSubBug.text ().right (4).toInt (),elmSubBug.text ().mid (elmSubBug.text ().find (
'/') + 1,elmSubBug.text ().findRev (
'/') - elmSubBug.text ().find (
'/') - 1).toInt (),elmSubBug.text ().left (elmSubBug.text ().find (
'/')).toInt ());
00288
00289
00290
if (elmSubBug.nodeName () ==
"ReportDate")
00291 pBug->
ReportDate.setYMD (elmSubBug.text ().right (4).toInt (),elmSubBug.text ().mid (elmSubBug.text ().find (
'/') + 1,elmSubBug.text ().findRev (
'/') - elmSubBug.text ().find (
'/') - 1).toInt (),elmSubBug.text ().left (elmSubBug.text ().find (
'/')).toInt ());
00292
00293
00294
if (elmSubBug.nodeName () ==
"FixScheduled")
00295 pBug->
FixScheduled.setYMD (elmSubBug.text ().right (4).toInt (),elmSubBug.text ().mid (elmSubBug.text ().find (
'/') + 1,elmSubBug.text ().findRev (
'/') - elmSubBug.text ().find (
'/') - 1).toInt (),elmSubBug.text ().left (elmSubBug.text ().find (
'/')).toInt ());
00296
00297
00298 nodeChild = nodeChild.nextSibling ();
00299 }
00300
00301
InsertBug (pBug);
00302 }
00303 }
00304
00305
00313 void BugList::WriteXMLFile ()
00314 {
00315 QSortedList <QString> SortedBugList;
00316 QSortedList <QString> SortedDeveloperList;
00317 QDictIterator <Bug> BugIterator (
BugDictionary);
00318 QDictIterator <BugCounter> DevIterator (
Developers);
00319
QString * pEntry;
00320
Bug * pBug;
00321
BugCounter * pBugCounter;
00322
QString TheDate;
00323
00324
00325
00326
while (BugIterator.current())
00327 {
00328 SortedBugList.append (&BugIterator.current ()->BugID);
00329 ++BugIterator;
00330 }
00331 SortedBugList.sort ();
00332
00333
00334
while (DevIterator.current())
00335 {
00336 SortedDeveloperList.append (&DevIterator.current ()->Initials);
00337 ++DevIterator;
00338 }
00339 SortedDeveloperList.sort ();
00340
00341
QDomDocument xmlDocument (
"BugTracking");
00342 xmlDocument.appendChild (xmlDocument.createProcessingInstruction (
"xml",
"version=\"1.0\" encoding=\"UTF-8\""));
00343
00344
00345
QDomElement elmMain = xmlDocument.appendChild (xmlDocument.createElement(
"BugData")).toElement();
00346
00347
00348
QDomElement elmDevelopers = elmMain.appendChild (xmlDocument.createElement(
"Developers")).toElement();
00349
for (pEntry = SortedDeveloperList.first(); pEntry != NULL; pEntry = SortedDeveloperList.next ())
00350 {
00351
00352 pBugCounter =
Developers [*pEntry];
00353
00354
00355
QDomElement elmDeveloper = elmDevelopers.appendChild (xmlDocument.createElement(
"Developer")).toElement();
00356 elmDeveloper.setAttribute (
"Initials",pBugCounter->
Initials);
00357 elmDeveloper.setAttribute (
"Counter",pBugCounter->
LastBugNumber);
00358 }
00359
00360
00361
QDomElement elmBugs = elmMain.appendChild(xmlDocument.createElement(
"Bugs")).toElement();
00362
for (pEntry = SortedBugList.first(); pEntry != NULL; pEntry = SortedBugList.next ())
00363 {
00364
00365 pBug =
BugDictionary [*pEntry];
00366
QDomElement elmBug = elmBugs.appendChild (xmlDocument.createElement(
"Bug")).toElement();
00367
00368
00369
if (pBug->
BugID)
00370 elmBug.setAttribute (
"BugID",pBug->
BugID);
00371
00372
00373
if (pBug->
Description)
00374 elmBug.setAttribute (
"Description",pBug->
Description);
00375
00376
00377
if (pBug->
Severity)
00378 {
00379
QDomElement elmSeverity = elmBug.appendChild (xmlDocument.createElement(
"Severity")).toElement();
00380 elmSeverity.appendChild (xmlDocument.createTextNode(pBug->
Severity)).toElement();
00381 }
00382
00383
00384
if (pBug->
Priority)
00385 {
00386
QDomElement elmPriority = elmBug.appendChild (xmlDocument.createElement(
"Priority")).toElement();
00387 elmPriority.appendChild (xmlDocument.createTextNode(pBug->
Priority)).toElement();
00388 }
00389
00390
00391
if (pBug->
BugClass)
00392 {
00393
QDomElement elmBugClass = elmBug.appendChild (xmlDocument.createElement(
"BugClass")).toElement();
00394 elmBugClass.appendChild (xmlDocument.createTextNode(pBug->
BugClass)).toElement();
00395 }
00396
00397
00398
if (pBug->
Location)
00399 {
00400
QDomElement elmLocation = elmBug.appendChild (xmlDocument.createElement(
"Location")).toElement();
00401 elmLocation.appendChild (xmlDocument.createTextNode(pBug->
Location)).toElement();
00402 }
00403
00404
00405
if (pBug->
AssignedTo)
00406 {
00407
QDomElement elmAssignedTo = elmBug.appendChild (xmlDocument.createElement(
"AssignedTo")).toElement();
00408 elmAssignedTo.appendChild (xmlDocument.createTextNode(pBug->
AssignedTo)).toElement();
00409 }
00410
00411
00412
if (pBug->
AssignedEMail)
00413 {
00414
QDomElement elmAssignedEMail = elmBug.appendChild (xmlDocument.createElement(
"AssignedEMail")).toElement();
00415 elmAssignedEMail.appendChild (xmlDocument.createTextNode(pBug->
AssignedEMail)).toElement();
00416 }
00417
00418
00419
if (pBug->
ReportUserName)
00420 {
00421
QDomElement elmReportUserName = elmBug.appendChild (xmlDocument.createElement(
"ReportUserName")).toElement();
00422 elmReportUserName.appendChild (xmlDocument.createTextNode(pBug->
ReportUserName)).toElement();
00423 }
00424
00425
00426
if (pBug->
ReportEMail)
00427 {
00428
QDomElement elmReportEMail = elmBug.appendChild (xmlDocument.createElement(
"ReportEMail")).toElement();
00429 elmReportEMail.appendChild (xmlDocument.createTextNode(pBug->
ReportEMail)).toElement();
00430 }
00431
00432
00433
if (pBug->
Package)
00434 {
00435
QDomElement elmPackage = elmBug.appendChild (xmlDocument.createElement(
"Package")).toElement();
00436 elmPackage.appendChild (xmlDocument.createTextNode(pBug->
Package)).toElement();
00437 }
00438
00439
00440
if (pBug->
VersionNo)
00441 {
00442
QDomElement elmVersionNo = elmBug.appendChild (xmlDocument.createElement(
"VersionNo")).toElement();
00443 elmVersionNo.appendChild (xmlDocument.createTextNode(pBug->
VersionNo)).toElement();
00444 }
00445
00446
00447
if (pBug->
Notes)
00448 {
00449
QDomElement elmNotes = elmBug.appendChild (xmlDocument.createElement(
"Notes")).toElement();
00450 elmNotes.appendChild (xmlDocument.createTextNode(pBug->
Notes)).toElement();
00451 }
00452
00453
00454
if (pBug->
Workaround)
00455 {
00456
QDomElement elmWorkaround = elmBug.appendChild (xmlDocument.createElement(
"Workaround")).toElement();
00457 elmWorkaround.appendChild (xmlDocument.createTextNode(pBug->
Workaround)).toElement();
00458 }
00459
00460
00461
if (pBug->
Repeat)
00462 {
00463
QDomElement elmRepeat = elmBug.appendChild (xmlDocument.createElement(
"Repeat")).toElement();
00464 elmRepeat.appendChild (xmlDocument.createTextNode(pBug->
Repeat)).toElement();
00465 }
00466
00467
00468
if (pBug->
SysInfo)
00469 {
00470
QDomElement elmSysInfo = elmBug.appendChild (xmlDocument.createElement(
"SysInfo")).toElement();
00471 elmSysInfo.appendChild (xmlDocument.createTextNode(pBug->
SysInfo)).toElement();
00472 }
00473
00474
00475
if (!pBug->
AssignedDate.isNull ())
00476 {
00477
QDomElement elmAssignedDate = elmBug.appendChild (xmlDocument.createElement(
"AssignedDate")).toElement();
00478 TheDate.sprintf (
"%i/%i/%i",pBug->
AssignedDate.day (), pBug->
AssignedDate.month (), pBug->
AssignedDate.year ());
00479 elmAssignedDate.appendChild (xmlDocument.createTextNode(TheDate)).toElement();
00480 }
00481
00482
00483
if (!pBug->
ReportDate.isNull ())
00484 {
00485
QDomElement elmReportDate = elmBug.appendChild (xmlDocument.createElement(
"ReportDate")).toElement();
00486 TheDate.sprintf (
"%i/%i/%i",pBug->
ReportDate.day (), pBug->
ReportDate.month (), pBug->
ReportDate.year ());
00487 elmReportDate.appendChild (xmlDocument.createTextNode(TheDate)).toElement();
00488 }
00489
00490
00491
if (!pBug->
FixScheduled.isNull ())
00492 {
00493
QDomElement elmFixScheduled = elmBug.appendChild (xmlDocument.createElement(
"FixScheduled")).toElement();
00494 TheDate.sprintf (
"%i/%i/%i",pBug->
FixScheduled.day (), pBug->
FixScheduled.month (), pBug->
FixScheduled.year ());
00495 elmFixScheduled.appendChild (xmlDocument.createTextNode(TheDate)).toElement();
00496 }
00497
00498 ++BugIterator;
00499 }
00500
00501
00502
QFile file (
m_FileName);
00503
if (!
file.open (IO_WriteOnly))
00504 {
00505
QMessageBox (NULL, i18n(
"Unable to save the bug tracking file"));
00506
return;
00507 }
00508
QTextStream s(&
file);
00509 xmlDocument.save (s,4);
00510
file.close();
00511 }
00512
00513
00514
00515
00516 void BugList::InsertBug (
Bug * pBug)
00517 {
00518
QString Age;
00519
char tmp [10];
00520
00521
00522
if (!pBug->
ReportDate.isNull ())
00523 {
00524 sprintf (tmp,
"%03i",pBug->
ReportDate.daysTo (QDate::currentDate ()));
00525 Age = tmp;
00526 }
00527
else
00528 {
00529
00530 Age =
" - ";
00531 }
00532
00533
00534
BugDictionary.insert (pBug->
BugID,pBug);
00535
00536
00537 (
void)
new QListViewItem (
pMainBugList, pBug->
BugID, pBug->
Description, pBug->
Severity, pBug->
Priority, Age, pBug->
Package, pBug->
AssignedTo);
00538 }
00539
00540
00541
00542
00543
00544
00545 void BugList::slotAddBug (
Bug * pBug)
00546 {
00547
00548
InsertBug (pBug);
00549
00550
00551
Dirty = TRUE;
00552 }
00553
00554
00555 void BugList::slotUpdateBug (
Bug * pBug)
00556 {
00557
QListViewItem * pItem;
00558
QString Age;
00559
char tmp [10];
00560
00561
00562
if (!pBug->
ReportDate.isNull ())
00563 {
00564 sprintf (tmp,
"%03i",pBug->
ReportDate.daysTo (QDate::currentDate ()));
00565 Age = tmp;
00566 }
00567
else
00568 {
00569
00570 Age =
" - ";
00571 }
00572
00573 pItem =
pMainBugList->currentItem ();
00574
if (pItem != NULL)
00575 {
00576
00577 pItem->setText (
LST_DESC,pBug->
Description);
00578 pItem->setText (
LST_SEVERITY,pBug->
Severity);
00579 pItem->setText (
LST_AGE,Age);
00580 pItem->setText (
LST_PACKAGE,pBug->
Package);
00581 pItem->setText (
LST_ASSIGNEDTO,pBug->
AssignedTo);
00582 pItem->setText (
LST_PRIORITY,pBug->
Priority);
00583
00584
00585
Dirty = TRUE;
00586 }
00587 }
00588
00589
00590
00591
00592 void BugList::slotAddClicked()
00593 {
00594
Bug * pBug;
00595
BugCounter * pBugCounter;
00596
00597
00598 pBug =
new Bug;
00599
00600
00601 pBugCounter =
Developers [
m_Initials];
00602
00603
00604
if (!pBugCounter)
00605 {
00606
BugCounter * pBugCounter;
00607
00608
00609 pBugCounter =
new BugCounter;
00610 pBugCounter->
Initials =
m_Initials;
00611 pBugCounter->
LastBugNumber = 0;
00612 Developers.insert (pBugCounter->
Initials, pBugCounter);
00613
00614
00615 pBugCounter = Developers [
m_Initials];
00616 }
00617
00618
00619 pBug->
BugID = pBugCounter->
GetNextID ();
00620
00621
00622
BugEdit * pBugEdit =
new BugEdit (
this,
"bugedit",pBug,TRUE,TRUE);
00623 pBugEdit->setGeometry (0,0,400,400);
00624
00625
00626 connect (pBugEdit, SIGNAL(sigAddBug (Bug *)),
this, SLOT(
slotAddBug (Bug *)));
00627
00628
00629 pBugEdit->show();
00630 }
00631
00632
00633
00634
00635 void BugList::slotEditClicked()
00636 {
00637
Bug * pBug;
00638
00639
00640
if (
pMainBugList->currentItem () != NULL)
00641 {
00642
00643 pBug =
BugDictionary [
pMainBugList->currentItem ()->text (0)];
00644
00645
00646
BugEdit * pBugEdit =
new BugEdit (
this,
"bugedit",pBug,FALSE,TRUE);
00647 pBugEdit->setGeometry (0,0,400,400);
00648
00649
00650 connect (pBugEdit, SIGNAL(sigUpdateBug (
Bug *)),
this, SLOT(
slotUpdateBug (Bug *)));
00651
00652
00653 pBugEdit->show();
00654 }
00655 }
00656
00657
00658
00659
00660 void BugList::slotListDoubleClicked (
QListViewItem *)
00661 {
00662
slotEditClicked ();
00663 }
00664
00665
00666
00667
00668 void BugList::slotRemoveClicked()
00669 {
00670
QMessageBox MB;
00671
00672
00673
if (
pMainBugList->currentItem () != NULL)
00674 {
00675
00676
if (MB.warning (
this,
00677 i18n (
"Delete Bug Report"),
00678 i18n (
"When you delete a bug instead of closing\n"
00679
"it, there will no notification sent to\n"
00680
"the person who reported the bug or to\n"
00681
"any relevant newsgroups.\n\n"
00682
"Are you sure you want to do this?"),
00683 QMessageBox::Yes,QMessageBox::Cancel | QMessageBox::Default) == QMessageBox::Yes)
00684 {
00685
00686
BugDictionary.remove (
pMainBugList->currentItem ()->text (0));
00687
delete pMainBugList->currentItem ();
00688
00689
00690
Dirty = TRUE;
00691 }
00692 }
00693 }
00694
00695
00696
00697
00698
00699
00700
00701
00702 void BugList::slotCompletedClicked()
00703 {
00704
00705
00706
00707
if (
pMainBugList->currentItem () != NULL)
00708 {
00709
00710
BugDictionary.remove (
pMainBugList->currentItem ()->text (0));
00711
delete pMainBugList->currentItem ();
00712
00713
00714
Dirty = TRUE;
00715 }
00716 }
00717
00718
00719
00720
00721
00722 void BugList::slotCloseClicked()
00723 {
00724
00725
if (
Dirty)
00726 {
00727
QMessageBox MB;
00728
int Result;
00729
00730 Result = MB.warning (
this,
00731 i18n (
"The Bug List has Changed"),
00732 i18n (
"The bug list has been changed.\n"
00733
"Do you want to save your changes?"),
00734 QMessageBox::Yes | QMessageBox::Default,QMessageBox::No,QMessageBox::Cancel);
00735
if (Result == QMessageBox::Yes)
00736 {
00737
00738
WriteXMLFile ();
00739 }
00740
00741
00742
if (Result == QMessageBox::Cancel)
00743
return;
00744 }
00745
00746
00747 close ();
00748 emit
signalDeactivate ();
00749 }
00750
00751
00752
00753
00754
00755 void BugList::slotCancelClicked()
00756 {
00757
if (
Dirty)
00758 {
00759
QMessageBox MB;
00760
00761
00762
if (MB.warning (
this,
00763 i18n (
"The Bug List has Changed"),
00764 i18n (
"The bug list has been changed.\n"
00765
"If you exit now you will lose all your changes.\n"
00766
"Are you sure you want to exit?"),
00767 QMessageBox::Yes,QMessageBox::Cancel | QMessageBox::Default) == QMessageBox::Cancel)
00768 {
00769
00770
return;
00771 }
00772 }
00773
00774
00775 close ();
00776 emit
signalDeactivate ();
00777 }
00778
00779
00780 void BugList::resizeEvent (
QResizeEvent *
QEvent)
00781 {
00782
00783
pBugListBox->setGeometry (10, 10, this->width () - 130, this->height () - 20);
00784
pMaintenanceBox->setGeometry (this->width () - 110, 10, 100, 200);
00785
pExitBox->setGeometry (this->width () - 110, this->height () - 70, 100, 60);
00786
00787
00788
00789
00790
00791 QWidget::resizeEvent (QEvent);
00792 }
00793
00794
00795 void BugList::slotFilter ()
00796 {
00797
00798 }
00799
00800
00801
00802
00803 void BugList::slotOwnership ()
00804 {
00805
QMessageBox MB;
00806
Bug * pBug;
00807
00808
00809
if (
pMainBugList->currentItem () != NULL)
00810 {
00811
00812 pBug =
BugDictionary [
pMainBugList->currentItem ()->text (0)];
00813
00814
if ((pBug->
AssignedTo !=
m_UserName) && (pBug->
AssignedTo.length () > 0))
00815 {
00816
if (MB.warning (
this,
00817 i18n (
"Bug Owner Already Set"),
00818 i18n (
"The owner information for this bug\n"
00819
"has already been set. Are you\n"
00820
"sure you want to change it?"),
00821 QMessageBox::Yes | QMessageBox::Default,QMessageBox::No) != QMessageBox::Yes)
00822 {
00823
return;
00824 }
00825 }
00826
00827
00828 pBug->
AssignedTo =
m_UserName;
00829 pBug->
AssignedDate = QDateTime::currentDateTime ().date ();
00830 pBug->
AssignedEMail =
m_UserEMail;
00831
00832
00833
slotUpdateBug (pBug);
00834 }
00835 }
00836
#include "buglist.moc"